[go: up one dir, main page]

CN105005450B - Data writing method, memory storage device and memory control circuit unit - Google Patents

Data writing method, memory storage device and memory control circuit unit Download PDF

Info

Publication number
CN105005450B
CN105005450B CN201410173227.6A CN201410173227A CN105005450B CN 105005450 B CN105005450 B CN 105005450B CN 201410173227 A CN201410173227 A CN 201410173227A CN 105005450 B CN105005450 B CN 105005450B
Authority
CN
China
Prior art keywords
data
instance
check code
unit
programmed
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.)
Active
Application number
CN201410173227.6A
Other languages
Chinese (zh)
Other versions
CN105005450A (en
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.)
Phison Electronics Corp
Original Assignee
Phison Electronics Corp
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 Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to CN201410173227.6A priority Critical patent/CN105005450B/en
Publication of CN105005450A publication Critical patent/CN105005450A/en
Application granted granted Critical
Publication of CN105005450B publication Critical patent/CN105005450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明提供一种数据写入方法、存储器存储装置及存储器控制电路单元。此方法包括:接收写入指令,其中此写入指令指示将数据写入至一逻辑地址,并且此逻辑地址属于一逻辑程序化单元;当此逻辑程序化单元所映射的实体程序化单元所属的实体抹除单元是第一类实体抹除单元时,依据第一码率来将此数据与对应于此数据的校验码编程至此实体程序化单元;以及当此实体抹除单元是第二类实体抹除单元时,依据第二码率来将此数据与对应于此数据的校验码编程至此实体程序化单元,其中第一码率高于第二码率。藉此,可延长比特错误率较高的实体抹除单元的使用寿命。

The present invention provides a data writing method, a memory storage device and a memory control circuit unit. The method includes: receiving a write instruction, wherein the write instruction indicates that data is written to a logical address, and the logical address belongs to a logical programming unit; when the physical erasing unit to which the physical programming unit mapped by the logical programming unit belongs is a first type of physical erasing unit, programming the data and the check code corresponding to the data into the physical programming unit according to a first code rate; and when the physical erasing unit is a second type of physical erasing unit, programming the data and the check code corresponding to the data into the physical programming unit according to a second code rate, wherein the first code rate is higher than the second code rate. In this way, the service life of the physical erasing unit with a higher bit error rate can be extended.

Description

数据写入方法、存储器存储装置及存储器控制电路单元Data writing method, memory storage device and memory control circuit unit

技术领域technical field

本发明是有关于一种数据写入机制,且特别是有关于一种用于可复写式非易失性存储器模块的数据写入方法、存储器存储装置及存储器控制电路单元。The present invention relates to a data writing mechanism, and in particular to a data writing method for a rewritable non-volatile memory module, a memory storage device and a memory control circuit unit.

背景技术Background technique

数码相机、移动电话与MP3播放器在这几年来的成长十分迅速,使得消费者对存储媒体的需求也急速增加。由于可复写式非易失性存储器模块(例如,快闪存储器)具有数据非易失性、省电、体积小,以及无机械结构等特性,所以非常适合内装于上述所举例的各种便携式多媒体装置中。Digital cameras, mobile phones, and MP3 players have grown rapidly in recent years, making consumers' demand for storage media also increase rapidly. Since the rewritable non-volatile memory module (for example, flash memory) has the characteristics of data non-volatility, power saving, small size, and no mechanical structure, it is very suitable for being embedded in various portable multimedia devices listed above. device.

一般来说,可复写式非易失性存储器模块内的每一个实体区块的使用寿命是与实体区块的抹除次数有关。在一个实体区块被重复的抹除之后,存储在此实体区块内的数据的错误比特会逐渐增加。当数据的错误比特数超过可以正确地被更正的数量(例如,实体区块的抹除次数超过一抹除次数上限)时,此实体区块往往会被舍弃不用。Generally speaking, the service life of each physical block in the rewritable non-volatile memory module is related to the erasing times of the physical block. After a physical block is repeatedly erased, error bits of data stored in the physical block will gradually increase. When the number of erroneous bits in the data exceeds the number that can be correctly corrected (for example, the erasure times of the physical block exceeds an upper limit of erasure times), the physical block is often discarded.

发明内容Contents of the invention

本发明提供一种数据写入方法、存储器存储装置及存储器控制电路单元,可在实体抹除单元的比特错误率升高时,改为利用可靠度较高的方式来持续使用此实体抹除单元,而不是直接将其舍弃不用。The present invention provides a data writing method, a memory storage device and a memory control circuit unit. When the bit error rate of the physical erasing unit increases, the physical erasing unit can be continuously used in a way with higher reliability , rather than discarding it directly.

本发明提供一种数据写入方法,用于控制可复写式非易失性存储器模块,可复写式非易失性存储器模块包括多个实体抹除单元,每一所述实体抹除单元包括多个实体程序化单元,并且所述数据写入方法包括:接收写入指令,其中写入指令指示将一数据写入至多个逻辑单元的至少其中之一,其中所述逻辑单元的至少其中之一映射至所述实体程序化单元中的第一实体程序化单元,并且第一实体程序化单元属于所述实体抹除单元中的第一实体抹除单元;判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元,其中第一类实体抹除单元的第一比特错误率低于第二类实体抹除单元的第二比特错误率;当第一实体抹除单元属于第一类实体抹除单元时,依据第一码率(code rate)来将数据与对应于数据的一校验码编程至第一实体程序化单元;以及当第一实体抹除单元属于第二类实体抹除单元时,依据第二码率来将数据与对应于数据的校验码编程至第一实体程序化单元,其中第一码率高于第二码率。The present invention provides a data writing method for controlling a rewritable non-volatile memory module. The rewritable non-volatile memory module includes a plurality of physical erasing units, each of which includes multiple physical erasing units. physical programming units, and the data writing method includes: receiving a write instruction, wherein the write instruction indicates to write a data to at least one of a plurality of logical units, wherein at least one of the logical units Mapping to the first physical programming unit in the physical programming unit, and the first physical programming unit belongs to the first physical erasing unit in the physical erasing unit; judging that the first physical erasing unit belongs to the first physical erasing unit A physical erasing unit of the type or a physical erasing unit of the second type, wherein the first bit error rate of the physical erasing unit of the first type is lower than the second bit error rate of the physical erasing unit of the second type; when the first physical erasing unit When the unit belongs to the first physical erasing unit, data and a check code corresponding to the data are programmed to the first physical programming unit according to a first code rate; and when the first physical erasing unit belongs to When the second type of physical unit is erased, the data and the check code corresponding to the data are programmed into the first physical programming unit according to the second code rate, wherein the first code rate is higher than the second code rate.

在本发明的一范例实施例中,所述判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元的步骤包括:判断第一实体抹除单元的比特错误率评估值是否符合门槛条件;若第一实体抹除单元的比特错误率评估值不符合门槛条件,判定第一实体抹除单元属于第一类实体抹除单元;以及若第一实体抹除单元的比特错误率评估值符合门槛条件,判定第一实体抹除单元属于第二类实体抹除单元。In an exemplary embodiment of the present invention, the step of judging that the first physical erasing unit belongs to the first type of physical erasing unit or the second type of physical erasing unit includes: judging the bit error rate of the first physical erasing unit Whether the evaluation value meets the threshold condition; if the bit error rate evaluation value of the first physical erasing unit does not meet the threshold condition, it is determined that the first physical erasing unit belongs to the first type of physical erasing unit; and if the first physical erasing unit’s The bit error rate evaluation value meets the threshold condition, and it is determined that the first physical erasing unit belongs to the second type of physical erasing unit.

在本发明的一范例实施例中,所述数据写入方法还包括:根据第一实体抹除单元的抹除次数信息、写入次数信息、读取次数信息、错误比特数信息、错误比特率信息、数据存放时间信息及温度信息的至少其中之一或至少二者的组合,来决定第一实体抹除单元的比特错误率评估值。In an exemplary embodiment of the present invention, the data writing method further includes: according to the erasing times information, writing times information, reading times information, error bit number information, error bit rate of the first physical erasing unit Information, at least one of data storage time information and temperature information, or a combination of at least two, to determine the bit error rate evaluation value of the first physical erasing unit.

在本发明的一范例实施例中,所述依据第一码率来将数据与对应于数据的校验码写入至第一实体程序化单元的步骤包括:将数据分成至少一第一数据段并且产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。所述依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的步骤包括:将数据分成至少一第二数据段并且产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度相同于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度短于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the step of writing data and a check code corresponding to the data into the first physical programming unit according to the first code rate includes: dividing the data into at least one first data segment And generating at least one first check code segment, wherein each of the first check code segments corresponds to one of the first data segments. The step of writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: dividing the data into at least one second data segment and generating at least one second check code segment , wherein each of the second check code segments corresponds to one of the second data segments. wherein a data length of each of the first data segments is the same as a data length of each of the second data segments, and a data length of each of the first check code segments is shorter than that of each of the first data segments A data length of the two-check code segment.

在本发明的一范例实施例中,所述其中依据第一码率来将数据与对应于数据的校验码写入至第一实体程序化单元的步骤包括:将数据分成至少一第一数据段并且产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。所述依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的步骤包括:将数据分成至少一第二数据段并且产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度长于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度相同于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the step of writing the data and the check code corresponding to the data into the first physical programming unit according to the first code rate includes: dividing the data into at least one first data segments and generate at least one first check code segment, wherein each of the first check code segments corresponds to one of the first data segments. The step of writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: dividing the data into at least one second data segment and generating at least one second check code segment , wherein each of the second check code segments corresponds to one of the second data segments. wherein a data length of each of the first data segments is longer than a data length of each of the second data segments, and a data length of each of the first check code segments is the same as that of each of the second A data length of the check code segment.

在本发明的一范例实施例中,所述依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的步骤包括:判断数据的数据长度是否超过N个基本管理单位的数据长度,其中N是正整数,并且N+1个基本管理单位的数据长度等于第一实体程序化单元的容量大小;当数据的数据长度不超过N个基本管理单位的数据长度时,仅依据第二码率将数据与对应于数据的校验码写入至第一实体程序化单元;以及当数据的数据长度超过N个基本管理单位的数据长度时,依据第二码率将第一部分的数据与第一部分的校验码写入至第一实体程序化单元并且将第二部分的数据与第二部分的校验码写入至所述实体程序化单元中的第二实体程序化单元。In an exemplary embodiment of the present invention, the step of writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: judging whether the data length of the data exceeds N The data length of the basic management unit, where N is a positive integer, and the data length of N+1 basic management units is equal to the capacity of the first entity programming unit; when the data length of the data does not exceed the data length of N basic management units , only write the data and the check code corresponding to the data into the first physical programming unit according to the second code rate; and when the data length of the data exceeds the data length of N basic management units, write the data according to the second code rate The data of the first part and the check code of the first part are written into the first entity programming unit, and the data of the second part and the check code of the second part are written into the second entity program in the program entity unit. unit.

在本发明的一范例实施例中,所述第二实体程序化单元属于第一实体抹除单元或者所述实体抹除单元中也属于第二类实体抹除单元的第二实体抹除单元。In an exemplary embodiment of the present invention, the second physical programming unit belongs to the first physical erasing unit or a second physical erasing unit among the physical erasing units also belongs to the second type of physical erasing unit.

在本发明的一范例实施例中,所述第一部分的数据的数据长度符合N个基本管理单位的数据长度,并且所述数据写入方法还包括:将至少一第一无效比特写入至第一实体程序化单元中以填满未被第一部分的数据与第一部分的校验码所写满的部分;以及将至少一第二无效比特写入至第二实体程序化单元中以填满未被第二部分的数据与第二部分的校验码所写满的部分。In an exemplary embodiment of the present invention, the data length of the first part of data conforms to the data length of N basic management units, and the data writing method further includes: writing at least one first invalid bit into the first a physical programming unit to fill the unfilled part of the first part of the data and the first part of the check code; and writing at least one second invalid bit into the second physical programming unit to fill the unfilled part The part filled with the data of the second part and the check code of the second part.

本发明另提供一种存储器存储装置,所述存储器存储装置包括连接接口单元、可复写式非易失性存储器模块及存储器控制电路单元。连接接口单元用以电连接至主机系统。可复写式非易失性存储器模块包括多个实体抹除单元,并且每一所述实体抹除单元包括多个实体程序化单元。存储器控制电路单元电连接至连接接口单元与可复写式非易失性存储器模块。其中存储器控制电路单元用以接收写入指令,其中写入指令指示将数据写入至多个逻辑单元的至少其中之一,其中所述逻辑单元的至少其中之一映射至所述实体程序化单元中的第一实体程序化单元,并且第一实体程序化单元属于所述实体抹除单元中的第一实体抹除单元。存储器控制电路单元还用以判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元,其中第一类实体抹除单元的第一比特错误率低于第二类实体抹除单元的第二比特错误率。当第一实体抹除单元属于第一类实体抹除单元时,存储器控制电路单元还用以依据第一码率来将数据与对应于数据的校验码编程至第一实体程序化单元。当第一实体抹除单元属于第二类实体抹除单元时,存储器控制电路单元还用以依据第二码率来将数据与对应于数据的校验码编程至第一实体程序化单元,其中第一码率高于第二码率。The present invention further provides a memory storage device, which includes a connection interface unit, a rewritable non-volatile memory module and a memory control circuit unit. The connection interface unit is used to electrically connect to the host system. The rewritable non-volatile memory module includes a plurality of physical erasing units, and each of the physical erasing units includes a plurality of physical programming units. The memory control circuit unit is electrically connected to the connection interface unit and the rewritable non-volatile memory module. Wherein the memory control circuit unit is used to receive a write instruction, wherein the write instruction indicates to write data into at least one of a plurality of logic units, wherein at least one of the logic units is mapped to the physical programming unit The first physical programming unit, and the first physical programming unit belongs to the first physical erasing unit in the physical erasing unit. The memory control circuit unit is also used to determine whether the first physical erasing unit belongs to the first type of physical erasing unit or the second type of physical erasing unit, wherein the first bit error rate of the first type of physical erasing unit is lower than that of the second type The second bit error rate of the physical erasing unit. When the first physical erasing unit belongs to the first type of physical erasing unit, the memory control circuit unit is further configured to program data and a check code corresponding to the data into the first physical programming unit according to the first code rate. When the first physical erasing unit belongs to the second type of physical erasing unit, the memory control circuit unit is also used to program data and a check code corresponding to the data into the first physical programming unit according to the second code rate, wherein The first code rate is higher than the second code rate.

在本发明的一范例实施例中,所述存储器控制电路单元判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元的操作包括:判断第一实体抹除单元的比特错误率评估值是否符合门槛条件;若第一实体抹除单元的比特错误率评估值不符合门槛条件,判定第一实体抹除单元属于第一类实体抹除单元;以及若第一实体抹除单元的比特错误率评估值符合门槛条件,判定第一实体抹除单元属于第二类实体抹除单元。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit judging that the first physical erasing unit belongs to the first type of physical erasing unit or the second type of physical erasing unit includes: judging the first physical erasing unit Whether the bit error rate evaluation value of the first physical erasing unit meets the threshold condition; if the bit error rate evaluation value of the first physical erasing unit does not meet the threshold condition, it is determined that the first physical erasing unit belongs to the first type of physical erasing unit; and if the first physical erasing unit The bit error rate evaluation value of the erasing unit meets the threshold condition, and it is determined that the first physical erasing unit belongs to the second type of physical erasing unit.

在本发明的一范例实施例中,所述存储器控制电路单元还用以根据第一实体抹除单元的抹除次数信息、写入次数信息、读取次数信息、错误比特数信息、错误比特率信息、数据存放时间信息及温度信息的至少其中之一或至少二者的组合,来决定第一实体抹除单元的比特错误率评估值。In an exemplary embodiment of the present invention, the memory control circuit unit is further configured to, according to the erase count information, write count information, read count information, error bit number information, and error bit rate of the first entity erasing unit Information, at least one of data storage time information and temperature information, or a combination of at least two, to determine the bit error rate evaluation value of the first physical erasing unit.

在本发明的一范例实施例中,所述存储器控制电路单元依据第一码率来将数据与对应于数据的校验码写入至第一实体程序化单元的操作包括:将数据分成至少一第一数据段并且产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。所述存储器控制电路单元依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的操作包括:将数据分成至少一第二数据段并且产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度相同于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度短于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit writing data and a check code corresponding to the data into the first physical programming unit according to the first code rate includes: dividing the data into at least one The first data segment and generating at least one first check code segment, wherein each of the first check code segments corresponds to one of the first data segments. The operation of the memory control circuit unit writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: dividing the data into at least one second data segment and generating at least one second Check code segments, wherein each of the second check code segments corresponds to one of the second data segments. wherein a data length of each of the first data segments is the same as a data length of each of the second data segments, and a data length of each of the first check code segments is shorter than that of each of the first data segments A data length of the two-check code segment.

在本发明的一范例实施例中,所述存储器控制电路单元依据第一码率来将数据与对应于数据的校验码写入至第一实体程序化单元的操作包括:将数据分成至少一第一数据段并且产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。所述存储器控制电路单元依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的操作包括:将数据分成至少一第二数据段并且产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度长于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度相同于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit writing data and a check code corresponding to the data into the first physical programming unit according to the first code rate includes: dividing the data into at least one The first data segment and generating at least one first check code segment, wherein each of the first check code segments corresponds to one of the first data segments. The operation of the memory control circuit unit writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: dividing the data into at least one second data segment and generating at least one second Check code segments, wherein each of the second check code segments corresponds to one of the second data segments. wherein a data length of each of the first data segments is longer than a data length of each of the second data segments, and a data length of each of the first check code segments is the same as that of each of the second A data length of the check code segment.

在本发明的一范例实施例中,所述存储器控制电路单元依据第二码率来将数据与对应于数据的校验码写入至第一实体程序化单元的操作包括:判断数据的数据长度是否超过N个基本管理单位的数据长度,其中N是正整数,并且N+1个基本管理单位的数据长度等于第一实体程序化单元的容量大小;当数据的数据长度不超过N个基本管理单位的数据长度时,仅依据第二码率将数据与对应于数据的校验码写入至第一实体程序化单元;以及当数据的数据长度超过N个基本管理单位的数据长度时,依据第二码率将第一部分的数据与第一部分的校验码写入至第一实体程序化单元并且将第二部分的数据与第二部分的校验码写入至所述实体程序化单元中的第二实体程序化单元。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit writing the data and the check code corresponding to the data into the first physical programming unit according to the second code rate includes: judging the data length of the data Whether it exceeds the data length of N basic management units, where N is a positive integer, and the data length of N+1 basic management units is equal to the capacity of the first entity programming unit; when the data length of the data does not exceed N basic management units When the data length of the data is longer than the second code rate, the data and the check code corresponding to the data are written to the first entity programming unit; and when the data length of the data exceeds the data length of N basic management units, according to the second code rate Write the data of the first part and the verification code of the first part into the first physical programming unit and write the data of the second part and the verification code of the second part into the physical programming unit A second entity programmatic unit.

在本发明的一范例实施例中,所述第一部分的数据的一数据长度符合N个基本管理单位的数据长度。所述存储器控制电路单元还用以将至少一第一无效比特写入至第一实体程序化单元中以填满未被第一部分的数据与第一部分的校验码所写满的部分。所述存储器控制电路单元还用以将至少一第二无效比特写入至第二实体程序化单元中以填满未被第二部分的数据与第二部分的校验码所写满的部分。In an exemplary embodiment of the present invention, a data length of the first part of data corresponds to a data length of N basic management units. The memory control circuit unit is also used for writing at least one first invalid bit into the first physical programming unit to fill up the part not filled by the first part of data and the first part of check code. The memory control circuit unit is also used for writing at least one second invalid bit into the second physical programming unit to fill up the part not filled by the second part of data and the second part of check code.

本发明另提供一种存储器控制电路单元,所述存储器控制电路单元用于控制可复写式非易失性存储器模块。其中可复写式非易失性存储器模块包括多个实体抹除单元,每一所述实体抹除单元包括多个实体程序化单元,并且存储器控制电路单元包括主机接口、存储器接口、错误检查与校正电路及存储器管理电路。主机接口用以电连接至主机系统。存储器接口用以电连接至可复写式非易失性存储器模块。存储器管理电路电连接至主机接口、存储器接口及错误检查与校正电路。其中存储器管理电路用以接收写入指令,其中写入指令指示将数据写入至多个逻辑单元中的至少其中之一,其中所述逻辑单元中的至少其中之一映射至所述实体程序化单元中的第一实体程序化单元,并且第一实体程序化单元属于所述实体抹除单元中的一第一实体抹除单元。存储器控制电路单元还用以判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元,其中第一类实体抹除单元的第一比特错误率低于第二类实体抹除单元的第二比特错误率。当第一实体抹除单元属于第一类实体抹除单元时,存储器管理电路还用以发送第一指令串行,其中第一指令串行指示依据第一码率将数据与对应于数据的校验码编程至第一实体程序化单元。当第一实体抹除单元属于第二类实体抹除单元时,存储器管理电路还用以发送第二指令串行,其中第二指令串行指示依据第二码率将数据与对应于数据的校验码编程至第一实体程序化单元,其中第一码率高于第二码率。The present invention further provides a memory control circuit unit, which is used for controlling a rewritable non-volatile memory module. Wherein the rewritable non-volatile memory module includes a plurality of physical erasing units, each of which includes a plurality of physical programming units, and the memory control circuit unit includes a host interface, a memory interface, error checking and correction circuit and memory management circuit. The host interface is used to electrically connect to the host system. The memory interface is used for electrically connecting to the rewritable non-volatile memory module. The memory management circuit is electrically connected to the host interface, the memory interface and the error checking and correction circuit. Wherein the memory management circuit is used to receive a write instruction, wherein the write instruction indicates to write data to at least one of a plurality of logic units, wherein at least one of the logic units is mapped to the physical programming unit The first physical programming unit in the first physical programming unit, and the first physical programming unit belongs to a first physical erasing unit in the physical erasing unit. The memory control circuit unit is also used to determine whether the first physical erasing unit belongs to the first type of physical erasing unit or the second type of physical erasing unit, wherein the first bit error rate of the first type of physical erasing unit is lower than that of the second type The second bit error rate of the physical erasing unit. When the first physical erasing unit belongs to the first type of physical erasing unit, the memory management circuit is further configured to send a first instruction sequence, wherein the first instruction sequence indicates to convert the data to the calibration corresponding to the data according to the first code rate Code verification is programmed to the first entity programming unit. When the first physical erasing unit belongs to the second type of physical erasing unit, the memory management circuit is also used to send a second instruction sequence, wherein the second instruction sequence indicates to convert the data to the calibration corresponding to the data according to the second code rate Code checking is programmed to the first physical programming unit, wherein the first code rate is higher than the second code rate.

在本发明的一范例实施例中,所述存储器管理电路判断第一实体抹除单元属于第一类实体抹除单元或第二类实体抹除单元的操作包括:判断第一实体抹除单元的比特错误率评估值是否符合门槛条件;若第一实体抹除单元的比特错误率评估值不符合门槛条件,判定第一实体抹除单元属于第一类实体抹除单元;以及若第一实体抹除单元的比特错误率评估值符合门槛条件,判定第一实体抹除单元属于第二类实体抹除单元。In an exemplary embodiment of the present invention, the operation of the memory management circuit judging that the first physical erasing unit belongs to the first type of physical erasing unit or the second type of physical erasing unit includes: judging the first physical erasing unit Whether the bit error rate evaluation value meets the threshold condition; if the bit error rate evaluation value of the first physical erasing unit does not meet the threshold condition, it is determined that the first physical erasing unit belongs to the first type of physical erasing unit; and if the first physical erasing unit The bit error rate evaluation value of the erasing unit meets the threshold condition, and it is determined that the first physical erasing unit belongs to the second type of physical erasing unit.

在本发明的一范例实施例中,所述存储器管理电路还用以根据第一实体抹除单元的抹除次数信息、写入次数信息、读取次数信息、错误比特数信息、错误比特率信息、数据存放时间信息及温度信息的至少其中之一或至少二者的组合,来决定第一实体抹除单元的比特错误率评估值。In an exemplary embodiment of the present invention, the memory management circuit is further configured to, according to the erase count information, write count information, read count information, error bit number information, and error bit rate information of the first physical erasing unit , at least one of data storage time information and temperature information or a combination of at least two of them to determine the bit error rate evaluation value of the first physical erasing unit.

在本发明的一范例实施例中,所述存储器管理电路发送第一指令串行的操作还包括:将数据分成至少一第一数据段并且控制错误检查与校正电路产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。其中存储器管理电路发送第二指令串行的操作还包括:将数据分成至少一第二数据段并且控制错误检查与校正电路产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度相同于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度短于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the operation of the memory management circuit sending the first command sequence further includes: dividing the data into at least one first data segment and controlling the error checking and correction circuit to generate at least one first check code segments, wherein each of the first check code segments corresponds to one of the first data segments. The operation wherein the memory management circuit sends the second command sequence further includes: dividing the data into at least one second data segment and controlling the error checking and correction circuit to generate at least one second check code segment, wherein each of the second check code segments The code segment corresponds to one of the second data segments. wherein a data length of each of the first data segments is the same as a data length of each of the second data segments, and a data length of each of the first check code segments is shorter than that of each of the first data segments A data length of the two-check code segment.

在本发明的一范例实施例中,所述存储器管理电路发送第一指令串行的操作还包括:将数据分成至少一第一数据段并且控制错误检查与校正电路产生至少一第一校验码段,其中每一所述第一校验码段对应于所述第一数据段的其中之一。其中存储器管理电路发送第二指令串行的操作还包括:将数据分成至少一第二数据段并且控制错误检查与校正电路产生至少一第二校验码段,其中每一所述第二校验码段对应于所述第二数据段的其中之一。其中每一所述第一数据段的一数据长度长于每一所述第二数据段的一数据长度,并且每一所述第一校验码段的一数据长度相同于每一所述第二校验码段的一数据长度。In an exemplary embodiment of the present invention, the operation of the memory management circuit sending the first command sequence further includes: dividing the data into at least one first data segment and controlling the error checking and correction circuit to generate at least one first check code segments, wherein each of the first check code segments corresponds to one of the first data segments. The operation wherein the memory management circuit sends the second command sequence further includes: dividing the data into at least one second data segment and controlling the error checking and correction circuit to generate at least one second check code segment, wherein each of the second check code segments The code segment corresponds to one of the second data segments. wherein a data length of each of the first data segments is longer than a data length of each of the second data segments, and a data length of each of the first check code segments is the same as that of each of the second A data length of the check code segment.

在本发明的一范例实施例中,所述存储器管理电路发送第二指令串行的操作包括:判断数据的数据长度是否超过N个基本管理单位的数据长度,其中N是正整数,并且N+1个基本管理单位的数据长度等于第一实体程序化单元的容量大小。当数据的数据长度不超过N个基本管理单位的数据长度时,发送第二指令串行,其中第二指令串行指示依据第二码率而仅将数据与对应于数据的校验码写入至第一实体程序化单元。当数据的数据长度超过N个基本管理单位的数据长度时,发送第二指令串行,其中第二指令串行指示依据第二码率将第一部分的数据与第一部分的校验码需写入至第一实体程序化单元并且将第二部分的数据与第二部分的校验码写入至所述实体程序化单元中的一第二实体程序化单元。In an exemplary embodiment of the present invention, the operation of the memory management circuit sending the second command sequence includes: judging whether the data length of the data exceeds the data length of N basic management units, where N is a positive integer, and N+1 The data length of a basic management unit is equal to the capacity of the first entity programming unit. When the data length of the data does not exceed the data length of N basic management units, send the second instruction sequence, wherein the second instruction sequence indicates that only the data and the check code corresponding to the data are written according to the second code rate To the first entity programming unit. When the data length of the data exceeds the data length of N basic management units, send the second command sequence, wherein the second command sequence indicates that the first part of the data and the first part of the check code need to be written according to the second code rate to the first physical programming unit and write the second part of the data and the second part of the verification code into a second physical programming unit of the physical programming unit.

在本发明的一范例实施例中,所述第一部分的数据的数据长度符合N个基本管理单位的数据长度。第二指令串行还指示至少一第一无效比特需被写入至第一实体程序化单元中以填满未被第一部分的数据与第一部分的校验码所写满的部分,以及至少一第二无效比特需被写入至第二实体程序化单元中以填满未被第二部分的数据与第二部分的校验码所写满的部分。In an exemplary embodiment of the present invention, the data length of the first part of data conforms to the data length of N basic management units. The second instruction sequence also indicates that at least one first invalid bit needs to be written into the first physical programming unit to fill up the part not filled by the first part of data and the first part of check code, and at least one The second invalid bit needs to be written into the second physical programming unit to fill up the part not filled by the second part of data and the second part of check code.

基于上述,本发明提出的数据写入方法、存储器存储装置及存储器控制电路单元,可根据可复写式非易失性存储器模块中的实体抹除单元是第一类实体抹除单元或第二类实体抹除单元,而适应性地根据第一码率或高于第一码率的第二码率来将数据与对应于此数据的校验码编程至此实体抹除单元的实体程序化单元。藉此,即使实体抹除单元的比特错误率超过预设的容许范围,此实体抹除单元还是可以被持续使用,而不会直接被舍弃。Based on the above, the data writing method, memory storage device and memory control circuit unit proposed by the present invention can be based on whether the physical erasing unit in the rewritable non-volatile memory module is the first type of physical erasing unit or the second type The physical erasing unit adaptively programs data and a check code corresponding to the data into the physical programming unit of the physical erasing unit according to the first code rate or a second code rate higher than the first code rate. In this way, even if the bit error rate of the physical erasing unit exceeds the preset allowable range, the physical erasing unit can still be used continuously instead of being discarded directly.

为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail with reference to the accompanying drawings.

附图说明Description of drawings

图1A示出本发明的一范例实施例的主机系统与存储器存储装置;Figure 1A illustrates a host system and memory storage device of an exemplary embodiment of the present invention;

图1B示出本发明的一范例实施例的电脑、输入/输出装置与存储器存储装置的示意图;FIG. 1B shows a schematic diagram of a computer, an input/output device, and a memory storage device according to an exemplary embodiment of the present invention;

图1C示出本发明的一范例实施例的主机系统与存储器存储装置的示意图;FIG. 1C shows a schematic diagram of a host system and a memory storage device according to an exemplary embodiment of the present invention;

图2示出图1A所示的存储器存储装置的概要方块图;Figure 2 shows a schematic block diagram of the memory storage device shown in Figure 1A;

图3示出本发明的一范例实施例的存储器控制电路单元的概要方块图;FIG. 3 shows a schematic block diagram of a memory control circuit unit of an exemplary embodiment of the present invention;

图4示出本发明的一范例实施例的管理可复写式非易失性存储器模块的范例示意图;FIG. 4 shows an exemplary schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention;

图5示出本发明的一范例实施例根据第一码率将数据与对应于此数据的校验码至实体程序化单元的范例示意图;FIG. 5 shows an exemplary schematic diagram of sending data and a check code corresponding to the data to a physical programming unit according to a first code rate according to an exemplary embodiment of the present invention;

图6示出本发明的一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图;FIG. 6 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into a physical programming unit according to a second code rate according to an exemplary embodiment of the present invention;

图7示出本发明的另一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图;FIG. 7 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into the physical programming unit according to another exemplary embodiment of the present invention;

图8示出本发明的另一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图;FIG. 8 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into a physical programming unit according to another exemplary embodiment of the present invention;

图9示出本发明的一范例实施例的数据写入方法的流程图;FIG. 9 shows a flowchart of a data writing method according to an exemplary embodiment of the present invention;

图10示出本发明的另一范例实施例的数据写入方法的流程图。FIG. 10 shows a flowchart of a data writing method according to another exemplary embodiment of the present invention.

附图标记说明:Explanation of reference signs:

1000:主机系统;1000: host system;

1100:电脑;1100: computer;

1102:微处理器;1102: microprocessor;

1104:随机存取存储器;1104: random access memory;

1106:输入/输出装置;1106: input/output device;

1108:系统总线;1108: system bus;

1110:数据传输接口;1110: data transmission interface;

1202:鼠标;1202: mouse;

1204:键盘;1204: keyboard;

1206:显示器;1206: display;

1208:打印机;1208: printer;

1212:U盘;1212: U disk;

1214:记忆卡;1214: memory card;

1216:固态硬盘;1216: SSD;

1310:数码相机;1310: digital camera;

1312:SD卡;1312: SD card;

1314:MMC卡;1314: MMC card;

1316:记忆棒;1316: memory stick;

1318:CF卡;1318: CF card;

1320:嵌入式存储装置;1320: embedded storage device;

100:存储器存储装置;100: memory storage device;

102:连接接口单元;102: connect the interface unit;

104:存储器控制电路单元;104: memory control circuit unit;

106:可复写式非易失性存储器模块;106: a rewritable non-volatile memory module;

304(0)~304(R):实体抹除单元;304(0)~304(R): Entity erasing unit;

202:存储器管理电路;202: memory management circuit;

204:主机接口;204: host interface;

206:存储器接口;206: memory interface;

252:缓冲存储器;252: buffer memory;

254:电源管理电路;254: power management circuit;

256:错误检查与校正电路;256: error checking and correction circuit;

402:存储区;402: storage area;

406:系统区;406: system area;

410(0)~410(D):逻辑地址;410(0)~410(D): logical address;

501、601、701、801:数据;501, 601, 701, 801: data;

510(0)、610(0)、710(0)、810(0):逻辑程序化单元;510(0), 610(0), 710(0), 810(0): logic programming unit;

512(0)、612(0)、712(0)、812(0)、812(1):实体程序化单元;512(0), 612(0), 712(0), 812(0), 812(1): entity programming unit;

501_1~501_4、601_1~601_4、701_1~701_8、801_1~801_5:数据段;501_1~501_4, 601_1~601_4, 701_1~701_8, 801_1~801_5: data segment;

502_1~502_4、602_1~602_4、702_1~702_8、802_1~802_5: 校验码段;502_1~502_4, 602_1~602_4, 702_1~702_8, 802_1~802_5: check code segment;

S902、S904、S906、S908:数据写入方法各步骤;S902, S904, S906, S908: each step of the data writing method;

S1002、S1004、S1006、S1008、S1010、S1012: 数据写入方法各步骤。S1002, S1004, S1006, S1008, S1010, S1012: each step of the data writing method.

具体实施方式Detailed ways

一般而言,存储器存储装置(也称,存储器存储系统)包括可复写式非易失性存储器模块与控制器(也称,控制电路)。通常存储器存储装置是与主机系统一起使用,以使主机系统可将数据写入至存储器存储装置或从存储器存储装置中读取数据。Generally speaking, a memory storage device (also called a memory storage system) includes a rewritable non-volatile memory module and a controller (also called a control circuit). Typically memory storage devices are used with a host system such that the host system can write data to or read data from the memory storage device.

图1A示出本发明的一范例实施例的主机系统与存储器存储装置;图1B示出本发明的一范例实施例的电脑、输入/输出装置与存储器存储装置的示意图;图1C示出本发明的一范例实施例的主机系统与存储器存储装置的示意图。Figure 1A shows a host system and a memory storage device of an exemplary embodiment of the present invention; Figure 1B shows a schematic diagram of a computer, an input/output device, and a memory storage device of an exemplary embodiment of the present invention; Figure 1C illustrates the present invention A schematic diagram of a host system and a memory storage device of an exemplary embodiment of FIG.

请参照图1A,主机系统1000一般包括电脑1100与输入/输出(input/output,I/O)装置1106。电脑1100包括微处理器1102、随机存取存储器(random accessmemory,RAM)1104、系统总线1108与数据传输接口1110。输入/输出装置1106包括如图1B的鼠标1202、键盘1204、显示器1206与打印机1208。必须了解的是,图2所示的装置非限制输入/输出装置1106,输入/输出装置1106可还包括其他装置。Referring to FIG. 1A , the host system 1000 generally includes a computer 1100 and an input/output (I/O) device 1106 . The computer 1100 includes a microprocessor 1102 , a random access memory (random access memory, RAM) 1104 , a system bus 1108 and a data transmission interface 1110 . The input/output device 1106 includes a mouse 1202, a keyboard 1204, a monitor 1206 and a printer 1208 as shown in FIG. 1B. It must be understood that the device shown in FIG. 2 is not limited to the input/output device 1106, and the input/output device 1106 may also include other devices.

在本发明实施例中,存储器存储装置100是通过数据传输接口1110与主机系统1000的其他元件电连接。通过微处理器1102、随机存取存储器1104与输入/输出装置1106的操作可将数据写入至存储器存储装置100或从存储器存储装置100中读取数据。例如,存储器存储装置100可以是如图2所示的U盘1212、记忆卡1214或固态硬盘(Solid State Drive,SSD)1216等的可复写式非易失性存储器存储装置。In the embodiment of the present invention, the memory storage device 100 is electrically connected to other components of the host system 1000 through the data transmission interface 1110 . Data can be written into or read from the memory storage device 100 through the operations of the microprocessor 1102 , the random access memory 1104 and the input/output device 1106 . For example, the memory storage device 100 may be a rewritable non-volatile memory storage device such as a USB flash drive 1212, a memory card 1214, or a solid state drive (Solid State Drive, SSD) 1216 as shown in FIG. 2 .

一般而言,主机系统1000为可实质地与存储器存储装置100配合以存储数据的任意系统。虽然在本范例实施例中,主机系统1000是以电脑系统来作说明,然而,在本发明另一范例实施例中主机系统1000可以是数码相机、摄像机、通信装置、音频播放器或视频播放器等系统。例如,在主机系统为数码相机(摄像机)1310时,可复写式非易失性存储器存储装置100则为其所使用的SD卡1312、MMC卡1314、记忆棒(memory stick)1316、CF卡1318或嵌入式存储装置1320(如图1C所示)。嵌入式存储装置1320包括嵌入式多媒体卡(Embedded MMC,eMMC)。值得一提的是,嵌入式多媒体卡是直接电连接于主机系统的基板上。In general, host system 1000 is any system that can cooperate substantially with memory storage device 100 to store data. Although in this exemplary embodiment, the host system 1000 is described as a computer system, however, in another exemplary embodiment of the present invention, the host system 1000 may be a digital camera, video camera, communication device, audio player or video player and other systems. For example, when the host system is a digital camera (video camera) 1310, the rewritable nonvolatile memory storage device 100 is an SD card 1312, an MMC card 1314, a memory stick (memory stick) 1316, and a CF card 1318. Or an embedded storage device 1320 (as shown in FIG. 1C ). The embedded storage device 1320 includes an embedded multimedia card (Embedded MMC, eMMC). It is worth mentioning that the embedded multimedia card is directly electrically connected to the substrate of the host system.

图2示出图1A所示的存储器存储装置的概要方块图。FIG. 2 shows a schematic block diagram of the memory storage device shown in FIG. 1A.

请参照图2,存储器存储装置100包括连接接口单元102、存储器控制电路单元104与可复写式非易失性存储器模块106。Referring to FIG. 2 , the memory storage device 100 includes a connection interface unit 102 , a memory control circuit unit 104 and a rewritable non-volatile memory module 106 .

在本范例实施例中,连接接口单元102是兼容于串行高级技术附件(SerialAdvanced Technology Attachment,SATA)标准。然而,必须了解的是,本发明不限于此,连接接口单元102也可以是符合并行高级技术附件(Parallel Advanced TechnologyAttachment,PATA)标准、电气和电子工程师协会(Institute of Electrical andElectronic Engineers,IEEE)1394标准、高速外围零件连接接口(Peripheral ComponentInterconnect Express,PCI Express)标准、通用串行总线(Universal Serial Bus,USB)标准、超高速一代(Ultra High Speed-I,UHS-I)接口标准、超高速二代(Ultra HighSpeed-II,UHS-II)接口标准、安全数码(Secure Digital,SD)接口标准、记忆棒(MemoryStick,MS)接口标准、多媒体存储卡(Multi Media Card,MMC)接口标准、小型快闪(CompactFlash,CF)接口标准、集成式驱动电子接口(Integrated Device Electronics,IDE)标准或其他适合的标准。在本范例实施例中,连接接口单元102可与存储器控制电路单元104封装在一个芯片中,或布设于一包含存储器控制电路单元104的芯片外。In this exemplary embodiment, the connection interface unit 102 is compatible with the Serial Advanced Technology Attachment (SATA) standard. However, it must be understood that the present invention is not limited thereto, and that the connection interface unit 102 may also be in accordance with the Parallel Advanced Technology Attachment (Parallel Advanced Technology Attachment, PATA) standard, the Institute of Electrical and Electronic Engineers (Institute of Electrical and Electronic Engineers, IEEE) 1394 standard , Peripheral Component Interconnect Express (PCI Express) standard, Universal Serial Bus (Universal Serial Bus, USB) standard, Ultra High Speed-I (UHS-I) interface standard, Ultra High Speed II (Ultra High Speed-II, UHS-II) interface standard, Secure Digital (Secure Digital, SD) interface standard, Memory Stick (MemoryStick, MS) interface standard, Multi Media Card (Multi Media Card, MMC) interface standard, small flash (CompactFlash, CF) interface standard, Integrated Device Electronics (IDE) standard, or other suitable standards. In this exemplary embodiment, the connection interface unit 102 and the memory control circuit unit 104 can be packaged in one chip, or arranged outside a chip including the memory control circuit unit 104 .

存储器控制电路单元104用以执行以硬件形式或固件形式实作的多个逻辑门或控制指令,并且根据主机系统1000的指令在可复写式非易失性存储器模块106中进行数据的写入、读取与抹除等操作。The memory control circuit unit 104 is used to execute a plurality of logic gates or control instructions implemented in the form of hardware or firmware, and write data in the rewritable non-volatile memory module 106 according to the instructions of the host system 1000, Read and erase operations.

可复写式非易失性存储器模块106是电连接至存储器控制电路单元104,并且用以存储主机系统1000所写入的数据。可复写式非易失性存储器模块106具有实体抹除单元304(0)~304(R)。例如,实体抹除单元304(0)~304(R)可属于同一个存储器晶粒(die)或者属于不同的存储器晶粒。每一实体抹除单元分别具有复数个实体程序化单元,并且属于同一个实体抹除单元的实体程序化单元可被独立地写入且被同时地抹除。例如,每一实体抹除单元是由128个实体程序化单元所组成。然而,必须了解的是,本发明不限于此,每一实体抹除单元是可由64个实体程序化单元、256个实体程序化单元或其他任意个实体程序化单元所组成。The rewritable non-volatile memory module 106 is electrically connected to the memory control circuit unit 104 and used for storing data written by the host system 1000 . The rewritable non-volatile memory module 106 has physical erasing units 304 ( 0 )˜ 304 (R). For example, the physical erasing units 304(0)˜304(R) may belong to the same memory die or belong to different memory dies. Each physical erasing unit has a plurality of physical programming units, and the physical programming units belonging to the same physical erasing unit can be written independently and erased simultaneously. For example, each physical erasing unit is composed of 128 physical programming units. However, it must be understood that the present invention is not limited thereto, and each physical erasing unit may be composed of 64 physical programming units, 256 physical programming units, or any other number of physical programming units.

更具体来说,每一个实体抹除单元包括多条字符线与多条比特线,每一条字符线与每一条比特线交叉处配置有一个存储单元。每一个存储单元可存储一或多个比特。在同一个实体抹除单元中,所有的存储单元会一起被抹除。在此范例实施例中,实体抹除单元为抹除的最小单位。也即,每一实体抹除单元含有最小数目之一并被抹除的存储单元。例如,实体抹除单元为实体区块。另一方面,同一个字符线上的存储单元会组成一或多个实体程序化单元。若每一个存储单元可存储2个以上的比特,则同一个字符线上的实体程序化单元可被分类为下实体程序化单元与上实体程序化单元。一般来说,下实体程序化单元的写入速度会大于上实体程序化单元的写入速度。在此范例实施例中,实体程序化单元为程序化的最小单元。即,实体程序化单元为写入数据的最小单元。例如,实体程序化单元为实体页面或是实体扇(sector)。在本范例实施例中,实体程序化单元为实体页面,并且每一个实体程序化单元包括数据比特区与冗余比特区。数据比特区包含多个实体扇,用以存储使用者的数据,而冗余比特区用以存储系统的数据(例如,校验码)。在本范例实施例中,每一个数据比特区包含32个实体扇,且一个实体扇的大小为512字节(byte,B)。然而,在其他范例实施例中,数据比特区中也可包含8个、16个或数目更多或更少的实体扇,本发明并不限制实体扇的大小以及个数。More specifically, each physical erasing unit includes a plurality of word lines and a plurality of bit lines, and a storage unit is arranged at the intersection of each word line and each bit line. Each memory cell can store one or more bits. In the same physical erasing unit, all storage units will be erased together. In this exemplary embodiment, the physical erasing unit is the smallest unit of erasing. That is, each physical erase unit contains a minimum number of memory cells that are erased. For example, the physical erasing unit is a physical block. On the other hand, storage units on the same word line will form one or more physical programming units. If each storage unit can store more than 2 bits, the physical programming units on the same word line can be classified into lower physical programming units and upper physical programming units. Generally speaking, the writing speed of the lower physical programming unit is greater than that of the upper physical programming unit. In this exemplary embodiment, the entity programming unit is the smallest unit of programming. That is, the entity programming unit is the smallest unit for writing data. For example, the entity programming unit is an entity page or an entity sector. In this exemplary embodiment, the physical programming unit is a physical page, and each physical programming unit includes a data bit area and a redundant bit area. The data bit area includes a plurality of physical sectors for storing user data, and the redundant bit area is used for storing system data (eg, check code). In this exemplary embodiment, each data bit area includes 32 physical sectors, and the size of one physical sector is 512 bytes (byte, B). However, in other exemplary embodiments, the data bit area may also include 8, 16 or more or less physical sectors, and the present invention does not limit the size and number of physical sectors.

在本范例实施例中,可复写式非易失性存储器模块106为多阶存储单元(MultiLevel Cell,MLC)NAND型快闪存储器模块,即一个存储单元中可存储至少2个比特。然而,本发明不限于此,可复写式非易失性存储器模块106也可是单阶存储单元(Single LevelCell,SLC)NAND型快闪存储器模块、复数阶存储单元(Trinary Level Cell,TLC)NAND型快闪存储器模块、其他快闪存储器模块或其他具有相同特性的存储器模块。In this exemplary embodiment, the rewritable non-volatile memory module 106 is a multi-level cell (MultiLevel Cell, MLC) NAND flash memory module, that is, at least 2 bits can be stored in one memory cell. However, the present invention is not limited thereto, and the rewritable nonvolatile memory module 106 may also be a single-level memory cell (Single Level Cell, SLC) NAND flash memory module, a complex number-level memory cell (Trinary Level Cell, TLC) NAND type Flash memory modules, other flash memory modules, or other memory modules with the same characteristics.

图3示出本发明的一范例实施例的存储器控制电路单元的概要方块图。FIG. 3 shows a schematic block diagram of a memory control circuit unit according to an exemplary embodiment of the present invention.

请参照图3,存储器控制电路单元104包括存储器管理电路202、主机接口204与存储器接口206。Referring to FIG. 3 , the memory control circuit unit 104 includes a memory management circuit 202 , a host interface 204 and a memory interface 206 .

存储器管理电路202用以控制存储器控制电路单元104的整体操作。具体来说,存储器管理电路202具有多个控制指令,并且在存储器存储装置100操作时,此些控制指令会被执行以进行数据的写入、读取与抹除等操作。以下说明存储器管理电路202的操作时,等同于说明存储器控制电路单元104的操作,以下并不再赘述。The memory management circuit 202 is used to control the overall operation of the memory control circuit unit 104 . Specifically, the memory management circuit 202 has a plurality of control instructions, and when the memory storage device 100 is operating, these control instructions are executed to perform operations such as writing, reading, and erasing data. The following description of the operation of the memory management circuit 202 is equivalent to the description of the operation of the memory control circuit unit 104 , which will not be repeated below.

在本范例实施例中,存储器管理电路202的控制指令是以固件形式来实作。例如,存储器管理电路202具有微处理器单元(未示出)与只读存储器(未示出),并且此些控制指令是被烧录至此只读存储器中。当存储器存储装置100操作时,此些控制指令会由微处理器单元来执行以进行数据的写入、读取与抹除等操作。In this exemplary embodiment, the control commands of the memory management circuit 202 are implemented in the form of firmware. For example, the memory management circuit 202 has a microprocessor unit (not shown) and a read-only memory (not shown), and these control instructions are burned into the read-only memory. When the memory storage device 100 is operating, these control instructions are executed by the microprocessor unit to perform operations such as writing, reading, and erasing data.

在本发明另一范例实施例中,存储器管理电路202的控制指令也可以程序码形式存储于可复写式非易失性存储器模块106的特定区域(例如,存储器模块106中专用于存放系统数据的系统区)中。此外,存储器管理电路202具有微处理器单元(未示出)、只读存储器(未示出)及随机存取存储器(未示出)。特别是,此只读存储器具有开机码(boot code),并且当存储器控制电路单元104被使能时,微处理器单元会先执行此开机码来将存储于可复写式非易失性存储器模块106中的控制指令载入至存储器管理电路202的随机存取存储器中。之后,微处理器单元会运作此些控制指令以进行数据的写入、读取与抹除等操作。In another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 may also be stored in a specific area of the rewritable non-volatile memory module 106 in the form of program codes (for example, in the memory module 106 dedicated to storing system data system area). In addition, the memory management circuit 202 has a microprocessor unit (not shown), a read only memory (not shown) and a random access memory (not shown). In particular, the ROM has a boot code (boot code), and when the memory control circuit unit 104 is enabled, the microprocessor unit will first execute the boot code to store in the rewritable non-volatile memory module The control instructions in 106 are loaded into the random access memory of the memory management circuit 202 . Afterwards, the microprocessor unit will execute these control instructions to perform operations such as writing, reading and erasing data.

此外,在本发明另一范例实施例中,存储器管理电路202的控制指令也可以一硬件形式来实作。例如,存储器管理电路202包括微控制器、存储器管理单元、存储器写入单元、存储器读取单元、存储器抹除单元与数据处理单元。存储器管理单元、存储器写入单元、存储器读取单元、存储器抹除单元与数据处理单元是电连接至微控制器。其中,存储器管理单元用以管理可复写式非易失性存储器模块106的实体抹除单元;存储器写入单元用以对可复写式非易失性存储器模块106下达写入指令以将数据写入至可复写式非易失性存储器模块106中;存储器读取单元用以对可复写式非易失性存储器模块106下达读取指令以从可复写式非易失性存储器模块106中读取数据;存储器抹除单元用以对可复写式非易失性存储器模块106下达抹除指令以将数据从可复写式非易失性存储器模块106中抹除;而数据处理单元用以处理欲写入至可复写式非易失性存储器模块106的数据以及从可复写式非易失性存储器模块106中读取的数据。In addition, in another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 may also be implemented in a hardware form. For example, the memory management circuit 202 includes a microcontroller, a memory management unit, a memory writing unit, a memory reading unit, a memory erasing unit and a data processing unit. The memory management unit, the memory writing unit, the memory reading unit, the memory erasing unit and the data processing unit are electrically connected to the microcontroller. Wherein, the memory management unit is used to manage the physical erasing unit of the rewritable non-volatile memory module 106; the memory write unit is used to issue a write command to the rewritable non-volatile memory module 106 to write data In the rewritable non-volatile memory module 106; the memory reading unit is used to issue a read instruction to the rewritable non-volatile memory module 106 to read data from the rewritable non-volatile memory module 106 ; The memory erasing unit is used to issue an erase command to the rewritable non-volatile memory module 106 to erase data from the rewritable non-volatile memory module 106; and the data processing unit is used to process the write-in Data to the rewritable nonvolatile memory module 106 and data read from the rewritable nonvolatile memory module 106 .

主机接口204是电连接至存储器管理电路202并且用以接收与识别主机系统1000所传送的指令与数据。也就是说,主机系统1000所传送的指令与数据会通过主机接口204来传送至存储器管理电路202。在本范例实施例中,主机接口204是兼容于SATA标准。然而,必须了解的是本发明不限于此,主机接口204也可以是兼容于PATA标准、IEEE1394标准、PCIExpress标准、USB标准、SD标准、UHS-I标准、UHS-II标准、MS标准、MMC标准、eMMC标准、UFS标准、CF标准、IDE标准或其他适合的数据传输标准。The host interface 204 is electrically connected to the memory management circuit 202 and is used for receiving and identifying commands and data transmitted by the host system 1000 . That is to say, the commands and data transmitted by the host system 1000 are transmitted to the memory management circuit 202 through the host interface 204 . In this exemplary embodiment, the host interface 204 is compatible with the SATA standard. However, it must be understood that the present invention is not limited thereto, and the host interface 204 may also be compatible with PATA standard, IEEE1394 standard, PCIExpress standard, USB standard, SD standard, UHS-I standard, UHS-II standard, MS standard, MMC standard , eMMC standard, UFS standard, CF standard, IDE standard or other suitable data transmission standards.

存储器接口206是电连接至存储器管理电路202并且用以存取可复写式非易失性存储器模块106。也就是说,欲写入至可复写式非易失性存储器模块106的数据会经由存储器接口206转换为可复写式非易失性存储器模块106所能接受的格式。The memory interface 206 is electrically connected to the memory management circuit 202 and used for accessing the rewritable non-volatile memory module 106 . That is to say, the data to be written into the rewritable nonvolatile memory module 106 will be converted into a format acceptable to the rewritable nonvolatile memory module 106 via the memory interface 206 .

在本发明的一范例实施例中,存储器控制电路单元104还包括缓冲存储器252、电源管理电路254与错误检查与校正电路256。In an exemplary embodiment of the present invention, the memory control circuit unit 104 further includes a buffer memory 252 , a power management circuit 254 and an error checking and correction circuit 256 .

缓冲存储器252是电连接至存储器管理电路202并且用以暂存来自于主机系统1000的数据与指令或来自于可复写式非易失性存储器模块106的数据。The buffer memory 252 is electrically connected to the memory management circuit 202 and used for temporarily storing data and instructions from the host system 1000 or data from the rewritable non-volatile memory module 106 .

电源管理电路254是电连接至存储器管理电路202并且用以控制存储器存储装置100的电源。The power management circuit 254 is electrically connected to the memory management circuit 202 and used for controlling the power of the memory storage device 100 .

错误检查与校正电路256是电连接至存储器管理电路202并且用以执行错误检查与校正程序以确保数据的正确性。具体来说,当存储器管理电路202从主机系统1000中接收到写入指令时,错误检查与校正电路256会为对应此写入指令的数据产生对应的校验码,并且存储器管理电路202会将对应此写入指令的数据与对应的校验码写入至可复写式非易失性存储器模块106中。例如,此校验码包括错误更正码(error correcting code,ECC code)与错误检测码(error detecting code,EDC code)的至少其中之一。此外,此校验码还可以包括任意可以用来对数据的正确性进行验证的码,本发明不加以限制。之后,当存储器管理电路202从可复写式非易失性存储器模块106中读取数据时会同时读取此数据对应的校验码,并且错误检查与校正电路256会依据此校验码对所读取的数据执行错误检查与校正程序。The error checking and correcting circuit 256 is electrically connected to the memory management circuit 202 and used for executing error checking and correcting procedures to ensure the correctness of data. Specifically, when the memory management circuit 202 receives a write command from the host system 1000, the error checking and correction circuit 256 will generate a corresponding check code for the data corresponding to the write command, and the memory management circuit 202 will The data corresponding to the write command and the corresponding check code are written into the rewritable non-volatile memory module 106 . For example, the check code includes at least one of an error correcting code (ECC code) and an error detecting code (EDC code). In addition, the check code may also include any code that can be used to verify the correctness of the data, which is not limited in the present invention. Afterwards, when the memory management circuit 202 reads data from the rewritable non-volatile memory module 106, it will read the check code corresponding to the data at the same time, and the error checking and correction circuit 256 will check all the data according to the check code. The read data is subjected to error checking and correction procedures.

图4示出本发明的一范例实施例的管理可复写式非易失性存储器模块的范例示意图。FIG. 4 shows an exemplary schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention.

必须了解的是,在此描述可复写式非易失性存储器模块106的实体抹除单元的操作时,以“提取”、“分组”、“划分”、“关联”等词来操作实体抹除单元是逻辑上的概念。也就是说,可复写式非易失性存储器模块106的实体抹除单元的实际位置并未更动,而是逻辑上对可复写式非易失性存储器模块106的实体抹除单元进行操作。It must be understood that when describing the operation of the physical erasing unit of the rewritable non-volatile memory module 106, words such as "extract", "group", "divide", and "associate" are used to operate the physical erase. A unit is a logical concept. That is to say, the actual position of the physical erasing unit of the rewritable non-volatile memory module 106 is not changed, but the physical erasing unit of the rewritable non-volatile memory module 106 is logically operated.

请参照图4,存储器管理电路202可将可复写式非易失性存储器模块106的实体抹除单元304(0)~304(R)逻辑地划分为多个区域,例如为存储区402与系统区406。Please refer to FIG. 4, the memory management circuit 202 can logically divide the physical erasing units 304(0)-304(R) of the rewritable non-volatile memory module 106 into multiple areas, for example, the storage area 402 and the system District 406.

存储区402的实体抹除单元是用以存储来自主机系统1000的数据。存储区402中会存储有效数据与无效数据。例如,当主机系统要删除一份有效数据时,被删除的数据可能还是存储在存储区402中,但会被标记为无效数据。没有存储有效数据的实体抹除单元也被称为闲置实体抹除单元。没有存储有效数据的实体程序化单元也被称为闲置实体程序化单元。例如,被抹除以后的实体抹除单元便会成为闲置实体抹除单元。若存储区402或系统区406中有实体抹除单元损坏时,存储区402中的实体抹除单元也可以用来替换损坏的实体抹除单元。倘若存储区402中没有可用的实体抹除单元来替换损坏的实体抹除单元时,则存储器管理电路202会将整个存储器存储装置100宣告为写入保护(write protect)状态,而无法再写入数据。The physical erase unit of the storage area 402 is used to store data from the host system 1000 . Valid data and invalid data are stored in the storage area 402 . For example, when the host system wants to delete a piece of valid data, the deleted data may still be stored in the storage area 402, but it will be marked as invalid data. A physical erasing unit that does not store valid data is also called an idle physical erasing unit. Physical programming units that do not store valid data are also referred to as idle physical programming units. For example, the erased physical erasing unit becomes an idle physical erasing unit. If a physical erasing unit in the storage area 402 or the system area 406 is damaged, the physical erasing unit in the storage area 402 can also be used to replace the damaged physical erasing unit. If there is no available physical erasing unit in the storage area 402 to replace the damaged physical erasing unit, the memory management circuit 202 will declare the entire memory storage device 100 as a write-protected (write protect) state, and can no longer write data.

系统区406的实体抹除单元是用以记录系统数据,其中此系统数据包括关于存储器芯片的制造商与型号、存储器芯片的实体抹除单元数、每一实体抹除单元的实体程序化单元数等。The physical erasing unit of the system area 406 is used to record system data, wherein the system data includes the manufacturer and model of the memory chip, the number of physical erasing units of the memory chip, and the number of physical programming units of each physical erasing unit Wait.

存储区402与系统区406的实体抹除单元的数量会依据不同的存储器规格而有所不同。此外,必须了解的是,在存储器存储装置100的操作中,实体抹除单元关联至存储区402与系统区406的分组关系会动态地变动。例如,当系统区406中的实体抹除单元损坏而被存储区402的实体抹除单元取代时,则原本在存储区402的实体抹除单元会被关联至系统区406。The number of physical erasing units in the storage area 402 and the system area 406 varies according to different memory specifications. In addition, it must be understood that during the operation of the memory storage device 100 , the grouping relationship of the physical erasing unit associated with the storage area 402 and the system area 406 will change dynamically. For example, when the physical erasing unit in the system area 406 is damaged and replaced by the physical erasing unit in the storage area 402 , the original physical erasing unit in the storage area 402 will be associated with the system area 406 .

存储器管理电路202会配置逻辑地址410(0)~410(D)以映射至存储区402中部分的实体抹除单元304(0)~304(A)。主机系统1000是通过逻辑地址410(0)~410(D)来存取存储区402中的数据。在此范例实施例中,一个逻辑地址是映射至一个实体扇,多个逻辑地址会组成一个逻辑程序化单元,并且多个逻辑程序化单元会组成一个逻辑抹除单元。一个逻辑程序化单元可以是映射至一或多个实体程序化单元,而一个逻辑抹除单元可以是映射至一或多个实体抹除单元。The memory management circuit 202 configures the logical addresses 410(0)˜410(D) to be mapped to some of the physical erasing units 304(0)˜304(A) in the storage area 402 . The host system 1000 accesses the data in the storage area 402 through logical addresses 410(0)˜410(D). In this exemplary embodiment, one logical address is mapped to one physical sector, multiple logical addresses form a logical programming unit, and multiple logical programming units form a logical erasing unit. A logical programming unit may be mapped to one or more physical programming units, and a logical erasing unit may be mapped to one or more physical erasing units.

存储器管理电路202会接收来自主机系统1000的写入指令。此写入指令指示将一数据写入至一或多个逻辑单元。在本范例实施例中,一个逻辑单元是指逻辑地址410(0)~410(D)中的一个逻辑地址(也称为第一逻辑地址)。第一逻辑地址属于一或多个第一逻辑程序化单元,并且第一逻辑程序化单元映射至存储区402的一或多个第一实体程序化单元。然而,在另一范例实施例中,一个逻辑单元也可以是指一个逻辑程序化单元(例如,第一逻辑程序化单元)。在将数据写入至第一实体程序化单元之前,存储器管理电路202会判断第一实体程序化单元所属的实体抹除单元(也称为第一实体抹除单元)是第一类实体抹除单元或第二类实体程序化单元。其中,第一类实体抹除单元的比特错误率(bit error rate,第一类实体抹除单元的比特错误率也称为第一比特错误率)会低于第二类实体程序化单元的比特错误率(也称为第二比特错误率)。实体抹除单元的比特错误率指的是存储在此实体抹除单元中的数据被读取后,错误比特在所读取出的数据中所占的比例。在一范例实施例中,也可将第二类实体程序化单元称为高错误率实体程序化单元。The memory management circuit 202 receives a write command from the host system 1000 . The write command indicates to write a data to one or more logical units. In this exemplary embodiment, a logical unit refers to a logical address (also referred to as a first logical address) among the logical addresses 410(0)˜410(D). The first logical address belongs to one or more first logical programming units, and the first logical programming units are mapped to one or more first physical programming units of the memory area 402 . However, in another exemplary embodiment, a logic unit may also refer to a logic programming unit (eg, the first logic programming unit). Before writing data into the first physical programming unit, the memory management circuit 202 will determine that the physical erasing unit (also referred to as the first physical erasing unit) to which the first physical programming unit belongs is the first type of physical erasing unit. unit or second-class entity programmatic unit. Among them, the bit error rate (bit error rate of the first type of physical erasing unit, the bit error rate of the first type of physical erasing unit is also called the first bit error rate) will be lower than that of the second type of physical programming unit. Error rate (also known as the second bit error rate). The bit error rate of the physical erasing unit refers to the proportion of error bits in the read data after the data stored in the physical erasing unit is read. In an exemplary embodiment, the second type of physical programming unit may also be called a high error rate physical programming unit.

在一范例实施例中,存储器管理电路202会判断第一实体抹除单元的比特错误率评估值是否符合门槛条件。若第一实体抹除单元的比特错误率评估值不符合门槛条件,存储器管理电路202会判定第一实体抹除单元属于第一类实体抹除单元。若第一实体抹除单元的比特错误率评估值符合门槛条件,则存储器管理电路202会判定第一实体抹除单元属于第二类实体抹除单元。例如,在一范例实施例中,一个实体抹除单元的比特错误率评估值具有两种状态,分别是“0”或“1”。只有当一个实体抹除单元的比特错误率评估值是“1”时,存储器管理电路202会判定此实体抹除单元的比特错误率评估值符合门槛条件。In an exemplary embodiment, the memory management circuit 202 determines whether the evaluation value of the bit error rate of the first physical erasing unit meets a threshold condition. If the bit error rate evaluation value of the first physical erasing unit does not meet the threshold condition, the memory management circuit 202 determines that the first physical erasing unit belongs to the first type of physical erasing unit. If the bit error rate evaluation value of the first physical erasing unit meets the threshold condition, the memory management circuit 202 determines that the first physical erasing unit belongs to the second type of physical erasing unit. For example, in an exemplary embodiment, the bit error rate evaluation value of a physical erasing unit has two states, which are "0" or "1". Only when the estimated bit error rate of a physical erasing unit is "1", the memory management circuit 202 determines that the estimated bit error rate of the physical erasing unit meets the threshold condition.

此外,在另一范例实施例中,一个实体抹除单元的比特错误率评估值则可以具有两种以上的状态,并且每一种状态与此实体抹除单元的比特错误率有关。在一范例实施例中,比特错误率评估值可以是0~100中的任一个数值。一个实体抹除单元的比特错误率评估值越高,表示此实体抹除单元的比特错误率越高。一个实体抹除单元的比特错误率评估值越低,表示此实体抹除单元的比特错误率越低。只有当实体抹除单元的比特错误率评估值达到一个门槛值(例如,70)时,存储器管理电路202会判定此实体抹除单元的比特错误率评估值符合门槛条件。此外,比特错误率评估值也可以是以任意的形式来表示,而不限于上述。Furthermore, in another exemplary embodiment, the bit error rate evaluation value of a physical erasing unit may have more than two states, and each state is related to the bit error rate of the physical erasing unit. In an exemplary embodiment, the evaluation value of the bit error rate may be any value in the range of 0-100. The higher the bit error rate evaluation value of a physical erasing unit is, the higher the bit error rate of the physical erasing unit is. The lower the bit error rate evaluation value of a physical erasing unit is, the lower the bit error rate of the physical erasing unit is. Only when the estimated bit error rate of the physical erasing unit reaches a threshold (for example, 70), the memory management circuit 202 determines that the estimated bit error rate of the physical erasing unit meets the threshold condition. In addition, the bit error rate evaluation value may also be expressed in any form, and is not limited to the above.

一般来说,实体抹除单元的比特错误率与实体抹除单元的抹除次数、写入次数及读取次数呈正相关(positive correlation)。其中,实体抹除单元的抹除次数、写入次数及读取次数分别指的是实体抹除单元被抹除、写入及读取过的次数。一个实体抹除单元的抹除次数、写入次数及读取次数的至少其中之一越高,则存储在此实体抹除单元中的数据被读取时所包含的错误比特的数量可能会越多。其中,又以抹除次数对于实体抹除单元的比特错误率的影响最大。此外,在某些情况下,实体抹除单元的比特错误率也可能会与实体抹除单元的数据存放时间及/或温度有关。实体抹除单元的数据存放时间指的是数据被存储在实体抹除单元内多久了,并且可以是取一个实体抹除单元中的每一笔数据的存放时间中的最大者或平均值,且不限于此。此外,可复写式非易失性存储器模块106中的各个实体抹除单元的温度可能相同也可以不同,但通常会有些微差异。Generally, the bit error rate of the physical erasing unit is positively correlated with the times of erasing, writing and reading of the physical erasing unit. Wherein, the times of erasing, writing and reading of the physical erasing unit refer to the times of erasing, writing and reading of the physical erasing unit respectively. The higher at least one of the erasing times, the writing times and the reading times of a physical erasing unit is, the higher the number of error bits may be when the data stored in the physical erasing unit is read. many. Among them, the number of times of erasing has the greatest impact on the bit error rate of the physical erasing unit. In addition, in some cases, the bit error rate of the physical erasing unit may also be related to the data storage time and/or temperature of the physical erasing unit. The data storage time of the physical erasing unit refers to how long the data has been stored in the physical erasing unit, and can be the maximum or the average value of the storage time of each piece of data in a physical erasing unit, and Not limited to this. In addition, the temperature of each physical erasing unit in the rewritable non-volatile memory module 106 may be the same or different, but usually slightly different.

当一个实体抹除单元的抹除次数、写入次数及读取次数至少其中之一超过一预设次数、一个实体抹除单元的数据存放时间超过一预设时间及/或一个实体抹除单元的温度超出一预设温度范围时,存储在此实体抹除单元中的数据被读取时所包含的错误比特数及/或错误比特率会大幅升高,并且有很高的机率会超过错误检查与校正电路256所能够检测及/或校正的错误比特的最大数量。因此,在一范例实施例中,存储器管理电路202可以根据一个实体抹除单元的抹除次数信息、写入次数信息、读取次数信息、错误比特数信息、错误比特率信息、数据存放时间信息及温度信息的至少其中之一或至少二者的组合,来决定此实体抹除单元的比特错误率评估值。例如,在一范例实施例中,根据抹除次数信息,存储器管理电路202会判断第一实体抹除单元的抹除次数是否超过一预设次数。此预设次数例如是由厂商预先设定或由使用者自行设定。例如,此预设次数可以是3000次或者更多或更少。当第一实体抹除单元的抹除次数超过此预设次数时,存储器管理电路202会将第一实体抹除单元的比特错误率评估值设为“1”或相对应的任意数值。反之,当第一实体抹除单元的抹除次数没有超过此预设次数时,则存储器管理电路202会将第一实体抹除单元的比特错误率评估值设为“0”或相对应的任意数值。When at least one of the erasing times, writing times and reading times of a physical erasing unit exceeds a preset number of times, the data storage time of a physical erasing unit exceeds a preset time and/or a physical erasing unit When the temperature exceeds a preset temperature range, the number of error bits and/or the error bit rate contained in the data stored in the physical erasing unit will increase significantly when the data is read, and there is a high probability that it will exceed the error bit rate. The maximum number of erroneous bits that the check and correct circuitry 256 is capable of detecting and/or correcting. Therefore, in an exemplary embodiment, the memory management circuit 202 can, according to the erasure count information, write count information, read count information, error bit number information, error bit rate information, and data storage time information of a physical erasing unit and temperature information to determine the bit error rate evaluation value of the physical erasing unit. For example, in an exemplary embodiment, according to the erase count information, the memory management circuit 202 determines whether the erase count of the first physical erasing unit exceeds a preset count. The default number of times is, for example, preset by the manufacturer or set by the user. For example, the preset number of times may be 3000 or more or less. When the erasing times of the first physical erasing unit exceed the preset times, the memory management circuit 202 sets the bit error rate evaluation value of the first physical erasing unit to “1” or any corresponding value. Conversely, when the erasing times of the first physical erasing unit do not exceed the preset times, the memory management circuit 202 will set the bit error rate evaluation value of the first physical erasing unit to “0” or any corresponding value. value.

换句话说,对于一个全新的可复写式非易失性存储器模块来说,此可复写式非易失性存储器模块中所有的实体抹除单元都会是第一类实体抹除单元。然而,随着此可复写式非易失性存储器模块的使用时间增加,在此可复写式非易失性存储器模块中将会有越来越多的实体抹除单元会因为被执行抹除、写入及/或读取操作的次数增加而成为第二类实体抹除单元。或者,根据数据存储时间增加与温度变化,部分的第一类实体抹除单元也可能会转变为第二类实体抹除单元。换言之,任何会影响实体抹除单元的比特错误率的因素,都可以用来作为判断一个实体抹除单元是第一类实体抹除单元或第二类实体抹除单元的依据。In other words, for a brand new rewritable nonvolatile memory module, all the physical erasing units in the rewritable nonvolatile memory module will be the first type of physical erasing units. However, as the usage time of the rewritable non-volatile memory module increases, more and more entity erasing units in the rewritable non-volatile memory module will be erased, The number of writing and/or reading operations is increased to become the second type of physical erasing unit. Or, according to the increase of data storage time and the change of temperature, part of the first-type physical erasing units may also be transformed into the second-type physical erasing units. In other words, any factor that affects the bit error rate of the physical erasing unit can be used as a basis for judging whether a physical erasing unit is the first type of physical erasing unit or the second type of physical erasing unit.

存储器管理电路202可以将被判定为是第二类实体抹除单元的实体抹除单元纪录在一表格。当存储器管理电路202欲将数据写入至属于第一实体抹除单元的第一实体程序化单元时,存储器管理电路202可以查询此表格,以得知第一实体抹除单元是第一类实体抹除单元或第二类实体抹除单元。此外,存储器管理电路202也可以是以分区或分组的方式,将被判定为是第二类实体抹除单元的实体抹除单元关联至存储区402中的一高错误率区或一高错误率群组,本发明不加以限制。The memory management circuit 202 may record the physical erasing units determined to be the second type of physical erasing units in a table. When the memory management circuit 202 intends to write data into the first physical programming unit belonging to the first physical erasing unit, the memory management circuit 202 can query this table to know that the first physical erasing unit is a first type entity The erasing unit or the second type of entity erasing unit. In addition, the memory management circuit 202 may also associate the physical erasing unit determined as the second type of physical erasing unit with a high error rate area or a high error rate area in the storage area 402 in a partition or grouping manner. group, the present invention is not limited.

根据第一实体抹除单元是第一类实体抹除单元或第二类实体抹除单元,存储器管理电路202会选择性地根据一第一码率(code rate)或一第二码率来将此数据与对应于此数据的校验码编程(programming)至第一实体程序化单元,其中第一码率高于第二码率。例如,当第一实体抹除单元是第一类实体抹除单元时,存储器管理电路202会依据第一码率来将此数据与对应于此数据的校验码编程至第一实体程序化单元。当第一实体抹除单元是第二类实体抹除单元时,则存储器管理电路202会依据第二码率来将此数据与对应于此数据的校验码编程至第一实体程序化单元。在一范例实施例中,编程也可被称为写入。也就是说,将一笔数据编程至一个实体程序化单元,等同于将一笔数据写入至一个实体程序化单元。According to whether the first physical erasing unit is a first-type physical erasing unit or a second-type physical erasing unit, the memory management circuit 202 will selectively perform a code rate according to a first code rate or a second code rate The data and the check code corresponding to the data are programmed to the first physical programming unit, wherein the first code rate is higher than the second code rate. For example, when the first physical erasing unit is the first type of physical erasing unit, the memory management circuit 202 will program the data and the check code corresponding to the data into the first physical programming unit according to the first code rate . When the first physical erasing unit is the second type of physical erasing unit, the memory management circuit 202 programs the data and the check code corresponding to the data into the first physical programming unit according to the second code rate. In an example embodiment, programming may also be referred to as writing. That is to say, programming a piece of data into a physical programming unit is equivalent to writing a piece of data into a physical programming unit.

详细而言,存储器管理电路202会将欲写入的数据分成一或多个数据段并且控制检查与校正电路256产生一或多个校验码段,其中每一个校验码段对应于一个数据段。在此,一个数据段是用来产生一个校验码段的单位,并且一个校验码段是用来对其对应的数据段进行验证及/或校正。举例来说,假设k是一个数据段的数据长度,并且n-k是对应于此数据段的校验码段的数据长度,则k与n的比值(即,k/n)可称为码率。特别是,若欲写入的数据的数据长度符合一个数据段的数据长度,则此数据本身就是一个数据段,并且对应于此数据的校验码就是对应于此数据段的校验码段。若欲写入的数据的数据长度符合多个数据段的数据长度的总和,则此数据可以被分为多个数据段,并且对应于此数据的校验码会包括对应于此些数据段的多个校验码段。In detail, the memory management circuit 202 divides the data to be written into one or more data segments and controls the check and correction circuit 256 to generate one or more check code segments, wherein each check code segment corresponds to a data segment part. Here, a data segment is a unit used to generate a check code segment, and a check code segment is used to verify and/or correct its corresponding data segment. For example, assuming that k is the data length of a data segment, and n-k is the data length of a parity code segment corresponding to this data segment, the ratio of k to n (ie, k/n) can be called a code rate. In particular, if the data length of the data to be written matches the data length of a data segment, the data itself is a data segment, and the check code corresponding to the data is the check code segment corresponding to the data segment. If the data length of the data to be written conforms to the sum of the data lengths of multiple data segments, the data can be divided into multiple data segments, and the check code corresponding to this data will include corresponding to these data segments Multiple checksum segments.

在本范例实施例中,当第一实体抹除单元是第一类实体抹除单元时,存储器管理电路202是根据预设的数据段的数据长度与校验码段的数据长度(即,第一码率)来将欲写入的数据与对应的校验码写入至第一实体程序化单元。In this exemplary embodiment, when the first physical erasing unit is the first type of physical erasing unit, the memory management circuit 202 performs the operation according to the preset data length of the data segment and the data length of the check code segment (that is, the first A code rate) to write the data to be written and the corresponding check code into the first physical programming unit.

图5示出本发明的一范例实施例根据第一码率将数据与对应于此数据的校验码至实体程序化单元的范例示意图。FIG. 5 shows an exemplary schematic diagram of sending data and a check code corresponding to the data to a physical programming unit according to a first code rate according to an exemplary embodiment of the present invention.

请参照图5,假设来自主机系统1000的写入指令指示将数据501写入至逻辑地址410(0)。例如,数据501的数据长度是4KB(1KB=1024bytes)。假设逻辑地址410(0)属于逻辑程序化单元510(0),则存储器管理电路202会将数据501写入至逻辑程序化单元510(0)。逻辑程序化单元510(0)映射至实体程序化单元512(0)。当实体程序化单元512(0)所属的实体抹除单元304(0)是第一类实体抹除单元时,基于数据501的数据长度,存储器管理电路202会将数据501分为数据段501_1~501_4。例如,每一个数据段501_1~501_4的数据长度是1KB。检查与校正电路256会产生对应于数据段501_1~501_4的校验码段502_1~502_4。例如,每一个校验码段502_1~502_4的数据长度是70B(1B=1bytes)。也就是说,当一个数据长度是1KB的数据段被读取时,此数据段可以被依据数据长度是70B的校验码段来进行验证及/或校正。存储器管理电路202会根据一预设规则将数据段501_1~501_4与校验码段502_1~502_4写入至实体程序化单元512(0)。例如,在本范例实施例中,每一个存储校验码段的实体地址范围是继续于存储此校验码段所对应的数据段的实体地址范围(如图5所示)。然而,在另一范例实施例中,所有的数据段与校验码段也可以是被分开地存储。例如,将所有的数据段存储在存放使用者数据的实体地址范围,并且将所有的校验码段存储在存放冗余数据的实体地址范围。Referring to FIG. 5 , assume that the write command from the host system 1000 indicates to write data 501 to the logical address 410 (0). For example, the data length of the data 501 is 4KB (1KB=1024bytes). Assuming that the logical address 410(0) belongs to the logical programming unit 510(0), the memory management circuit 202 will write the data 501 into the logical programming unit 510(0). Logical programming unit 510(0) maps to physical programming unit 512(0). When the physical erasing unit 304(0) to which the physical programming unit 512(0) belongs is the first type of physical erasing unit, based on the data length of the data 501, the memory management circuit 202 divides the data 501 into data segments 501_1~ 501_4. For example, the data length of each data segment 501_1-501_4 is 1KB. The checking and correcting circuit 256 generates check code segments 502_1 - 502_4 corresponding to the data segments 501_1 - 501_4 . For example, the data length of each check code segment 502_1˜502_4 is 70B (1B=1bytes). That is to say, when a data segment with a data length of 1KB is read, the data segment can be verified and/or corrected according to a check code segment with a data length of 70B. The memory management circuit 202 writes the data segments 501_1 - 501_4 and the check code segments 502_1 - 502_4 into the physical programming unit 512 ( 0 ) according to a preset rule. For example, in this exemplary embodiment, each physical address range for storing the verification code segment is continuous with the physical address range for storing the data segment corresponding to the verification code segment (as shown in FIG. 5 ). However, in another exemplary embodiment, all data segments and check code segments may also be stored separately. For example, all data segments are stored in the physical address range where user data is stored, and all check code segments are stored in the physical address range where redundant data is stored.

另一方面,在本范例实施例中,当第一实体抹除单元是第二类实体抹除单元时,存储器管理电路202会增加每一个数据段所对应的校验码段的数据长度,以根据预设的数据段的数据长度与较长的校验码段的数据长度(即,第二码率)来将欲写入的数据与对应的校验码写入至第一实体程序化单元。On the other hand, in this exemplary embodiment, when the first physical erasing unit is the second type of physical erasing unit, the memory management circuit 202 will increase the data length of the check code segment corresponding to each data segment to Write the data to be written and the corresponding check code into the first physical programming unit according to the preset data length of the data segment and the longer data length of the check code segment (that is, the second code rate). .

图6示出本发明的一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图。FIG. 6 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into a physical programming unit according to a second code rate according to an exemplary embodiment of the present invention.

请参照图6,假设来自主机系统1000的写入指令指示将数据601写入至逻辑地址410(1)。例如,数据501的数据长度是4KB。假设逻辑地址410(1)属于逻辑程序化单元610(0),则存储器管理电路202会将数据601写入至逻辑程序化单元610(0)。逻辑程序化单元610(0)映射至实体程序化单元612(0)。当实体程序化单元612(0)所属的实体抹除单元304(1)是第二类实体抹除单元时,基于数据601的数据长度,存储器管理电路202会将数据601分为数据段601_1~601_4。例如,每一个数据段601_1~601_4的数据长度是1KB。检查与校正电路256会产生对应于数据段601_1~601_4的校验码段602_1~602_4。例如,每一个校验码段602_1~602_4的数据长度是140B。也就是说,在此范例实施例中,每一个校验码段的数据长度是图5的范例实施例中的每一个校验码段的数据长度的2倍,且不限于此。例如,此倍数还可以是3倍、4倍或者更多。存储器管理电路202根据上述预设规则将数据段601_1~601_4与校验码段602_1~602_4写入至实体程序化单元612(0)。也就是说,当一个数据长度是1KB的数据段被读取时,此数据段可以被依据数据长度是140B的校验码段来进行验证及/或校正。藉此,即使用来存储数据的实体抹除单元是第二类实体抹除单元,所读取的数据中更多的错误比特可以被找到及/或更正。例如,在图5的范例实施例中,1个数据长度是1KB的数据段中约有40bits的错误比特可以被找到,而在此范例实施例中,1个数据长度是1KB的数据段中可能有80bits的错误比特可以被找到。Referring to FIG. 6 , assume that the write command from the host system 1000 indicates to write data 601 to the logical address 410(1). For example, the data length of the data 501 is 4KB. Assuming that the logical address 410(1) belongs to the logical programming unit 610(0), the memory management circuit 202 will write the data 601 into the logical programming unit 610(0). Logical programming unit 610(0) maps to physical programming unit 612(0). When the physical erasing unit 304(1) to which the physical programming unit 612(0) belongs is the second type of physical erasing unit, based on the data length of the data 601, the memory management circuit 202 divides the data 601 into data segments 601_1~ 601_4. For example, the data length of each data segment 601_1~601_4 is 1KB. The checking and correcting circuit 256 generates check code segments 602_1 - 602_4 corresponding to the data segments 601_1 - 601_4 . For example, the data length of each check code segment 602_1 - 602_4 is 140B. That is to say, in this exemplary embodiment, the data length of each check code segment is twice the data length of each check code segment in the exemplary embodiment of FIG. 5 , and is not limited thereto. For example, this multiple can also be 3 times, 4 times or more. The memory management circuit 202 writes the data segments 601_1 - 601_4 and the check code segments 602_1 - 602_4 into the physical programming unit 612 ( 0 ) according to the above preset rules. That is to say, when a data segment with a data length of 1KB is read, the data segment can be verified and/or corrected according to a check code segment with a data length of 140B. Thus, even if the physical erasing unit used to store data is the second type of physical erasing unit, more error bits in the read data can be found and/or corrected. For example, in the exemplary embodiment of Fig. 5, 1 data length is that the error bit of 40bits can be found in the data segment of 1KB approximately, and in this exemplary embodiment, 1 data length is that in the data segment of 1KB may There are 80bits of error bits that can be found.

然而,在另一范例实施例中,当第一实体抹除单元是第二类实体抹除单元时,存储器管理电路202不去改变校验码段的数据长度,而是去减少每一个数据段的数据长度,以根据较短的数据段的数据长度与预设的校验码段的数据长度(也即,第二码率)来将欲写入的数据与对应的校验码写入至第一实体程序化单元。However, in another exemplary embodiment, when the first physical erasing unit is the second type of physical erasing unit, the memory management circuit 202 does not change the data length of the check code segment, but reduces each data segment to write the data to be written and the corresponding check code into the A first entity programming unit.

图7示出本发明的另一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图。FIG. 7 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into a physical programming unit according to another exemplary embodiment of the present invention.

请参照图7,假设来自主机系统1000的写入指令指示将数据701写入至逻辑地址410(2)。例如,数据701的数据长度是4KB。假设逻辑地址410(2)属于逻辑程序化单元710(0),则存储器管理电路202会将数据701写入至逻辑程序化单元710(0)。逻辑程序化单元710(0)映射至实体程序化单元712(0)。当实体程序化单元712(0)所属的实体抹除单元304(2)是第二类实体抹除单元时,基于数据701的数据长度,存储器管理电路202会将数据701分为数据段701_1~701_8。例如,每一个数据段701_1~701_8的数据长度是512B。也就是说,在此范例实施例中,每一个数据段的数据长度是图5的范例实施例中的每一个数据段的数据长度的1/2倍,且不限于此。例如,此倍数还可以是1/3倍、1/4倍或者更少。检查与校正电路256会产生对应于数据段701_1~701_8的校验码段702_1~702_8。例如,每一个校验码段702_1~702_8的数据长度是70B。存储器管理电路202根据上述预设规则将数据段701_1~701_8与校验码段702_1~702_8写入至实体程序化单元712(0)。也就是说,当一个数据长度是512B的数据段被读取时,此数据段可以被依据数据长度是70B的校验码段来进行验证及/或校正。藉此,即使用来存储数据的实体抹除单元是第二类实体抹除单元,所读取的数据中更多的错误比特可以被找到及/或更正。例如,在图5的范例实施例中,1个数据长度是1KB的数据段中约有40bits的错误比特可以被找到,而在此范例实施例中,1个数据长度是512B的数据段中可能有40bits的错误比特可以被找到。以此类推,在数据长度的总和是1KB的2个数据段中,就可能有80bits的错误比特可以被找到。Referring to FIG. 7 , assume that the write command from the host system 1000 indicates to write data 701 to the logical address 410 ( 2 ). For example, the data length of data 701 is 4KB. Assuming that the logical address 410(2) belongs to the logical programming unit 710(0), the memory management circuit 202 will write the data 701 into the logical programming unit 710(0). Logical programming unit 710(0) maps to physical programming unit 712(0). When the physical erasing unit 304(2) to which the physical programming unit 712(0) belongs is the second type of physical erasing unit, based on the data length of the data 701, the memory management circuit 202 divides the data 701 into data segments 701_1~ 701_8. For example, the data length of each data segment 701_1-701_8 is 512B. That is to say, in this exemplary embodiment, the data length of each data segment is 1/2 times the data length of each data segment in the exemplary embodiment of FIG. 5 , and is not limited thereto. For example, this multiple can also be 1/3 times, 1/4 times or less. The checking and correcting circuit 256 generates check code segments 702_1 - 702_8 corresponding to the data segments 701_1 - 701_8 . For example, the data length of each check code segment 702_1 - 702_8 is 70B. The memory management circuit 202 writes the data segments 701_1 - 701_8 and the check code segments 702_1 - 702_8 into the physical programming unit 712 ( 0 ) according to the above preset rules. That is to say, when a data segment with a data length of 512B is read, the data segment can be verified and/or corrected according to a check code segment with a data length of 70B. Thus, even if the physical erasing unit used to store data is the second type of physical erasing unit, more error bits in the read data can be found and/or corrected. For example, in the exemplary embodiment of Fig. 5, about 40 bits of erroneous bits can be found in a data segment whose data length is 1KB, and in this exemplary embodiment, may be found in a data segment whose data length is 512B There are 40bits of error bits that can be found. By analogy, in two data segments whose total data length is 1KB, there may be 80 bits of error bits that can be found.

值得一提的是,若根据上述码率的定义(即,k/n),则图5的范例实施例中的第一码率可以是以1024/(1024+70)来表示,图6的范例实施例中的第二码率可以是以1024/(1024+140)来表示,并且图7的范例实施例中的第二码率可以是以512/(512+70)来表示。也就是说,当一个实体抹除单元的比特错误率提高至无法使用预设的错误检测机制来检错时,通过使用较低的码率来对欲写入至此实体抹除单元的数据进行编码,此实体抹除单元仍然可以继续使用,而不需要马上将其视为无法使用或损坏的实体抹除单元。It is worth mentioning that, according to the definition of the above code rate (that is, k/n), the first code rate in the exemplary embodiment of FIG. 5 can be represented by 1024/(1024+70), and the The second code rate in the exemplary embodiment may be represented by 1024/(1024+140), and the second code rate in the exemplary embodiment of FIG. 7 may be represented by 512/(512+70). That is to say, when the bit error rate of a physical erasing unit is increased to the point that the preset error detection mechanism cannot be used to detect errors, by using a lower code rate to encode the data to be written into this physical erasing unit, This physical erasing unit can still continue to be used, and it does not need to be immediately regarded as an unusable or damaged physical erasing unit.

值得一提的是,在图5的范例实施例中,只需要一个实体程序化单元就可以完整的存储数据长度不超过一个逻辑程序化单元的容量大小的数据与此数据所对应的校验码。例如,假设实体程序化单元512(0)的容量大小是8KB,则只要数据501的数据长度不超过8KB,则数据501与对应于数据501的校验码就可以被完整的写入至实体程序化单元512(0)。在根据第二码率来写入数据与对应于此数据的校验码的另一实施例中,假设实体程序化单元512(0)的容量大小是16KB,则只要数据501的数据长度不超过16KB,则数据501与对应于数据501的校验码就可以被完整的写入至实体程序化单元512(0)。此外,实体程序化单元的容量大小还可以是32KB或者更大,而不限于此。然而,在图6与图7的范例实施例中,欲写入的数据的数据长度不变,但是对应于此数据的校验码的数据长度增加了,因此,在某些例子中,即使欲写入的数据的数据长度没有超过一个逻辑程序化单元的容量大小,但是此数据的数据长度与对应于此数据的校验码的数据长度的总和仍有可能会超过一个实体程序化单元的容量大小。在此情况下,存储器管理电路202通常会使用两个或两个以上的实体程序化单元来存储数据与对应于此数据的校验码。也即,将欲写入的数据的一部分(也称为第一部分)写入至第一实体程序化单元,并且将欲写入的数据的另一部分(也称为第二部分)写入至一第二实体程序化单元。例如,假设第一实体程序化单元的容量大小是8KB,则在一范例实施例中,第一实体程序化单元最多可以被用来存储数据长度为7KB的数据与对应的数据长度为980B(即,7×140或者14×70)校验码。若欲写入的数据的数据长度为8KB,则此数据中数据长度为7KB的第一部分数据会被写入至第一实体程序化单元,并且此数据中数据长度为1KB的第二部分数据则会被写入至第二实体程序化单元。例如,第二实体程序化单元可以是属于上述第一实体抹除单元、存储区402中也属于第二类实体抹除单元的任一个实体抹除单元或者任意的实体抹除单元,本发明不加以限制。It is worth mentioning that, in the exemplary embodiment shown in Figure 5, only one physical programming unit is needed to completely store the data whose data length does not exceed the capacity of one logical programming unit and the check code corresponding to this data . For example, assuming that the capacity of the entity programming unit 512(0) is 8KB, as long as the data length of the data 501 does not exceed 8KB, then the data 501 and the check code corresponding to the data 501 can be completely written into the entity program UL unit 512(0). In another embodiment of writing data and a check code corresponding to the data according to the second code rate, assuming that the capacity of the entity programming unit 512(0) is 16KB, as long as the data length of the data 501 does not exceed 16KB, the data 501 and the check code corresponding to the data 501 can be completely written into the physical programming unit 512(0). In addition, the capacity of the entity programming unit may also be 32KB or larger, but is not limited thereto. However, in the exemplary embodiments of FIG. 6 and FIG. 7 , the data length of the data to be written remains unchanged, but the data length of the check code corresponding to the data increases. Therefore, in some examples, even if the desired The data length of the written data does not exceed the capacity of a logical programming unit, but the sum of the data length of this data and the data length of the check code corresponding to this data may still exceed the capacity of a physical programming unit size. In this case, the memory management circuit 202 usually uses two or more physical programming units to store data and a check code corresponding to the data. That is, a part of the data to be written (also referred to as the first part) is written into the first physical programming unit, and another part of the data to be written (also referred to as the second part) is written into a A second entity programmatic unit. For example, assuming that the capacity of the first physical programming unit is 8KB, then in an exemplary embodiment, the first physical programming unit can be used to store data with a data length of 7KB at most and a corresponding data length of 980B (that is, , 7×140 or 14×70) check code. If the data length of the data to be written is 8KB, the first part of the data with a data length of 7KB will be written to the first entity programming unit, and the second part of the data with a data length of 1KB will be will be written to the second physical programming unit. For example, the second physical programming unit may be any physical erasing unit that belongs to the above-mentioned first physical erasing unit, and also belongs to the second type of physical erasing unit in the storage area 402, or any physical erasing unit. The present invention does not be restricted.

在一范例实施例中,存储器管理电路202是以特定的一数据长度作为一个基本管理单位,并且根据此基本管理单位来将数据写入至可复写式非易失性存储器模块106。例如,一个基本管理单位的数据长度是4KB,且不限于此。一个实体程序化单元的容量大小可以是符合一或多个基本管理单位的数据长度。例如,当实体程序化单元的容量大小是8KB时,此实体程序化单元的容量大小符合2个基本管理单位的数据长度。当实体程序化单元的容量大小是16KB时,此实体程序化单元的容量大小符合4个基本管理单位的数据长度,以此类推。以容量大小为8KB的实体程序化单元为例,当欲写入至此实体程序化单元的数据的数据长度不超过一个基本管理单位的数据长度时,存储器管理电路202是以一个基本管理单位来将此数据写入至此实体程序化单元。当欲写入的数据的数据长度超过一个基本管理单位的数据长度并且不超过2个基本管理单位的数据长度时,存储器管理电路202是以二个基本管理单位来将此数据写入至此实体程序化单元。In an exemplary embodiment, the memory management circuit 202 uses a specific data length as a basic management unit, and writes data into the rewritable non-volatile memory module 106 according to the basic management unit. For example, the data length of one basic management unit is 4KB, and is not limited thereto. The capacity of a physical programming unit can be the data length corresponding to one or more basic management units. For example, when the capacity of the physical programming unit is 8KB, the capacity of the physical programming unit corresponds to the data length of 2 basic management units. When the capacity of the physical programming unit is 16KB, the capacity of the physical programming unit corresponds to the data length of 4 basic management units, and so on. Taking the physical programming unit with a capacity of 8KB as an example, when the data length of the data to be written into the physical programming unit does not exceed the data length of a basic management unit, the memory management circuit 202 uses a basic management unit to write This data is written to this entity programmatic unit. When the data length of the data to be written exceeds the data length of one basic management unit and does not exceed the data length of two basic management units, the memory management circuit 202 writes the data into the entity program in two basic management units unit.

在此范例实施例中,假设一个实体程序化单元的容量大小符合N+1个基本管理单位的数据长度,其中N是正整数。例如,N可以是1、3或5,且不限于此。当第一实体程序化单元是第二类实体抹除单元时,存储器管理电路202会判断欲写入的数据的数据长度是否超过N个基本管理单位的数据长度,其中N是视第一实体程序化单元的容量大小而定。例如,当实体程序化单元的容量大小是8KB时,表示此实体程序化单元的容量大小符合2个基本管理单位的数据长度,故N是1。当实体程序化单元的容量大小是16KB时,表示此实体程序化单元的容量大小符合4个基本管理单位的数据长度,故N是3,以此类推。当第一实体抹除单元是第二类实体抹除单元且欲写入的数据的数据长度不超过N个基本管理单位的数据长度时,存储器管理电路202即可仅依据第二码率将欲写入的数据与对应于此数据的校验码写入至第一实体程序化单元。反之,当第一实体抹除单元是第二类实体抹除单元且欲写入的数据的数据长度超过N个基本管理单位的数据长度时,存储器管理电路202会依据第二码率将欲写入的数据的一第一部分与对应于此数据的校验码的一第一部分写入至第一实体程序化单元,并且依据第二码率将欲写入的数据的一第二部分与对应于此数据的校验码的一第二部分写入至第二实体程序化单元。例如,第二实体程序化单元可以是属于上述第一实体抹除单元、存储区402中也属于第二类实体抹除单元的任一个实体抹除单元或者任意的实体抹除单元,本发明不加以限制。In this exemplary embodiment, it is assumed that the capacity of a physical programming unit corresponds to the data length of N+1 basic management units, where N is a positive integer. For example, N may be 1, 3 or 5, and is not limited thereto. When the first physical programming unit is the second type of physical erasing unit, the memory management circuit 202 will judge whether the data length of the data to be written exceeds the data length of N basic management units, where N is the data length of the first physical program Depends on the capacity of the unit. For example, when the capacity of the physical programming unit is 8KB, it means that the capacity of the physical programming unit conforms to the data length of 2 basic management units, so N is 1. When the capacity of the physical programming unit is 16KB, it means that the capacity of the physical programming unit conforms to the data length of 4 basic management units, so N is 3, and so on. When the first physical erasing unit is the second type of physical erasing unit and the data length of the data to be written does not exceed the data length of N basic management units, the memory management circuit 202 can write the data to be written only according to the second code rate. The written data and the verification code corresponding to the data are written into the first physical programming unit. Conversely, when the first physical erasing unit is the second type of physical erasing unit and the data length of the data to be written exceeds the data length of N basic management units, the memory management circuit 202 will write the data to be written according to the second code rate. A first part of the input data and a first part of the verification code corresponding to the data are written into the first physical programming unit, and a second part of the data to be written and corresponding to the verification code are written according to the second code rate A second part of the verification code of the data is written into the second physical programming unit. For example, the second physical programming unit may be any physical erasing unit that belongs to the above-mentioned first physical erasing unit, and also belongs to the second type of physical erasing unit in the storage area 402, or any physical erasing unit. The present invention does not be restricted.

图8示出本发明的另一范例实施例根据第二码率将数据与对应于此数据的校验码写入至实体程序化单元的范例示意图。FIG. 8 shows an exemplary schematic diagram of writing data and a check code corresponding to the data into a physical programming unit according to another exemplary embodiment of the present invention.

请参照图8,假设来自主机系统1000的写入指令指示将数据801写入至逻辑地址410(3)。例如,数据801的数据长度是5KB。假设逻辑地址410(3)属于逻辑程序化单元810(0),则存储器管理电路202会将数据801写入至逻辑程序化单元810(0)。逻辑程序化单元810(0)映射至实体程序化单元812(0)。当实体程序化单元812(0)所属的实体抹除单元304(3)是第二类实体抹除单元时,基于数据801的数据长度,存储器管理电路202会将数据801分为数据段801_1~801_5。例如,每一个数据段801_1~801_5的数据长度是1KB。检查与校正电路256会产生对应于数据段801_1~801_5的校验码段802_1~802_5。例如,每一个校验码段802_1~802_5的数据长度是140B。此外,数据801也可以是以图7的范例实施例的方式来划分为更多的数据段(例如,10个数据长度是512B的数据段等),并且每一个校验码段的数据长度可以被设定为预设的校验码段的数据长度(例如,70B),本发明不加以限制。存储器管理电路202会判断数据801的数据长度是否超过N个基本管理单位的数据长度。在此,假设实体程序化单元812(0)的容量大小是8KB,故N是1。存储器管理电路202会判断数据801的数据长度(例如,5KB)是否超过一个基本管理单位的数据长度(例如,4KB)。当数据801的数据长度超过一个基本管理单位的数据长度时,存储器管理电路202会将数据段801_1~801_4与对应于数据段801_1~801_4的校验码段802_1~802_4写入至实体程序化单元812(0),并且将数据段801_5与对应于数据段801_5的校验码段802_5写入至实体程序化单元812(1),其中,数据段801_1~801_4的数据长度符合一个基本管理单位的数据长度。虽然在此范例实施例中第二实体程序化单元是以同样属于实体抹除单元304(3)的实体程序化单元812(1)为例,但是,在另一范例实施例中,第二实体程序化单元也可以是属于存储区402中也属于第二类实体抹除单元的任一个实体抹除单元或者任意的实体抹除单元。也就是说,在将数据801写入至实体程序化单元812(0)与812(1)之后,逻辑程序化单元810(0)是映射至实体程序化单元812(0)与812(1)。此外,若实体程序化单元812(0)的容量大小是16KB或者更多,则仅需将N设为3或者相对应的数值即可。Referring to FIG. 8 , assume that a write command from the host system 1000 indicates to write data 801 to the logical address 410 ( 3 ). For example, the data length of the data 801 is 5KB. Assuming that the logical address 410(3) belongs to the logical programming unit 810(0), the memory management circuit 202 will write the data 801 into the logical programming unit 810(0). Logical programming unit 810(0) maps to physical programming unit 812(0). When the physical erasing unit 304(3) to which the physical programming unit 812(0) belongs is the second type of physical erasing unit, based on the data length of the data 801, the memory management circuit 202 divides the data 801 into data segments 801_1~ 801_5. For example, the data length of each data segment 801_1-801_5 is 1KB. The checking and correcting circuit 256 generates check code segments 802_1 - 802_5 corresponding to the data segments 801_1 - 801_5 . For example, the data length of each check code segment 802_1 - 802_5 is 140B. In addition, the data 801 can also be divided into more data segments (for example, 10 data segments whose data length is 512B, etc.) in the manner of the exemplary embodiment of FIG. 7 , and the data length of each check code segment can be The data length (for example, 70B) set as the preset check code segment is not limited by the present invention. The memory management circuit 202 determines whether the data length of the data 801 exceeds the data length of N basic management units. Here, it is assumed that the capacity of the physical programming unit 812(0) is 8KB, so N is 1. The memory management circuit 202 will determine whether the data length of the data 801 (for example, 5KB) exceeds the data length of a basic management unit (for example, 4KB). When the data length of the data 801 exceeds the data length of a basic management unit, the memory management circuit 202 will write the data segments 801_1-801_4 and the check code segments 802_1-802_4 corresponding to the data segments 801_1-801_4 into the physical programming unit 812(0), and write the data segment 801_5 and the check code segment 802_5 corresponding to the data segment 801_5 into the entity programming unit 812(1), wherein the data lengths of the data segments 801_1~801_4 conform to the requirements of a basic management unit Data length. Although in this exemplary embodiment the second physical programming unit is an example of the physical programming unit 812(1) that also belongs to the physical erasing unit 304(3), in another exemplary embodiment, the second physical The programming unit may also be any physical erasing unit that belongs to the second type of physical erasing unit in the storage area 402 or any physical erasing unit. That is, after data 801 is written to physical programming units 812(0) and 812(1), logical programming unit 810(0) is mapped to physical programming units 812(0) and 812(1) . In addition, if the capacity of the physical programming unit 812(0) is 16KB or more, it is only necessary to set N to 3 or a corresponding value.

此外,在图5至图8的范例实施例中,当存储器管理电路202在将数据段与校验码段写入至第一实体程序化单元时,存储器管理电路202会一并将一或多个第一无效比特写入至第一实体程序化单元中未被数据段与校验码段所写满的部分。类似地,当存储器管理电路202在将数据段与校验码段写入至第二实体程序化单元时,存储器管理电路202会一并将一或多个第二无效比特写入至第二实体程序化单元中未被数据段与校验码段所写满的部分。第一无效比特与第二无效比特可以是任意的无效数据。In addition, in the exemplary embodiments of FIG. 5 to FIG. 8 , when the memory management circuit 202 writes the data segment and the check code segment into the first physical programming unit, the memory management circuit 202 will simultaneously write one or more A first invalid bit is written into the part of the first physical programming unit that is not filled by the data segment and the check code segment. Similarly, when the memory management circuit 202 writes the data segment and the check code segment into the programming unit of the second entity, the memory management circuit 202 will also write one or more second invalid bits into the second entity The part of the programming unit that is not filled by the data segment and the check code segment. The first invalid bit and the second invalid bit may be any invalid data.

图9示出本发明的一范例实施例的数据写入方法的流程图。FIG. 9 shows a flowchart of a data writing method according to an exemplary embodiment of the present invention.

请参照图9,在步骤S902中,接收写入指令,其中此写入指令指示将数据写入至多个逻辑单元中的至少其中之一,其中所述逻辑单元中的至少其中之一映射至第一实体程序化单元,并且第一实体程序化单元属于第一实体抹除单元。Please refer to FIG. 9 , in step S902, a write instruction is received, wherein the write instruction indicates to write data to at least one of a plurality of logical units, wherein at least one of the logical units is mapped to the first A physical programming unit, and the first physical programming unit belongs to the first physical erasing unit.

在步骤S904中,判断第一实体抹除单元是第一类实体抹除单元或第二类实体抹除单元。In step S904, it is determined whether the first physical erasing unit is a first type physical erasing unit or a second type physical erasing unit.

当第一实体抹除单元是第一类实体抹除单元时,在步骤S906中,依据第一码率来将此数据与对应于此数据的校验码编程至此第一实体程序化单元。When the first physical erasing unit is the first type of physical erasing unit, in step S906, the data and the check code corresponding to the data are programmed into the first physical programming unit according to the first coding rate.

当第一实体抹除单元是第二类实体抹除单元时,在步骤S908中,依据第二码率来将此数据与对应于此数据的此校验码编程至此第一实体程序化单元,其中此第一码率高于此第二码率。When the first physical erasing unit is the second type of physical erasing unit, in step S908, program the data and the check code corresponding to the data into the first physical programming unit according to the second code rate, Wherein the first code rate is higher than the second code rate.

图10示出本发明的另一范例实施例的数据写入方法的流程图。FIG. 10 shows a flowchart of a data writing method according to another exemplary embodiment of the present invention.

请参照图10,在步骤S1002中,接收写入指令,其中此写入指令指示将数据写入至多个逻辑单元中的至少其中之一,其中所述逻辑单元中的至少其中之一映射至第一实体程序化单元,并且第一实体程序化单元属于第一实体抹除单元。Please refer to FIG. 10 , in step S1002, a write instruction is received, wherein the write instruction indicates to write data to at least one of a plurality of logical units, wherein at least one of the logical units is mapped to the first A physical programming unit, and the first physical programming unit belongs to the first physical erasing unit.

在步骤S1004中,判断第一实体抹除单元是第一类实体抹除单元或第二类实体抹除单元。In step S1004, it is determined whether the first entity erasing unit is a first type entity erasing unit or a second type entity erasing unit.

当第一实体抹除单元是第一类实体抹除单元时,在步骤S1006中,依据第一码率来将此数据与对应于此数据的校验码写入至此第一实体程序化单元。When the first physical erasing unit is the first type of physical erasing unit, in step S1006, write the data and the check code corresponding to the data into the first physical programming unit according to the first code rate.

当第一实体抹除单元是第二类实体抹除单元时,在步骤S1008中,判断此数据的数据长度是否超过N个基本管理单位的数据长度,其中N是正整数,并且N+1个基本管理单位的数据长度等于第一实体程序化单元的容量大小。When the first physical erasing unit is the second type of physical erasing unit, in step S1008, it is judged whether the data length of this data exceeds the data length of N basic management units, wherein N is a positive integer, and N+1 basic management units The data length of the management unit is equal to the capacity of the first entity programming unit.

当此数据的数据长度没有超过N个基本管理单位的数据长度时,在步骤S1010中,仅依据第二码率将此数据与对应于此数据的校验码写入至第一实体程序化单元。When the data length of the data does not exceed the data length of N basic management units, in step S1010, write the data and the check code corresponding to the data into the first entity programming unit only according to the second code rate .

当此数据的数据长度超过N个基本管理单位的数据长度时,在步骤S1012中,依据第二码率将第一部分的此数据与第一部分的此校验码写入至第一实体程序化单元并且将第二部分的此数据与第二部分的此校验码写入至第二实体程序化单元。When the data length of the data exceeds the data length of N basic management units, in step S1012, write the first part of the data and the first part of the check code into the first entity programming unit according to the second code rate And write the data of the second part and the verification code of the second part into the second entity programming unit.

然而,图9与图10中各步骤已详细说明如上,在此便不在赘述。值得注意的是,图9与图10中各步骤可以实作为多个程序码或是电路,本发明并不在此限。此外,图9与图10的方法可以搭配以上实施例使用,也可以单独使用,本发明并不在此限。特别是,在本范例实施例中,存储器管理电路202所执行的数据及/或校验码的写入或读取等对于可复写式非易失性存储器模块106的各种操作,例如是通过发送至少一指令串行(command sequence)至可复写式非易失性存储器模块106来完成,其中每一个指令串行包括至少一个指令。可复写式非易失性存储器模块106可以根据所接收到的指令串行来执行相对应的操作。However, each step in FIG. 9 and FIG. 10 has been described in detail above, and will not be repeated here. It should be noted that each step in FIG. 9 and FIG. 10 can be implemented as a plurality of program codes or circuits, and the present invention is not limited thereto. In addition, the methods shown in FIG. 9 and FIG. 10 can be used together with the above embodiments, or can be used alone, and the present invention is not limited thereto. In particular, in this exemplary embodiment, various operations of the rewritable non-volatile memory module 106, such as writing or reading data and/or verification codes performed by the memory management circuit 202, are performed, for example, by Send at least one command sequence to the rewritable non-volatile memory module 106 to complete, wherein each command sequence includes at least one command. The rewritable non-volatile memory module 106 can perform corresponding operations in series according to the received instructions.

此外,在另一范例实施例中,上述判断步骤也可以套用至实体程序化单元或实体扇。例如,可根据上述各范例实施例中提及的方式来判断第一实体程序化单元是第一类实体程序化单元或者第二类实体程序化单元,并且根据判断结果决定根据第一码率或第二码率来将数据与对应的校验码写入至第一实体程序化单元。特别是,同一个实体抹除单元中不同的实体程序化单元或实体扇也可能有不同的比特错误率,因此,这样的作法可能会更贴近实际的存储器使用状况。In addition, in another exemplary embodiment, the above-mentioned judging steps can also be applied to the physical programming unit or the physical fan. For example, it can be judged according to the methods mentioned in the above exemplary embodiments that the first physical programming unit is the first type of physical programming unit or the second type of physical programming unit, and according to the judgment result, it is determined whether the first code rate or The second code rate is used to write the data and the corresponding check code into the first physical programming unit. In particular, different physical programming units or physical sectors in the same physical erasing unit may also have different bit error rates, so this approach may be closer to the actual memory usage.

综上所述,本发明提出的数据写入方法、存储器存储装置及存储器控制电路单元,可根据可复写式非易失性存储器模块中的实体抹除单元是第一类实体抹除单元或第二类实体抹除单元,而适应性地根据第一码率或高于第一码率的第二码率来将数据与对应于此数据的校验码写入至此实体抹除单元中。藉此,即使某一实体抹除单元的比特错误率超过预设的容许范围,此实体抹除单元还是可以被持续使用,而不会直接被舍弃。In summary, the data writing method, memory storage device and memory control circuit unit proposed by the present invention can be based on whether the physical erasing unit in the rewritable non-volatile memory module is the first type of physical erasing unit or the second type of physical erasing unit. The second type of physical erasing unit adaptively writes data and a check code corresponding to the data into the physical erasing unit according to the first code rate or a second code rate higher than the first code rate. In this way, even if the bit error rate of a certain physical erasing unit exceeds the preset allowable range, the physical erasing unit can still be used continuously instead of being discarded directly.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.

Claims (24)

1. a kind of method for writing data, for controlling a reproducible nonvolatile memorizer module, the duplicative is non-volatile Property memory module includes multiple entity erased cells, and each of entity erased cell includes multiple entity program units, It is characterized in that, and the method for writing data include:
Receive a write instruction, wherein write instruction instruction by a data be written into multiple logic units at least within it One, wherein in those logic units this at least one map to the first instance journey in those entity program units Sequence unit, and the first instance programmed cell belongs to the first instance erased cell in those entity erased cells;
Judge that the first instance erased cell belongs to a first kind entity erased cell or one second class entity erased cell;
When the first instance erased cell belongs to the first kind entity erased cell, according to one first code check by the data with It is programmed to the first instance programmed cell corresponding to a check code of the data;And
When the first instance erased cell belongs to the second class entity erased cell, according to one second code check by the data with It is programmed to the first instance programmed cell corresponding to the check code of the data, wherein first code check is higher than the second code Rate,
The data and the check code corresponding to the data are wherein programmed to the first instance program according to second code check Change unit the step of include:
When the data length of the data is no more than the data length of N number of basic management unit, according to second code check by the number It is programmed to the first instance programmed cell according to the check code corresponding to the data;And
It, will according to second code check when the data length of the data is more than the data length of N number of basic management unit The data of one first part and the check code of a first part are programmed to the first instance programmed cell and by one the The data of two parts are programmed to the second instance journey in those entity program units with the check code of a second part Sequence unit.
2. method for writing data according to claim 1, which is characterized in that judge that the first instance erased cell belongs to this The step of first kind entity erased cell or the second class entity erased cell includes:
Judge whether a bit error rate assessed value of the first instance erased cell meets a Sharp criteria;
If the bit error rate assessed value of the first instance erased cell does not meet the Sharp criteria, judge that the first instance is smeared Except unit belongs to the first kind entity erased cell;And
If the bit error rate assessed value of the first instance erased cell meets the Sharp criteria, judge that the first instance is erased Unit belongs to the second class entity erased cell.
3. method for writing data according to claim 2, which is characterized in that further include:
It erases a number information, write-in number information, a reading times information, one wrong according to the one of the first instance erased cell Errored bit number information, a wrong bitrate information, a data resting period information and a temperature information at least one or At least combination, to determine the bit error rate assessed value of the first instance erased cell.
4. method for writing data according to claim 1, which is characterized in that
The data and the check code corresponding to the data are programmed to the first instance sequencing list according to first code check Member step include:
The data are divided at least one first data segment and generate at least one first check code section, wherein it is each this at least 1 the One check code section corresponds at least one of one first data segment,
The data and the check code corresponding to the data are wherein programmed to the first instance program according to second code check Change unit the step of include:
The data are divided at least one second data segment and generate at least one second check code section, wherein it is each this at least 1 the Two check code sections correspond at least one of one second data segment,
One data length of wherein each at least one first data segment is identical to a number of each at least one second data segment It is shorter than each at least one second check code section according to a data length of length, and each at least one first check code section One data length.
5. method for writing data according to claim 1, which is characterized in that
The data and the check code corresponding to the data are programmed to the first instance sequencing list according to first code check Member step include:
The data are divided at least one first data segment and generate at least one first check code section, wherein it is each this at least 1 the One check code section corresponds at least one of one first data segment,
The data and the check code corresponding to the data are wherein programmed to the first instance program according to second code check Change unit the step of include:
The data are divided at least one second data segment and generate at least one second check code section, wherein it is each this at least 1 the Two check code sections correspond at least one of one second data segment,
One data length of wherein each at least one first data segment is longer than a data of each at least one second data segment Length, and a data length of each at least one first check code section is identical to each at least one second check code section One data length.
6. method for writing data according to claim 1, which is characterized in that according to second code check by the data with it is right Should include the step of the check code of the data is programmed to the first instance programmed cell:
Judge the data the data length whether be more than N number of basic management unit the data length, wherein N is just whole Number, and a data length of N+1 basic management unit is equal to an amount of capacity of the first instance programmed cell.
7. method for writing data according to claim 6, which is characterized in that the second instance programmed cell belong to this The second instance that the second class entity erased cell is also belonged in one entity erased cell or those entity erased cells is smeared Except unit.
8. method for writing data according to claim 5, which is characterized in that a data of the data of the first part are long Degree meets the data length of N number of basic management unit, and the method for writing data further includes:
At least one first inactive bit is programmed in the first instance programmed cell to fill up not being somebody's turn to do by the first part Data and the check code of the first part write full part;And
At least one second inactive bit is programmed in the second instance programmed cell to fill up not being somebody's turn to do by the second part Data and the check code of the second part write full part.
9. a kind of memory storage apparatus, which is characterized in that including:
One connecting interface unit, to be electrically connected to a host system;
One reproducible nonvolatile memorizer module, including multiple entity erased cells, and each of entity is erased list Member includes multiple entity program units;And
One memorizer control circuit unit is electrically connected to the connecting interface unit and the type nonvolatile mould Block,
To receive a write instruction, one data are written the wherein memorizer control circuit unit for wherein write instruction instruction To at least one of multiple logic units, wherein in those logic units this at least one map to those entities A first instance programmed cell in programmed cell, and the first instance programmed cell belongs to those entities and erases list A first instance erased cell in member,
The memorizer control circuit unit is also judging that the first instance erased cell belongs to a first kind entity erased cell Or one second class entity erased cell, wherein one first bit error rate of the first kind entity erased cell are less than second class One second bit error rate of entity erased cell,
When the first instance erased cell belongs to the first kind entity erased cell, the memorizer control circuit unit also to The data and the check code corresponding to the data are programmed to the first instance programmed cell according to one first code check,
When the first instance erased cell belongs to the second class entity erased cell, the memorizer control circuit unit also to The data and the check code corresponding to the data are programmed to the first instance programmed cell according to one second code check, In first code check be higher than second code check,
Wherein the memorizer control circuit unit according to second code check by the data with corresponding to the data the check code The operation for being programmed to the first instance programmed cell includes:
When the data length of the data is no more than the data length of N number of basic management unit, according to second code check by the number It is programmed to the first instance programmed cell according to the check code corresponding to the data;And
It, will according to second code check when the data length of the data is more than the data length of N number of basic management unit The data of one first part and the check code of a first part are programmed to the first instance programmed cell and by one the The data of two parts are programmed to the second instance journey in those entity program units with the check code of a second part Sequence unit.
10. memory storage apparatus according to claim 9, which is characterized in that the memorizer control circuit unit judges The first instance erased cell belongs to the first kind entity erased cell or the operation of the second class entity erased cell includes:
Judge whether a bit error rate assessed value of the first instance erased cell meets a Sharp criteria;
If the bit error rate assessed value of the first instance erased cell does not meet the Sharp criteria, judge that the first instance is smeared Except unit belongs to the first kind entity erased cell;And
If the bit error rate assessed value of the first instance erased cell meets the Sharp criteria, judge that the first instance is erased Unit belongs to the second class entity erased cell.
11. memory storage apparatus according to claim 10, which is characterized in that the memorizer control circuit unit is also used With according to the one of the first instance erased cell erase number information, one write-in number information, a reading times information, a mistake Bit number information, a wrong bitrate information, a data resting period information and a temperature information at least one or extremely Few combination, to determine the bit error rate assessed value of the first instance erased cell.
12. memory storage apparatus according to claim 9, which is characterized in that
The memorizer control circuit unit programs the data and the check code corresponding to the data according to first code check Operation to the first instance programmed cell includes:
The data are divided at least one first data segment and generate at least one first check code section, wherein it is each this at least 1 the One check code section corresponds at least one of one first data segment,
Wherein the memorizer control circuit unit according to second code check by the data with corresponding to the data the check code The operation for being programmed to the first instance programmed cell includes:
The data are divided at least one second data segment and generate at least one second check code section, wherein it is each this at least 1 the Two check code sections correspond at least one of one second data segment,
One data length of wherein each at least one first data segment is identical to a number of each at least one second data segment It is shorter than each at least one second check code section according to a data length of length, and each at least one first check code section One data length.
13. memory storage apparatus according to claim 9, which is characterized in that
The memorizer control circuit unit programs the data and the check code corresponding to the data according to first code check Operation to the first instance programmed cell includes:
The data are divided at least one first data segment and generate at least one first check code section, wherein it is each this at least 1 the One check code section corresponds at least one of one first data segment,
Wherein the memorizer control circuit unit according to second code check by the data with corresponding to the data the check code The operation for being programmed to the first instance programmed cell includes:
The data are divided at least one second data segment and generate at least one second check code section, wherein it is each this at least 1 the Two check code sections correspond at least one of one second data segment,
One data length of wherein each at least one first data segment is longer than a data of each at least one second data segment Length, and a data length of each at least one first check code section is identical to each at least one second check code section One data length.
14. memory storage apparatus according to claim 9, which is characterized in that the memorizer control circuit unit foundation The data are programmed to the operation of the first instance programmed cell by second code check with the check code corresponding to the data Including:
Judge the data the data length whether be more than N number of basic management unit the data length, wherein N is just whole Number, and a data length of N+1 basic management unit is equal to an amount of capacity of the first instance programmed cell.
15. memory storage apparatus according to claim 14, which is characterized in that the second instance programmed cell belongs to One second that the second class entity erased cell is also belonged in the first instance erased cell or those entity erased cells is real Body erased cell.
16. memory storage apparatus according to claim 14, which is characterized in that a number of the data of the first part Meet the data length of N number of basic management unit according to length,
The memorizer control circuit unit will be also being at least programmed to the first instance programmed cell by one first inactive bit In full part write with the check code for filling up the not data by the first part and the first part,
The memorizer control circuit unit will be also being at least programmed to the second instance programmed cell by one second inactive bit In full part write with the check code for filling up the not data by the second part and the second part.
17. a kind of memorizer control circuit unit, which is characterized in that for controlling a type nonvolatile mould Block, the wherein reproducible nonvolatile memorizer module include multiple entity erased cells, each of entity erased cell Including multiple entity program units, and the memorizer control circuit unit includes:
One host interface, to be electrically connected to a host system;
One memory interface, to be electrically connected to the reproducible nonvolatile memorizer module;
One error checking and correcting circuit;And
One memory management circuitry is electrically connected to the host interface, the memory interface and the error checking and correcting circuit,
To receive a write instruction, one data are written at most the wherein memory management circuitry for wherein write instruction instruction At least one in a logic unit, wherein in those logic units this at least one map to those entity journeys A first instance programmed cell in sequence unit, and the first instance programmed cell belongs to those entity erased cells In a first instance erased cell,
The memorizer control circuit unit is also judging that the first instance erased cell belongs to a first kind entity erased cell Or one second class entity erased cell, wherein one first bit error rate of the first kind entity erased cell are less than second class One second bit error rate of entity erased cell,
When the first instance erased cell belongs to the first kind entity erased cell, the memory management circuitry is also sending The instruction of one first command serial, wherein first command serial is according to one first code check by the data and corresponding to the one of the data Check code is programmed to the first instance programmed cell,
When the first instance erased cell belongs to the second class entity erased cell, the memory management circuitry is also sending The instruction of one second command serial, wherein second command serial by the data and corresponds to being somebody's turn to do for the data according to one second code check Check code is programmed to the first instance programmed cell, and wherein first code check is higher than second code check,
The operation that the memory management circuitry sends second command serial includes:
When the data length of the data is no more than the data length of N number of basic management unit, second command serial is sent, In second command serial instruction according to second code check and only the data are programmed to the check code for corresponding to the data The first instance programmed cell,
When the data length of the data is more than the data length of N number of basic management unit, second strings of commands is sent The instruction of row, wherein second command serial is according to second code check by the school of the data of a first part and a first part It tests code and is programmed to the first instance programmed cell and by the check code of the data of a second part and a second part The second instance programmed cell being programmed in those entity program units.
18. memorizer control circuit unit according to claim 17, which is characterized in that the memory management circuitry judges The first instance erased cell belongs to the first kind entity erased cell or the operation of the second class entity erased cell includes:
Judge whether a bit error rate assessed value of the first instance erased cell meets a Sharp criteria;
If the bit error rate assessed value of the first instance erased cell does not meet the Sharp criteria, judge that the first instance is smeared Except unit belongs to the first kind entity erased cell;And
If the bit error rate assessed value of the first instance erased cell meets the Sharp criteria, judge that the first instance is erased Unit belongs to the second class entity erased cell.
19. memorizer control circuit unit according to claim 18, which is characterized in that the memory management circuitry is also used With according to the one of the first instance erased cell erase number information, one write-in number information, a reading times information, a mistake Bit number information, a wrong bitrate information, a data resting period information and a temperature information at least one or extremely Few combination, to determine the bit error rate assessed value of the first instance erased cell.
20. memorizer control circuit unit according to claim 17, which is characterized in that
The operation that the memory management circuitry sends first command serial further includes:
The data are divided at least one first data segment and control the error checking and generate at least one first school with correcting circuit Code section is tested, wherein each at least one first check code section corresponds at least one of one first data segment,
The operation that wherein memory management circuitry sends second command serial further includes:
The data are divided at least one second data segment and control the error checking and generate at least one second school with correcting circuit Code section is tested, wherein each at least one second check code section corresponds at least one of one second data segment,
One data length of wherein each at least one first data segment is identical to a number of each at least one second data segment It is shorter than each at least one second check code section according to a data length of length, and each at least one first check code section One data length.
21. memorizer control circuit unit according to claim 17, which is characterized in that
The operation that the memory management circuitry sends first command serial further includes:
The data are divided at least one first data segment and control the error checking and generate at least one first school with correcting circuit Code section is tested, wherein each at least one first check code section corresponds at least one of one first data segment,
The operation that wherein memory management circuitry sends second command serial further includes:
The data are divided at least one second data segment and control the error checking and generate at least one second school with correcting circuit Code section is tested, wherein each at least one second check code section corresponds at least one of one second data segment,
One data length of wherein each at least one first data segment is longer than a data of each at least one second data segment Length, and a data length of each at least one first check code section is identical to each at least one second check code section One data length.
22. memorizer control circuit unit according to claim 17, which is characterized in that the memory management circuitry is sent The operation of second command serial includes:
Judge the data the data length whether be more than N number of basic management unit the data length, wherein N is just whole Number, and a data length of N+1 basic management unit is equal to an amount of capacity of the first instance programmed cell.
23. memorizer control circuit unit according to claim 22, which is characterized in that the second instance programmed cell Belong to and also belongs to the one of the second class entity erased cell in the first instance erased cell or those entity erased cells Two entity erased cells.
24. memorizer control circuit unit according to claim 22, which is characterized in that the data of the first part One data length meets the data length of N number of basic management unit,
Second command serial also indicate at least one first inactive bit need to be programmed in the first instance programmed cell with It fills up not data by the first part and the check code of the first part writes full part, and at least one second nothing Effect is programmed in the second instance programmed cell than special procuring to fill up not data by the second part and this second The check code divided writes full part.
CN201410173227.6A 2014-04-25 2014-04-25 Data writing method, memory storage device and memory control circuit unit Active CN105005450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410173227.6A CN105005450B (en) 2014-04-25 2014-04-25 Data writing method, memory storage device and memory control circuit unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410173227.6A CN105005450B (en) 2014-04-25 2014-04-25 Data writing method, memory storage device and memory control circuit unit

Publications (2)

Publication Number Publication Date
CN105005450A CN105005450A (en) 2015-10-28
CN105005450B true CN105005450B (en) 2018-11-02

Family

ID=54378134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410173227.6A Active CN105005450B (en) 2014-04-25 2014-04-25 Data writing method, memory storage device and memory control circuit unit

Country Status (1)

Country Link
CN (1) CN105005450B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843744B (en) * 2015-12-03 2020-05-26 群联电子股份有限公司 Data programming method and memory storage device
CN107025941A (en) * 2016-01-29 2017-08-08 瑞昱半导体股份有限公司 Solid state disk control circuit
CN107305476B (en) * 2016-04-25 2020-03-31 群联电子股份有限公司 Data correction method, memory control circuit unit and memory storage device
CN107643876A (en) * 2016-07-20 2018-01-30 大心电子股份有限公司 Storage management method, memory storage apparatus and memorizer control circuit unit
CN109508252B (en) * 2017-09-15 2022-03-01 群联电子股份有限公司 Data encoding method, memory control circuit unit, and memory storage device
CN109709902B (en) * 2017-10-25 2022-01-21 富泰华精密电子(郑州)有限公司 Data interaction method, system and memory
CN108388483A (en) * 2018-03-10 2018-08-10 北京联想核芯科技有限公司 Configure the method, apparatus and computer readable storage medium of code check
CN109358815B (en) * 2018-10-18 2021-06-29 郑州云海信息技术有限公司 A NAND flash memory data management method and device
CN111324286A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory and control method and device thereof
CN111580741B (en) * 2019-02-15 2023-06-13 群联电子股份有限公司 Data writing method, memory control circuit unit and memory storage device
CN111831210B (en) * 2019-04-18 2023-12-15 群联电子股份有限公司 Memory management method, memory control circuit unit and memory storage device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193870A (en) * 2010-03-09 2011-09-21 群联电子股份有限公司 Memory management and write-in method, memory controller and memory storage system
TWI381273B (en) * 2006-10-10 2013-01-01 Marvell World Trade Ltd Adaptive systems and methods for storing and retrieving data to and from memory cells
CN103329103A (en) * 2010-10-27 2013-09-25 Lsi公司 Adaptive ECC techniques for flash memory based data storage

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4575346B2 (en) * 2006-11-30 2010-11-04 株式会社東芝 Memory system
CN101464836B (en) * 2007-12-20 2010-10-20 宇瞻科技股份有限公司 data storage method of flash memory storage device
JP5422984B2 (en) * 2008-12-08 2014-02-19 富士通株式会社 NONVOLATILE MEMORY, MEMORY CONTROL DEVICE, MEMORY CONTROL SYSTEM, AND NONVOLATILE MEMORY CONTROL METHOD
CN101477534B (en) * 2008-12-24 2013-09-18 北京中星微电子有限公司 File management method and apparatus for implementing balance abrasion of flash memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI381273B (en) * 2006-10-10 2013-01-01 Marvell World Trade Ltd Adaptive systems and methods for storing and retrieving data to and from memory cells
CN102193870A (en) * 2010-03-09 2011-09-21 群联电子股份有限公司 Memory management and write-in method, memory controller and memory storage system
CN103329103A (en) * 2010-10-27 2013-09-25 Lsi公司 Adaptive ECC techniques for flash memory based data storage

Also Published As

Publication number Publication date
CN105005450A (en) 2015-10-28

Similar Documents

Publication Publication Date Title
CN105005450B (en) Data writing method, memory storage device and memory control circuit unit
CN106158040B (en) Read voltage level estimation method, memory storage device and control circuit unit
CN104765569B (en) Data writing method, memory control circuit unit and memory storage device
CN103514096B (en) Data storage method, memory controller and memory storage device
TWI689816B (en) Block management method, memory control circuit unit and memory storage apparatus
CN111078146B (en) Memory management method, memory storage device and memory control circuit unit
CN104636267B (en) Memory control method, memory storage device and memory control circuit unit
CN104866429A (en) Memory management method, memory control circuit unit and memory storage device
TWI545581B (en) Method for writing data, memory storage device and memory control circuit unit
CN105988950A (en) Memory management method, memory control circuit unit and memory storage device
TW201351137A (en) Memory management method, memory controller and memory storage device using the same
CN105022695A (en) Data storage method, memory control circuit unit and memory storage device
CN107045890B (en) Data protection method, memory control circuit unit and memory storage device
CN106484307A (en) Memory management method, memory control circuit unit and memory storage device
CN103914391A (en) Data reading method, memory controller and memory storage device
CN116230062A (en) Voltage prediction method, memory storage device and memory control circuit unit
CN103678162A (en) System data storage method, memory controller and memory storage device
CN111580741B (en) Data writing method, memory control circuit unit and memory storage device
TWI760697B (en) Data arrangement method of memory, memory storage device and memory control circuit unit
CN118800304A (en) Electrical parameter adjustment method, storage device and memory control circuit unit
CN109032957B (en) Memory management method, memory control circuit unit and memory storage device
CN112732199B (en) Data access method, memory control circuit unit and memory storage device
CN106445397A (en) Memory management method, memory control circuit unit and memory storage device
TWI597731B (en) Memory management method,memory storage device and memory control circuit unit
CN110400593A (en) Memory management method, memory storage device and memory control circuit unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant