CN113885777A - Data writing method and data storage device thereof - Google Patents

Data writing method and data storage device thereof Download PDF

Info

Publication number
CN113885777A
CN113885777A CN202010777138.8A CN202010777138A CN113885777A CN 113885777 A CN113885777 A CN 113885777A CN 202010777138 A CN202010777138 A CN 202010777138A CN 113885777 A CN113885777 A CN 113885777A
Authority
CN
China
Prior art keywords
data
period
error rate
damaged
control unit
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
CN202010777138.8A
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.)
Silicon Motion Inc
Original Assignee
Silicon Motion Inc
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 Silicon Motion Inc filed Critical Silicon Motion Inc
Publication of CN113885777A publication Critical patent/CN113885777A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1068Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in sector programmable memories, e.g. flash disk
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Abstract

A data writing method and a data storage device thereof are provided. The data storage device comprises a data storage medium and a control unit coupled to the data storage medium, wherein the data storage medium comprises a plurality of data columns and at least one damaged data column. The control unit writes data into a plurality of data columns of the data storage medium according to a period parameter and a damage parameter, wherein the period parameter stores a preset period with a first error rate, and the damage parameter is stored in the position of at least one damaged data column with the error rate larger than or equal to the preset error rate in the preset period.

Description

Data writing method and data storage device thereof
Technical Field
The present invention relates to a data writing method and a data storage device thereof, and more particularly, to a data writing method and a data storage device thereof for a data storage medium having periodically damaged data columns.
Background
Generally, a storage device, such as a Solid State Drive (SSD), an SD Memory Card (Secure Digital Memory Card), or a flash disk (USB), is mainly composed of a control unit and a data storage medium. The data storage medium is composed of a plurality of data columns (columns) for storing data. In the manufacturing process of the storage device, some data storage media which do not meet the standard of the original factory standard are inevitably produced and classified as secondary (downrade) products. Before these secondary products are sold to consumers, the damaged data column (bad column) in the data storage medium is detected and marked or recorded into the damaged data list. The control unit can skip the marked or recorded damaged data columns according to the damaged data list and does not write data into the damaged data columns, thereby avoiding the situation of data access errors.
However, in these sub-products, there is usually a phenomenon of periodically damaging data columns, i.e. a damaged data column occurs in every other interval. It is worth noting that when the cycle time is short, a large number of corrupted data columns will be generated, which far exceeds the number that can be tagged by hardware. If the detected defective data rows are marked or recorded one by one in the conventional manner, a large amount of memory space is required to record the positions of the defective data rows. For example, if a page (page) has 18000 data columns and one data column is corrupted every 8 data columns, there are 2250 corrupted data columns in total. A memory matrix (plane) therefore requires 2250 Bytes (4500Bytes) to record the location of the defective data column. More specifically, if the data storage medium is configured with 16 size granules and 4 memory matrices, the data storage medium needs 288KBytes to record the location of the damaged data row, which is much larger than the capacity of the Static Random Access Memory (SRAM) built in the conventional controller. Moreover, the number of marking or recording of defect columns is limited by hardware, and if the number of marking runs out, the remaining unmarked defect columns in the data storage medium may consume Code (ECC) capability, which results in no suitable of data.
Therefore, it is important to provide a method for greatly reducing the memory capacity required for recording the location of the damaged data columns under the limitation of the limited number of the damaged data columns which can be labeled by hardware for the data storage medium with the periodically damaged data columns.
Disclosure of Invention
In view of the above, an embodiment of the present invention provides a data writing method, suitable for a data storage medium, the data storage medium being coupled to a control unit, and the data storage medium including a plurality of data rows and at least one damaged data row, the data writing method including: the control unit writes data into a plurality of data columns of the data storage medium according to a period parameter and a damage parameter, wherein the period parameter stores a preset period with a first error rate, and the damage parameter is stored in the position of at least one damaged data column with the error rate larger than or equal to the preset error rate in the preset period.
In one embodiment of the present invention, the period parameter and the damage parameter are stored in a data storage medium.
In an embodiment of the present invention, before the step of writing the data into the plurality of data rows of the data storage medium by the control unit according to the period parameter and the defect parameter, the method further includes: the control unit sets a preset period range for detecting at least one damaged data row; the control unit divides the plurality of data rows into X periods according to a preset period, wherein the preset period is selected from a preset period range, X is the preset period divided by the plurality of data rows, and X is a positive integer, and each period of the X periods is provided with T data rows, wherein T is the preset period and T is a positive integer; the control unit respectively counts the number of the damaged data columns in X periods to obtain the total number of the damaged data columns corresponding to the data columns; the control unit respectively normalizes the total number of damaged data columns corresponding to the data columns to respectively calculate the error rates of the data columns under the condition of a preset period and respectively records the error rates into an error rate recording table; the control unit judges whether the value of the preset period is larger than or equal to the upper limit value of the preset period range; and when the judgment result is yes, the control unit selects a preset period with a first error rate, namely the highest error rate from the error rate record table and stores the preset period into the period parameter, and selects at least one damaged data column with the error rate more than or equal to the preset error rate in the preset period and stores the position of the at least one damaged data column into the damaged parameter.
In an embodiment of the present invention, after the step of determining whether the value of the predetermined period is greater than or equal to the upper limit value of the predetermined period range, the method further includes: and when the judgment result is negative, the control unit adjusts the numerical value of the preset period and executes the step that the control unit divides the plurality of data rows into X periods according to the preset period.
An embodiment of the present invention further provides a data storage device, including: the data storage medium and a control unit coupled to the data storage medium. The data storage medium comprises a plurality of data columns and at least one damaged data column. The control unit writes data into a plurality of data columns of the data storage medium according to a period parameter and a damage parameter, wherein the period parameter stores a predetermined period with a first error rate (usually the highest error rate), and the damage parameter stores the position of at least one damaged data column with the error rate greater than or equal to the predetermined error rate in the predetermined period.
In another embodiment of the present invention, the period parameter and the damage parameter are stored in a data storage medium.
In another embodiment of the present invention, the control unit further comprises: setting a predetermined period range for detecting at least one damaged data row; dividing the plurality of data rows into X periods according to a predetermined period, wherein the predetermined period is selected from a predetermined period range, X is the plurality of data rows divided by the predetermined period and X is a positive integer, and each of the X periods has T data rows, wherein T is the predetermined period and T is a positive integer; respectively counting the number of the damaged data columns in X periods to obtain the total number of the damaged data columns corresponding to the data columns; respectively normalizing the total number of damaged data columns corresponding to the data columns to respectively calculate the error rates of the data columns under the condition of a preset period, and respectively recording the error rates into an error rate recording table; judging whether the value of the preset period is greater than or equal to the upper limit value of the preset period range or not; and when the judgment result is yes, selecting a preset period with a first error rate (usually the highest error rate) from the error rate record table and storing the preset period to the period parameter, and selecting at least one damaged data column with the error rate more than or equal to the preset error rate in the preset period and storing the position of the at least one damaged data column to the damaged parameter.
In another embodiment of the present invention, the control unit further comprises: and when the judgment result is negative, adjusting the value of the preset period, and dividing the plurality of data rows into X periods according to the preset period.
The data writing method and the data storage device thereof provided by the embodiments of the present invention obtain the location of the damaged data row by reading the period parameter and the damage parameter, and simultaneously accurately write the data into the data row of the data storage medium, wherein the period parameter stores a predetermined period having a first error rate (usually the highest error rate), and the damage parameter stores the location of at least one damaged data row having an error rate greater than or equal to the predetermined error rate in the predetermined period. Therefore, in the process of writing data, the damaged data column can be skipped actively, so that the data are prevented from being written into the damaged data column of the data storage medium, and the purpose of greatly reducing the memory capacity required for storing or recording the position of the damaged data column is achieved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of a data storage device.
FIG. 2 is a schematic diagram of a data storage medium.
FIG. 3 is a flowchart illustrating a method for detecting a periodically corrupted data sequence on a data storage medium according to an embodiment of the present invention.
FIG. 4A is a diagram illustrating M data rows divided into X periods according to a predetermined period according to an embodiment of the invention.
FIG. 4B is a diagram illustrating M data rows divided into 2048 periods according to a predetermined period according to an embodiment of the present invention.
FIG. 4C is a diagram illustrating M data rows divided into 1820 periods according to a predetermined period according to an embodiment of the invention.
FIG. 4D is a block diagram of M data rows divided into 1638 periods according to a predetermined period according to an embodiment of the invention.
FIG. 5 is a flowchart illustrating a data writing method according to an embodiment of the invention.
FIG. 6 is a diagram illustrating an example of generating an error rate record table according to an embodiment of the present invention.
Detailed Description
Referring to fig. 1, fig. 1 is a schematic diagram of a data storage device. The data storage device includes a data storage medium 10 and a control unit 20, wherein the control unit 20 is coupled to the data storage medium 10 for accessing data from the data storage medium 10.
Referring to FIG. 2, FIG. 2 is a schematic diagram of a data storage medium. The data storage medium 10 includes a plurality of data rows 11, and the data rows in the same row are referred to as data pages (pages, as denoted by P0 to PN-1), and every N data pages are divided into one data Block (Block, as denoted by B0 to BZ-1). Wherein N, Z are all positive integers. In the present embodiment, the data storage medium 10 is implemented by a non-volatile memory, for example, a memory device with long-term data storage, such as a Flash memory (Flash memory), a Magnetoresistive random access memory (Magnetoresistive RAM), a Ferroelectric random access memory (Ferroelectric RAM), and the like.
The data writing method and the data storage device thereof according to the embodiment of the invention can be used for detecting the data storage medium 10 with the periodically damaged data row (not shown) to obtain the position of the damaged data row. Thereby ensuring that data can be accurately written to the data columns 11 of the data storage medium 10 without writing to a corrupted data column of the data storage medium 10. Suppose there are M data rows 11 per page P0-PN-1, and one data row 11 is corrupted every T data rows 11, i.e., one corrupted data row is found every T data rows 11, wherein M, T is a positive integer. In addition, for simplicity, the embodiment randomly selects one of the blocks B0 through BZ-1 of the data storage medium 10 as a sample block to perform the detection of the defective data row without using all of the blocks B0 through BZ-1.
FIG. 3 is a flowchart illustrating a method for detecting a periodically corrupted data sequence on a data storage medium according to an embodiment of the present invention. After the detection method is started (as shown in step S100). First, the control unit 20 sets a predetermined period range for detecting the damaged data row (as shown in step S101), that is, detects or scans all the data rows 11 within the predetermined period range to obtain the damaged position of the data row 11, that is, the position of the damaged data row. In other words, the data row 11 that detected the defect can be regarded as a defective data row. For example, if the predetermined period is set to range from 2 to 256 data rows 11. The control unit 20 starts detecting the defective data row at cycle 2, continues detecting the defective data row at cycle 3, and so on, and finally detects the defective data row at cycle 256. It should be noted that the predetermined period range is arbitrarily set according to actual requirements. In the embodiment of the present invention, for simplicity, only the value of 8 to 10 is used as the predetermined detection period range.
Next, referring to fig. 4A, fig. 4A is a schematic diagram illustrating that M data rows are divided into X periods according to a predetermined period according to an embodiment of the invention. The control unit 20 divides the M data trains 11 into X (M/T) periods (i.e., the period T0 to the period TX-1) according to the value of the predetermined period T, wherein the value of the predetermined period T is selected from the values set in the predetermined period range, and there are T data trains 11 in each period (as shown in step S102). It should be noted that if the M data rows 11 cannot be divided by the predetermined period T to generate the remainder, that is, there are a small portion of the data rows 11 that are not divided into X periods, the small portion of the data rows 11 can be skipped over or regarded as non-damaged data rows.
Referring to fig. 4B, fig. 4B is a schematic diagram illustrating that M data rows are divided into 2048 periods according to a predetermined period according to an embodiment of the present invention. Assuming that each of the data pages P0-PN-1 has 16384 data columns 11 (i.e., M ═ 16384), and the predetermined period T has a value of 8, the 16384 data columns 11 can be divided into 2048 (i.e., X ═ 16384/8) periods (i.e., period T0-period T2047), where each period has 8 data columns 11 (i.e., first data column C0-eighth data column C7).
Next, the control unit 20 respectively counts the number of damaged M data columns 11 in X cycles (as shown in step S103), that is, counts the number of damaged first data column C0 in the period T0 to the period T2047, counts the number of damaged second data column C1 in the period T0 to the period T2047, and so on, and counts the number of damaged eighth data column C7 in the period T0 to the period T2047. Incidentally, any one of the data columns 11 may be that the total number is damaged in X cycles; all numbers are undamaged; partially damaged; the part is not damaged. For example, if only the third data row C2 and the sixth data row C5 of the data rows 11 are partially damaged in the period T0 to the period T2047, the rest of the data rows (i.e., the first data row C0, the second data row C1, the fourth data row C3, the fifth data row C4, the seventh data row C6 and the eighth data row C7) are all undamaged in the period T0 to the period T2047. More specifically, the third data row C2 has more than half of the cycles from cycle T0 to cycle TX-1 being corrupted, for example, 1024 cycles, i.e., 1024 third data rows C2 are corrupted, while the sixth data row C5 has more than three-quarters of the cycles from cycle T0 to cycle TX-1 being corrupted, for example 1536 cycles, i.e., 1536 sixth data rows C5 are corrupted. Finally, the control unit 20 counts the total number of the damaged data rows in the period T0 to the period T2047 for the first data row C0 to the eighth data row C, respectively, and sequentially lists the data rows in the order of the data row 11 as follows: 0. 0, 1024, 0, 1536, 0.
Next, the control unit 20 normalizes (normalizes) the total number of damaged data columns of the data columns 11 to calculate the error rates of the data columns 11 in the predetermined period T, and records the error rates into the error rate recording table (as shown in step S104). In the embodiment of the invention, when the predetermined period T is 8, the control unit 20 divides the total number of the damaged data columns respectively corresponding to the first data column C0 to the eighth data column C7 by X (i.e., 2048) periods to perform normalization. More specifically, the control unit 20 divides the statistical results "0, 1024, 0, 1536, 0" related to the total number of the damaged data columns in the period T0 to the period T2047 of the first data column C0 to the eighth data column C in the step S103 by 2048 respectively to perform the normalization, and sequentially lists the normalization results as follows: 0. 0, 0.5, 0, 0.75, 0. This indicates that the error rates of the third and sixth data columns C2 and C5 are 50% and 75%, respectively, while the error rates of the remaining data columns are 0%. Then, the control unit 20 stores the result of normalization at the predetermined period T of 8 into the error rate recording table (as shown in fig. 6).
After that, the control unit 20 determines whether the predetermined period T is equal to or greater than the upper limit value of the predetermined period range (as shown in step S104). If not, the value of the predetermined period T is adjusted, and the process returns to step S102 (as shown in step S106). In the embodiment of the present invention, since the predetermined period T is less than the upper limit value (i.e. 10) of the predetermined period range when the predetermined period T is 8, the value of the predetermined period T is adjusted to 9, and the process returns to step S102.
Referring to fig. 4C, fig. 4C is a diagram illustrating M data rows divided into 1820 periods according to a predetermined period according to an embodiment of the invention. In step S102, when the predetermined period T is 9, 16384 data columns are divided into 1820 (i.e., X ═ 16384/9) periods (i.e., period T0 to period T1819), where each period has 9 data columns 11 (i.e., first data column C0 to ninth data column C8).
Next, in step S103, the control unit 20 counts the number of the first to ninth data trains C0 to C8 damaged in the periods T0 to T1819, respectively. For example, assume that the first data column C0, the second data column C1, the third data column C2, the fourth data column C3, the fifth data column C4, the sixth data column C5, the seventh data column C6, the eighth data column C7, and the ninth data column C8 are corrupted by one-tenth of a cycle, two-tenth of a cycle, three-tenth of a cycle, one-tenth of a cycle, three-tenth of a cycle, four-tenth of a cycle, two-tenth of a cycle, and one-tenth of a cycle, respectively. In other words, there are 182 first data columns C0 in total as defective data columns; a total of 364 second data columns C1 are corrupt data columns; a total of 546 third data columns C2 are corrupt data columns; a total of 182 fourth data columns C3 are corrupt data columns; a total of 182 fifth data columns C4 are corrupt data columns; a total of 546 sixth data columns C5 are corrupt data columns; a total of 728 seventh data columns C6 are corrupt data columns; a total of 364 eighth data columns C7 are corrupt data columns; there are 182 ninth data columns C8 in total that are corrupt. Finally, the control unit 20 counts the total number of the damaged data columns in the cycles T0 to T1819 for the first data column C0 to the ninth data column C respectively, and lists them in sequence as follows: 182. 364, 546, 182, 546, 728, 364, 182.
Next, in step S104, when the predetermined period T is 9, the control unit 20 divides the total number of the defective data columns respectively corresponding to the first data column C0 through the ninth data column C8 by X (i.e., 1820) periods to perform normalization. More specifically, the control unit 20 divides the statistical result "182, 364, 546, 182, 546, 728, 364, 182" regarding the total number of the damaged data columns in the period T0 to the period T1819 of the first data column C0 to the nine data column C8 by 1820 in step S103 to perform normalization, and sequentially lists the results of the normalization as follows: 0.1, 0.2, 0.3, 0.1, 0.3, 0.4, 0.2, 0.1. This means that the error rates of the first, second, third, fourth, fifth, sixth, seventh, eighth, and ninth data columns C0, C1, C2, C3, C4, C5, C6, C7, and C8 are 10%, 20%, 30%, 10%, 30%, 40%, 20%, and 10%, respectively. Then, the control unit 20 stores the result of the normalization with the predetermined period T of 9 into the error rate recording table (as shown in fig. 6).
Thereafter, in step S105, it is determined whether or not the predetermined period T is equal to or greater than the upper limit value of the predetermined period range. In the embodiment of the present invention, since the predetermined period T is 9 smaller than the upper limit value (i.e. 10) of the predetermined period range, the value of the predetermined period T is adjusted to 10, and the process returns to step S102.
Referring to fig. 4D, fig. 4D is a diagram illustrating an embodiment of dividing M data rows into 1638 periods according to a predetermined period. In step S102, when the predetermined period T is 10, 16384 data columns are divided into 1638 (i.e., X ═ 16384/10) periods (i.e., period T0 to period T1637), where each period has 10 data columns 11 (i.e., first data column C0 to tenth data column C9).
Next, in step S103, the control unit 20 counts the number of the first data string C0 to the tenth data string C9 damaged in the period T0 to the period T1637, respectively. For example, assume that the first data column C0, the second data column C1, the third data column C2, the fourth data column C3, the fifth data column C4, the sixth data column C5, the seventh data column C6, the eighth data column C7, the ninth data column C8, and the tenth data column C9 are corrupted with one-tenth of a cycle, two-tenth of a cycle, three-tenth of a cycle, one-tenth of a cycle, two-tenth of a cycle, one-tenth of a cycle, and two-tenth of a cycle, respectively. In other words, a total of 163 first data columns C0 are defective data columns; 163 second data columns C1 in total are defective data columns; a total of 327 third data columns C2 are corrupt data columns; a total of 491 fourth data columns C3 are corrupt data columns; a total of 163 fifth data columns C4 are defective data columns; a total of 327 sixth data columns C5 are corrupt data columns; a total of 327 seventh data columns C6 are corrupt data columns; a total of 163 eighth data columns C7 are defective data columns; 163 ninth data columns C8 in total are defective data columns; in total, 327 tenth data columns C9 are corrupt data columns. Finally, the control unit 20 counts the total number of the damaged data columns in the period T0 to the period T1637 for the first data column C0 to the tenth data column C9 respectively, and lists them in sequence as follows: 163. 163, 327, 491, 163, 327, 163, 327.
Next, in step S104, for the predetermined period T of 10, the control unit 20 divides the total number of the damaged data columns respectively corresponding to the first data column C0 through the tenth data column C9 by X (i.e., 1638) periods to perform normalization. Further, the control unit 20 divides the statistical results "163, 327, 491, 163, 327, 163, 327" regarding the total number of the damaged data columns in the period T0 to the period T1637 of the first data column C0 to the tenth data column C9 in step S103 by 1638, respectively, to perform normalization, and sequentially lists the results of the normalization as follows: 0.1, 0.2, 0.3, 0.1, 0.2, 0.1, 0.2. This indicates that the error rates of the first data column C0, the second data column C1, the third data column C2, the fourth data column C3, the fifth data column C4, the sixth data column C5, the seventh data column C6, the eighth data column C7, the ninth data column C8, and the tenth data column C9 are 10%, 20%, 30%, 10%, 20%, 10%, and 20%, respectively. Then, the control unit 20 stores the result of the normalization with the predetermined period T of 10 into the error rate recording table (as shown in fig. 6).
Thereafter, in step S105, it is determined whether or not the predetermined period T is equal to or greater than the upper limit value of the predetermined period range. Since the predetermined period T is 10 equal to the upper limit value (i.e., 10) of the predetermined period range, step S107 is executed.
In step S107, the control unit 20 selects a value of the predetermined period T having the first error rate (usually the highest error rate) from the error rate log table. As can be seen from the error rate record table, when the predetermined period T is 8, the maximum error rate is 0.75; when the predetermined period T is 9, the highest error rate is 0.4; when the predetermined period T is 10, the highest error rate is 0.3. Since the predetermined period T is equal to 8, there is the highest error rate. Therefore, the control unit 20 selects the predetermined period T to be 8, and regards the predetermined period T as the predetermined period T having the highest error rate. Then, the control unit 20 further selects the data row 11 with the error rate greater than or equal to the predetermined error rate in the predetermined period T, and regards the data row 11 as a damaged data row. More specifically, the control unit 20 selects the data sequence 11 having an error rate equal to or greater than a predetermined error rate from the first data sequence C0 through the eighth data sequence C7, and treats the selected data sequence 11 as a defective data sequence, and records the defective data sequence in the data storage medium 10. For example, assuming that the predetermined error rate is set to 20%, when the predetermined period T is 8, the error rates of the third data row C2 (error rate is 30%) and the sixth data row C5 (error rate is 75%) are less than 20%, and the remaining data rows 11 are all less than 20%, so the third data row C2 and the sixth data row C5 are marked or recorded as the damaged data rows.
Thereafter, the control unit 20 uses the period parameter to store the value of the predetermined period T having the highest error rate, and uses the defect parameter to store the position where the error rate of the defective data column is equal to or greater than the predetermined error rate at the time of the predetermined period T having the highest error rate (as shown in step S108). In the embodiment of the present invention, the predetermined period T stored by the period parameter is 8, and the position of the damaged data column stored by the damaged parameter is the third data column C2 and the sixth data column C5, wherein the period parameter and the damaged parameter can be stored in the data storage medium 10 or the data storage device. In addition, a defect data row record table (not shown) can be established according to the period parameter and the defect parameter, and is used for recording the position of the defect data row in the predetermined period T.
It should be noted that, since the predetermined period range is set to be 2 to 256, which represents that the maximum predetermined period T is 256 data rows, it only needs to spend 1Byte of memory capacity to record the value of the predetermined period T. Further, if each data column is recorded with 1 bit (bit), 256 data columns are required to be recorded, and therefore, when the upper limit value of the predetermined period range is 256, it takes only 32(256/8) Bytes of memory capacity to record the position of the damaged data column. In other words, the data storage device only needs to spend 33Bytes of memory capacity in total to record the position of the periodically corrupted data row in the data storage medium 10. Compared with the conventional method that the memory capacity of thousands of Bytes is needed to record the positions of all the damaged data rows, the method for detecting the periodically damaged data rows of the data storage medium of the embodiment of the invention only needs the memory capacity of tens of Bytes to record the positions of all the damaged data rows, thereby greatly reducing the memory space needed for storing or recording the positions of the damaged data rows.
Referring to fig. 5, fig. 5 is a flowchart illustrating a data writing method according to an embodiment of the invention. More specifically, the control unit 20 only reads the period parameter and the defect parameter (as shown in step S201), and obtains the location of the defective data sequence in the data storage medium 10 according to the value of the predetermined period T stored in the period parameter and the location of the defective data sequence stored in the defect parameter. Then, the control unit 20 skips or passes (bypass) the damaged data column upon encountering the location of the damaged data column during the writing of the data to the data column 11 of the data storage medium 10 (as shown in step S202), without writing the data into the damaged data column. Therefore, data is prevented from being written into the damaged data column of the data storage medium. Similarly, when reading data, the control unit 20 may also obtain the location of the damaged data column in the data storage medium 10 by reading the period parameter and the damage parameter, so that during reading the data column 11 of the data storage medium 10, the location of the damaged data column is skipped or passed over without reading the damaged data column. Thereby, the data stored in the data storage medium is accurately read.
In summary, the data writing method and the data storage device thereof provided by the embodiments of the invention obtain the location of the damaged data row by reading the period parameter and the damage parameter, and simultaneously accurately write the data into the data row of the data storage medium, wherein the period parameter stores the predetermined period with the highest error rate, and the damage parameter stores the location of at least one damaged data row with an error rate greater than or equal to the predetermined error rate in the predetermined period. Therefore, in the process of writing data, the damaged data column can be skipped actively, so that the data are prevented from being written into the damaged data column of the data storage medium, and the purpose of greatly reducing the memory capacity required for storing or recording the position of the damaged data column is achieved.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A method for writing data in a data storage medium, the data storage medium coupled to a control unit, the data storage medium comprising a plurality of data columns and at least one defective data column, the method comprising:
the control unit writes data into the data rows of the data storage medium according to a period parameter and a damage parameter, wherein the period parameter stores a preset period with a first error rate, and the damage parameter stores the position of at least one damaged data row with the error rate larger than or equal to a preset error rate in the preset period.
2. The method according to claim 1, wherein the period parameter and the defect parameter are stored in the data storage medium.
3. The method as claimed in claim 1, wherein before the step of writing the data into the data columns of the data storage medium by the control unit according to the period parameter and the defect parameter, the method further comprises:
the control unit sets a preset period range for detecting the at least one damaged data row;
the control unit divides the plurality of data rows into X periods according to the predetermined period, wherein the predetermined period is selected from the predetermined period range, X is the predetermined period divided by the plurality of data rows, and X is a positive integer, and each of the X periods has T data rows, wherein T is the predetermined period and T is a positive integer;
the control unit respectively counts the number of the damaged data columns in the X periods to obtain the total number of the damaged data columns corresponding to the data columns;
the control unit respectively normalizes the total number of the damaged data columns corresponding to the data columns to respectively calculate the error rates of the data columns under the condition of the preset period, and respectively records the error rates into an error rate recording table;
the control unit judges whether the numerical value of the preset period is larger than or equal to the upper limit value of the preset period range; and
when the error rate is judged to be yes, the control unit selects the preset period with the first error rate from the error rate record table and stores the preset period to the period parameter, and selects the at least one damaged data column with the error rate larger than or equal to the preset error rate in the preset period and stores the position of the at least one damaged data column to the damaged parameter.
4. The data writing method according to claim 3, wherein after the step of the control unit determining whether the value of the predetermined period is greater than or equal to the upper limit value of the predetermined period range, the method further comprises:
and when the judgment result is no, the control unit adjusts the numerical value of the preset period and executes the step that the control unit divides the plurality of data rows into the X periods according to the preset period.
5. A data storage device, comprising:
a data storage medium including a plurality of data columns and at least one defective data column; and
the control unit writes data into the data rows of the data storage medium according to the period parameter and the defect parameter, wherein the period parameter stores a predetermined period with a first error rate, and the defect parameter stores the position of the at least one defective data row with the error rate greater than or equal to a predetermined error rate in the predetermined period.
6. The data storage device of claim 5, wherein the period parameter and the corruption parameter are stored in the data storage medium.
7. The data storage device of claim 5, wherein the control unit further comprises:
setting a preset period range for detecting the at least one damaged data row;
dividing the plurality of data rows into X periods according to the predetermined period, wherein the predetermined period is selected from the predetermined period range, X is the predetermined period divided by the plurality of data rows, and X is a positive integer, and each of the X periods has T data rows, wherein T is the predetermined period and T is a positive integer;
respectively counting the number of the damaged data columns in the X periods to obtain the total number of the damaged data columns corresponding to the data columns;
respectively normalizing the total number of the damaged data columns corresponding to the data columns to respectively calculate the error rates of the data columns under the preset period condition, and respectively recording the error rates into an error rate recording table;
judging whether the numerical value of the preset period is greater than or equal to the upper limit value of the preset period range or not; and
and when the judgment result is yes, selecting the preset period with the first error rate from the error rate record table and storing the preset period to the period parameter, and selecting the at least one damaged data column with the error rate greater than or equal to the preset error rate in the preset period and storing the position of the at least one damaged data column to the damaged parameter.
8. The data storage device of claim 7, wherein the control unit further comprises:
and when the judgment result is negative, adjusting the numerical value of the preset period, and dividing the plurality of data rows into the X periods according to the preset period.
CN202010777138.8A 2020-07-03 2020-08-05 Data writing method and data storage device thereof Pending CN113885777A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
TW109122482A TWI774015B (en) 2020-07-03 2020-07-03 Data writing method and data storage device thereof
TW109122482 2020-07-03

Publications (1)

Publication Number Publication Date
CN113885777A true CN113885777A (en) 2022-01-04

Family

ID=79012039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010777138.8A Pending CN113885777A (en) 2020-07-03 2020-08-05 Data writing method and data storage device thereof

Country Status (2)

Country Link
CN (1) CN113885777A (en)
TW (1) TWI774015B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7734966B1 (en) * 2002-12-26 2010-06-08 Marvell International Ltd. Method and system for memory testing and test data reporting during memory testing
US20110002169A1 (en) * 2009-07-06 2011-01-06 Yan Li Bad Column Management with Bit Information in Non-Volatile Memory Systems
US9146807B2 (en) * 2012-12-04 2015-09-29 Sandisk Technologies Inc. Bad column handling in flash memory
US9348694B1 (en) * 2013-10-09 2016-05-24 Avago Technologies General Ip (Singapore) Pte. Ltd. Detecting and managing bad columns
TWI601148B (en) * 2016-05-05 2017-10-01 慧榮科技股份有限公司 Method for selecting bad columns and data storage device with? bad column summary table
TWI605462B (en) * 2016-05-11 2017-11-11 慧榮科技股份有限公司 Method for selecting bad columns within data storage media

Also Published As

Publication number Publication date
TW202203020A (en) 2022-01-16
TWI774015B (en) 2022-08-11

Similar Documents

Publication Publication Date Title
US8407410B2 (en) Wear-leveling and bad block management of limited lifetime memory devices
CN107346212B (en) Method for screening damaged data row and data storage device with damaged data row general table
US20120011309A1 (en) Method for preventing read-disturb happened in non-volatile memory and controller thereof
TWI581093B (en) Method for selecting bad columns within data storage media
JPH03167644A (en) Device and method for handling defect in semiconductor memory
US9465537B2 (en) Memory system and method of controlling memory system
US20090024787A1 (en) Data writing method and apparatus
US11682468B2 (en) Method and system for replacement of memory cells
CN105489242B (en) Data storage device and method of operating the same
CN111522684A (en) Method and device for simultaneously correcting soft and hard errors of phase change memory
US10734079B1 (en) Sub block mode read scrub design for non-volatile memory
US10956064B2 (en) Adjusting code rates to mitigate cross-temperature effects in a non-volatile memory (NVM)
CN113885777A (en) Data writing method and data storage device thereof
TWI763608B (en) Data storage device and selecting bad column method thereof
US11335432B2 (en) Method for selecting bad columns in data storage medium
TWI605462B (en) Method for selecting bad columns within data storage media
CN112863591B (en) Test and processing method for Open Block
CN114203252A (en) Bad block detection method, device, equipment and storage medium of nonvolatile memory
TWI795974B (en) Data storage device and error tolerance selecting method thereof
TWI637261B (en) Method for selecting bad columns within data storage media
US11803312B2 (en) Data storage device and selecting bad data block method thereof
US20060117134A1 (en) System and method for prolonging usage lifetime of a non-volatile memory
US11403010B2 (en) Data storage device and plane selection method thereof
KR20230122909A (en) Electronic device for storing data and data storage method using the same
CN113934570A (en) Identification method and identification system for failure characteristics of flash memory page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination