CN103412826A - Garbage collection method and system of solid state disk - Google Patents

Garbage collection method and system of solid state disk Download PDF

Info

Publication number
CN103412826A
CN103412826A CN2013103054992A CN201310305499A CN103412826A CN 103412826 A CN103412826 A CN 103412826A CN 2013103054992 A CN2013103054992 A CN 2013103054992A CN 201310305499 A CN201310305499 A CN 201310305499A CN 103412826 A CN103412826 A CN 103412826A
Authority
CN
China
Prior art keywords
data page
data
solid state
page
hard disc
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
Application number
CN2013103054992A
Other languages
Chinese (zh)
Inventor
姜华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ramaxel Technology Shenzhen Co Ltd
Original Assignee
Ramaxel Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ramaxel Technology Shenzhen Co Ltd filed Critical Ramaxel Technology Shenzhen Co Ltd
Priority to CN2013103054992A priority Critical patent/CN103412826A/en
Publication of CN103412826A publication Critical patent/CN103412826A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention is suitable for the field of storage technology, and provides a garbage collection method of a solid state disk. The method comprises the steps that the number of modification times of data pages in the solid state disk is recorded; the data pages are stored in different data blocks according to the number of the modification times; according to the number of the modification times, garbage collection is conducted on the different data blocks. The invention further provides a garbage collection system of the solid state disk correspondingly, wherein the garbage collection system achieves the garbage collection method. By means of the garbage collection method and the garbage collection system, the number of garbage collection times of the solid state disk can be reduced, and performance is promoted.

Description

The rubbish recovering method of solid state hard disc and system
Technical field
The present invention relates to technical field of memory, relate in particular to a kind of rubbish recovering method and system of solid state hard disc.
Background technology
At present, SSD(Solid State Disk, solid state hard disc) in mobile device, portable set and server, obtained applying more widely.SSD, when being widely used, also exposes some problems: during the capacity increase that is used in SSD, the writing rate of SSD can be more and more lower.The reason that this phenomenon produces has a lot, and wherein very the more important is exactly the characteristics of SSD self, and when Update Table, SSD applies for that always a new blank page preserves the data of new merging, and the original page that cancels.Like this, the quantity of the available block in SSD constantly reduces, and in piece, the quantity growth of invalid page is rapid simultaneously, causes often being triggered of garbage reclamation mechanism, and causes data-moving frequent, and overall performance descends.
In summary, the rubbish recovering method of existing solid state hard disc and system, obviously exist inconvenience and defect in actual use, improved so be necessary.
Summary of the invention
For above-mentioned defect, the object of the present invention is to provide a kind of rubbish recovering method and system of solid state hard disc, can reduce the garbage reclamation number of times of solid state hard disc, promote its performance.
To achieve these goals, the invention provides a kind of rubbish recovering method of solid state hard disc, described method comprises:
Record the modification number of times of data page in described solid state hard disc;
Described data page is pressed and revised the number of times classified storage in different data blocks;
Modification number of times according to described data page, carry out garbage reclamation to different data blocks.
According to the rubbish recovering method of solid state hard disc of the present invention, the described step that described data page is put into to different data blocks by the classification of modification number of times comprises:
At least one described data page is set and revises frequency threshold value;
The data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.
According to the rubbish recovering method of solid state hard disc of the present invention, described described data page put into to different data block steps and comprised by revising the number of times classification:
Described data page is set and revises a plurality of threshold intervals of number of times;
The interval corresponding data page of same threshold is stored in to same data block, and the data page that different threshold intervals are corresponding is stored in different data blocks.
According to the rubbish recovering method of solid state hard disc of the present invention, the described modification number of times step that records data page in described solid state hard disc comprises:
Read described data page, the Update Table of described data page and unmodified former data are merged into to a new data page;
The modification number of times of described data page is added to 1, and be kept in described unmodified former data;
Described new data page is write to new blank page.
The present invention also provides a kind of garbage retrieving system of solid state hard disc, and described system comprises:
The amendment record module, for recording the modification number of times of described solid state hard disc data page;
The classified storage module, for pressing described data page to revise the number of times classified storage in different data blocks;
The garbage reclamation module, the modification number of times for according to described data page, carry out garbage reclamation to different data blocks.
According to the garbage retrieving system of solid state hard disc of the present invention, described classified storage module comprises:
Submodule is set, revises frequency threshold value be used at least one described data page is set;
Store submodule, the data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.
According to the garbage retrieving system of solid state hard disc of the present invention, the described submodule that arranges is further used for arranging a plurality of threshold intervals that described data page is revised number of times;
Described storage submodule is further used for the interval corresponding data page of same threshold is stored in to same data block, and the data page that different threshold intervals are corresponding is stored in different data blocks.
According to the garbage retrieving system of solid state hard disc of the present invention, described amendment record module comprises:
Merge submodule, be used to reading described data page, the Update Table of described data page and unmodified former data are merged into to a new data page;
The counting submodule, add 1 for the modification number of times by described data page, and new modification number of times be kept in described unmodified former data;
Write submodule, for described new data page is write to new blank page.
The present invention is by recording the modification number of times of data page in solid state hard disc, and according to this modification number of times, data page is classified, the data page of difference being revised to the number of times scope is stored in different data blocks, when carrying out garbage reclamation, can to different data blocks, adopt different garbage collection strategies according to different modification number of times scopes, can greatly reduce whereby the garbage reclamation number of times of solid state hard disc, promote the performance of solid state hard disc.
The accompanying drawing explanation
Fig. 1 is the structural representation of garbage retrieving system of the solid state hard disc of one embodiment of the invention;
Fig. 2 is the structural representation of garbage retrieving system of the solid state hard disc of another embodiment of the present invention;
Fig. 3 is the structural representation of data block of the solid state hard disc of one embodiment of the invention;
Fig. 4 is the rubbish recovering method process flow diagram of the solid state hard disc of one embodiment of the invention;
Fig. 5 is the rubbish recovering method process flow diagram of the solid state hard disc of another embodiment of the present invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Referring to Fig. 1, the invention provides a kind of garbage retrieving system of solid state hard disc, this system 100 comprises amendment record module 10, classified storage module 20 and garbage reclamation module 30, wherein:
Amendment record module 10, for recording the modification number of times of described solid state hard disc data page.In the application of solid state hard disc, the modification of its data is to carry out in data page, and each data block of solid state hard disc can be stored a plurality of data pages.When the data of data page were modified, amendment record module 10 added 1 by the modification number of times of this data page.
Classified storage module 20, for pressing described data page to revise the number of times classified storage in different data blocks.Different data pages usually stores different data, so the number of times be modified corresponding to Various types of data page, and if data are not modified after writing, the data that were modified before the possibility be modified after it is generally less than; The data of frequently being revised in the past, the possibility be modified after it is greater than other data.The present embodiment carries out piecemeal storage by different modification number of times by data page by classified storage module 20, greatly is conducive to follow-up garbage reclamation
Garbage reclamation module 30, the modification number of times for according to described data page, carry out garbage reclamation to different data blocks.Due to the data page of different data block store, garbage retrieving system 100, when each data block is carried out to garbage reclamation, can call suitable garbage reclamation algorithm according to the modification number of times scope of data page in piece.For the data block of revising the less data page place of number of times, can reclaim or adopt comparatively simple garbage reclamation algorithm.
The present invention is the foundation using the modification number of times of data page as garbage reclamation in SSD.Modification number of times by record data, the data of this page are modified at every turn, counting just increases by 1, when SSD did garbage reclamation, the page in processing a plurality of, be placed in different masses revising less data page and the larger data page of number of times of number of times, reduce the possibility of the irregular growth of invalid number of pages in piece, free block can be more, thereby reduce the triggering times of garbage reclamation, improve the performance of SSD.
In another embodiment of the present invention, referring to Fig. 2, amendment record module 10 comprises:
Merge submodule 11, for the reading out data page, the Update Table of described data page and unmodified former data are merged into to a new data page.When certain data page of solid state hard disc was modified, it had comprised and has been modified data and unmodified raw data, after modification, merges submodule 11 amended data and unmodified raw data are merged into to a new data page.
Counting submodule 12, add 1 for the modification number of times by described data page, and new modification number of times be kept in described unmodified former data, and this counting submodule 12 can be realized with counter.
Write submodule 13, for described new data page is write to new blank page.
Described classified storage module 20 comprises:
Submodule 21 is set, revises frequency threshold value be used at least one described data page is set.Such as, the modification frequency threshold value that data page can be set is M, also the threshold interval that a plurality of threshold values form a plurality of scopes can be set.
Store submodule 22, the data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.The modification frequency threshold value M of take is example, and the data page that the present embodiment can be less than the modification number of times M is stored in the first data block, and the data page that the modification number of times is greater than to M is stored in the second data block, to facilitate garbage reclamation.For the system that is provided with a plurality of threshold values, this storage submodule 22 can be stored in same data block by the interval corresponding data page of same threshold, and the data page that different threshold intervals are corresponding is stored in different data blocks.
In concrete application of the present invention, revise the possibility that the data in the less data page of number of times are modified less, the possibility that becomes invalid page diminishes; Revise the possibility that the data in the more data page of number of times are modified larger, in the piece of this page place, the quantity of invalid page may be a lot, in SSD of the present invention, adopt DRAM to come data cached, modification to page in data block is directly carried out in DRAM, in can before the SSD outage, these class data really being written to NAND, go, data in this data block are still effectively, until again revise the data in this data block after restarting next time.
In embodiment shown in Figure 3 ,-1 in figure means unemployed data page, and 1 means to be modified data page once, and 2 mean to be modified the data page of twice, the like.
In this embodiment, in a long time, in figure, in block4 and block5, invalid number of pages also can be less, and in block6, invalid number of pages can be larger, and in whole SSD, free block becomes many, and the garbage reclamation number of times reduces, performance boost.
Referring to Fig. 4, the invention provides a kind of rubbish recovering method of solid state hard disc, they can be by system 100 realizations as shown in Figure 1, and the method comprises:
Step S401, record the modification number of times of data page in described solid state hard disc.
In the application of solid state hard disc, the modification of its data is to carry out in data page, and each data block of solid state hard disc can be stored a plurality of data pages.When the data of data page were modified, system 100 added 1 by the modification number of times of this data page.
Step S402, press described data page to revise the number of times classified storage in different data blocks.
Different data pages usually stores different data, so the number of times be modified corresponding to Various types of data page, and if data are not modified after writing, the data that were modified before the possibility be modified after it is generally less than; The data of frequently being revised in the past, the possibility be modified after it is greater than other data.The present embodiment carries out piecemeal storage by different modification number of times by data page by classified storage module 20, greatly is conducive to follow-up garbage reclamation
Step S403, according to the modification number of times of described data page,
Different data blocks is carried out to garbage reclamation.Due to the data page of different data block store, garbage retrieving system 100, when each data block is carried out to garbage reclamation, can call suitable garbage reclamation algorithm according to the modification number of times scope of data page in piece.For the data block of revising the less data page place of number of times, can reclaim or adopt comparatively simple garbage reclamation algorithm.
The present invention is the foundation using the modification number of times of data page as garbage reclamation in SSD.Modification number of times by record data, the data of this page are modified at every turn, counting just increases by 1, when SSD did garbage reclamation, the page in processing a plurality of, be placed in different masses revising less data page and the larger data page of number of times of number of times, reduce the possibility of the irregular growth of invalid number of pages in piece, free block can be more, thereby reduce the triggering times of garbage reclamation, improve the performance of SSD.
Referring to Fig. 5, the invention provides the rubbish recovering method of another kind of solid state hard disc, they can be by system 100 realizations as shown in Figure 2, and the method comprises:
Step S501, read described data page, and the Update Table of described data page and unmodified former data are merged into to a new data page.When certain data page of solid state hard disc was modified, it had comprised and has been modified data and unmodified raw data, after modification, merges submodule 11 amended data and unmodified raw data are merged into to a new data page.
Step S502, add 1 by the modification number of times of described data page, and be kept in described unmodified former data, and this step can realize by preset conuter in solid state hard disc.
Step S503, write new blank page by described new data page.
Step S504, arrange at least one described data page and revise frequency threshold value.Such as, the modification frequency threshold value that data page can be set is M, also the threshold interval that a plurality of threshold values form a plurality of scopes can be set.
Step S505, the data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.The modification frequency threshold value M of take is example, and the data page that the present embodiment can be less than the modification number of times M is stored in the first data block, and the data page that the modification number of times is greater than to M is stored in the second data block, to facilitate garbage reclamation.For the system that is provided with a plurality of threshold values, this storage submodule 22 can be stored in same data block by the interval corresponding data page of same threshold, and the data page that different threshold intervals are corresponding is stored in different data blocks.
Step S506, the modification number of times according to described data page, carry out garbage reclamation to different data blocks.According to the scope of the data modification number of times of different data blocks, call different garbage reclamation algorithms, greatly reduce the garbage reclamation number of times of solid state hard disc, promote the solid state hard disc performance.
In sum, the present invention is by recording the modification number of times of data page in solid state hard disc, and according to this modification number of times, data page is classified, the data page of difference being revised to the number of times scope is stored in different data blocks, when carrying out garbage reclamation, can to different data blocks, adopt different garbage collection strategies according to different modification number of times scopes, can greatly reduce whereby the garbage reclamation number of times of solid state hard disc, promote the performance of solid state hard disc.
Certainly; the present invention also can have other various embodiments; in the situation that do not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art are when making according to the present invention various corresponding changes and distortion, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.

Claims (8)

1. the rubbish recovering method of a solid state hard disc, is characterized in that, described method comprises:
Record the modification number of times of data page in described solid state hard disc;
Described data page is pressed and revised the number of times classified storage in different data blocks;
Modification number of times according to described data page, carry out garbage reclamation to different data blocks.
2. the rubbish recovering method of solid state hard disc according to claim 1, is characterized in that, the described step that described data page is put into to different data blocks by the classification of modification number of times comprises:
At least one described data page is set and revises frequency threshold value;
The data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.
3. the rubbish recovering method of solid state hard disc according to claim 2, is characterized in that, described described data page is put into to different data block steps and comprised by revising the number of times classification:
Described data page is set and revises a plurality of threshold intervals of number of times;
The interval corresponding data page of same threshold is stored in to same data block, and the data page that different threshold intervals are corresponding is stored in different data blocks.
4. the rubbish recovering method of solid state hard disc according to claim 1, is characterized in that, the described modification number of times step that records data page in described solid state hard disc comprises:
Read described data page, the Update Table of described data page and unmodified former data are merged into to a new data page;
The modification number of times of described data page is added to 1, and be kept in described unmodified former data;
Described new data page is write to new blank page.
5. the garbage retrieving system of a solid state hard disc, is characterized in that, described system comprises:
The amendment record module, for recording the modification number of times of described solid state hard disc data page;
The classified storage module, for pressing described data page to revise the number of times classified storage in different data blocks;
The garbage reclamation module, the modification number of times for according to described data page, carry out garbage reclamation to different data blocks.
6. the garbage retrieving system of solid state hard disc according to claim 5, is characterized in that, described classified storage module comprises:
Submodule is set, revises frequency threshold value be used at least one described data page is set;
Store submodule, the data page that the modification number of times is less than to described threshold value is stored in the first data block, and the data page that the modification number of times is greater than to described threshold value is stored in the second data block.
7. the garbage retrieving system of solid state hard disc according to claim 6, is characterized in that, the described submodule that arranges is further used for arranging a plurality of threshold intervals that described data page is revised number of times;
Described storage submodule is further used for the interval corresponding data page of same threshold is stored in to same data block, and the data page that different threshold intervals are corresponding is stored in different data blocks.
8. the garbage retrieving system of solid state hard disc according to claim 5, is characterized in that, described amendment record module comprises:
Merge submodule, be used to reading described data page, the Update Table of described data page and unmodified former data are merged into to a new data page;
The counting submodule, add 1 for the modification number of times by described data page, and new modification number of times be kept in described unmodified former data;
Write submodule, for described new data page is write to new blank page.
CN2013103054992A 2013-07-18 2013-07-18 Garbage collection method and system of solid state disk Pending CN103412826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013103054992A CN103412826A (en) 2013-07-18 2013-07-18 Garbage collection method and system of solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013103054992A CN103412826A (en) 2013-07-18 2013-07-18 Garbage collection method and system of solid state disk

Publications (1)

Publication Number Publication Date
CN103412826A true CN103412826A (en) 2013-11-27

Family

ID=49605839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013103054992A Pending CN103412826A (en) 2013-07-18 2013-07-18 Garbage collection method and system of solid state disk

Country Status (1)

Country Link
CN (1) CN103412826A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714891A (en) * 2013-12-11 2015-06-17 华为技术有限公司 Flash memory data management method and device
CN105589811A (en) * 2014-11-10 2016-05-18 慧荣科技股份有限公司 Data storage device and operating method
CN105701035A (en) * 2014-12-12 2016-06-22 爱思开海力士有限公司 Data storage device and operating method thereof
CN106527971A (en) * 2016-10-08 2017-03-22 华中科技大学 Method for improving read performance of SSD during junk recovery period
CN106528000A (en) * 2016-12-02 2017-03-22 郑州云海信息技术有限公司 Data storage device and read-write performance optimization method and system thereof
CN107092563A (en) * 2017-04-20 2017-08-25 紫光华山信息技术有限公司 A kind of rubbish recovering method and device
CN107391774A (en) * 2017-09-15 2017-11-24 厦门大学 The rubbish recovering method of JFS based on data de-duplication
WO2018086075A1 (en) * 2016-11-11 2018-05-17 华为技术有限公司 Storage system and system garbage collection method
CN109284233A (en) * 2018-09-18 2019-01-29 郑州云海信息技术有限公司 A kind of rubbish recovering method and relevant apparatus of storage system
CN111427509A (en) * 2019-01-09 2020-07-17 爱思开海力士有限公司 Controller, data storage device and operation method thereof

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714891A (en) * 2013-12-11 2015-06-17 华为技术有限公司 Flash memory data management method and device
CN104714891B (en) * 2013-12-11 2017-12-15 华为技术有限公司 A kind of flash data management method and device
CN105589811B (en) * 2014-11-10 2019-02-01 慧荣科技股份有限公司 Data memory device and operating method
CN105589811A (en) * 2014-11-10 2016-05-18 慧荣科技股份有限公司 Data storage device and operating method
CN105701035A (en) * 2014-12-12 2016-06-22 爱思开海力士有限公司 Data storage device and operating method thereof
CN105701035B (en) * 2014-12-12 2021-04-02 爱思开海力士有限公司 Data storage device and method of operating the same
CN106527971A (en) * 2016-10-08 2017-03-22 华中科技大学 Method for improving read performance of SSD during junk recovery period
CN106527971B (en) * 2016-10-08 2019-11-26 华中科技大学 A method of promoting SSD reading performance during garbage reclamation
US10621085B2 (en) 2016-11-11 2020-04-14 Huawei Technologies Co., Ltd. Storage system and system garbage collection method
WO2018086075A1 (en) * 2016-11-11 2018-05-17 华为技术有限公司 Storage system and system garbage collection method
CN106528000A (en) * 2016-12-02 2017-03-22 郑州云海信息技术有限公司 Data storage device and read-write performance optimization method and system thereof
CN107092563A (en) * 2017-04-20 2017-08-25 紫光华山信息技术有限公司 A kind of rubbish recovering method and device
CN107092563B (en) * 2017-04-20 2021-02-26 新华三信息技术有限公司 Garbage recovery method and device
CN107391774A (en) * 2017-09-15 2017-11-24 厦门大学 The rubbish recovering method of JFS based on data de-duplication
CN109284233A (en) * 2018-09-18 2019-01-29 郑州云海信息技术有限公司 A kind of rubbish recovering method and relevant apparatus of storage system
CN109284233B (en) * 2018-09-18 2022-02-18 郑州云海信息技术有限公司 Garbage recovery method of storage system and related device
CN111427509A (en) * 2019-01-09 2020-07-17 爱思开海力士有限公司 Controller, data storage device and operation method thereof

Similar Documents

Publication Publication Date Title
CN103412826A (en) Garbage collection method and system of solid state disk
US10061693B2 (en) Method of generating secondary index and apparatus for storing secondary index
US20180260318A1 (en) Read-write control method for memory, and corresponding memory and server
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
CN101645043B (en) Methods for reading and writing data and memory device
US7516296B2 (en) Flash memory storage device and read/write method
CN102147711B (en) Storage method and device based on data content identification
TWI431627B (en) Flash memory apparatus and method for operating a flash memory apparatus
CN107562644B (en) Compression method of solid state disk mapping table
CN102831072B (en) Flash memory device and management method, data read-write method and read-write equipment
CN103713972B (en) A kind of incremental backup system and method
CN102637142A (en) Computer system and method for realizing log management
CN103257830A (en) Storage cell accessing method and storage cell
CN103049224A (en) Method, device and system for importing data into physical tape
CN115421651A (en) Data processing method of solid state disk, electronic device and medium
CN116257523A (en) Column type storage indexing method and device based on nonvolatile memory
CN102541982B (en) Method for organizing and accessing metadata file log
CN106020717B (en) Data processing method and electronic equipment
CN105573673A (en) Database based data cache system
CN103309619A (en) NAND Flash memory data storage method
CN102867046B (en) Database optimizing method based on solid state hard disc and system
CN108563586B (en) Method for separating garbage recovery data and user data in solid-state disk
CN102722456A (en) Flash memory device and data writing method thereof
CN109634528A (en) A kind of rule method, apparatus, equipment and the storage medium of target data
CN102880432A (en) Method and system for increasing writing speeds of flash memory chips by aid of limited lives of data and controller of system

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

Application publication date: 20131127