CN104881370A - Method for constructing reliable flash memory storage system in cooperative usage of erasure codes and error correction codes - Google Patents
Method for constructing reliable flash memory storage system in cooperative usage of erasure codes and error correction codes Download PDFInfo
- Publication number
- CN104881370A CN104881370A CN201510236451.XA CN201510236451A CN104881370A CN 104881370 A CN104881370 A CN 104881370A CN 201510236451 A CN201510236451 A CN 201510236451A CN 104881370 A CN104881370 A CN 104881370A
- Authority
- CN
- China
- Prior art keywords
- page
- request
- bit
- errors
- error correcting
- 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.)
- Granted
Links
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The present invention discloses a method for constructing reliable flash memory storage system in cooperative usage of erasure codes and error correction codes, comprising the following steps: receiving an IO request R, determining whether the IO request R is a write request or a read request; for a write request, applying erasure codes to s numbers of user data pages of each stripping so as to generate a total s+k numbers of pages to be written, writing the s+k numbers of pages to be written together with verification and error correction codes of each page to a storage device; for a read request, dividing the read request into sub-requests which belong to different strippings, and for each sub-request, reading out each page and the verification and error correction codes of each page, calculating the verification of each page and identifying bit errors and finding out the page with the largest number of errors, wherein if the number of errors of the page is not greater than the largest error bit T that can be corrected by the error correction codes to be adopted, the error correction codes will be adopted in correcting bit errors in the sub-requests, otherwise the erasure codes will be adopted to correct bit errors in the sub-requests, and the data requested by the sub-requests will be sent back. The method herein has the advantages of low calculating overhead, fast IO speed, and marked effect of prolonged flash memory lifespan.
Description
Technical field
The present invention relates to computer memory system field, be specifically related to the reliable flash-memory storage system construction method of a kind of collaborative use correcting and eleting codes and error correcting code.
Background technology
Flash memory is widely deployed in large-scale storage systems because of its superior performance, but its limited life-span hinders flash memory to a certain extent and writing the popularization under intensive load.The life-span of flash memory refers to the erasable number of times that each storage unit can be born.Manufacturer, when releasing a flash chip, can provide the nominal life that this chip is corresponding.If the erasable number of times of each storage unit is within nominal life, the bit error rate of flash memory is lower, and the data be kept on flash memory are considered to reliable.In fact, after erasable number of times exceedes nominal life very on a large scale in, flash memory still can preserve data, and just bit error rate progressively becomes large, may occur data Loss.But along with the further increase of erasable number of times, bit error rate exponentially increases, and finally causes flash memory unavailable.According to above-described flash memory bit error rate rising tendency, bit error rate with erasable number of times increase exponentially increase before, flash memory remains available; Correct the bit-errors occurred in flash memory according to suitable means, even if the erasable number of times of each storage unit exceedes nominal life, the data of preserving in a flash memory remain reliable.
ECC (Error Correction Code, error correcting code) is a kind of conventional fault tolerant mechanism in memory device.When memory device writes one page user data in storage medium, simultaneously for this page data generates the error correcting code of some.Error correcting code and user data are together kept in storage medium.When responding the read request of upper layer application, the error correcting code of the user data of upper layer application request and correspondence is taken out by memory device simultaneously from storage medium, and utilize error correcting code to detect and correct the bit-errors occurred in user data, thus ensure that user data is reliably complete.The feature of error correcting code is that space expense is very low, and it utilizes more than ten position information can ensure that the data integrity of hundreds of byte is reliable.But its limited error recovery capability, the scene that the probability that is only applicable to make mistakes is lower.When the erasable number of times of each storage unit of flash memory is within nominal life, bit error rate is lower, and error correcting code can ensure that data are reliable.If erasable number of times exceedes nominal life, bit error rate constantly rises, and error correcting code must adopt more check bit and be aided with complicated calculating could correct the bit-errors occurred in user data.Error correcting code calculates in IO critical path, and excessive computing cost can have a strong impact on IO performance.So, when flash memory exceedes nominal life actual life, simply utilize error correcting code can not ensure the reliability of flash-memory storage system with very low computing cost.
Correcting and eleting codes (Erasure Code) is that one is usually used in system-level fault tolerant mechanism, and it ensures data reliability mainly through preserving a large amount of redundant datas.For abstract be (n, k) two correcting and eleting codes of tuple, when responding the write request of upper layer application, it generates k part redundant data according to n part user data, and this n+k number, according in the same size, is written simultaneously in storage system.When responding the read request of upper layer application, as long as have n part still reliably complete in this n+k number certificate, correctly can recover all customer data.The feature of correcting and eleting codes is that fault-tolerant ability is strong, and its fault-tolerant ability increases with the increase of k value, is applicable to the scene that bit error rate is higher.When the erasable number of times of each storage unit of flash memory exceedes nominal life, although bit error rate is higher, as long as correcting and eleting codes selects enough large k value, can ensure that the data integrity on flash memory is reliable, certain computing cost and space expense can be introduced.
The above-described two kinds of fault tolerant mechanisms of Integrated comparative are known: error correcting code is only applicable to the lower scene of error rate, and when error rate is higher, the computing cost of error correcting code significantly increases, and even cannot ensure the correctness of data; Correcting and eleting codes is applicable to the higher scene of error rate, and it can with a large amount of bit-errors occurred in powerful fault-tolerant ability correction of data, and computing cost is constant, but when bit-errors is less, the computing cost of correcting and eleting codes is higher than error correcting code.The above two kinds of mechanism of independent use are difficult to beyond the life of flash memory to manufacturer's nominal life while guarantee IO performance.Therefore, how to realize the collaborative use of error correcting code and correcting and eleting codes, premised on avoiding having a negative impact to performance, realize the reliability being kept at the data in flash-memory storage system when flash memory exceedes nominal life actual life, extend the actual life of flash memory, become technical matters urgently to be resolved hurrily.
Summary of the invention
The technical problem to be solved in the present invention is: for the problems referred to above of prior art, provides that a kind of computing cost is low, IO speed is fast, realizes being kept at when flash memory exceedes nominal life actual life the reliability of the data in flash-memory storage system, the service life of flash memory prolongation collaborative use correcting and eleting codes of Be very effective and the reliable flash-memory storage system construction method of error correcting code.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
A reliable flash-memory storage system construction method for collaborative use correcting and eleting codes and error correcting code, step comprises:
1) initialization receives the buffer zone of I/O request;
2) receive I/O request R, judge the read-write type of I/O request R, if read-write type is write request, then redirect performs step 3); If otherwise read-write type is read request, then redirect performs step 4);
3) be that unit chooses by the data of writing of I/O request R according to band, correcting and eleting codes is adopted to generate k the redundant data page s the user data page of each band chosen, calculate School Affairs, the error correcting code of s+k the page of described s the user data page and k redundant data page composition respectively, and by School Affairs, the error correcting code together write storage device of a described s+k page and each page;
4) I/O request R is divided into the sub-request belonging to different band respectively, for each height request, read each page and the School Affairs thereof of son request, error correcting code, calculate the School Affairs of each page and identify the bit-errors of each page, find out the page that bit-errors is maximum, judge the maximum wrong figure place the T whether number of bit errors of the page that bit-errors is maximum is greater than used error correcting code and can corrects, if the number of bit errors of the page that bit-errors is maximum is not more than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of error correcting code syndrome, if the number of bit errors of the page that bit-errors is maximum is greater than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of correcting and eleting codes syndrome, return the data that each page of son request comprises.
Preferably, described step 1) also comprise initialization for recording the write request counter Count of the page sum of memory device to be written
wbe the step of 0, described step 3) detailed step comprise:
3.1) page number that write request R comprises is added to write request counter Count
win;
3.2) write request counter Count is judged
wwhether exceed default threshold value h, wherein h is the integer being greater than the page quantity n comprised in a complete band; If write request counter Count
wexceed default threshold value h, then redirect performs step 3.3); If write request counter Count
wbe no more than default threshold value h, then redirect performs step 2);
3.3) according to the Count that page number is to be written
windividual page of data of writing makes ascending sort, by Count to be written
windividual page of data of writing is divided in different bands, and make the page being numbered x be divided in xth/n band, wherein n represents the page quantity comprised in a complete band; From Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4);
3.4) adopt correcting and eleting codes to generate k the redundancy page s the user data page in the complete band chosen or imperfect band and obtain s+k the page altogether, calculate School Affairs, the error correcting code of each page in a described s+k page respectively, by the error correcting code of each page in a described s+k page and a described s+k page and School Affairs together write storage device; Final from write request counter Count
win deduct the user data page quantity s of this write storage device, jump procedure 3.2).
Preferably, described step 3.2) in threshold value h be 10 times of the page quantity n comprised in a complete band.
Preferably, described step 3.3) detailed step comprise:
3.3.1) from write request counter Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then redirect performs step 3.3.2);
3.3.2) judge whether I/O request R is continuous print write request, if I/O request R is continuous print write request, then redirect performs step 2); I/O request R discrete write request else if, then redirect performs step 3.3.3);
3.3.3) choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4).
Preferably, described step 3.4) in by the error correcting code of each page in a described s+k page and a described s+k page and School Affairs together write storage device time, memory device is that in a described s+k page, each page to be written distributes an idle physical page, in a described s+k page, the data of each page are written into the data area of the physical page of distribution, and in a described s+k page, the error correcting code of each page and School Affairs are written into the additional areas of the physical page of distribution.
Preferably, described step 3.4) in calculate each page in a described s+k page respectively School Affairs specifically refer to the word Word bit stream in the page to be calculated being divided into fixed size, each word Word comprises 64 bits, and the result then calculated as XOR by these words Word is as the School Affairs of this page.
Preferably, described step 4) detailed step comprise:
4.1) I/O request R is divided into m the son request belonging to different band respectively;
4.2) the sub-request counter i of Initialize installation is 0;
4.3) son request R is read
ieach page comprised, together reads error correcting code corresponding to each page and School Affairs;
4.4) son request R is calculated
ithe School Affairs of each page comprised, according to the School Affairs calculated and step 4.3) in read the School Affairs that obtains and compare recognin request R
ibit-errors in each page comprised;
4.5) son request R is found out
ithe page that in each page comprised, error bit is maximum, the maximum wrong figure place T that the wrong figure place of the pages maximum for described error bit and the error correcting code adopted can be corrected is compared, if the number of bit errors of the page that bit-errors is maximum is not more than the maximum wrong figure place T that used error correcting code can be corrected, then redirect performs step 4.6); The number of bit errors of the page that bit-errors is maximum is greater than the maximum wrong figure place T that used error correcting code can be corrected else if, then jump procedure 4.7);
4.6) error correcting code syndrome request R is used
iin the bit-errors of each page, if correct unsuccessfully, then redirect performs step 4.7); Correct successfully else if, then redirect performs step 4.8);
4.7) correcting and eleting codes syndrome request R is utilized
iin the bit-errors of each page;
4.8) son request R is returned to upper layer application
ithe user data comprised;
4.9) sub-request counter i is increased;
4.10) if sub-request counter i is less than son, request splits quantity m, then judge to also have untreated complete sub-request, redirect performs step 4.3); If sub-request counter i equals son, request splits quantity m, then judge to have processed all sub-requests, and redirect performs step 2).
Preferably, described step 4.1) in when I/O request R being divided into m the son request belonging to different band respectively, the value of m is (Offset
r+ Size
r+ n-1)/n-Offset
r/ n, wherein n represents the user data number of pages comprised in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that comprises of I/O request R, I/O request R is by with start address Offset
rthe Size started
rindividual continuous page composition; I-th son request R in described m son request
ithe page comprised is such as formula shown in (1);
In formula (1), R
irepresent i-th son request, n represents the page quantity in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that I/O request R comprises.
Preferably, described step 4.7) detailed step comprise:
4.7.1) initialization data recovers number counter is 0; At sub-request R
iin belong to same band the basis that has been read of v the page on, read n-v number certificate from memory device, obtain the n number certificate at least needed when correcting and eleting codes makes date restoring to described band altogether;
4.7.2) according to the common n number read out according to by correcting and eleting codes syndrome request R
iin the bit-errors of each page, if successful syndrome request R
iin the bit-errors of each page, then redirect performs step 4.8); Otherwise date restoring number counter is added 1, and redirect performs step 4.7.3);
4.7.3) judge whether the value of date restoring number counter equals
if the value of date restoring number counter is less than
then read the other n number certificate at least needed when correcting and eleting codes makes date restoring to described band, redirect performs step 4.7.2); The value of date restoring number counter equals else if
then judge to utilize correcting and eleting codes syndrome request R
iin each page bit-errors failure.
The present invention works in coordination with and uses the reliable flash-memory storage system construction method of correcting and eleting codes and error correcting code to have following advantage:
1, the present invention is directed to that service life of flash memory is limited, bit error rate with erasable number of times increase and the problem that progressively increases, utilize correcting and eleting codes to correct the bit-errors occurred in flash memory, thus the actual life of flash memory extended to beyond manufacturer's nominal life.Because correcting and eleting codes has very strong error correcting capability, service life of flash memory can be extended decades of times by the present invention, has the advantage that life is effective, can significantly improve the reliability of flash-memory storage system.
2, the present invention is directed to when the average erasable number of times of each storage unit of flash memory is less, bit error rate also low time, utilize correcting and eleting codes to correct the bit-errors computing cost occurred in flash memory relatively large.In order to reduce computing cost, first the present invention adopts School Affairs to do anticipation to the bit-errors occurred in flash memory pages.When the bit-errors that School Affairs judges is less, error correcting code is adopted to correct the bit-errors occurred in the page.Error correcting code error correcting capability is relatively weak, is only applicable to the situation that bit error rate is lower, but its computing cost is lower, can not produce significant impact to IO performance.Owing to adopting correcting and eleting codes and error correcting code flexibly, the present invention can life-span of significant prolongation flash memory, has again the advantage that computing cost is low.
3, computing cost of the present invention is lower, can not produce significant negative effect to IO performance.When making date restoring with correcting and eleting codes, give full play to the high concurrency of flash memory, the read request related to by date restoring is dispatched on multiple concurrent passage, has the advantage that IO performance is good.
Accompanying drawing explanation
Fig. 1 is the basic implementing procedure schematic diagram of the embodiment of the present invention.
Fig. 2 is the detailed implementing procedure schematic diagram of the embodiment of the present invention.
Embodiment
As shown in Figure 1, the collaborative step of the reliable flash-memory storage system construction method of correcting and eleting codes and error correcting code that uses of the present embodiment association comprises:
1) initialization receives the buffer zone of I/O request; The buffer zone of initialization reception I/O request is applies for a panel region in internal memory, in order to preserve the read-write requests that upper layer application sends;
2) receive I/O request R, judge the read-write type of I/O request R, if read-write type is write request, then redirect performs step 3); If otherwise read-write type is read request, then redirect performs step 4);
3) be that unit chooses by the data of writing of I/O request R according to band, correcting and eleting codes is adopted to generate k the redundant data page s the user data page of each band chosen, calculate School Affairs, the error correcting code of s+k the page that s the user data page and k redundant data page form respectively, and by School Affairs, the error correcting code together write storage device (i.e. flash-memory storage system) of s+k the page and each page;
4) I/O request R is divided into the sub-request belonging to different band respectively, for each height request, read each page and the School Affairs thereof of son request, error correcting code, calculate the School Affairs of each page and identify the bit-errors of each page, find out the page that bit-errors is maximum, judge the maximum wrong figure place the T whether number of bit errors of the page that bit-errors is maximum is greater than used error correcting code and can corrects, if the number of bit errors of the page that bit-errors is maximum is not more than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of error correcting code syndrome, if the number of bit errors of the page that bit-errors is maximum is greater than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of correcting and eleting codes syndrome, return the data that each page of son request comprises.
I/O request R can be designated (Type
r, Offset
r, Size
r), wherein Type
rrepresent the read-write type of I/O request R, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that I/O request R comprises; Therefore, the present embodiment step 2) judge that the read-write type of I/O request R is and judge read-write type Type
rvalue Types.The present embodiment is intended to utilize fault tolerant mechanism, collaborative error correcting code and the correcting and eleting codes of using corrects the bit-errors occurred in flash memory, first by the bit-errors in School Affairs technology (Check Sum) rough estimates data, use error correcting code error recovery when bit error rate is lower, avoid having a negative impact to performance; When bit-errors is higher, adopt correcting and eleting codes error recovery, the reliability being kept at the data in flash-memory storage system when flash memory exceedes nominal life actual life can be realized, there is the advantage that computing cost is low, IO speed fast, service life of flash memory extends Be very effective.
As shown in Figure 2, the present embodiment step 1) also comprise initialization for recording the write request counter Count of the page sum of memory device to be written
wbe the step of 0, Count
wrepresent also non-write storage device the page sum, the present embodiment step 3) detailed step comprise:
3.1) page number that write request R comprises is added to write request counter Count
win;
3.2) write request counter Count is judged
wwhether exceed default threshold value h, wherein h is the integer being greater than the page quantity n comprised in a complete band; If write request counter Count
wexceed default threshold value h, then redirect performs step 3.3); If write request counter Count
wbe no more than default threshold value h, then redirect performs step 2);
3.3) according to the Count that page number is to be written
w(represent write request counter Count
wvalue, lower with) individual page of data of writing makes ascending sort, by Count to be written
windividual page of data of writing is divided in different bands, and make the page being numbered x be divided in xth/n band, wherein n represents the page quantity comprised in a complete band; From Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4);
3.4) adopt correcting and eleting codes to generate k the redundancy page s the user data page in the complete band chosen or imperfect band and obtain s+k the page altogether, calculate School Affairs, the error correcting code of each page in s+k the page respectively, by the error correcting code of each page in s+k the page and s+k the page and School Affairs together write storage device; Final from write request counter Count
win deduct the user data page quantity s of this write storage device, jump procedure 3.2).
Correcting and eleting codes can abstractly be one (n, k) two tuple, represents that correcting and eleting codes generates k part check information according to n part user data.This n+k number, according to composition band, is together write in the memory device of bottom.In the storage system adopting correcting and eleting codes, each write operation all relates to the band that comprises n+k the page, instead of a simple write page.So, when writing data in memory device, after should waiting until that all data of a band all arrive as far as possible, then send write request to storage system.By write request counter Count in the present embodiment
wthen be used for the accumulation page, whenever by write request counter Count
wwhen the data of the memory device to be written of record reach h the page, can by partial data write storage device; If the page sum Count of memory device to be written
wbe no more than h, then redirect performs step 2) continue to accept new read-write requests, until the data of memory device to be written reach h the page, thus so that correcting and eleting codes tries hard to find complete band from the page of accumulation, thus to reduce loss is write to flash memory, extend the serviceable life of memory device.
In the present embodiment, step 3.2) in threshold value h be 10 times of the page quantity n comprised in a complete band.
In the present embodiment, step 3.3) detailed step comprise:
3.3.1) from write request counter Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then redirect performs step 3.3.2);
3.3.2) judge whether I/O request R is continuous print write request, if I/O request R is continuous print write request, then redirect performs step 2); I/O request R discrete write request else if, then redirect performs step 3.3.3);
3.3.3) choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4).
By above-mentioned steps 3.3.1) ~ 3.3.3), can avoid as far as possible in a band because the renewal of certain customers' page causes the renewal of all checking datas, realize the optimization for continuous print write request, guarantee when in the face of continuous print write request, complete band is not found if current, then redirect performs step 2) continue to accept follow-up continuous print write request, until there is complete band or follow-up for discrete write request in the data of memory device to be written, thus can reduce further loss is write to flash memory, extend the serviceable life of memory device.
In the present embodiment, step 3.4) to be adopted by s the user data page in the complete band chosen or imperfect band correcting and eleting codes to generate k the redundancy page when obtaining s+k the page altogether; For the complete band chosen, user data page quantity s is wherein the page quantity n in complete band; For the imperfect band chosen, user data page quantity s is wherein less than for the page quantity n in aforementioned complete band.But, no matter the complete band chosen or imperfect band, assuming that there be s User Page memory device to be written in this band, then generate the new check information (k the page) of k part according to this s the page, thus obtain s+k the page altogether.
The physical page of flash memory comprises two parts: preserve the data area of data and the additional areas of Preservation Metadata.In the present embodiment, step 3.4) in by the error correcting code of each page in s+k the page and s+k the page and School Affairs together write storage device time, memory device is that in s+k the page, each page to be written distributes an idle physical page, in s+k the page, the data of each page are written into the data area of the physical page of distribution, and in s+k the page, the error correcting code of each page and School Affairs are written into the additional areas of the physical page of distribution.Assuming that memory device is page of data Page to be written
datathe physical page distributed is Page
physical, then Page
datacorresponding data write Page
physicaldata area, Page
dataerror correcting code and School Affairs write Page
physicaladditional areas.The present embodiment carrys out error correcting code and the School Affairs of memory page based on additional areas, thus can under the prerequisite of storage organization not changing memory device, realize the error correcting code of the page and the storage of School Affairs, thus provide Back ground Information for follow-up based on error correcting code and correcting and eleting codes.
In the present embodiment, step 3.4) in calculate each page in s+k the page respectively School Affairs specifically refer to the word Word bit stream in the page to be calculated being divided into fixed size, each word Word comprises 64 bits, and the result then calculated as XOR by these words Word is as the School Affairs of this page.Certainly, step 4) in calculate the Methods and steps 3.4 of School Affairs of each page) in calculate the method for the School Affairs of each page in s+k the page respectively identical.It should be noted that, School Affairs technology (Check Sum) is calibration technology more common at present, such as can also adopt current all kinds of common checksum algorithm as required, and the checksum algorithm that the present embodiment adopts calculates based on XOR, computing cost is little.
As shown in Figure 2, step 4 in the present embodiment) detailed step comprise:
4.1) I/O request R is divided into m the son request R belonging to different band respectively
0, R
1, R
2r
m-1; Correcting and eleting codes is that base unit ensures the reliability of data with band, and for being conceptualized as (n, k) two correcting and eleting codes of tuple, a band comprises n+k page data.When responding the read request of upper layer application, first correcting and eleting codes needs the band at the data place finding upper layer application request, and these data may be distributed in multiple band.For the present embodiment, m son request R
0, R
1, R
2r
m-1jointly constitute all data of user's request, but they belong to different bands, correcting and eleting codes will read these bands successively, and therefrom find out the data of user's request; I-th son request R in m son request
ithe page comprised is as shown in formula (1);
In formula (1), R
irepresent i-th son request, n represents the page quantity in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that I/O request R comprises.
4.2) the sub-request counter i of Initialize installation is 0;
4.3) son request R is read
ieach page comprised, together reads error correcting code corresponding to each page and School Affairs; Intrinsic concurrency is all there is, so son request R can be read concomitantly due to flash memory and based on the memory device of flash memory
ieach page comprised, guarantees that reliable memory system that the present embodiment builds has and higher reads performance;
4.4) son request R is calculated
ithe School Affairs of each page comprised, according to the School Affairs calculated and step 4.3) in read the School Affairs that obtains and compare recognin request R
ibit-errors in each page comprised; In the present embodiment, with abovementioned steps 3.4) in calculate the step of the School Affairs of each page in s+k the page respectively identical, sample also refers to the word Word bit stream in the page to be calculated being divided into fixed size, each word Word comprises 64 bits, and the result then calculated as XOR by these words Word is as the School Affairs of this page; By result of calculation and step 4.3) in read the School Affairs that obtains and make XOR, the difference figure place of two kinds of School Affairs is identified as BE
j, BE
jthe bit-errors number thinking to occur in this page can be similar to;
4.5) son request R is found out
ithe page that in each page comprised, error bit is maximum, the maximum wrong figure place T that the wrong figure place of the pages maximum for error bit and the error correcting code that adopts can be corrected is compared, if the number of bit errors of the maximum page of bit-errors is not more than the maximum wrong figure place T that used error correcting code can correct (son request R is described
iin the bit error rate of each page lower, only adopt the bit-errors occurred in error correcting code and each page of recoverable), then redirect performs step 4.6); The number of bit errors of the page that bit-errors is maximum is greater than maximum wrong figure place T (the explanation request R that used error correcting code can be corrected else if
iin the bit error rate of each page higher, the wrong figure place of appearance has exceeded the error correcting capability of error correcting code, and error correcting code just can not successful restoring user data, therefore needs to adopt correcting and eleting codes to correct the bit-errors occurred in each page), then jump procedure 4.7); Wherein, the wrong figure place of the page that error bit is maximum can be expressed as shown in formula (2);
In formula (2), P represents son request R
itotal page number, BE
jrepresent son request R
iin a jth page in the difference figure place of two kinds of School Affairs;
4.6) error correcting code syndrome request R is used
iin the bit-errors of each page, if correct unsuccessfully, then redirect performs step 4.7); Correct successfully else if, then redirect performs step 4.8); In fact, the bit-errors that School Affairs detects may be less than the actual bit-errors occurred in the page, if therefore in the page, the actual bit-errors occurred has exceeded the error correcting capability of error correcting code, error correcting code just can not successful restoring user data, now, redirect performs step 4.7) utilize correcting and eleting codes to correct bit-errors in the page; If error correcting code successfully corrects R
iin the bit-errors of all pages, then redirect performs step 4.8), thus the bit-errors correction capability of the present embodiment can be improved;
4.7) correcting and eleting codes syndrome request R is utilized
iin the bit-errors of each page;
4.8) son request R is returned to upper layer application
ithe user data comprised;
4.9) sub-request counter i is increased;
4.10) if sub-request counter i is less than son, request splits quantity m, then judge to also have untreated complete sub-request, redirect performs step 4.3); If sub-request counter i equals son, request splits quantity m, then judge to have processed all sub-requests, and redirect performs step 2).
In the present embodiment, step 4.1) in when I/O request R being divided into m the son request belonging to different band respectively, the value of m is (Offset
r+ Size
r+ n-1)/n-Offset
r/ n, wherein n represents the user data number of pages comprised in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that comprises of I/O request R, I/O request R is by with start address Offset
rthe Size started
rindividual continuous page composition.Read request R is by with Offset
rfor the Size of start address
rindividual continuous page composition, these user data pages may be distributed in different bands.Because each band comprises n page user data, then the user data page being numbered l is included in l/n band.By above account form, can by all customer data page division of R in the individual different band of m.Wherein, the value of m is (Offset
r+ Size
r+ n-1)/n-Offset
r/ n.The sub-request dropped in m different band is identified as R respectively
0, R
1, R
2..., R
m-1.
In the present embodiment, step 4.7) detailed step comprise:
4.7.1) initialization data recovers number counter is 0; At sub-request R
iin belong to same band the basis that has been read of v the page on, read n-v number certificate from memory device, obtain the n number certificate at least needed when correcting and eleting codes makes date restoring to band altogether;
4.7.2) according to the common n number read out according to by correcting and eleting codes syndrome request R
iin the bit-errors of each page, if successful syndrome request R
iin the bit-errors of each page, then redirect performs step 4.8); Otherwise date restoring number counter is added 1, and redirect performs step 4.7.3);
4.7.3) judge whether the value of date restoring number counter equals
if the value of date restoring number counter is less than
then read the other n number certificate at least needed when correcting and eleting codes makes date restoring to band, redirect performs step 4.7.2); The value of date restoring number counter equals else if
then judge to utilize correcting and eleting codes syndrome request R
iin each page bit-errors failure.
For adopting the storage system of correcting and eleting codes, when responding the read request of upper layer application, as long as have n part still reliably complete in this n+k number certificate, correctly can recover all customer data.The present embodiment is based on abovementioned steps 4.7.1) ~ 4.7.3), guarantee based on complete, correct, reliable n number in n+k number certificate according to the error correction realized bit-errors.
In sum, the present embodiment conbined usage correcting and eleting codes and error correcting code recover the bit-errors occurred in flash memory pages, thus reach the object of significant prolongation service life of flash memory, raising flash-memory storage system reliability.When upper layer application sends write request, for the page to be written calculates the redundant information of correcting and eleting codes, and calculate error correcting code and the School Affairs of each page, correcting and eleting codes redundant information, error correcting code, School Affairs are together preserved on a storage device.When upper layer application reads data, first utilize the bit-errors number occurred in the School Affairs preliminary judgement page.If bit-errors is less, then use error correcting code correction data; If bit-errors is more, then correcting and eleting codes is adopted to recover data.The above method, while the powerful error correcting capability of guarantee, adopts the bit-errors occurred in the lower method correcting user data of computing cost as far as possible, has the advantage that computing cost is low, IO performance is good.Because correcting and eleting codes has powerful error correcting capability, when the erasable number of times of each storage unit of flash memory is a lot, error rate is very high, the bit-errors that correcting and eleting codes still can occur in successful restoring user data.So the present embodiment significantly can increase the erasable number of times that each storage unit of flash memory can bear, there is the advantage that life is effective.
The above is only the preferred embodiment of the present invention, protection scope of the present invention be not only confined to above-described embodiment, and all technical schemes belonged under thinking of the present invention all belong to protection scope of the present invention.It should be pointed out that for those skilled in the art, some improvements and modifications without departing from the principles of the present invention, these improvements and modifications also should be considered as protection scope of the present invention.
Claims (9)
1. the collaborative reliable flash-memory storage system construction method using correcting and eleting codes and error correcting code, is characterized in that step comprises:
1) initialization receives the buffer zone of I/O request;
2) receive I/O request R, judge the read-write type of I/O request R, if read-write type is write request, then redirect performs step 3); If otherwise read-write type is read request, then redirect performs step 4);
3) be that unit chooses by the data of writing of I/O request R according to band, correcting and eleting codes is adopted to generate k the redundant data page s the user data page of each band chosen, calculate School Affairs, the error correcting code of s+k the page of described s the user data page and k redundant data page composition respectively, and by School Affairs, the error correcting code together write storage device of a described s+k page and each page;
4) I/O request R is divided into the sub-request belonging to different band respectively, for each height request, read each page and the School Affairs thereof of son request, error correcting code, calculate the School Affairs of each page and identify the bit-errors of each page, find out the page that bit-errors is maximum, judge the maximum wrong figure place the T whether number of bit errors of the page that bit-errors is maximum is greater than used error correcting code and can corrects, if the number of bit errors of the page that bit-errors is maximum is not more than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of error correcting code syndrome, if the number of bit errors of the page that bit-errors is maximum is greater than the maximum wrong figure place T that used error correcting code can be corrected, then use the bit-errors occurred in each page in the request of correcting and eleting codes syndrome, return the data that each page of son request comprises.
2. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 1 and error correcting code, is characterized in that, described step 1) also comprise initialization for recording the write request counter Count of the page sum of memory device to be written
wbe the step of 0, described step 3) detailed step comprise:
3.1) page number that write request R comprises is added to write request counter Count
win;
3.2) write request counter Count is judged
wwhether exceed default threshold value h, wherein h is the integer being greater than the page quantity n comprised in a complete band; If write request counter Count
wexceed default threshold value h, then redirect performs step 3.3); If write request counter Count
wbe no more than default threshold value h, then redirect performs step 2);
3.3) according to the Count that page number is to be written
windividual page of data of writing makes ascending sort, by Count to be written
windividual page of data of writing is divided in different bands, and make the page being numbered x be divided in xth/n band, wherein n represents the page quantity comprised in a complete band; From Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4);
3.4) adopt correcting and eleting codes to generate k the redundancy page s the user data page in the complete band chosen or imperfect band and obtain s+k the page altogether, calculate School Affairs, the error correcting code of each page in a described s+k page respectively, by the error correcting code of each page in a described s+k page and a described s+k page and School Affairs together write storage device; Final from write request counter Count
win deduct the user data page quantity s of this write storage device, jump procedure 3.2).
3. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 2 and error correcting code, is characterized in that: described step 3.2) in threshold value h be 10 times of the page quantity n comprised in a complete band.
4. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 3 and error correcting code, is characterized in that, described step 3.3) detailed step comprise:
3.3.1) from write request counter Count to be written
windividual writing in page of data chooses a complete band, if choose complete band success, then redirect performs step 3.4); Choose complete band else if unsuccessful, then redirect performs step 3.3.2);
3.3.2) judge whether I/O request R is continuous print write request, if I/O request R is continuous print write request, then redirect performs step 2); I/O request R discrete write request else if, then redirect performs step 3.3.3);
3.3.3) choose comprise the user data page maximum have an imperfect band, redirect perform step 3.4).
5. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 4 and error correcting code, it is characterized in that: described step 3.4) in by the error correcting code of each page in a described s+k page and a described s+k page and School Affairs together write storage device time, memory device is that in a described s+k page, each page to be written distributes an idle physical page, in a described s+k page, the data of each page are written into the data area of the physical page of distribution, in a described s+k page, the error correcting code of each page and School Affairs are written into the additional areas of the physical page of distribution.
6. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 5 and error correcting code, it is characterized in that: described step 3.4) in calculate each page in a described s+k page respectively School Affairs specifically refer to the word Word bit stream in the page to be calculated being divided into fixed size, each word Word comprises 64 bits, and the result then calculated as XOR by these words Word is as the School Affairs of this page.
7., according to the reliable flash-memory storage system construction method of the collaborative use correcting and eleting codes in claim 1 ~ 6 described in any one and error correcting code, it is characterized in that, described step 4) detailed step comprise:
4.1) I/O request R is divided into m the son request belonging to different band respectively;
4.2) the sub-request counter i of Initialize installation is 0;
4.3) son request R is read
ieach page comprised, together reads error correcting code corresponding to each page and School Affairs;
4.4) son request R is calculated
ithe School Affairs of each page comprised, according to the School Affairs calculated and step 4.3) in read the School Affairs that obtains and compare recognin request R
ibit-errors in each page comprised;
4.5) son request R is found out
ithe page that in each page comprised, error bit is maximum, the maximum wrong figure place T that the wrong figure place of the pages maximum for described error bit and the error correcting code adopted can be corrected is compared, if the number of bit errors of the page that bit-errors is maximum is not more than the maximum wrong figure place T that used error correcting code can be corrected, then redirect performs step 4.6); The number of bit errors of the page that bit-errors is maximum is greater than the maximum wrong figure place T that used error correcting code can be corrected else if, then jump procedure 4.7);
4.6) error correcting code syndrome request R is used
iin the bit-errors of each page, if correct unsuccessfully, then redirect performs step 4.7); Correct successfully else if, then redirect performs step 4.8);
4.7) correcting and eleting codes syndrome request R is utilized
iin the bit-errors of each page;
4.8) son request R is returned to upper layer application
ithe user data comprised;
4.9) sub-request counter i is increased;
4.10) if sub-request counter i is less than son, request splits quantity m, then judge to also have untreated complete sub-request, redirect performs step 4.3); If sub-request counter i equals son, request splits quantity m, then judge to have processed all sub-requests, and redirect performs step 2).
8. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 7 and error correcting code, it is characterized in that: described step 4.1) in when I/O request R being divided into m the son request belonging to different band respectively, the value of m is (Offset
r+ Size
r+ n-1)/n-Offset
r/ n, wherein n represents the user data number of pages comprised in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that comprises of I/O request R, I/O request R is by with start address Offset
rthe Size started
rindividual continuous page composition; I-th son request R in described m son request
ithe page comprised is such as formula shown in (1);
In formula (1), R
irepresent i-th son request, n represents the page quantity in a complete band, Offset
rrepresent the start address of I/O request R, Size
rrepresent the page number that I/O request R comprises.
9. the reliable flash-memory storage system construction method of collaborative use correcting and eleting codes according to claim 8 and error correcting code, is characterized in that, described step 4.7) detailed step comprise:
4.7.1) initialization data recovers number counter is 0; At sub-request R
iin belong to same band the basis that has been read of v the page on, read n-v number certificate from memory device, obtain the n number certificate at least needed when correcting and eleting codes makes date restoring to described band altogether;
4.7.2) according to the common n number read out according to by correcting and eleting codes syndrome request R
iin the bit-errors of each page, if successful syndrome request R
iin the bit-errors of each page, then redirect performs step 4.8); Otherwise date restoring number counter is added 1, and redirect performs step 4.7.3);
4.7.3) judge whether the value of date restoring number counter equals
if the value of date restoring number counter is less than
then read the other n number certificate at least needed when correcting and eleting codes makes date restoring to described band, redirect performs step 4.7.2); The value of date restoring number counter equals else if
then judge to utilize correcting and eleting codes syndrome request R
iin each page bit-errors failure.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510236451.XA CN104881370B (en) | 2015-05-11 | 2015-05-11 | Collaboration uses correcting and eleting codes and the reliable flash-memory storage system construction method of error correcting code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510236451.XA CN104881370B (en) | 2015-05-11 | 2015-05-11 | Collaboration uses correcting and eleting codes and the reliable flash-memory storage system construction method of error correcting code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104881370A true CN104881370A (en) | 2015-09-02 |
CN104881370B CN104881370B (en) | 2018-01-12 |
Family
ID=53948870
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510236451.XA Active CN104881370B (en) | 2015-05-11 | 2015-05-11 | Collaboration uses correcting and eleting codes and the reliable flash-memory storage system construction method of error correcting code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104881370B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445726A (en) * | 2016-09-28 | 2017-02-22 | 上海爱数信息技术股份有限公司 | Data repairing method for distributed erasure code storage system |
CN107544862A (en) * | 2016-06-29 | 2018-01-05 | 中兴通讯股份有限公司 | A kind of data storage reconstructing method and device, memory node based on correcting and eleting codes |
CN109426622A (en) * | 2017-08-31 | 2019-03-05 | 香港理工大学深圳研究院 | A kind of method and high life flash memory solid-state disk improving the flash memory solid-state disk service life |
CN110896415A (en) * | 2019-11-22 | 2020-03-20 | 浪潮电子信息产业股份有限公司 | Data readdir method, system, equipment and computer medium |
CN111435286A (en) * | 2019-01-14 | 2020-07-21 | 深圳市茁壮网络股份有限公司 | Data storage method, device and system |
CN111708742A (en) * | 2020-05-24 | 2020-09-25 | 苏州浪潮智能科技有限公司 | Input/output pre-reading method and device for distributed file system |
WO2021088423A1 (en) * | 2019-11-08 | 2021-05-14 | 苏州浪潮智能科技有限公司 | Memory management method and system for raid io, terminal and storage medium |
CN113890687A (en) * | 2021-11-15 | 2022-01-04 | 杭州叙简未兰电子有限公司 | High-reliability audio transmission method and device based on mixing of error correction codes and erasure codes |
CN114093409A (en) * | 2022-01-21 | 2022-02-25 | 苏州浪潮智能科技有限公司 | Flash memory verification method and device, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101627444A (en) * | 2007-10-03 | 2010-01-13 | 株式会社东芝 | Semiconductor memory device |
CN102034548A (en) * | 2009-09-25 | 2011-04-27 | 三星电子株式会社 | Nonvolatile memory device and system, and method of programming a nonvolatile memory device |
CN102934093A (en) * | 2010-06-29 | 2013-02-13 | 英特尔公司 | Method and system to improve the performance and/or reliability of a solid-state drive |
-
2015
- 2015-05-11 CN CN201510236451.XA patent/CN104881370B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101627444A (en) * | 2007-10-03 | 2010-01-13 | 株式会社东芝 | Semiconductor memory device |
CN102034548A (en) * | 2009-09-25 | 2011-04-27 | 三星电子株式会社 | Nonvolatile memory device and system, and method of programming a nonvolatile memory device |
CN102934093A (en) * | 2010-06-29 | 2013-02-13 | 英特尔公司 | Method and system to improve the performance and/or reliability of a solid-state drive |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107544862B (en) * | 2016-06-29 | 2022-03-25 | 中兴通讯股份有限公司 | Stored data reconstruction method and device based on erasure codes and storage node |
CN107544862A (en) * | 2016-06-29 | 2018-01-05 | 中兴通讯股份有限公司 | A kind of data storage reconstructing method and device, memory node based on correcting and eleting codes |
CN106445726A (en) * | 2016-09-28 | 2017-02-22 | 上海爱数信息技术股份有限公司 | Data repairing method for distributed erasure code storage system |
CN109426622A (en) * | 2017-08-31 | 2019-03-05 | 香港理工大学深圳研究院 | A kind of method and high life flash memory solid-state disk improving the flash memory solid-state disk service life |
CN109426622B (en) * | 2017-08-31 | 2020-11-24 | 香港理工大学深圳研究院 | Method for prolonging service life of flash memory solid-state disk and long-service-life flash memory solid-state disk |
CN111435286A (en) * | 2019-01-14 | 2020-07-21 | 深圳市茁壮网络股份有限公司 | Data storage method, device and system |
CN111435286B (en) * | 2019-01-14 | 2023-12-05 | 深圳市茁壮网络股份有限公司 | Data storage method, device and system |
WO2021088423A1 (en) * | 2019-11-08 | 2021-05-14 | 苏州浪潮智能科技有限公司 | Memory management method and system for raid io, terminal and storage medium |
CN110896415A (en) * | 2019-11-22 | 2020-03-20 | 浪潮电子信息产业股份有限公司 | Data readdir method, system, equipment and computer medium |
CN110896415B (en) * | 2019-11-22 | 2022-05-24 | 浪潮电子信息产业股份有限公司 | Data readdir method, system, equipment and computer medium |
WO2021238284A1 (en) * | 2020-05-24 | 2021-12-02 | 苏州浪潮智能科技有限公司 | Distributed file system input output pre-reading method and apparatus |
CN111708742B (en) * | 2020-05-24 | 2022-11-29 | 苏州浪潮智能科技有限公司 | Input/output pre-reading method and device for distributed file system |
CN111708742A (en) * | 2020-05-24 | 2020-09-25 | 苏州浪潮智能科技有限公司 | Input/output pre-reading method and device for distributed file system |
CN113890687A (en) * | 2021-11-15 | 2022-01-04 | 杭州叙简未兰电子有限公司 | High-reliability audio transmission method and device based on mixing of error correction codes and erasure codes |
CN114093409A (en) * | 2022-01-21 | 2022-02-25 | 苏州浪潮智能科技有限公司 | Flash memory verification method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN104881370B (en) | 2018-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104881370A (en) | Method for constructing reliable flash memory storage system in cooperative usage of erasure codes and error correction codes | |
US11042441B2 (en) | Stripe mapping in memory | |
US9170898B2 (en) | Apparatus and methods for providing data integrity | |
CN101681281B (en) | Emerging bad block detection | |
CN106776109B (en) | Solid state disk reading error detection device and method for detecting reasons of uncorrectable errors | |
US20190121690A1 (en) | Pool-level solid state drive error correction | |
KR101560077B1 (en) | Apparatus and methods for providing data integrity | |
EP2529305B1 (en) | System and method to correct data errors using a stored count of bit values | |
US8601311B2 (en) | System and method for using over-provisioned data capacity to maintain a data redundancy scheme in a solid state memory | |
US8266501B2 (en) | Stripe based memory operation | |
US8370715B2 (en) | Error checking addressable blocks in storage | |
US9158675B2 (en) | Architecture for storage of data on NAND flash memory | |
US7908512B2 (en) | Method and system for cache-based dropped write protection in data storage systems | |
US20080016413A1 (en) | Raid 3 + 3 | |
US20140372838A1 (en) | Bad disk block self-detection method and apparatus, and computer storage medium | |
US9063869B2 (en) | Method and system for storing and rebuilding data | |
US20130124931A1 (en) | Transmission error detector for flash memory controller | |
CN104035830A (en) | Method and device for recovering data | |
CN103336727B (en) | The method that NAND flash memory storage equipment is carried out data manipulation | |
CN112486419A (en) | Data storage method, device and recovery method based on RAID5 and solid state disk | |
CN103092727B (en) | Data error-correcting method in flash storage medium and device | |
CN113420341A (en) | Data protection method, data protection equipment and computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |