TW202125265A - Memory management method, memory storage device and memory control circuit unit - Google Patents

Memory management method, memory storage device and memory control circuit unit Download PDF

Info

Publication number
TW202125265A
TW202125265A TW108147177A TW108147177A TW202125265A TW 202125265 A TW202125265 A TW 202125265A TW 108147177 A TW108147177 A TW 108147177A TW 108147177 A TW108147177 A TW 108147177A TW 202125265 A TW202125265 A TW 202125265A
Authority
TW
Taiwan
Prior art keywords
threshold
bit
memory
misread
unit
Prior art date
Application number
TW108147177A
Other languages
Chinese (zh)
Other versions
TWI784224B (en
Inventor
胡昕
許亮
張小楊
王志
Original Assignee
大陸商合肥兆芯電子有限公司
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 大陸商合肥兆芯電子有限公司 filed Critical 大陸商合肥兆芯電子有限公司
Priority to TW108147177A priority Critical patent/TWI784224B/en
Publication of TW202125265A publication Critical patent/TW202125265A/en
Application granted granted Critical
Publication of TWI784224B publication Critical patent/TWI784224B/en

Links

Images

Landscapes

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

Abstract

A memory management method is provided according to an exemplary embodiment of the invention. The method includes: reading a physical unit and updating a read count of the physical unit; scanning the physical unit if the updated read count is not less than a reading count threshold; and adjusting the reading count threshold according to the read count and an error bit. Therefore, the data unit that needs to be scanned can be determined to reduce unnecessary data scanning.

Description

記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元Memory management method, memory storage device and memory control circuit unit

本發明是有關於一種記憶體管理技術,且特別是有關於一種記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元。The present invention relates to a memory management technology, and particularly relates to a memory management method, a memory storage device and a memory control circuit unit.

數位相機、行動電話與MP3播放器在這幾年來的成長十分迅速,使得消費者對儲存媒體的需求也急速增加。由於可複寫式非揮發性記憶體模組(rewritable non-volatile memory module)(例如,快閃記憶體)具有資料非揮發性、省電、體積小,以及無機械結構等特性,所以非常適合內建於上述所舉例的各種可攜式多媒體裝置中。Digital cameras, mobile phones and MP3 players have grown rapidly in the past few years, which has led to a rapid increase in consumer demand for storage media. As the rewritable non-volatile memory module (for example, flash memory) has the characteristics of non-volatile data, power saving, small size, and no mechanical structure, it is very suitable for internal Built in the various portable multimedia devices mentioned above.

在記憶體管理技術中,當主機系統對記憶體儲存裝置中同一資料單元的讀取次數超過一定數量後,可能會導致資料單元中儲存的資料不穩定,因此需要對資料單元進行掃描檢查,以確定資料單元是否需要更新。然而,若狀況良好的資料單元經常被掃描將影響記憶體的效能。或者,狀況不好的資料單元未被及時掃描並將資料搬移,可能會造成資料丟失。因此需要準確的判斷需要進行資料掃描的資料單元。In the memory management technology, when the host system reads the same data unit in the memory storage device more than a certain number of times, the data stored in the data unit may be unstable. Therefore, it is necessary to scan and check the data unit. Determine whether the data unit needs to be updated. However, if data units in good condition are scanned frequently, the performance of the memory will be affected. Or, data units that are not in good condition are not scanned and moved in time, which may cause data loss. Therefore, it is necessary to accurately determine the data unit that needs to be scanned.

本發明提供一種記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元,可判斷需要進行資料掃描的資料單元。The invention provides a memory management method, a memory storage device and a memory control circuit unit, which can determine the data unit that needs to be scanned for data.

本發明的範例實施例提供一種記憶體管理方法,用於記憶體儲存裝置,且所述記憶體管理方法包括:讀取實體單元,並更新所述實體單元的讀取次數;在所述更新的讀取次數不小於讀取次數閥值時掃描所述實體單元;以及根據所述讀取次數及讀錯位元調整所述讀取次數閥值。An exemplary embodiment of the present invention provides a memory management method for a memory storage device, and the memory management method includes: reading a physical unit, and updating the number of times the physical unit is read; Scanning the physical unit when the number of reading times is not less than the threshold value of the number of reading times; and adjusting the threshold value of the number of reading times according to the number of reading times and read error bits.

在本發明的一範例實施例中,根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的步驟包括:根據所述實體單元的讀錯位元閥值及最大讀錯位元決定第一讀錯相關因素。In an exemplary embodiment of the present invention, the step of adjusting the threshold of the number of reads according to the number of reads and the number of misreads includes: according to the threshold of misreads and the maximum misread of the physical unit Decide the factors related to the first mispronunciation.

在本發明的一範例實施例中,根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的步驟包括:根據先前讀取次數閥值、預設讀取次數閥值及所述第一讀錯相關因素決定所述讀取次數閥值。In an exemplary embodiment of the present invention, the step of adjusting the threshold of the number of readings according to the number of readings and the number of misreading bits includes: according to the threshold of the number of previous readings, a threshold of the number of presets, and The first reading error-related factor determines the threshold of the number of readings.

在本發明的一範例實施例中,所述記憶體管理方法包括:根據所述實體單元的抹除次數決定所述預設讀取次數閥值。In an exemplary embodiment of the present invention, the memory management method includes: determining the preset read count threshold according to the erasure count of the physical unit.

在本發明的一範例實施例中,讀取所述實體單元,並更新所述實體單元的所述讀取次數的步驟更包括:取得所述實體單元的所述讀錯位元。In an exemplary embodiment of the present invention, the step of reading the physical unit and updating the read count of the physical unit further includes: obtaining the misread bit of the physical unit.

在本發明的一範例實施例中,在所述更新的讀取次數不小於所述讀取次數閥值閥值時掃描所述實體單元的步驟包括:若所述讀錯位元大於讀錯位元閥值,則將所述實體單元中的資料複製至另一實體單元;以及若所述讀錯位元不大於所述讀錯位元閥值,則記錄所述更新的讀取次數。In an exemplary embodiment of the present invention, the step of scanning the physical unit when the updated number of reads is not less than the threshold of the number of reads includes: if the read error bit is greater than the read error bit threshold Value, copy the data in the physical unit to another physical unit; and if the misread bit is not greater than the misread bit threshold, record the updated read times.

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的步驟更包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the step of obtaining the misread bit of the physical unit further includes: if the misread bit is greater than the maximum misread bit, updating the maximum misread bit according to the misread bit Yuan.

在本發明的一範例實施例中,所述方法更包括:根據所述實體單元的讀錯位元閥值及所述更新的最大讀錯位元決定第二讀錯相關因素;根據先前讀取次數閥值、預設讀取次數閥值及所述第二讀錯相關因素決定更新的讀取次數閥值;以及在所述更新的讀取次數不小於所述更新的讀取次數閥值時掃描所述實體單元。In an exemplary embodiment of the present invention, the method further includes: determining a second read error related factor according to the read error bit threshold of the physical unit and the updated maximum read error bit; according to the previous read count threshold Value, the preset reading times threshold, and the second reading error-related factors determine the updated reading times threshold; and scanning when the updated reading times is not less than the updated reading times threshold The physical unit.

本發明的範例實施例另提供一種記憶體儲存裝置,其包括連接介面單元、可複寫式非揮發性記憶體模組以及記憶體控制電路單元。所述連接介面單元用以耦接至主機系統。所述記憶體控制電路單元耦接至所述連接介面單元與所述可複寫式非揮發性記憶體模組。所述記憶體控制電路單元用以讀取所述實體單元,並更新所述實體單元的讀取次數。所述記憶體控制電路單元更用以在所述更新的讀取次數不小於所述讀取次數閥值時掃描所述實體單元。並且所述記憶體控制電路單元更用以根據所述讀取次數及讀錯位元調整所述讀取次數閥值。An exemplary embodiment of 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 for coupling to the host system. The memory control circuit unit is coupled to the connection interface unit and the rewritable non-volatile memory module. The memory control circuit unit is used for reading the physical unit and updating the reading times of the physical unit. The memory control circuit unit is further configured to scan the physical unit when the updated read count is not less than the read count threshold. And the memory control circuit unit is further used to adjust the threshold of the number of reads according to the number of reads and read error bits.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的操作包括:根據所述實體單元的讀錯位元閥值及最大讀錯位元決定第一讀錯相關因素。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of read errors includes: according to the number of read errors of the physical unit The threshold value and the maximum misreading bit determine the factors related to the first misreading.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的操作包括:根據先前讀取次數閥值、預設讀取次數閥值及所述第一讀錯相關因素決定所述讀取次數閥值。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of misread bits includes: according to the threshold of the number of previous reads, pre- It is assumed that the threshold of the number of readings and the first reading error-related factor determine the threshold of the number of readings.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述實體單元的抹除次數決定所述預設讀取次數閥值。In an exemplary embodiment of the present invention, the memory control circuit unit determines the preset read count threshold according to the erase count of the physical unit.

在本發明的一範例實施例中,所述記憶體控制電路單元讀取所述實體單元,並更新所述實體單元的所述讀取次數的操作包括:取得所述實體單元的所述讀錯位元。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to read the physical unit and update the read count of the physical unit includes: obtaining the read misalignment of the physical unit Yuan.

在本發明的一範例實施例中,所述記憶體控制電路單元在所述更新的讀取次數不小於所述讀取次數閥值時掃描所述實體單元的操作包括:若所述讀錯位元大於讀錯位元閥值,則將所述實體單元中的資料複製至另一實體單元;以及若所述讀錯位元不大於所述讀錯位元閥值,則記錄所述更新的讀取次數。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to scan the physical unit when the updated read count is not less than the read count threshold includes: if the read error bit If it is greater than the misreading bit threshold, copy the data in the physical unit to another physical unit; and if the misreading bit is not greater than the misreading threshold, then recording the updated reading times.

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的操作包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the operation of obtaining the misread bit of the physical unit includes: if the misread bit is greater than the maximum misread bit, updating the maximum misread bit according to the misread bit .

在本發明的一範例實施例中,所述記憶體控制電路單元更用以根據所述實體單元的讀錯位元閥值及所述更新的最大讀錯位元決定第二讀錯相關因素,所述記憶體控制電路單元更用以根據先前讀取次數閥值、預設讀取次數閥值及所述第二讀錯相關因素決定更新的讀取次數閥值,並且所述記憶體控制電路單元更用以在所述更新的讀取次數不小於所述更新的讀取次數閥值時掃描所述實體單元。In an exemplary embodiment of the present invention, the memory control circuit unit is further configured to determine a second read error related factor according to the read error bit threshold of the physical unit and the updated maximum read error bit. The memory control circuit unit is further configured to determine an updated threshold of the number of reads according to the threshold of the number of previous reads, the threshold of the number of presets, and the second read error-related factor, and the memory control circuit unit further It is used to scan the physical unit when the updated read count is not less than the updated read count threshold.

本發明的另一範例實施例提供一種記憶體控制電路單元,其用於控制包括可複寫式非揮發性記憶體模組的記憶體儲存裝置,且所述記憶體控制電路單元包括主機介面、記憶體介面以及記憶體管理電路。所述主機介面用以耦接至主機系統。所述記憶體介面用以耦接至所述可複寫式非揮發性記憶體模組。所述記憶體管理電路耦接至所述主機介面與所述記憶體介面。所述記憶體控制電路單元用以讀取所述實體單元,並更新所述實體單元的讀取次數。所述記憶體控制電路單元更用以在所述更新的讀取次數不小於所述讀取次數閥值時掃描所述實體單元。並且所述記憶體控制電路單元更用以根據讀所述讀取次數及錯位元調整所述讀取次數閥值。Another exemplary embodiment of the present invention provides a memory control circuit unit for controlling a memory storage device including a rewritable non-volatile memory module, and the memory control circuit unit includes a host interface, a memory Body interface and memory management circuit. The host interface is used for coupling to a host system. The memory interface is used for coupling to the rewritable non-volatile memory module. The memory management circuit is coupled to the host interface and the memory interface. The memory control circuit unit is used for reading the physical unit and updating the reading times of the physical unit. The memory control circuit unit is further configured to scan the physical unit when the updated read count is not less than the read count threshold. And the memory control circuit unit is further used for adjusting the threshold of the number of reads according to the number of reads and the number of misalignments.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的操作包括:根據所述實體單元的讀錯位元閥值及最大讀錯位元決定第一讀錯相關因素。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of read errors includes: according to the number of read errors of the physical unit The threshold value and the maximum misreading bit determine the factors related to the first misreading.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述讀取次數及所述讀錯位元調整所述讀取次數閥值的操作包括:根據先前讀取次數閥值、預設讀取次數閥值及所述第一讀錯相關因素決定所述讀取次數閥值。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of misread bits includes: according to the threshold of the number of previous reads, pre- It is assumed that the threshold of the number of readings and the first reading error-related factor determine the threshold of the number of readings.

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述實體單元的抹除次數決定所述預設讀取次數閥值。In an exemplary embodiment of the present invention, the memory control circuit unit determines the preset read count threshold according to the erase count of the physical unit.

在本發明的一範例實施例中,所述記憶體控制電路單元讀取所述實體單元,並更新所述實體單元的所述讀取次數的操作包括:取得所述實體單元的所述讀錯位元。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to read the physical unit and update the read count of the physical unit includes: obtaining the read misalignment of the physical unit Yuan.

在本發明的一範例實施例中,所述記憶體控制電路單元在所述更新的讀取次數不小於所述讀取次數閥值時掃描所述實體單元的操作包括:若所述讀錯位元大於讀錯位元閥值,則將所述實體單元中的資料複製至另一實體單元;以及若所述讀錯位元不大於所述讀錯位元閥值,則記錄所述更新的讀取次數。In an exemplary embodiment of the present invention, the operation of the memory control circuit unit to scan the physical unit when the updated read count is not less than the read count threshold includes: if the read error bit If it is greater than the misreading bit threshold, copy the data in the physical unit to another physical unit; and if the misreading bit is not greater than the misreading threshold, then recording the updated reading times.

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的操作包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the operation of obtaining the misread bit of the physical unit includes: if the misread bit is greater than the maximum misread bit, updating the maximum misread bit according to the misread bit .

在本發明的一範例實施例中,所述記憶體控制電路單元更用以根據所述實體單元的讀錯位元閥值及所述更新的最大讀錯位元決定第二讀錯相關因素,所述記憶體控制電路單元更用以根據先前讀取次數閥值、預設讀取次數閥值及所述第二讀錯相關因素決定更新的讀取次數閥值,並且所述記憶體控制電路單元更用以在所述更新的讀取次數不小於所述更新的讀取次數閥值時掃描所述實體單元。In an exemplary embodiment of the present invention, the memory control circuit unit is further configured to determine a second read error related factor according to the read error bit threshold of the physical unit and the updated maximum read error bit. The memory control circuit unit is further configured to determine an updated threshold of the number of reads according to the threshold of the number of previous reads, the threshold of the number of presets, and the second read error-related factor, and the memory control circuit unit further It is used to scan the physical unit when the updated read count is not less than the updated read count threshold.

基於上述,記憶體管理電路可根據實體單元的讀錯位元閥值及最大讀錯位元決定相關讀錯因素。接著,根據先前讀取次數閥值、預設讀取次數閥值及相關讀錯因素決定讀取次數閥值。在計算出讀取次數閥值之後,記憶體管理電路判斷實體單元的讀取次數是否不小於讀取次數閥值。並在讀取次數不小於讀取次數閥值時掃描實體單元。藉此,可有效減少不必要的資料掃描及/或避免未及時掃描實體單元而造成資料丟失的問題。Based on the above, the memory management circuit can determine the related read error factors according to the read error bit threshold and the maximum read error bit of the physical unit. Then, the threshold of the number of readings is determined according to the threshold of the number of previous readings, the threshold of the number of readings preset, and related reading error factors. After calculating the threshold of the number of reads, the memory management circuit determines whether the number of reads of the physical unit is not less than the threshold of the number of reads. And scan the physical unit when the number of readings is not less than the threshold of the number of readings. In this way, unnecessary data scanning can be effectively reduced and/or the problem of data loss caused by failure to scan the physical unit in time can be avoided.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail in conjunction with the accompanying drawings.

一般而言,記憶體儲存裝置(亦稱,記憶體儲存系統)包括可複寫式非揮發性記憶體模組(rewritable non-volatile memory module)與控制器(亦稱,控制電路)。通常記憶體儲存裝置是與主機系統一起使用,以使主機系統可將資料寫入至記憶體儲存裝置或從記憶體儲存裝置中讀取資料。Generally speaking, a memory storage device (also known as a memory storage system) includes a rewritable non-volatile memory module and a controller (also known as a control circuit). Generally, the memory storage device is used together with the host system, so that the host system can write data to the memory storage device or read data from the memory storage device.

圖1是根據本發明的一範例實施例所繪示的主機系統、記憶體儲存裝置及輸入/輸出(I/O)裝置的示意圖。圖2是根據本發明的另一範例實施例所繪示的主機系統、記憶體儲存裝置及I/O裝置的示意圖。FIG. 1 is a schematic diagram of a host system, a memory storage device, and an input/output (I/O) device according to an exemplary embodiment of the present invention. FIG. 2 is a schematic diagram of a host system, a memory storage device, and an I/O device according to another exemplary embodiment of the present invention.

請參照圖1與圖2,主機系統11一般包括處理器111、隨機存取記憶體(random access memory, RAM)112、唯讀記憶體(read only memory, ROM)113及資料傳輸介面114。處理器111、隨機存取記憶體112、唯讀記憶體113及資料傳輸介面114皆耦接至系統匯流排(system bus)110。1 and FIG. 2, the host system 11 generally includes a processor 111, a random access memory (RAM) 112, a read only memory (ROM) 113, and a data transmission interface 114. The processor 111, the random access memory 112, the read-only memory 113, and the data transmission interface 114 are all coupled to a system bus 110.

在本範例實施例中,主機系統11是透過資料傳輸介面114與記憶體儲存裝置10耦接。例如,主機系統11可經由資料傳輸介面114將資料儲存至記憶體儲存裝置10或從記憶體儲存裝置10中讀取資料。此外,主機系統11是透過系統匯流排110與I/O裝置12耦接。例如,主機系統11可經由系統匯流排110將輸出訊號傳送至I/O裝置12或從I/O裝置12接收輸入訊號。In this exemplary embodiment, the host system 11 is coupled to the memory storage device 10 through the data transmission interface 114. For example, the host system 11 can store data to the memory storage device 10 or read data from the memory storage device 10 via the data transmission interface 114. In addition, the host system 11 is coupled to the I/O device 12 through the system bus 110. For example, the host system 11 can transmit output signals to the I/O device 12 or receive input signals from the I/O device 12 via the system bus 110.

在本範例實施例中,處理器111、隨機存取記憶體112、唯讀記憶體113及資料傳輸介面114可設置在主機系統11的主機板20上。資料傳輸介面114的數目可以是一或多個。透過資料傳輸介面114,主機板20可以經由有線或無線方式耦接至記憶體儲存裝置10。記憶體儲存裝置10可例如是隨身碟201、記憶卡202、固態硬碟(Solid State Drive, SSD)203或無線記憶體儲存裝置204。無線記憶體儲存裝置204可例如是近距離無線通訊(Near Field Communication, NFC)記憶體儲存裝置、無線傳真(WiFi)記憶體儲存裝置、藍牙(Bluetooth)記憶體儲存裝置或低功耗藍牙記憶體儲存裝置(例如,iBeacon)等以各式無線通訊技術為基礎的記憶體儲存裝置。此外,主機板20也可以透過系統匯流排110耦接至全球定位系統(Global Positioning System, GPS)模組205、網路介面卡206、無線傳輸裝置207、鍵盤208、螢幕209、喇叭210等各式I/O裝置。例如,在一範例實施例中,主機板20可透過無線傳輸裝置207存取無線記憶體儲存裝置204。In this exemplary embodiment, the processor 111, the random access memory 112, the read-only memory 113, and the data transmission interface 114 may be disposed on the motherboard 20 of the host system 11. The number of data transmission interfaces 114 may be one or more. Through the data transmission interface 114, the motherboard 20 can be coupled to the memory storage device 10 in a wired or wireless manner. The memory storage device 10 may be, for example, a flash drive 201, a memory card 202, a solid state drive (SSD) 203, or a wireless memory storage device 204. The wireless memory storage device 204 may be, for example, a Near Field Communication (NFC) memory storage device, a wireless fax (WiFi) memory storage device, a Bluetooth (Bluetooth) memory storage device, or a Bluetooth low energy memory device. Storage devices (for example, iBeacon) and other memory storage devices based on various wireless communication technologies. In addition, the motherboard 20 can also be coupled to a Global Positioning System (GPS) module 205, a network interface card 206, a wireless transmission device 207, a keyboard 208, a screen 209, a speaker 210, etc. through the system bus 110. Type I/O device. For example, in an exemplary embodiment, the motherboard 20 can access the wireless memory storage device 204 through the wireless transmission device 207.

在一範例實施例中,所提及的主機系統為可實質地與記憶體儲存裝置配合以儲存資料的任意系統。雖然在上述範例實施例中,主機系統是以電腦系統來作說明,然而,圖3是根據本發明的另一範例實施例所繪示的主機系統與記憶體儲存裝置的示意圖。請參照圖3,在另一範例實施例中,主機系統31也可以是數位相機、攝影機、通訊裝置、音訊播放器、視訊播放器或平板電腦等系統,而記憶體儲存裝置30可為其所使用的安全數位(Secure Digital, SD)卡32、小型快閃(Compact Flash, CF)卡33或嵌入式儲存裝置34等各式非揮發性記憶體儲存裝置。嵌入式儲存裝置34包括嵌入式多媒體卡(embedded Multi Media Card, eMMC)341及/或嵌入式多晶片封裝(embedded Multi Chip Package, eMCP)儲存裝置342等各類型將記憶體模組直接耦接於主機系統的基板上的嵌入式儲存裝置。In an exemplary embodiment, the host system mentioned is any system that can substantially cooperate with a memory storage device to store data. Although in the above exemplary embodiment, the host system is described as a computer system, FIG. 3 is a schematic diagram of a host system and a memory storage device according to another exemplary embodiment of the present invention. 3, in another exemplary embodiment, the host system 31 can also be a system such as a digital camera, a video camera, a communication device, an audio player, a video player, or a tablet computer, and the memory storage device 30 can be used for it. Various non-volatile memory storage devices such as a Secure Digital (SD) card 32, a Compact Flash (CF) card 33, or an embedded storage device 34 are used. The embedded storage device 34 includes an embedded Multi Media Card (eMMC) 341 and/or an embedded Multi Chip Package (embedded Multi Chip Package, eMCP) storage device 342. The memory module is directly coupled to the Embedded storage device on the substrate of the host system.

圖4是根據本發明的一範例實施例所繪示的記憶體儲存裝置的概要方塊圖。請參照圖4,記憶體儲存裝置10包括連接介面單元402、記憶體控制電路單元404與可複寫式非揮發性記憶體模組406。FIG. 4 is a schematic block diagram of a memory storage device according to an exemplary embodiment of the present invention. 4, the memory storage device 10 includes a connection interface unit 402, a memory control circuit unit 404, and a rewritable non-volatile memory module 406.

連接介面單元402用以將記憶體儲存裝置10耦接至主機系統11。記憶體儲存裝置10可透過連接介面單元402與主機系統11通訊。在本範例實施例中,連接介面單元402是相容於序列先進附件(Serial Advanced Technology Attachment, SATA)標準。然而,必須瞭解的是,本發明不限於此,連接介面單元402亦可以是符合並列先進附件(Parallel Advanced Technology Attachment, PATA)標準、電氣和電子工程師協會(Institute of Electrical and Electronic Engineers, IEEE)1394標準、高速周邊零件連接介面(Peripheral Component Interconnect Express, PCI Express)標準、通用序列匯流排(Universal Serial Bus, USB)標準、SD介面標準、超高速一代(Ultra High Speed-I, UHS-I)介面標準、超高速二代(Ultra High Speed-II, UHS-II)介面標準、記憶棒(Memory Stick, MS)介面標準、MCP介面標準、MMC介面標準、eMMC介面標準、通用快閃記憶體(Universal Flash Storage, UFS)介面標準、eMCP介面標準、CF介面標準、整合式驅動電子介面(Integrated Device Electronics, IDE)標準或其他適合的標準。連接介面單元402可與記憶體控制電路單元404封裝在一個晶片中,或者連接介面單元402是佈設於一包含記憶體控制電路單元404之晶片外。The connection interface unit 402 is used to couple the memory storage device 10 to the host system 11. The memory storage device 10 can communicate with the host system 11 through the connection interface unit 402. In this exemplary embodiment, the connection interface unit 402 is compatible with the Serial Advanced Technology Attachment (SATA) standard. However, it must be understood that the present invention is not limited to this, and the connection interface unit 402 may also conform to the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 Standard, high-speed peripheral component connection interface (Peripheral Component Interconnect Express, PCI Express) standard, Universal Serial Bus (USB) standard, SD interface standard, Ultra High Speed-I (UHS-I) interface Standard, Ultra High Speed-II (UHS-II) interface standard, Memory Stick (MS) interface standard, MCP interface standard, MMC interface standard, eMMC interface standard, universal flash memory (Universal Flash Storage, UFS) interface standard, eMCP interface standard, CF interface standard, Integrated Device Electronics (IDE) standard or other suitable standards. The connection interface unit 402 and the memory control circuit unit 404 can be packaged in one chip, or the connection interface unit 402 can be arranged outside a chip including the memory control circuit unit 404.

記憶體控制電路單元404用以執行以硬體型式或韌體型式實作的多個邏輯閘或控制指令並且根據主機系統11的指令在可複寫式非揮發性記憶體模組406中進行資料的寫入、讀取與抹除等運作。The memory control circuit unit 404 is used to execute a plurality of logic gates or control commands implemented in a hardware type or a firmware type, and perform data processing in the rewritable non-volatile memory module 406 according to the instructions of the host system 11 Operations such as writing, reading, and erasing.

可複寫式非揮發性記憶體模組406是耦接至記憶體控制電路單元404並且用以儲存主機系統11所寫入之資料。可複寫式非揮發性記憶體模組406可以是單階記憶胞(Single Level Cell, SLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存1個位元的快閃記憶體模組)、多階記憶胞(Multi Level Cell, MLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存2個位元的快閃記憶體模組)、三階記憶胞(Triple Level Cell,TLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存3個位元的快閃記憶體模組)、四階記憶胞(Quad Level Cell,QLC)NAND型快閃記憶體模組(即,一個記憶胞中可儲存4個位元的快閃記憶體模組)、其他快閃記憶體模組或其他具有相同特性的記憶體模組。The rewritable non-volatile memory module 406 is coupled to the memory control circuit unit 404 and used to store data written by the host system 11. The rewritable non-volatile memory module 406 can be a single level cell (SLC) NAND flash memory module (that is, a flash memory that can store 1 bit in a memory cell). Module), Multi Level Cell (MLC) NAND-type flash memory module (that is, a flash memory module that can store 2 bits in a memory cell), and a third-level memory cell ( Triple Level Cell (TLC) NAND flash memory modules (that is, a flash memory module that can store 3 bits in a memory cell), Quad Level Cell (QLC) NAND flash memory modules Flash memory module (that is, a flash memory module that can store 4 bits in a memory cell), other flash memory modules, or other memory modules with the same characteristics.

可複寫式非揮發性記憶體模組406中的每一個記憶胞是以電壓(以下亦稱為臨界電壓)的改變來儲存一或多個位元。具體來說,每一個記憶胞的控制閘極(control gate)與通道之間有一個電荷捕捉層。透過施予一寫入電壓至控制閘極,可以改變電荷補捉層的電子量,進而改變記憶胞的臨界電壓。此改變記憶胞之臨界電壓的操作亦稱為“把資料寫入至記憶胞”或“程式化(programming)記憶胞”。隨著臨界電壓的改變,可複寫式非揮發性記憶體模組406中的每一個記憶胞具有多個儲存狀態。透過施予讀取電壓可以判斷一個記憶胞是屬於哪一個儲存狀態,藉此取得此記憶胞所儲存的一或多個位元。Each memory cell in the rewritable non-volatile memory module 406 stores one or more bits with a change in voltage (hereinafter also referred to as a threshold voltage). Specifically, there is a charge trapping layer between the control gate and the channel of each memory cell. By applying a write voltage to the control gate, the amount of electrons in the charge trapping layer can be changed, thereby changing the threshold voltage of the memory cell. This operation of changing the threshold voltage of the memory cell is also referred to as "writing data into the memory cell" or "programming the memory cell". As the threshold voltage changes, each memory cell in the rewritable non-volatile memory module 406 has multiple storage states. By applying the read voltage, it is possible to determine which storage state a memory cell belongs to, thereby obtaining one or more bits stored in the memory cell.

在本範例實施例中,可複寫式非揮發性記憶體模組406的記憶胞可構成多個實體程式化單元,並且此些實體程式化單元可構成多個實體抹除單元。具體來說,同一條字元線上的記憶胞可組成一或多個實體程式化單元。若每一個記憶胞可儲存2個以上的位元,則同一條字元線上的實體程式化單元可至少可被分類為下實體程式化單元與上實體程式化單元。例如,一記憶胞的最低有效位元(Least Significant Bit,LSB)是屬於下實體程式化單元,並且一記憶胞的最高有效位元(Most Significant Bit,MSB)是屬於上實體程式化單元。一般來說,在MLC NAND型快閃記憶體中,下實體程式化單元的寫入速度會大於上實體程式化單元的寫入速度,及/或下實體程式化單元的可靠度是高於上實體程式化單元的可靠度。In this exemplary embodiment, the memory cells of the rewritable non-volatile memory module 406 can constitute a plurality of physical programming units, and these physical programming units can constitute a plurality of physical erasing units. Specifically, the memory cells on the same character line can form one or more physical programming units. If each memory cell can store more than two bits, the physical programming unit on the same character line can be at least classified into a lower physical programming unit and an upper physical programming unit. For example, the Least Significant Bit (LSB) of a memory cell belongs to the lower physical programming unit, and the Most Significant Bit (MSB) of a memory cell belongs to the upper physical programming unit. Generally speaking, in MLC NAND flash memory, the writing speed of the lower physical programming unit is higher than that of the upper physical programming unit, and/or the reliability of the lower physical programming unit is higher than that of the upper physical programming unit. The reliability of the physical programming unit.

在本範例實施例中,實體程式化單元為程式化的最小單元。即,實體程式化單元為寫入資料的最小單元。例如,實體程式化單元可為實體頁面(page)或是實體扇(sector)。若實體程式化單元為實體頁面,則此些實體程式化單元可包括資料位元區與冗餘(redundancy)位元區。資料位元區包含多個實體扇,用以儲存使用者資料,而冗餘位元區用以儲存系統資料(例如,錯誤更正碼等管理資料)。在本範例實施例中,資料位元區包含32個實體扇,且一個實體扇的大小為512位元組(byte, B)。然而,在其他範例實施例中,資料位元區中也可包含8個、16個或數目更多或更少的實體扇,並且每一個實體扇的大小也可以是更大或更小。另一方面,實體抹除單元為抹除之最小單位。亦即,每一實體抹除單元含有最小數目之一併被抹除之記憶胞。例如,實體抹除單元為實體區塊(block)。In this exemplary embodiment, the physical programming unit is the smallest programming unit. That is, the physical programming unit is the smallest unit for writing data. For example, the physical programming unit may be a physical page (page) or a physical sector (sector). If the physical programming unit is a physical page, these physical programming units may include a data bit area and a redundancy bit area. The data bit area includes multiple physical sectors for storing user data, and the redundant bit area is used for storing system data (for example, management data such as error correction codes). In this exemplary embodiment, the 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 size of each physical sector can also be larger or smaller. On the other hand, the physical erasure unit is the smallest unit of erasure. That is, each physical erasing unit contains one of the smallest number of memory cells to be erased. For example, the physical erasing unit is a physical block.

圖5是根據本發明的一範例實施例所繪示的記憶體控制電路單元的概要方塊圖。請參照圖5,記憶體控制電路單元404包括記憶體管理電路502、主機介面504及記憶體介面506。FIG. 5 is a schematic block diagram of a memory control circuit unit according to an exemplary embodiment of the present invention. 5, the memory control circuit unit 404 includes a memory management circuit 502, a host interface 504, and a memory interface 506.

記憶體管理電路502用以控制記憶體控制電路單元404的整體運作。具體來說,記憶體管理電路502具有多個控制指令,並且在記憶體儲存裝置10運作時,此些控制指令會被執行以進行資料的寫入、讀取與抹除等運作。以下說明記憶體管理電路502的操作時,等同於說明記憶體控制電路單元404的操作。The memory management circuit 502 is used to control the overall operation of the memory control circuit unit 404. Specifically, the memory management circuit 502 has a plurality of control commands, and when the memory storage device 10 is operating, these control commands are executed to perform operations such as writing, reading, and erasing data. The following description of the operation of the memory management circuit 502 is equivalent to the description of the operation of the memory control circuit unit 404.

在本範例實施例中,記憶體管理電路502的控制指令是以韌體型式來實作。例如,記憶體管理電路502具有微處理器單元(未繪示)與唯讀記憶體(未繪示),並且此些控制指令是被燒錄至此唯讀記憶體中。當記憶體儲存裝置10運作時,此些控制指令會由微處理器單元來執行以進行資料的寫入、讀取與抹除等運作。In this exemplary embodiment, the control commands of the memory management circuit 502 are implemented in firmware. For example, the memory management circuit 502 has a microprocessor unit (not shown) and a read-only memory (not shown), and these control commands are burned into the read-only memory. When the memory storage device 10 is operating, these control commands are executed by the microprocessor unit to perform operations such as writing, reading, and erasing data.

在另一範例實施例中,記憶體管理電路502的控制指令亦可以程式碼型式儲存於可複寫式非揮發性記憶體模組406的特定區域(例如,記憶體模組中專用於存放系統資料的系統區)中。此外,記憶體管理電路502具有微處理器單元(未繪示)、唯讀記憶體(未繪示)及隨機存取記憶體(未繪示)。特別是,此唯讀記憶體具有開機碼(boot code),並且當記憶體控制電路單元404被致能時,微處理器單元會先執行此開機碼來將儲存於可複寫式非揮發性記憶體模組406中之控制指令載入至記憶體管理電路502的隨機存取記憶體中。之後,微處理器單元會運轉此些控制指令以進行資料的寫入、讀取與抹除等運作。In another exemplary embodiment, the control commands of the memory management circuit 502 can also be stored in a specific area of the rewritable non-volatile memory module 406 in the form of code (for example, the memory module is dedicated to storing system data). System area). In addition, the memory management circuit 502 has a microprocessor unit (not shown), a read-only memory (not shown), and a random access memory (not shown). In particular, the read-only memory has a boot code, and when the memory control circuit unit 404 is enabled, the microprocessor unit will first execute the boot code to store it in the rewritable non-volatile memory The control commands in the volume module 406 are loaded into the random access memory of the memory management circuit 502. After that, the microprocessor unit runs these control commands to perform data writing, reading, and erasing operations.

此外,在另一範例實施例中,記憶體管理電路502的控制指令亦可以一硬體型式來實作。例如,記憶體管理電路502包括微控制器、記憶胞管理電路、記憶體寫入電路、記憶體讀取電路、記憶體抹除電路與資料處理電路。記憶胞管理電路、記憶體寫入電路、記憶體讀取電路、記憶體抹除電路與資料處理電路是耦接至微控制器。記憶胞管理電路用以管理可複寫式非揮發性記憶體模組406的記憶胞或記憶胞群組。記憶體寫入電路用以對可複寫式非揮發性記憶體模組406下達寫入指令序列以將資料寫入至可複寫式非揮發性記憶體模組406中。記憶體讀取電路用以對可複寫式非揮發性記憶體模組406下達讀取指令序列以從可複寫式非揮發性記憶體模組406中讀取資料。記憶體抹除電路用以對可複寫式非揮發性記憶體模組406下達抹除指令序列以將資料從可複寫式非揮發性記憶體模組406中抹除。資料處理電路用以處理欲寫入至可複寫式非揮發性記憶體模組406的資料以及從可複寫式非揮發性記憶體模組406中讀取的資料。寫入指令序列、讀取指令序列及抹除指令序列可各別包括一或多個程式碼或指令碼並且用以指示可複寫式非揮發性記憶體模組406執行相對應的寫入、讀取及抹除等操作。在一範例實施例中,記憶體管理電路502還可以下達其他類型的指令序列給可複寫式非揮發性記憶體模組406以指示執行相對應的操作。In addition, in another exemplary embodiment, the control commands of the memory management circuit 502 can also be implemented in a hardware type. For example, the memory management circuit 502 includes a microcontroller, a memory cell management circuit, a memory writing circuit, a memory reading circuit, a memory erasing circuit, and a data processing circuit. The memory cell management circuit, the memory writing circuit, the memory reading circuit, the memory erasing circuit and the data processing circuit are coupled to the microcontroller. The memory cell management circuit is used to manage the memory cell or the memory cell group of the rewritable non-volatile memory module 406. The memory write circuit is used to issue a write command sequence to the rewritable non-volatile memory module 406 to write data into the rewritable non-volatile memory module 406. The memory read circuit is used to issue a read command sequence to the rewritable non-volatile memory module 406 to read data from the rewritable non-volatile memory module 406. The memory erasing circuit is used to issue an erasing command sequence to the rewritable non-volatile memory module 406 to erase data from the rewritable non-volatile memory module 406. The data processing circuit is used for processing data to be written to the rewritable non-volatile memory module 406 and data read from the rewritable non-volatile memory module 406. The write command sequence, the read command sequence, and the erase command sequence may each include one or more program codes or command codes and are used to instruct the rewritable non-volatile memory module 406 to perform corresponding writing and reading. Take and erase operations. In an exemplary embodiment, the memory management circuit 502 can also send other types of command sequences to the rewritable non-volatile memory module 406 to instruct to perform corresponding operations.

主機介面504是耦接至記憶體管理電路502。記憶體管理電路502可透過主機介面504與主機系統11通訊。主機介面504可用以接收與識別主機系統11所傳送的指令與資料。例如,主機系統11所傳送的指令與資料可透過主機介面504來傳送至記憶體管理電路502。此外,記憶體管理電路502可透過主機介面504將資料傳送至主機系統11。在本範例實施例中,主機介面504是相容於SATA標準。然而,必須瞭解的是本發明不限於此,主機介面504亦可以是相容於PATA標準、IEEE 1394標準、PCI Express標準、USB標準、SD標準、UHS-I標準、UHS-II標準、MS標準、MMC標準、eMMC標準、UFS標準、CF標準、IDE標準或其他適合的資料傳輸標準。The host interface 504 is coupled to the memory management circuit 502. The memory management circuit 502 can communicate with the host system 11 through the host interface 504. The host interface 504 can be used to receive and identify commands and data sent by the host system 11. For example, the commands and data sent by the host system 11 can be sent to the memory management circuit 502 through the host interface 504. In addition, the memory management circuit 502 can transmit data to the host system 11 through the host interface 504. In this exemplary embodiment, the host interface 504 is compatible with the SATA standard. However, it must be understood that the present invention is not limited to this. The host interface 504 can also be compatible with PATA standards, IEEE 1394 standards, PCI Express standards, USB standards, SD standards, UHS-I standards, UHS-II standards, and MS standards. , MMC standard, eMMC standard, UFS standard, CF standard, IDE standard or other suitable data transmission standards.

記憶體介面506是耦接至記憶體管理電路502並且用以存取可複寫式非揮發性記憶體模組406。也就是說,欲寫入至可複寫式非揮發性記憶體模組406的資料會經由記憶體介面506轉換為可複寫式非揮發性記憶體模組406所能接受的格式。具體來說,若記憶體管理電路502要存取可複寫式非揮發性記憶體模組406,記憶體介面506會傳送對應的指令序列。例如,這些指令序列可包括指示寫入資料的寫入指令序列、指示讀取資料的讀取指令序列、指示抹除資料的抹除指令序列、以及用以指示各種記憶體操作(例如,改變讀取電壓準位或執行垃圾回收操作等等)的相對應的指令序列。這些指令序列例如是由記憶體管理電路502產生並且透過記憶體介面506傳送至可複寫式非揮發性記憶體模組406。這些指令序列可包括一或多個訊號,或是在匯流排上的資料。這些訊號或資料可包括指令碼或程式碼。例如,在讀取指令序列中,會包括讀取的辨識碼、記憶體位址等資訊。The memory interface 506 is coupled to the memory management circuit 502 and used to access the rewritable non-volatile memory module 406. In other words, the data to be written into the rewritable non-volatile memory module 406 is converted into a format acceptable by the rewritable non-volatile memory module 406 through the memory interface 506. Specifically, if the memory management circuit 502 needs to access the rewritable non-volatile memory module 406, the memory interface 506 will send the corresponding command sequence. For example, these command sequences may include a write command sequence instructing to write data, a read command sequence instructing to read data, an erase command sequence instructing to erase data, and various memory operations (for example, changing read Take the voltage level or execute the garbage collection operation, etc.) corresponding to the instruction sequence. These command sequences are generated by the memory management circuit 502 and transmitted to the rewritable non-volatile memory module 406 through the memory interface 506, for example. These command sequences can include one or more signals, or data on the bus. These signals or data may include script codes or program codes. For example, in the read command sequence, the read identification code, memory address and other information will be included.

在一範例實施例中,記憶體控制電路單元404還包括錯誤檢查與校正電路508、緩衝記憶體510與電源管理電路512。In an exemplary embodiment, the memory control circuit unit 404 further includes an error checking and correction circuit 508, a buffer memory 510, and a power management circuit 512.

錯誤檢查與校正電路508是耦接至記憶體管理電路502並且用以執行錯誤檢查與校正操作以確保資料的正確性。具體來說,當記憶體管理電路502從主機系統11中接收到寫入指令時,錯誤檢查與校正電路508會為對應此寫入指令的資料產生對應的錯誤更正碼(error correcting code, ECC)及/或錯誤檢查碼(error detecting code,EDC),並且記憶體管理電路502會將對應此寫入指令的資料與對應的錯誤更正碼及/或錯誤檢查碼寫入至可複寫式非揮發性記憶體模組406中。之後,當記憶體管理電路502從可複寫式非揮發性記憶體模組406中讀取資料時會同時讀取此資料對應的錯誤更正碼及/或錯誤檢查碼,並且錯誤檢查與校正電路508會依據此錯誤更正碼及/或錯誤檢查碼對所讀取的資料執行錯誤檢查與校正操作。The error checking and correcting circuit 508 is coupled to the memory management circuit 502 and used to perform error checking and correcting operations to ensure the correctness of the data. Specifically, when the memory management circuit 502 receives a write command from the host system 11, the error checking and correction circuit 508 will generate a corresponding error correcting code (ECC) for the data corresponding to the write command. And/or error detecting code (EDC), and the memory management circuit 502 will write the data corresponding to the write command and the corresponding error correction code and/or error check code to the rewritable non-volatile In the memory module 406. After that, when the memory management circuit 502 reads data from the rewritable non-volatile memory module 406, it will read the error correction code and/or error check code corresponding to the data at the same time, and the error check and correction circuit 508 Based on this error correction code and/or error check code, error checking and correction operations will be performed on the read data.

緩衝記憶體510是耦接至記憶體管理電路502並且用以暫存來自於主機系統11的資料與指令或來自於可複寫式非揮發性記憶體模組406的資料。電源管理電路512是耦接至記憶體管理電路502並且用以控制記憶體儲存裝置10的電源。The buffer memory 510 is coupled to the memory management circuit 502 and used to temporarily store data and commands from the host system 11 or data from the rewritable non-volatile memory module 406. The power management circuit 512 is coupled to the memory management circuit 502 and used to control the power of the memory storage device 10.

在一範例實施例中,圖4的可複寫式非揮發性記憶體模組406亦稱為快閃(flash)記憶體模組,且記憶體控制電路單元404亦稱為用於控制快閃記憶體模組的快閃記憶體控制器。在一範例實施例中,圖5的記憶體管理電路502亦稱為快閃記憶體管理電路。In an exemplary embodiment, the rewritable non-volatile memory module 406 of FIG. 4 is also called a flash memory module, and the memory control circuit unit 404 is also called for controlling the flash memory The flash memory controller of the physical module. In an exemplary embodiment, the memory management circuit 502 of FIG. 5 is also referred to as a flash memory management circuit.

圖6是根據本發明的一範例實施例所繪示的管理可複寫式非揮發性記憶體模組的示意圖。請參照圖6,記憶體管理電路502可將可複寫式非揮發性記憶體模組406的實體單元610(0)~610(B)邏輯地分組至儲存區601與替換區602。儲存區601中的實體單元610(0)~610(A)是用以儲存資料,而替換區602中的實體單元610(A+1)~610(B)則是用以替換儲存區601中損壞的實體單元。例如,若從某一個實體單元中讀取的資料所包含的錯誤過多而無法被更正時,此實體單元會被視為是損壞的實體單元。須注意的是,若替換區602中沒有可用的實體抹除單元,則記憶體管理電路502可能會將整個記憶體儲存裝置10宣告為寫入保護(write protect)狀態,而無法再寫入資料。FIG. 6 is a schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention. 6, the memory management circuit 502 can logically group the physical units 610(0) to 610(B) of the rewritable non-volatile memory module 406 into the storage area 601 and the replacement area 602. The physical units 610(0)~610(A) in the storage area 601 are used to store data, and the physical units 610(A+1)~610(B) in the replacement area 602 are used to replace the storage area 601 Damaged physical unit. For example, if the data read from a certain physical unit contains too many errors to be corrected, the physical unit will be regarded as a damaged physical unit. It should be noted that if there is no available physical erasing unit in the replacement area 602, the memory management circuit 502 may declare the entire memory storage device 10 as a write protect state, and no more data can be written. .

在本範例實施例中,每一個實體單元是指一個實體抹除單元。然而,在另一範例實施例中,一個實體單元亦可以是指一個實體位址、一個實體程式化單元或由多個連續或不連續的實體位址組成。記憶體管理電路502會配置邏輯單元612(0)~612(C)以映射儲存區601中的實體單元610(0)~610(A)。在本範例實施例中,每一個邏輯單元是指一個邏輯位址。然而,在另一範例實施例中,一個邏輯單元也可以是指一個邏輯程式化單元、一個邏輯抹除單元或者由多個連續或不連續的邏輯位址組成。此外,邏輯單元612(0)~612(C)中的每一者可被映射至一或多個實體單元。In this exemplary embodiment, each physical unit refers to a physical erasing unit. However, in another exemplary embodiment, a physical unit may also refer to a physical address, a physical programming unit, or consist of multiple continuous or discontinuous physical addresses. The memory management circuit 502 will configure the logical units 612(0)-612(C) to map the physical units 610(0)-610(A) in the storage area 601. In this exemplary embodiment, each logical unit refers to a logical address. However, in another exemplary embodiment, a logic unit may also refer to a logic programming unit, a logic erasing unit, or consist of multiple consecutive or discontinuous logic addresses. In addition, each of the logical units 612(0)-612(C) may be mapped to one or more physical units.

記憶體管理電路502可將邏輯單元與實體單元之間的映射關係(亦稱為邏輯-實體位址映射關係)記錄於至少一邏輯-實體位址映射表。當主機系統11欲從記憶體儲存裝置10讀取資料或寫入資料至記憶體儲存裝置10時,記憶體管理電路502可根據此邏輯-實體位址映射表來執行對於記憶體儲存裝置10的資料存取操作。The memory management circuit 502 can record the mapping relationship between the logical unit and the physical unit (also referred to as the logical-physical address mapping relationship) in at least one logical-physical address mapping table. When the host system 11 wants to read data from the memory storage device 10 or write data to the memory storage device 10, the memory management circuit 502 can perform the processing of the memory storage device 10 according to the logical-physical address mapping table. Data access operations.

在本實施例提供的記憶體管理方法中,記憶體管理電路502會分別計算關聯於各實體單元的讀取次數(read count)的讀取次數閥值(read count threshold)。並且記憶體管理電路502根據計算出的讀取次數閥值與該實體單元累積的讀取次數進行比較,以決定是否要掃描該實體單元。In the memory management method provided in this embodiment, the memory management circuit 502 calculates the read count threshold associated with the read count of each physical unit. In addition, the memory management circuit 502 compares the calculated reading frequency threshold with the accumulated reading frequency of the physical unit to determine whether to scan the physical unit.

本實施例以掃描一實體抹除單元為例。記憶體管理電路502會根據實體抹除單元的讀取次數及讀錯位元調整讀取次數閥值。具體而言,記憶體管理電路502根據實體抹除單元的第一閥值及最大讀錯位元決定第一讀錯相關因素。第一閥值(即讀錯位元閥值)及最大讀錯位元關聯於讀錯位元。舉例而言,記憶體管理電路502可根據以下方程式(1)來計算第一讀錯相關因素。In this embodiment, scanning a physical erasing unit is taken as an example. The memory management circuit 502 adjusts the read count threshold according to the read count and misread bits of the physical erasing unit. Specifically, the memory management circuit 502 determines the first read error related factor according to the first threshold of the physical erasing unit and the maximum read error bit. The first threshold (ie, the threshold for misreading bits) and the maximum misreading bits are related to the misreading bits. For example, the memory management circuit 502 can calculate the first misread-related factor according to the following equation (1).

Figure 02_image001
(1)
Figure 02_image001
(1)

在方程式(1)中,factorerror bit 代表讀錯相關因素,thresholderror bit 代表讀錯位元閥值,並且error bitmax 代表最大讀錯位元(max read error bit)。讀錯位元閥值例如是經由一連串實驗事先決定,其可用於判斷實體抹除單元是否需要刷新(refresh)操作。具體來說,刷新操作是將實體抹除單元中的資料複製至另一實體單元,並將原實體抹除單元抹除後釋放到實體單元回收區中。最大讀錯位元是記錄實體抹除單元中最大的讀錯位元。In the equation (1), the factor error bit represents the read error related factors, the threshold error bit represents the read error bit threshold, and the error bit max represents the maximum read error bit (max read error bit). The threshold for misreading bits is determined in advance through a series of experiments, for example, and can be used to determine whether the physical erasing unit needs a refresh operation. Specifically, the refresh operation is to copy the data in the physical erasing unit to another physical unit, and then release the original physical erasing unit to the physical unit recovery area after erasing the original physical erasing unit. The maximum read error bit is the largest read error bit in the record entity erasing unit.

接著,記憶體管理電路502會根據第二閥值(即,先前讀取次數閥值)、第三閥值(即,預設讀取次數閥值)及第一讀錯相關因素決定第四閥值(即,讀取次數閥值)。第二閥值及第三閥值關聯於該實體單元的讀取次數。舉例而言,記憶體管理電路502可根據以下方程式(2)來計算讀取次數閥值。Then, the memory management circuit 502 will determine the fourth valve according to the second threshold (ie, the threshold of the number of previous reads), the third threshold (ie, the threshold of the preset number of reads), and the first read error related factors. Value (that is, the threshold of the number of readings). The second threshold and the third threshold are related to the number of readings of the physical unit. For example, the memory management circuit 502 can calculate the threshold of the number of read times according to the following equation (2).

Figure 02_image003
(2)
Figure 02_image003
(2)

在方程式(2)中,thresholdnext 代表讀取次數閥值,thresholdpre 代表先前讀取次數閥值,thresholdnormal 代表預設讀取次數閥值,並且factorerror bit 代表讀錯相關因素。具體而言,先前讀取次數閥值是前一次記憶體管理電路502掃描該實體抹除單元時,用於判斷是否要進行掃描的讀取次數閥值。而預設讀取次數閥值例如是記憶體管理電路502根據該實體抹除單元的抹除次數(erase count)決定。當抹除次數越高,實體抹除單元會有整體空間變小或是壞掉的風險,因此抹除次數與預設讀取次數閥值呈負相關。亦即,實體抹除單元的抹除次數越多,則預設讀取次數閥值越低。換句話說,讀取次數閥值可以根據實體抹除單元的抹除次數而重新計算決定。在一範例實施例中,各抹除次數與預設讀取次數閥值的對應關係可以例如是儲存在查找表中,並且記憶體管理電路502可以將抹除次數輸入至此查找表並將此查找表的輸出作為對應於抹除次數的預設讀取次數閥值。抹除次數與預設讀取次數閥值的對應關係例如下表1所示,其中對於不同的記憶體,抹除次數與預設讀取次數閥值之間的關係亦可能有所不同。對於單階記憶胞(Single Level Cell, SLC)NAND型快閃記憶體模組,預設讀取次數閥值會隨著抹除次數增加而減少。另一方面多階記憶胞(Multi Level Cell, MLC)NAND型快閃記憶體模組,預設讀取次數閥值會隨著抹除次數的增加而先增加然後減少。In equation (2), threshold next represents the threshold of the number of reads, threshold pre represents the threshold of the number of previous reads, threshold normal represents the threshold of the preset number of reads, and factor error bit represents factors related to reading errors. Specifically, the previous read count threshold is the read count threshold used to determine whether to scan the physical erasing unit the previous time when the memory management circuit 502 scans the physical erasing unit. The preset read count threshold is, for example, determined by the memory management circuit 502 according to the erase count of the physical erase unit. When the number of erasing times is higher, the physical erasing unit has the risk of becoming smaller or broken. Therefore, the number of erasing times is negatively correlated with the preset reading number threshold. That is, the more the erasing times of the physical erasing unit, the lower the preset reading times threshold. In other words, the threshold of the number of reads can be recalculated and determined according to the number of erasing of the physical erasing unit. In an exemplary embodiment, the corresponding relationship between each erase count and the preset read count threshold may be stored in a look-up table, for example, and the memory management circuit 502 may input the erase count into the look-up table and look it up. The output of the table is used as the preset reading number threshold corresponding to the number of erasures. The corresponding relationship between the number of erasing times and the threshold of the preset read times is shown in Table 1 below. For different memories, the relationship between the number of erasing and the threshold of the preset read times may be different. For Single Level Cell (SLC) NAND flash memory modules, the default read threshold will decrease as the number of erases increases. On the other hand, for Multi Level Cell (MLC) NAND flash memory modules, the default read threshold will first increase and then decrease as the number of erases increases.

表1   抹除次數 預設讀取次數閥值 FULL SLC Erase Count Group 00-50 5.0M 51-4000 5.0M 4001-10000 3.2M 10001-20000 2.5M 20001- 600k FULL TLC Erase Count Group 0-50 1.0M 51-150 2.5M 151-500 1.9M 501-1000 1.4M 1001- 500k Open SLC Erase Count Group 00-50 3.0M 51-4000 3.0M 4001-10000 2.1M 10001-20000 1.6M 20001- 400k Open TLC Erase Count Group 0-50 500k 51-150 1.4M 151-500 1.1M 501-1000 800k 1001- 250k Table 1 Number of erasures Preset reading threshold FULL SLC Erase Count Group 00-50 5.0M 51-4000 5.0M 4001-10000 3.2M 10001-20000 2.5M 20001- 600k FULL TLC Erase Count Group 0-50 1.0M 51-150 2.5M 151-500 1.9M 501-1000 1.4M 1001- 500k Open SLC Erase Count Group 00-50 3.0M 51-4000 3.0M 4001-10000 2.1M 10001-20000 1.6M 20001- 400k Open TLC Erase Count Group 0-50 500k 51-150 1.4M 151-500 1.1M 501-1000 800k 1001- 250k

在其他實施例中,各抹除次數與預設讀取次數閥值的對應關係也可以利用方程式計算而得,本發明不在此限制。In other embodiments, the corresponding relationship between the number of erasing times and the threshold value of the preset reading times can also be calculated using equations, and the present invention is not limited here.

在一範例實施例中,方程式(1)及(2)亦可以被調整,例如加入其他變數或調整至少部分邏輯運算元素,以符合實務需求,只要可計算出關於讀取次數閥值與實體抹除單元的最大讀錯位元呈負相關即可。In an exemplary embodiment, equations (1) and (2) can also be adjusted, such as adding other variables or adjusting at least part of the logical operation elements to meet practical needs, as long as the threshold for the number of reads and the physical wipe can be calculated In addition, the maximum misreading bit of the unit is negatively correlated.

當接收來自主機系統11的讀取指令時,記憶體管理電路502會發送讀取指令序列以指示可複寫式非揮發性記憶體模組406從此些記憶胞讀取資料。記憶體管理電路502會根據讀取指令讀取實體程式化單元(又稱實體頁),並更新實體抹除單元的讀取次數。具體而言,在記憶體管理電路502每次讀取實體程式化單元時,將持續累計實體抹除單元的讀取次數並更新讀取次數。記憶體管理電路502判斷更新的讀取次數是否不小於讀取次數閥值,並在更新的讀取次數不小於讀取次數閥值時掃描該實體抹除單元。若更新的讀取次數小於讀取次數閥值,記憶體管理電路502繼續接收來自主機系統11的讀取指令,並且繼續累計實體抹除單元的讀取次數直到大於或等於讀取次數閥值。When receiving a read command from the host system 11, the memory management circuit 502 will send a read command sequence to instruct the rewritable non-volatile memory module 406 to read data from these memory cells. The memory management circuit 502 reads the physical programming unit (also called the physical page) according to the read command, and updates the read count of the physical erase unit. Specifically, each time the memory management circuit 502 reads the physical programming unit, it will continue to accumulate the number of reads of the physical erase unit and update the number of reads. The memory management circuit 502 judges whether the updated read count is not less than the read count threshold, and scans the physical erasing unit when the updated read count is not less than the read count threshold. If the updated read count is less than the read count threshold, the memory management circuit 502 continues to receive the read command from the host system 11, and continues to accumulate the read count of the physical erasing unit until it is greater than or equal to the read count threshold.

藉由綜合考慮抹除次數、讀錯位元等因素對讀取次數閥值的影響,本實施例提供的記憶體管理方法可以準確的判斷是否需要進行掃描實體抹除單元。By comprehensively considering the influence of the number of erasing times, misreading bits and other factors on the threshold of reading times, the memory management method provided in this embodiment can accurately determine whether the physical erasing unit needs to be scanned.

在本實施例提供的記憶體管理方法中,記憶體管理電路502還可以在掃描實體抹除單元後根據其他條件判斷對實體抹除單元進行的操作。具體來說,掃描實體抹除單元可以例如讀取該實體抹除單元的全部實體程式化單元或部分實體程式化單元(例如僅讀取奇數頁或偶數頁、隔固定頁如三頁或五頁讀取實體程式化單元),而記憶體管理電路502在如上所述的讀取實體抹除單元的實體程式化單元時,即可取得各實體程式化單元的讀錯位元(read error bit)。記憶體管理電路502判斷更新的讀錯位元是否大於第一閥值(即,讀錯位元閥值)。若記憶體管理電路502判斷讀錯位元大於讀錯位元閥值,則刷新上述實體抹除單元。在刷新操作中,記憶體管理電路502將上述實體抹除單元中的資料複製至另一實體抹除單元,並將上述實體抹除單元抹除後釋放到實體抹除單元回收區中。若記憶體管理電路502判斷讀錯位元不大於讀錯位元閥值,則記錄更新的讀取次數,並且可回到步驟S803,記憶體管理電路502繼續接收來自主機系統11的讀取指令,並且在讀取實體抹除單元時更新讀錯位元。In the memory management method provided in this embodiment, the memory management circuit 502 can also determine the operation performed on the physical erasing unit according to other conditions after scanning the physical erasing unit. Specifically, the scanning physical erasing unit can, for example, read all the physical programming units or part of the physical programming units of the physical erasing unit (for example, reading only odd or even pages, fixed pages such as three or five pages). Read the physical programming unit), and the memory management circuit 502 can obtain the read error bit of each physical programming unit when reading the physical programming unit of the physical erasing unit as described above. The memory management circuit 502 determines whether the updated misread bit is greater than the first threshold (that is, the misread threshold). If the memory management circuit 502 determines that the misreading bit is greater than the misreading bit threshold, it refreshes the above-mentioned physical erasing unit. In the refresh operation, the memory management circuit 502 copies the data in the aforementioned physical erasing unit to another physical erasing unit, and releases the aforementioned physical erasing unit to the physical erasing unit recovery area after erasing. If the memory management circuit 502 determines that the read error bit is not greater than the read error bit threshold, it records the updated number of reads, and can return to step S803, the memory management circuit 502 continues to receive read commands from the host system 11, and The read error bit is updated when the physical erase unit is read.

在本實施例提供的記憶體管理方法中,記憶體管理電路502會根據不同條件重新計算讀取次數閥值。例如,根據實體單元的讀錯位元更新最大讀錯位元。具體而言,記憶體管理電路502會判斷讀錯位元是否大於最大讀錯位元。若記憶體管理電路502判斷所讀取的實體程式化單元的讀錯位元大於最大讀錯位元,則根據讀錯位元更新最大讀錯位元。若判斷所讀取的實體程式化單元的讀錯位元不大於最大讀錯位元,記憶體管理電路502繼續接收來自主機系統11的讀取指令,並且在讀取實體單元時更新讀錯位元。In the memory management method provided in this embodiment, the memory management circuit 502 recalculates the threshold of the number of reads according to different conditions. For example, the maximum read error bit is updated according to the read error bit of the physical unit. Specifically, the memory management circuit 502 determines whether the misread bit is greater than the maximum misread bit. If the memory management circuit 502 determines that the read error bit of the read physical programming unit is greater than the maximum read error bit, then the maximum read error bit is updated according to the read error bit. If it is determined that the read error bit of the read physical programming unit is not greater than the maximum read error bit, the memory management circuit 502 continues to receive the read command from the host system 11, and updates the read error bit when reading the physical unit.

在本範例實施例中,記憶體管理電路502在更新最大讀錯位元後重新計算讀取次數閥值。具體而言,記憶體管理電路502會根據實體單元的讀錯位元閥值及更新的最大讀錯位元決定第二讀錯相關因素。接著,根據先前讀取次數閥值、預設讀取次數閥值及第二讀錯相關因素決定第五閥值(即,更新的讀取次數閥值)。並且在更新的讀取次數不小於更新的讀取次數閥值時掃描實體單元。In this exemplary embodiment, the memory management circuit 502 recalculates the threshold of the number of read times after updating the maximum read error bit. Specifically, the memory management circuit 502 determines the second misread-related factor according to the read error bit threshold of the physical unit and the updated maximum read error bit. Then, the fifth threshold (ie, the updated threshold of the number of readings) is determined according to the threshold of the number of previous readings, the threshold of the preset readings, and the second reading error-related factors. And scan the physical unit when the updated reading times are not less than the updated reading times threshold.

圖7是根據本發明的一範例實施例所繪示的記憶體管理方法的流程圖。請參照圖7,在步驟S701中,根據實體單元的第一閥值及最大讀錯位元決定第一相關因素。在步驟S702中,根據第二閥值、第三閥值及第一相關因素決定第四閥值。在步驟S703中,讀取指令讀取實體單元,並更新實體單元的讀取次數。在步驟S704中,判斷更新的讀取次數是否不小於第四閥值,並在更新的讀取次數不小於第四閥值(步驟S704,判斷為是)時掃描該實體單元(步驟S705)。若更新的讀取次數小於第四閥值(步驟S704,判斷為否),可回到步驟S703。FIG. 7 is a flowchart of a memory management method according to an exemplary embodiment of the present invention. Referring to FIG. 7, in step S701, the first relevant factor is determined according to the first threshold of the physical unit and the maximum misreading bit. In step S702, the fourth threshold is determined according to the second threshold, the third threshold, and the first related factor. In step S703, the read instruction reads the physical unit, and updates the number of reads of the physical unit. In step S704, it is determined whether the updated number of reads is not less than the fourth threshold, and the physical unit is scanned when the updated number of reads is not less than the fourth threshold (step S704, the determination is YES) (step S705). If the updated number of reads is less than the fourth threshold (step S704, judged as No), return to step S703.

圖8是根據本發明的一範例實施例所繪示的記憶體管理方法的流程圖。請參照圖8,步驟S801~S805的具體內容可參考前述步驟S701~S705,各步驟已詳細說明如上,在此便不再贅述。需說明的是,在步驟S803中,讀取實體單元時,除了更新實體單元的讀取次數之外,還取得實體單元的讀錯位元。在步驟S806中,判斷更新的讀錯位元是否大於第一閥值(即讀錯閥值)。若判斷讀錯位元大於第一閥值(步驟S806,判斷為是),則刷新該實體單元(步驟S807)。若判斷讀錯位元不大於第一閥值(步驟S806,判斷為否),則記錄更新的讀取次數(步驟S808),並且可回到步驟S803。在步驟S809中,判斷讀錯位元是否大於最大讀錯位元。若判斷實體單元的讀錯位元大於最大讀錯位元(步驟S809,判斷為是),則根據讀錯位元更新最大讀錯位元(步驟S810)。若判斷實體單元的讀錯位元不大於最大讀錯位元(步驟S809,判斷為否),可回到步驟S803。FIG. 8 is a flowchart of a memory management method according to an exemplary embodiment of the present invention. Please refer to FIG. 8, the specific content of steps S801 to S805 can refer to the aforementioned steps S701 to S705, each step has been described in detail as above, and will not be repeated here. It should be noted that, in step S803, when the physical unit is read, in addition to updating the read times of the physical unit, the read error bit of the physical unit is also obtained. In step S806, it is determined whether the updated misreading bit is greater than the first threshold (that is, the misreading threshold). If it is determined that the misread bit is greater than the first threshold (step S806, the determination is YES), then the physical unit is refreshed (step S807). If it is judged that the misreading bit is not greater than the first threshold (step S806, judged as No), then the updated reading times are recorded (step S808), and step S803 can be returned to. In step S809, it is determined whether the misread bit is greater than the maximum misread bit. If it is determined that the misread bit of the physical unit is greater than the maximum misread bit (step S809, the judgment is YES), the maximum misread bit is updated according to the misread bit (step S810). If it is determined that the misreading bit of the physical unit is not greater than the maximum misreading bit (step S809, the judgment is No), the step S803 can be returned to.

值得注意的是,圖7至及圖8中各步驟可以實作為多個程式碼或是電路,本發明不加以限制。此外,在上述各實施例中,記憶體管理電路502例如是將各閥值、讀取次數、(最大)讀錯位元、計算結果等資料記錄儲存於可複寫式非揮發性記憶體模組406的特定區域中。It is worth noting that each step in FIG. 7 to FIG. 8 can be implemented as multiple program codes or circuits, and the present invention is not limited. In addition, in the foregoing embodiments, the memory management circuit 502 stores data records such as thresholds, read times, (maximum) misread bits, calculation results, etc., in the rewritable non-volatile memory module 406, for example. In a specific area.

綜上所述,本發明提供的記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元綜合考慮了抹除次數、讀錯位元對讀取次數閥值的影響。並且可根據各實體單元的最大讀錯位元動態計算各實體單元的讀取次數閥值,以準確判斷實體單元是否需要進行資料掃描。藉此,可有效減少不必要的資料掃描及/或避免未及時掃描實體單元而造成資料丟失的問題,提升記憶體的效能。In summary, the memory management method, memory storage device, and memory control circuit unit provided by the present invention comprehensively consider the effects of erasing times and misreading bits on the threshold of read times. In addition, the threshold value of the reading times of each physical unit can be dynamically calculated according to the maximum misread position of each physical unit, so as to accurately determine whether the physical unit needs to scan data. In this way, unnecessary data scanning can be effectively reduced and/or the problem of data loss caused by failure to scan the physical unit in time can be avoided, and the performance of the memory can be improved.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the relevant technical field can make some changes and modifications without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to those defined by the attached patent application scope.

10、30:記憶體儲存裝置 11、31:主機系統 110:系統匯流排 111:處理器 112:隨機存取記憶體 113:唯讀記憶體 114:資料傳輸介面 12:輸入/輸出(I/O)裝置 20:主機板 201:隨身碟 202:記憶卡 203:固態硬碟 204:無線記憶體儲存裝置 205:全球定位系統模組 206:網路介面卡 207:無線傳輸裝置 208:鍵盤 209:螢幕 210:喇叭 32:SD卡 33:CF卡 34:嵌入式儲存裝置 341:嵌入式多媒體卡 342:嵌入式多晶片封裝儲存裝置 402:連接介面單元 404:記憶體控制電路單元 406:可複寫式非揮發性記憶體模組 502:記憶體管理電路 504:主機介面 506:記憶體介面 508:錯誤檢查與校正電路 510:緩衝記憶體 512:電源管理電路 601:儲存區 602:替換區 610(0)~610(B):實體單元 612(0)~612(C):邏輯單元 S701~S705、S801~S810:步驟10.30: Memory storage device 11, 31: host system 110: system bus 111: processor 112: Random Access Memory 113: read-only memory 114: Data Transmission Interface 12: Input/output (I/O) device 20: Motherboard 201: flash drive 202: Memory Card 203: Solid State Drive 204: wireless memory storage device 205: Global Positioning System Module 206: network interface card 207: wireless transmission device 208: keyboard 209: Screen 210: Horn 32: SD card 33: CF card 34: Embedded storage device 341: Embedded Multimedia Card 342: Embedded multi-chip package storage device 402: connection interface unit 404: Memory control circuit unit 406: rewritable non-volatile memory module 502: Memory Management Circuit 504: Host Interface 506: Memory Interface 508: error checking and correction circuit 510: buffer memory 512: power management circuit 601: storage area 602: replacement area 610(0)~610(B): physical unit 612(0)~612(C): logic unit S701~S705, S801~S810: steps

圖1是根據本發明的一範例實施例所繪示的主機系統、記憶體儲存裝置及輸入/輸出(I/O)裝置的示意圖。 圖2是根據本發明的另一範例實施例所繪示的主機系統、記憶體儲存裝置及I/O裝置的示意圖。 圖3是根據本發明的另一範例實施例所繪示的主機系統與記憶體儲存裝置的示意圖。 圖4是根據本發明的一範例實施例所繪示的記憶體儲存裝置的概要方塊圖。 圖5是根據本發明的一範例實施例所繪示的記憶體控制電路單元的概要方塊圖。 圖6是根據本發明的一範例實施例所繪示的管理可複寫式非揮發性記憶體模組的示意圖。 圖7是根據本發明的一範例實施例所繪示的記憶體管理方法的流程圖。 圖8是根據本發明的一範例實施例所繪示的記憶體管理方法的流程圖。FIG. 1 is a schematic diagram of a host system, a memory storage device, and an input/output (I/O) device according to an exemplary embodiment of the present invention. FIG. 2 is a schematic diagram of a host system, a memory storage device, and an I/O device according to another exemplary embodiment of the present invention. 3 is a schematic diagram of a host system and a memory storage device according to another exemplary embodiment of the present invention. FIG. 4 is a schematic block diagram of a memory storage device according to an exemplary embodiment of the present invention. FIG. 5 is a schematic block diagram of a memory control circuit unit according to an exemplary embodiment of the present invention. FIG. 6 is a schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention. FIG. 7 is a flowchart of a memory management method according to an exemplary embodiment of the present invention. FIG. 8 is a flowchart of a memory management method according to an exemplary embodiment of the present invention.

S701~S705:步驟S701~S705: steps

Claims (24)

一種記憶體管理方法,用於一記憶體儲存裝置,且該記憶體管理方法包括: 讀取一實體單元,並更新該實體單元的讀取次數; 在該更新的讀取次數不小於一讀取次數閥值時掃描該實體單元;以及 根據該讀取次數及讀錯位元調整該讀取次數閥值。A memory management method used in a memory storage device, and the memory management method includes: Read a physical unit, and update the read count of the physical unit; Scan the physical unit when the updated read count is not less than a read count threshold; and Adjust the threshold of the number of reads according to the number of reads and read error bits. 如申請專利範圍第1項所述的記憶體管理方法,其中根據該讀取次數及該讀錯位元調整該讀取次數閥值的步驟包括: 根據該實體單元的一讀錯位元閥值及一最大讀錯位元決定一第一讀錯相關因素。For the memory management method described in item 1 of the scope of patent application, the step of adjusting the threshold of the number of reads according to the number of reads and the number of misread bits includes: A first misread related factor is determined according to a misreading bit threshold and a maximum misreading bit of the physical unit. 如申請專利範圍第2項所述的記憶體管理方法,其中根據該讀取次數及該讀錯位元調整該讀取次數閥值的步驟包括: 根據一先前讀取次數閥值、一預設讀取次數閥值及該第一讀錯相關因素決定該讀取次數閥值。For the memory management method described in item 2 of the scope of patent application, the step of adjusting the threshold of the number of reads according to the number of reads and the number of misread bits includes: The threshold of the number of readings is determined according to a threshold of the number of previous readings, a threshold of the number of readings, and the first reading error-related factors. 如申請專利範圍第3項所述的記憶體管理方法,其中該記憶體管理方法包括: 根據該實體單元的抹除次數決定該預設讀取次數閥值。The memory management method described in item 3 of the scope of patent application, wherein the memory management method includes: The threshold of the preset reading times is determined according to the erasing times of the physical unit. 如申請專利範圍第1項所述的記憶體管理方法,其中讀取該實體單元,並更新該實體單元的該讀取次數的步驟更包括: 取得該實體單元的該讀錯位元。For the memory management method described in item 1 of the scope of patent application, the step of reading the physical unit and updating the read count of the physical unit further includes: Obtain the misread bit of the physical unit. 如申請專利範圍第5項所述的記憶體管理方法,其中在該更新的讀取次數不小於該讀取次數閥值時掃描該實體單元的步驟包括: 若該讀錯位元大於一讀錯位元閥值,則將該實體單元中的資料複製至另一實體單元;以及 若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。For the memory management method described in item 5 of the scope of patent application, the step of scanning the physical unit when the updated read count is not less than the read count threshold includes: If the misread bit is greater than a misread bit threshold, copy the data in the physical unit to another physical unit; and If the misreading bit is not greater than the misreading bit threshold, the updated reading times are recorded. 如申請專利範圍第5項所述的記憶體管理方法,其中取得該實體單元的該讀錯位元的步驟更包括: 若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該最大讀錯位元。For the memory management method described in item 5 of the scope of patent application, the step of obtaining the misread bit of the physical unit further includes: If the misread bit is greater than a maximum misread bit, the maximum misread bit is updated according to the misread bit. 如申請專利範圍第7項所述的記憶體管理方法,其中該方法更包括: 根據該實體單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素; 根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數閥值;以及 在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體單元。The memory management method described in item 7 of the scope of patent application, wherein the method further includes: Determine a second misread related factor according to a misreading bit threshold of the physical unit and the updated maximum misreading bit; Determine an updated threshold of the number of readings according to a threshold of the number of previous readings, a threshold of the number of presets, and the second reading error related factors; and Scan the physical unit when the updated reading times are not less than the updated reading times threshold. 一種記憶體儲存裝置,包括: 一連接介面單元,用以耦接至一主機系統; 一可複寫式非揮發性記憶體模組;以及 一記憶體控制電路單元,耦接至該連接介面單元與該可複寫式非揮發性記憶體模組, 其中該記憶體控制電路單元用以讀取該實體單元,並更新該實體單元的讀取次數, 該記憶體控制電路單元更用以在該更新的讀取次數不小於一讀取次數閥值時掃描該實體單元,並且 該記憶體控制電路單元更用以根據該讀取次數及讀錯位元調整該讀取次數閥值。A memory storage device includes: A connection interface unit for coupling to a host system; A rewritable non-volatile memory module; and A memory control circuit unit coupled to the connection interface unit and the rewritable non-volatile memory module, The memory control circuit unit is used to read the physical unit and update the reading times of the physical unit, The memory control circuit unit is further used to scan the physical unit when the updated read count is not less than a read count threshold, and The memory control circuit unit is further used for adjusting the threshold of the number of reads according to the number of reads and read error bits. 如申請專利範圍第9項所述的記憶體儲存裝置,其中該記憶體控制電路單元根據該讀取次數及該讀錯位元調整該讀取次數閥值的操作包括: 根據該實體單元的一讀錯位元閥值及一最大讀錯位元決定一第一讀錯相關因素。For the memory storage device described in claim 9, wherein the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of misread bits includes: A first misread related factor is determined according to a misreading bit threshold and a maximum misreading bit of the physical unit. 如申請專利範圍第10項所述的記憶體儲存裝置,其中該記憶體控制電路單元根據該讀取次數及該讀錯位元調整該讀取次數閥值的操作包括: 根據一先前讀取次數閥值、一預設讀取次數閥值及該第一讀錯相關因素決定該讀取次數閥值。For the memory storage device described in claim 10, the operation of the memory control circuit unit to adjust the threshold of the read count according to the read count and the misread bit includes: The threshold of the number of readings is determined according to a threshold of the number of previous readings, a threshold of the number of readings, and the first reading error-related factors. 如申請專利範圍第11項所述的記憶體儲存裝置,其中該記憶體控制電路單元根據該實體單元的抹除次數決定該預設讀取次數閥值。According to the memory storage device described in claim 11, the memory control circuit unit determines the predetermined read count threshold according to the erasure count of the physical unit. 如申請專利範圍第9項所述的記憶體儲存裝置,其中該記憶體控制電路單元讀取該實體單元,並更新該實體單元的該讀取次數的操作包括: 取得該實體單元的該讀錯位元。In the memory storage device described in claim 9, wherein the operation of the memory control circuit unit to read the physical unit and update the read count of the physical unit includes: Obtain the misread bit of the physical unit. 如申請專利範圍第13項所述的記憶體儲存裝置,其中該記憶體控制電路單元在該更新的讀取次數不小於該讀取次數閥值時掃描該實體單元的操作包括: 若該讀錯位元大於一讀錯位元閥值,則將該實體單元中的資料複製至另一實體單元;以及 若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。For the memory storage device described in item 13 of the scope of patent application, the operation of the memory control circuit unit to scan the physical unit when the updated read count is not less than the read count threshold includes: If the misread bit is greater than a misread bit threshold, copy the data in the physical unit to another physical unit; and If the misreading bit is not greater than the misreading bit threshold, the updated reading times are recorded. 如申請專利範圍第13所述的記憶體儲存裝置,其中取得該實體單元的該讀錯位元的操作包括: 若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該最大讀錯位元。For the memory storage device described in the 13th scope of the patent application, the operation of obtaining the misread bit of the physical unit includes: If the misread bit is greater than a maximum misread bit, the maximum misread bit is updated according to the misread bit. 如申請專利範圍第15所述的記憶體儲存裝置,其中該記憶體控制電路單元更用以根據該實體單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素, 該記憶體控制電路單元更用以根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數閥值,並且 該記憶體控制電路單元更用以在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體單元。For example, the memory storage device according to the scope of patent application, wherein the memory control circuit unit is further used for determining a second misread correlation according to a misread bit threshold of the physical unit and the updated maximum misread bit factor, The memory control circuit unit is further configured to determine an updated threshold for the number of reads according to a threshold for the number of previous reads, a threshold for the number of presets, and the second read error related factors, and The memory control circuit unit is further used to scan the physical unit when the updated read times are not less than the updated read times threshold. 一種記憶體控制電路單元,用於控制包括一可複寫式非揮發性記憶體模組的一記憶體儲存裝置,且該記憶體控制電路單元包括: 一主機介面,用以耦接至一主機系統; 一記憶體介面,用以耦接至該可複寫式非揮發性記憶體模組;以及 一記憶體管理電路,耦接至該主機介面與該記憶體介面, 其中該記憶體控制電路單元用以讀取該實體單元,並更新該實體單元的讀取次數, 該記憶體控制電路單元更用以在該更新的讀取次數不小於一讀取次數閥值時掃描該實體單元,並且 該記憶體控制電路單元更用以根據該讀取次數及讀錯位元調整該讀取次數閥值。A memory control circuit unit for controlling a memory storage device including a rewritable non-volatile memory module, and the memory control circuit unit includes: A host interface for coupling to a host system; A memory interface for coupling to the rewritable non-volatile memory module; and A memory management circuit coupled to the host interface and the memory interface, The memory control circuit unit is used to read the physical unit and update the reading times of the physical unit, The memory control circuit unit is further used to scan the physical unit when the updated read count is not less than a read count threshold, and The memory control circuit unit is further used for adjusting the threshold of the number of reads according to the number of reads and read error bits. 如申請專利範圍第17項所述的記憶體控制電路單元,其中該記憶體控制電路單元根據該讀取次數及該讀錯位元調整該讀取次數閥值的操作包括: 根據該實體單元的一讀錯位元閥值及一最大讀錯位元決定一第一讀錯相關因素。For the memory control circuit unit described in claim 17, wherein the operation of the memory control circuit unit to adjust the threshold of the number of reads according to the number of reads and the number of misread bits includes: A first misread related factor is determined according to a misreading bit threshold and a maximum misreading bit of the physical unit. 如申請專利範圍第18項所述的記憶體控制電路單元,其中該記憶體控制電路單元根據該讀取次數及該讀錯位元調整該讀取次數閥值的操作包括: 根據一先前讀取次數閥值、一預設讀取次數閥值及該第一讀錯相關因素決定該讀取次數閥值。For the memory control circuit unit described in item 18 of the scope of patent application, the operation of the memory control circuit unit to adjust the threshold of the read count according to the read count and the misread bit includes: The threshold of the number of readings is determined according to a threshold of the number of previous readings, a threshold of the number of readings, and the first reading error-related factors. 如申請專利範圍第19項所述的記憶體控制電路單元,其中該記憶體控制電路單元根據該實體單元的抹除次數決定該預設讀取次數閥值。According to the memory control circuit unit described in item 19 of the scope of patent application, the memory control circuit unit determines the preset read count threshold according to the erasing count of the physical unit. 如申請專利範圍第17項所述的記憶體控制電路單元,其中該記憶體控制電路單元讀取該實體單元,並更新該實體單元的該讀取次數的操作包括: 取得該實體單元的該讀錯位元。The memory control circuit unit according to claim 17, wherein the operation of the memory control circuit unit to read the physical unit and update the read count of the physical unit includes: Obtain the misread bit of the physical unit. 如申請專利範圍第21項所述的記憶體控制電路單元,其中該記憶體控制電路單元在該更新的讀取次數不小於該讀取次數閥值時掃描該實體單元的操作包括: 若該讀錯位元大於一讀錯位元閥值,則將該實體單元中的資料複製至另一實體單元;以及 若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。For the memory control circuit unit described in item 21 of the scope of patent application, the operation of the memory control circuit unit to scan the physical unit when the updated read count is not less than the read count threshold includes: If the misread bit is greater than a misread bit threshold, copy the data in the physical unit to another physical unit; and If the misreading bit is not greater than the misreading bit threshold, the updated reading times are recorded. 如申請專利範圍第21所述的記憶體控制電路單元,其中取得該實體單元的該讀錯位元的操作包括: 若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該最大讀錯位元。For the memory control circuit unit described in the 21st scope of the patent application, the operation of obtaining the misread bit of the physical unit includes: If the misread bit is greater than a maximum misread bit, the maximum misread bit is updated according to the misread bit. 如申請專利範圍第23所述的記憶體控制電路單元,其中該記憶體控制電路單元更用以根據該實體單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素, 該記憶體控制電路單元更用以根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數閥值,並且 該記憶體控制電路單元更用以在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體單元。The memory control circuit unit according to the 23rd of the scope of patent application, wherein the memory control circuit unit is further used for determining a second read error according to a read error bit threshold of the physical unit and the updated maximum read error bit. relevant factors, The memory control circuit unit is further configured to determine an updated threshold for the number of reads according to a threshold for the number of previous reads, a threshold for the number of presets, and the second read error related factors, and The memory control circuit unit is further used to scan the physical unit when the updated read times are not less than the updated read times threshold.
TW108147177A 2019-12-23 2019-12-23 Memory management method, memory storage device and memory control circuit unit TWI784224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108147177A TWI784224B (en) 2019-12-23 2019-12-23 Memory management method, memory storage device and memory control circuit unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108147177A TWI784224B (en) 2019-12-23 2019-12-23 Memory management method, memory storage device and memory control circuit unit

Publications (2)

Publication Number Publication Date
TW202125265A true TW202125265A (en) 2021-07-01
TWI784224B TWI784224B (en) 2022-11-21

Family

ID=77908494

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108147177A TWI784224B (en) 2019-12-23 2019-12-23 Memory management method, memory storage device and memory control circuit unit

Country Status (1)

Country Link
TW (1) TWI784224B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117636967A (en) * 2024-01-25 2024-03-01 合肥兆芯电子有限公司 Memory control method, memory storage device and memory control circuit unit

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI373771B (en) * 2008-06-06 2012-10-01 Phison Electronics Corp Memory management method for non-volatile memory and controller using the same
TWI587304B (en) * 2016-03-09 2017-06-11 群聯電子股份有限公司 Memory managing method, memory control circuit unit and mempry storage apparatus
TWI602061B (en) * 2017-03-16 2017-10-11 群聯電子股份有限公司 Data writing method, memory storage device and memory control circuit unit
JP2018160194A (en) * 2017-03-23 2018-10-11 東芝メモリ株式会社 Memory system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117636967A (en) * 2024-01-25 2024-03-01 合肥兆芯电子有限公司 Memory control method, memory storage device and memory control circuit unit
CN117636967B (en) * 2024-01-25 2024-04-30 合肥兆芯电子有限公司 Memory control method, memory storage device and memory control circuit unit

Also Published As

Publication number Publication date
TWI784224B (en) 2022-11-21

Similar Documents

Publication Publication Date Title
CN111078149B (en) Memory management method, memory storage device and memory control circuit unit
TWI731338B (en) Memory control method, memory storage device and memory control circuit unit
TWI688953B (en) Memory management method, memory storage device and memory control circuit unit
TWI670716B (en) Data access method,memory storage device and memory control circuit unit
CN111078146B (en) Memory management method, memory storage device and memory control circuit unit
TWI717816B (en) Memory control method, memory storage device and memory control circuit unit
TWI796882B (en) Read disturb checking method, memory storage device and memory control circuit unit
CN112860194B (en) Memory control method, memory storage device and memory control circuit unit
US11221791B2 (en) Memory management method, memory device, and memory control circuit for improving data classification
TWI784224B (en) Memory management method, memory storage device and memory control circuit unit
CN116230062A (en) Voltage prediction method, memory storage device and memory control circuit unit
TWI757216B (en) Temperature control method, memory storage device and memory control circuit unit
US11983069B2 (en) Data rebuilding method, memory storage apparatus, and memory control circuit unit
TWI739676B (en) Memory control method, memory storage device and memory control circuit unit
TWI712886B (en) Memory management method, memory storage device and memory control circuit unit
CN111831210A (en) Memory management method, memory control circuit unit and memory storage device
US20240265983A1 (en) Read voltage adjustment method, memory storage device and memory control circuit unit
US12008239B1 (en) Memory management method, memory storage device and memory control circuit unit
US20240304259A1 (en) Voltage prediction method, memory storage device and memory control circuit unit
TWI765600B (en) Memory control method, memory storage device and memory control circuit unit
CN112201285B (en) Voltage control method, memory storage device and memory control circuit unit
TWI768496B (en) Read voltage control method, memory storage device and memory control circuit unit
US20240152296A1 (en) Data reading method, memory storage device, and memory control circuit unit
CN114138207B (en) Memory control method, memory storage device and memory control circuit unit
TWI726541B (en) Memory management method, memory storage device and memory control circuit unit