CN105159616A - Disk space management method and device - Google Patents
Disk space management method and device Download PDFInfo
- Publication number
- CN105159616A CN105159616A CN201510578464.5A CN201510578464A CN105159616A CN 105159616 A CN105159616 A CN 105159616A CN 201510578464 A CN201510578464 A CN 201510578464A CN 105159616 A CN105159616 A CN 105159616A
- Authority
- CN
- China
- Prior art keywords
- disk
- storage space
- data
- write
- target storage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a disk space management method and device. The method comprises the following steps of receiving a writing instruction for writing target data into a disk; finding a position, corresponding to the writing instruction, of a target storage space in the disk according to the writing instruction; mapping content data in the target storage space into a memory; revising the content data in the memory according to the target data; and flash-writing the revised content data in the content into the target storage space. According to the embodiment, by a mode of revising the data mapped into the memory and flash-writing the revised data into the disk at the corresponding position, the frequency of direct access to the disk is reduced, the efficiency of access to the disk is increased, and the influence on the disk performance is reduced.
Description
Technical field
The present invention relates to disk space management technical field, more particularly, relate to a kind of disk space management method and device.
Background technology
Disk space management is the mechanism of the distribution, recovery etc. of chunk on disk in a kind of responsible storage, pass through disk space management, can inquire about the service condition of chunk in disk, the arrangement situation etc. of data, can well utilize the chunk in disk by disk space management.Excessively use to prevent disk space and cause loss of data or collapse, existing file system, operating system can support the quotas administered of disk space, namely the disk space quota of user is set, the space of user is limited, user freely uses under given disk space quota, disk space shared by the All Files that system has according to user calculates the service condition in user disk space, when the disk space that user uses reaches quota restrictions, system can point out disk space full, does not allow user to continue uploading data again.But all directly can access disk to all operations of disk in prior art, frequent visit disk not only inefficiency, also can affect the performance of disk.
Therefore, how to reduce the number of times of directly access disk in operation, increase the efficiency of access disk, reducing the impact of the performance of disk is the problem needing now to solve.
Summary of the invention
The object of the present invention is to provide a kind of disk space management method and device, to realize the number of times of directly access disk in minimizing operation, increase the efficiency of access disk, reduce the impact of the performance on disk.
For achieving the above object, following technical scheme is embodiments provided:
A kind of disk space management method, comprising:
Receive write instruction target data being write disk;
According to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Content-data in described target storage space is mapped in internal memory;
According to described target data, the described content-data in described internal memory is modified;
By content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space.
Preferably, described reception also comprises after target data being write the write instruction of disk:
Judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
Preferably, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, also comprise:
Judge whether the quantity of idle storage space in described disk is less than I/O port size;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
Preferably, according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction, comprising:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
Preferably, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, comprising:
The bitmap of described target storage space is labeled as 1.
A kind of disk space management device, comprising:
Receiver module, for receiving write instruction target data being write disk;
Search module, for according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Mapping block, for being mapped in internal memory by the content-data in described target storage space;
Modified module, for according to described target data, modifies to the described content-data in described internal memory;
Write with a brush dipped in Chinese ink module, for by content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space.
Preferably, also comprise:
First judge module, for receive target data is write disk write instruction after, judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then trigger dilatation module, described dilatation module is used for carrying out dilatation process to described disk, and/or deletes the stale data in described disk.
Preferably, also comprise:
Second judge module, for by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, judges whether the quantity of idle storage space in described disk is less than I/O port size;
If so, described dilatation module is then triggered.
Preferably, search module described in comprise:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
Preferably, described in write with a brush dipped in Chinese ink module, comprising: the bitmap of described target storage space is labeled as 1.
Known by above scheme, a kind of disk space management method that the embodiment of the present invention provides and device, comprising: receive write instruction target data being write disk; According to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction; Content-data in described target storage space is mapped in internal memory; According to described target data, the described content-data in described internal memory is modified; By content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space, the present embodiment is this by modifying to the data be mapped in internal memory, again amended data are write with a brush dipped in Chinese ink the mode in the disk of correspondence position, decrease the number of times of directly access disk in operation, add the efficiency of access disk, decrease the impact on disk performance.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of disk space management method flow schematic diagram disclosed in the embodiment of the present invention;
Fig. 2 is a kind of disk chunk structural drawing disclosed in the embodiment of the present invention;
Fig. 3 is a kind of disk space management device schematic diagram disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of disk space management method and device, to realize the number of times of directly access disk in minimizing operation, increase the efficiency of access disk, reduce the impact of the performance on disk.
See Fig. 1, a kind of disk space management method that the embodiment of the present invention provides, comprising:
S101, receive write instruction target data being write disk;
Concrete, if when carrying out read operation to disk, be equally also found by B+ tree to need the position of chunk block on disk of reading to read.
S102, according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Preferably, according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction, comprising:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
Concrete, in the present embodiment, by bitmap and B+ tree, organization and administration are carried out to the chunk on disk, disk chunk is mapped in internal memory, when disk has I/O to access, the data in direct control internal memory, decrease the number of times of access disk, to improve the access efficiency of disk chunk
S103, the content-data in described target storage space is mapped in internal memory;
S104, according to described target data, the described content-data in described internal memory to be modified;
S105, by content-data amended in described internal memory, to write with a brush dipped in Chinese ink in described target storage space.
Concrete, when carrying out write operation to disk, the method adopted is in internal memory by the copy content of disk chunk (storage space namely in the present embodiment), operation to internal memory is converted into the operation of disk, after the chunk block operations in internal memory is completed, again the data in the chunk block changed are write with a brush dipped in Chinese ink the corresponding position of disk, to improve the efficiency of access disk.
Concrete, the B+ tree construction that the present embodiment provides is the modification tree of B-tree, and the difference of the B+ tree on m rank and the B-tree on m rank is:
1, containing n key word in the node having n stalk to set, each key word does not preserve data, is only used for index, and all data are all kept at leaf node.
2, contain the information of whole key word in all leafy nodes, and point to the pointer containing these keyword record, and leafy node itself is according to the size large order link from childhood of key word.
3, all non-terminal nodes can regard index part as, only containing maximum (or minimum) key word in its subtree (root node) in node.
See a kind of disk chunk structural drawing that Fig. 2 provides for the present embodiment, each chunk is divided into three parts specifically.Part I is the node-header of fixed size, and Part II is 3n key, and Part III is 3n value.The index position of key and the index position of value are one to one, key and value of manipulative indexing position forms an entry, as entry [3] is equivalent to key [3]-value [3].The quantity of the element (entry) that each chunk can deposit, mainly according to the type of node store data, i.e. the type decided of value.
A kind of disk space management method that the embodiment of the present invention provides, comprising: receive write instruction target data being write disk; According to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction; Content-data in described target storage space is mapped in internal memory; According to described target data, the described content-data in described internal memory is modified; By content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space, the present embodiment is this by modifying to the data be mapped in internal memory, again amended data are write with a brush dipped in Chinese ink the mode in the disk of correspondence position, decrease the number of times of directly access disk in operation, add the efficiency of access disk, decrease the impact on disk performance.
Preferably, described reception also comprises after target data being write the write instruction of disk:
Judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
Concrete, the present embodiment monitors the quantity of free block in Dynamic Acquisition disk by arranging idle chunk, its be specifically as follows user disk write or deletion data operation time, dynamically update the quantity of free block.
Concrete, the threshold value of described idle storage space can be a user-defined threshold value (representing the minimum value of idle chunk in disk), when whether the quantity of idle storage space in disk is less than the threshold value of idle storage space, then do not allow to disk write data, and triggers callback function, carries out dilatation process by call back function to disk, and/or deletes the stale data in described disk, prevent disk space from exhausting and cause loss of data, even collapse.
Preferably, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, comprising:
The bitmap of described target storage space is labeled as 1.
Concrete, in the present embodiment, adopt the chunk on the mode hyperdisk of bitmap, bitmap is labeled as 0 expression chunk and is not used, and bitmap is labeled as this chunk of 1 expression and is used.
Preferably, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, also comprise:
Judge whether the quantity of idle storage space in described disk is less than I/O port size;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
See Fig. 3, a kind of disk space management device that the embodiment of the present invention provides, comprising:
Receiver module 100, for receiving write instruction target data being write disk;
Search module 200, for according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Mapping block 300, for being mapped in internal memory by the content-data in described target storage space;
Modified module 400, for according to described target data, modifies to the described content-data in described internal memory;
Write with a brush dipped in Chinese ink module 500, for by content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space.
Preferably, in another embodiment of the invention, also comprise:
First judge module, for receive target data is write disk write instruction after, judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then trigger dilatation module, described dilatation module is used for carrying out dilatation process to described disk, and/or deletes the stale data in described disk.
Preferably, in another embodiment of the invention, also comprise:
Second judge module, for by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, judges whether the quantity of idle storage space in described disk is less than I/O port size;
If so, described dilatation module is then triggered.
Preferably, in another embodiment of the invention, search module 200 described in comprise:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
Preferably, in another embodiment of the invention, described in write with a brush dipped in Chinese ink module 500, comprising: the bitmap of described target storage space is labeled as 1.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (10)
1. a disk space management method, is characterized in that, comprising:
Receive write instruction target data being write disk;
According to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Content-data in described target storage space is mapped in internal memory;
According to described target data, the described content-data in described internal memory is modified;
By content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space.
2. disk space management method according to claim 1, is characterized in that, described reception also comprises after target data being write the write instruction of disk:
Judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
3. disk space management method according to claim 2, is characterized in that, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, also comprises:
Judge whether the quantity of idle storage space in described disk is less than I/O port size;
If so, then triggers callback function, carries out dilatation process to described disk, and/or deletes the stale data in described disk.
4. disk space management method according to claim 3, is characterized in that, according to said write instruction, searches the position of the target storage space corresponding with said write instruction, comprising in disk:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
5. disk space management method according to claim 4, is characterized in that, by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, comprising:
The bitmap of described target storage space is labeled as 1.
6. a disk space management device, is characterized in that, comprising:
Receiver module, for receiving write instruction target data being write disk;
Search module, for according to said write instruction, in disk, search the position of the target storage space corresponding with said write instruction;
Mapping block, for being mapped in internal memory by the content-data in described target storage space;
Modified module, for according to described target data, modifies to the described content-data in described internal memory;
Write with a brush dipped in Chinese ink module, for by content-data amended in described internal memory, write with a brush dipped in Chinese ink in described target storage space.
7. disk space management device according to claim 6, is characterized in that, also comprise:
First judge module, for receive target data is write disk write instruction after, judge whether the quantity of idle storage space in described disk is less than the threshold value of idle storage space;
If so, then trigger dilatation module, described dilatation module is used for carrying out dilatation process to described disk, and/or deletes the stale data in described disk.
8. disk space management device according to claim 7, is characterized in that, also comprise:
Second judge module, for by content-data amended in described internal memory, after writing with a brush dipped in Chinese ink in described target storage space, judges whether the quantity of idle storage space in described disk is less than I/O port size;
If so, described dilatation module is then triggered.
9. disk space management device according to claim 8, is characterized in that, described in search module and comprise:
According to said write instruction, in disk, searched the position of the target storage space corresponding with said write instruction by B+ tree.
10. disk space management device according to claim 9, is characterized in that, described in write with a brush dipped in Chinese ink module, comprising: the bitmap of described target storage space is labeled as 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510578464.5A CN105159616A (en) | 2015-09-11 | 2015-09-11 | Disk space management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510578464.5A CN105159616A (en) | 2015-09-11 | 2015-09-11 | Disk space management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105159616A true CN105159616A (en) | 2015-12-16 |
Family
ID=54800490
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510578464.5A Pending CN105159616A (en) | 2015-09-11 | 2015-09-11 | Disk space management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105159616A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528003A (en) * | 2016-12-09 | 2017-03-22 | 曙光信息产业(北京)有限公司 | Method and device for rebuilding disk array |
CN106569748A (en) * | 2016-10-27 | 2017-04-19 | 南方电网科学研究院有限责任公司 | Data processing method and device of Flash file system |
CN109445706A (en) * | 2018-10-30 | 2019-03-08 | 紫光华山信息技术有限公司 | Disk partition expansion method, device and server-side |
CN109542911A (en) * | 2018-12-03 | 2019-03-29 | 郑州云海信息技术有限公司 | A kind of metadata organization method, system, equipment and computer readable storage medium |
CN109597568A (en) * | 2018-09-18 | 2019-04-09 | 天津字节跳动科技有限公司 | A kind of date storage method, device, terminal device and storage medium |
CN109960463A (en) * | 2017-12-26 | 2019-07-02 | 中兴通讯股份有限公司 | A kind of disk management method, device and storage medium |
CN110134340A (en) * | 2019-05-23 | 2019-08-16 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus of metadata updates, equipment and storage medium |
CN110427364A (en) * | 2019-06-21 | 2019-11-08 | 北京奇艺世纪科技有限公司 | A kind of data processing method, device, electronic equipment and storage medium |
CN115442388A (en) * | 2022-10-21 | 2022-12-06 | 四川省华存智谷科技有限责任公司 | Capacity expansion method, device and system for 100% utilization rate of distributed storage cluster |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385623A (en) * | 2011-10-25 | 2012-03-21 | 曙光信息产业(北京)有限公司 | Catalogue access method in DFS (distributed file system) |
CN102968279A (en) * | 2012-11-13 | 2013-03-13 | 浪潮电子信息产业股份有限公司 | Thin provisioning method for storage system |
CN103294710A (en) * | 2012-02-28 | 2013-09-11 | 北京新媒传信科技有限公司 | Data access method and device |
-
2015
- 2015-09-11 CN CN201510578464.5A patent/CN105159616A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385623A (en) * | 2011-10-25 | 2012-03-21 | 曙光信息产业(北京)有限公司 | Catalogue access method in DFS (distributed file system) |
CN103294710A (en) * | 2012-02-28 | 2013-09-11 | 北京新媒传信科技有限公司 | Data access method and device |
CN102968279A (en) * | 2012-11-13 | 2013-03-13 | 浪潮电子信息产业股份有限公司 | Thin provisioning method for storage system |
Non-Patent Citations (2)
Title |
---|
刘峪竹: "基于SSD的Key-Value系统优化设计与实现", 《计算机研究与发展》 * |
韩其睿: "《操作系统原理》", 31 August 2013 * |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106569748A (en) * | 2016-10-27 | 2017-04-19 | 南方电网科学研究院有限责任公司 | Data processing method and device of Flash file system |
CN106569748B (en) * | 2016-10-27 | 2019-04-09 | 南方电网科学研究院有限责任公司 | Data processing method and device of Flash file system |
CN106528003A (en) * | 2016-12-09 | 2017-03-22 | 曙光信息产业(北京)有限公司 | Method and device for rebuilding disk array |
CN109960463A (en) * | 2017-12-26 | 2019-07-02 | 中兴通讯股份有限公司 | A kind of disk management method, device and storage medium |
CN109597568B (en) * | 2018-09-18 | 2022-03-04 | 天津字节跳动科技有限公司 | Data storage method and device, terminal equipment and storage medium |
CN109597568A (en) * | 2018-09-18 | 2019-04-09 | 天津字节跳动科技有限公司 | A kind of date storage method, device, terminal device and storage medium |
CN109445706A (en) * | 2018-10-30 | 2019-03-08 | 紫光华山信息技术有限公司 | Disk partition expansion method, device and server-side |
CN109542911A (en) * | 2018-12-03 | 2019-03-29 | 郑州云海信息技术有限公司 | A kind of metadata organization method, system, equipment and computer readable storage medium |
CN109542911B (en) * | 2018-12-03 | 2021-10-29 | 郑州云海信息技术有限公司 | Metadata organization method, system, equipment and computer readable storage medium |
CN110134340B (en) * | 2019-05-23 | 2020-03-06 | 苏州浪潮智能科技有限公司 | Method, device, equipment and storage medium for updating metadata |
CN110134340A (en) * | 2019-05-23 | 2019-08-16 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus of metadata updates, equipment and storage medium |
CN110427364A (en) * | 2019-06-21 | 2019-11-08 | 北京奇艺世纪科技有限公司 | A kind of data processing method, device, electronic equipment and storage medium |
CN115442388A (en) * | 2022-10-21 | 2022-12-06 | 四川省华存智谷科技有限责任公司 | Capacity expansion method, device and system for 100% utilization rate of distributed storage cluster |
CN115442388B (en) * | 2022-10-21 | 2023-01-06 | 四川省华存智谷科技有限责任公司 | Capacity expansion method, device and system for 100% utilization rate of distributed storage cluster |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105159616A (en) | Disk space management method and device | |
CN107423422B (en) | Spatial data distributed storage and search method and system based on grid | |
JP5996088B2 (en) | Cryptographic hash database | |
US10248676B2 (en) | Efficient B-Tree data serialization | |
CN102890722B (en) | Indexing method applied to time sequence historical database | |
CN103488704B (en) | A kind of date storage method and device | |
US9495398B2 (en) | Index for hybrid database | |
CN105117417A (en) | Read-optimized memory database Trie tree index method | |
CN110018983A (en) | A kind of metadata query method and device | |
US8924373B2 (en) | Query plans with parameter markers in place of object identifiers | |
CN103729447A (en) | Method for fast searching database | |
CN110347852A (en) | It is embedded in the file system and file management method of key assignments storage system extending transversely | |
CN104866497A (en) | Metadata updating method and device based on column storage of distributed file system as well as host | |
KR20190134115A (en) | Method and apparatus for providing efficient indexing and computer program included in computer readable medium therefor | |
CN104484471B (en) | A kind of implementation method of high-performance data storage engines | |
CN102779138B (en) | The hard disk access method of real time data | |
CN101986649B (en) | Shared data center used in telecommunication industry billing system | |
CN103914483B (en) | File memory method, device and file reading, device | |
WO2018205151A1 (en) | Data updating method and storage device | |
CN109597829B (en) | Middleware method for realizing searchable encryption relational database cache | |
CN102915340A (en) | Expanded B+ tree-based object file system | |
CN112148217B (en) | Method, device and medium for caching deduplication metadata of full flash memory system | |
CN102722450B (en) | Storage method for redundancy deletion block device based on location-sensitive hash | |
CN113704217A (en) | Metadata and data organization architecture method in distributed persistent memory file system | |
CN106326040A (en) | Method and device for managing snapshot metadata |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151216 |