TWI784224B - 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
TWI784224B
TWI784224B TW108147177A TW108147177A TWI784224B TW I784224 B TWI784224 B TW I784224B TW 108147177 A TW108147177 A TW 108147177A TW 108147177 A TW108147177 A TW 108147177A TW I784224 B TWI784224 B TW I784224B
Authority
TW
Taiwan
Prior art keywords
read
unit
error bit
threshold
memory
Prior art date
Application number
TW108147177A
Other languages
Chinese (zh)
Other versions
TW202125265A (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 in particular 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 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 non-volatility of data, power saving, small size, and no mechanical structure, it is very suitable for internal It is built in various portable multimedia devices as exemplified above.

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

本發明的範例實施例提供一種記憶體管理方法,用於記憶體儲存裝置,且所述記憶體管理方法包括:讀取實體單元,並更新所述實體單元的讀取次數;在所述更新的讀取次數不小於讀取次數閥值時掃描所述實體單元;以及根據所述讀取次數及讀錯位元調整所述讀取次數閥值。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 reading times of the physical unit; in the updated scanning the physical unit when the number of read times is not less than a threshold value of the number of read times; and adjusting the threshold value of the number of read times according to the number of read times and read error bits.

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

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

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

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

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

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的步驟更包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the step of obtaining the read error bit of the physical unit further includes: if the read error bit is greater than the maximum read error bit, updating the maximum read error bit according to the read error 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; value, the preset read times threshold and the second read error-related factors determine the updated read times threshold; and scan all read times when the updated read times threshold is not less than the updated read times threshold the entity 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 to read the physical unit and update 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 configured to adjust the read count threshold according to the read count and read error bits.

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

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

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述實體單元的抹除次數決定所述預設讀取次數閥值。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 reading the physical unit and updating the reading count of the physical unit includes: obtaining the read error of the physical unit Yuan.

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

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的操作包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the operation of obtaining the read error bit of the physical unit includes: if the read error bit is greater than the maximum read error bit, updating the maximum read error bit according to the read error 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 The memory control circuit unit is further used to determine an updated read count threshold according to the previous read count threshold, the preset read count threshold and the second read error-related factor, and the memory control circuit unit further and scanning the physical unit when the updated reading times is not less than the updated reading times 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 to read the physical unit and update 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 value of the read times according to the read times and the dislocation.

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

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

在本發明的一範例實施例中,所述記憶體控制電路單元根據所述實體單元的抹除次數決定所述預設讀取次數閥值。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 reading the physical unit and updating the reading count of the physical unit includes: obtaining the read error of the physical unit Yuan.

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

在本發明的一範例實施例中,取得所述實體單元的所述讀錯位元的操作包括:若所述讀錯位元大於最大讀錯位元,根據所述讀錯位元更新所述最大讀錯位元。In an exemplary embodiment of the present invention, the operation of obtaining the read error bit of the physical unit includes: if the read error bit is greater than the maximum read error bit, updating the maximum read error bit according to the read error 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 The memory control circuit unit is further used to determine an updated read count threshold according to the previous read count threshold, the preset read count threshold and the second read error-related factor, and the memory control circuit unit further and scanning the physical unit when the updated reading times is not less than the updated reading times threshold.

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

一般而言,記憶體儲存裝置(亦稱,記憶體儲存系統)包括可複寫式非揮發性記憶體模組(rewritable non-volatile memory module)與控制器(亦稱,控制電路)。通常記憶體儲存裝置是與主機系統一起使用,以使主機系統可將資料寫入至記憶體儲存裝置或從記憶體儲存裝置中讀取資料。Generally speaking, a memory storage device (also called a memory storage system) includes a rewritable non-volatile memory module (rewritable non-volatile memory module) and a controller (also called a control circuit). Generally, a memory storage device is used with a host system so that the host system can write data to 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。Please refer to FIG. 1 and FIG. 2 , the host system 11 generally includes a processor 111 , a random access memory (random access memory, RAM) 112 , a read only memory (read only memory, ROM) 113 and a data transmission interface 114 . The processor 111 , the RAM 112 , the ROM 113 and the data transmission interface 114 are all coupled to the 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 into the memory storage device 10 or read data from the memory storage device 10 through 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 through 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 can be disposed on the motherboard 20 of the host system 11 . The number of data transmission interfaces 114 can be one or more. Through the data transmission interface 114 , the motherboard 20 can be coupled to the memory storage device 10 via wired or wireless means. The memory storage device 10 can be, for example, a flash drive 201 , a memory card 202 , a solid state drive (Solid State Drive, SSD) 203 or a wireless memory storage device 204 . The wireless memory storage device 204 can be, for example, a near field communication (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 Storage devices (eg, 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, reference to a host system is substantially any system that can cooperate with a memory storage device to store data. Although in the above exemplary embodiments, the host system is described as a computer system, however, FIG. 3 is a schematic diagram of a host system and a memory storage device according to another exemplary embodiment of the present invention. Please refer to FIG. 3 , in another exemplary embodiment, the host system 31 may 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 may be configured by it. Various non-volatile memory storage devices such as a secure digital (Secure Digital, SD) card 32, a compact flash (Compact Flash, CF) card 33 or an embedded storage device 34 are used. The embedded storage device 34 includes various types such as an embedded multimedia card (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 An embedded storage device on a substrate of a 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. Referring to FIG. 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 for coupling 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 thereto, and the connection interface unit 402 may also be a standard conforming to the 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 (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 can be packaged with the memory control circuit unit 404 in a 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 instructions implemented in hardware or firmware and perform data storage in the rewritable non-volatile memory module 406 according to the instructions of the host system 11. Write, read and erase operations.

可複寫式非揮發性記憶體模組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 for storing data written by the host system 11 . The rewritable non-volatile memory module 406 can be a single-level memory cell (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 memory cell (Multi Level Cell, MLC) NAND flash memory module (that is, a flash memory module that can store 2 bits in a memory cell), three-level memory cell ( Triple Level Cell (TLC) NAND flash memory module (that is, a flash memory module that can store 3 bits in a memory cell), Quad Level Cell (QLC) NAND flash memory module A 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 by changing a voltage (also referred to as threshold voltage hereinafter). Specifically, there is a charge trapping layer between the control gate and the channel of each memory cell. By applying a writing 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. The operation of changing the threshold voltage of the memory cell is also called "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. Which storage state a memory cell belongs to can be judged by applying a read voltage, 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 form a plurality of physical programming units, and these physical programming units can form a plurality of physical erasing units. Specifically, the memory cells on the same word line can form one or more physical programming units. If each memory cell can store more than 2 bits, the physical programming units on the same word line can be at least classified into lower physical programming units and upper physical programming units. 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 physically programmed cells is greater than that of the upper physically programmed cells, and/or the reliability of the lower physically programmed cells is higher than that of the upper physically programmed cells. The solidity of the stylized unit.

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

圖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. Referring to FIG. 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 instructions, and when the memory storage device 10 is operating, these control instructions are executed to perform operations such as writing, reading, and erasing data. When describing the operation of the memory management circuit 502 below, it is equivalent to describing 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 the form of firmware. For example, the memory management circuit 502 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 10 is in operation, these control instructions will be 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 ROM has a boot code (boot code), and when the memory control circuit unit 404 is enabled, the microprocessor unit will first execute the boot code to store in the rewritable non-volatile memory The control instructions in the voxel module 406 are loaded into the random access memory of the memory management circuit 502 . Afterwards, the microprocessor unit executes these control instructions to perform operations such as writing, reading and erasing data.

此外,在另一範例實施例中,記憶體管理電路502的控制指令亦可以一硬體型式來實作。例如,記憶體管理電路502包括微控制器、記憶胞管理電路、記憶體寫入電路、記憶體讀取電路、記憶體抹除電路與資料處理電路。記憶胞管理電路、記憶體寫入電路、記憶體讀取電路、記憶體抹除電路與資料處理電路是耦接至微控制器。記憶胞管理電路用以管理可複寫式非揮發性記憶體模組406的記憶胞或記憶胞群組。記憶體寫入電路用以對可複寫式非揮發性記憶體模組406下達寫入指令序列以將資料寫入至可複寫式非揮發性記憶體模組406中。記憶體讀取電路用以對可複寫式非揮發性記憶體模組406下達讀取指令序列以從可複寫式非揮發性記憶體模組406中讀取資料。記憶體抹除電路用以對可複寫式非揮發性記憶體模組406下達抹除指令序列以將資料從可複寫式非揮發性記憶體模組406中抹除。資料處理電路用以處理欲寫入至可複寫式非揮發性記憶體模組406的資料以及從可複寫式非揮發性記憶體模組406中讀取的資料。寫入指令序列、讀取指令序列及抹除指令序列可各別包括一或多個程式碼或指令碼並且用以指示可複寫式非揮發性記憶體模組406執行相對應的寫入、讀取及抹除等操作。在一範例實施例中,記憶體管理電路502還可以下達其他類型的指令序列給可複寫式非揮發性記憶體模組406以指示執行相對應的操作。In addition, in another exemplary embodiment, the control instructions of the memory management circuit 502 can also be implemented in a hardware form. 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 memory cells or memory cell groups of the rewritable non-volatile memory module 406 . The memory writing 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 reading 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 erase 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 into 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 respectively include one or more program codes or command codes and are used to instruct the rewritable non-volatile memory module 406 to execute the corresponding write, read operations such as fetching and erasing. In an exemplary embodiment, the memory management circuit 502 can also issue 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 thereto, and the host interface 504 can also be compatible with PATA standard, IEEE 1394 standard, PCI Express 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.

記憶體介面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 for accessing the rewritable non-volatile memory module 406 . That is to say, the data to be written into the rewritable non-volatile memory module 406 will be converted into a format acceptable to the rewritable non-volatile memory module 406 through the memory interface 506 . Specifically, if the memory management circuit 502 wants to access the rewritable non-volatile memory module 406, the memory interface 506 will send a corresponding command sequence. For example, these command sequences may include a write command sequence for writing data, a read command sequence for reading data, an erase command sequence for erasing data, and instructions for various memory operations (for example, changing the read the corresponding sequence of instructions to fetch a voltage level or perform a garbage collection operation, etc.). These instruction sequences are, for example, generated by the memory management circuit 502 and sent to the rewritable non-volatile memory module 406 through the memory interface 506 . These command sequences can include one or more signals, or data on the bus. These signals or data may include instruction codes or program codes. For example, in the read command sequence, information such as read identification code and memory address 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 correction circuit 508 is coupled to the memory management circuit 502 and configured to perform error checking and correction operations to ensure correctness of 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 checking code (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 checking code into the rewritable non-volatile In the memory module 406. Afterwards, when the memory management circuit 502 reads data from the rewritable non-volatile memory module 406, it will simultaneously read the error correction code and/or error check code corresponding to the data, and the error check and correction circuit 508 Error checking and correction operations will be performed on the read data according to the error correction code and/or error check code.

緩衝記憶體510是耦接至記憶體管理電路502並且用以暫存來自於主機系統11的資料與指令或來自於可複寫式非揮發性記憶體模組406的資料。電源管理電路512是耦接至記憶體管理電路502並且用以控制記憶體儲存裝置10的電源。The buffer memory 510 is coupled to the memory management circuit 502 and used for temporarily storing data and instructions 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 for controlling 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 in FIG. 4 is also called a flash memory module, and the memory control circuit unit 404 is also called a Flash memory controller for the module. In an exemplary embodiment, the memory management circuit 502 of FIG. 5 is also called 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. Referring to FIG. 6 , the memory management circuit 502 can logically group the physical units 610 ( 0 )˜610 (B) of the rewritable non-volatile memory module 406 into a storage area 601 and a 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 data in the storage area 601 Damaged solid elements. 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 physical erase unit available in the replacement area 602, the memory management circuit 502 may declare the entire memory storage device 10 as a write-protected state, and data cannot be written any more. .

在本範例實施例中,每一個實體單元是指一個實體抹除單元。然而,在另一範例實施例中,一個實體單元亦可以是指一個實體位址、一個實體程式化單元或由多個連續或不連續的實體位址組成。記憶體管理電路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 stylized unit, or consist of multiple continuous or discontinuous physical addresses. The memory management circuit 502 configures 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 logical unit may also refer to a logical programming unit, a logical erasing unit, or consist of multiple consecutive or discontinuous logical addresses. Furthermore, each of 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 intends to read data from the memory storage device 10 or write data to the memory storage device 10, the memory management circuit 502 can execute 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 a read count threshold (read count threshold) associated with the read count (read count) of each physical unit. And the memory management circuit 502 compares the calculated reading times threshold with the accumulated reading times of the physical unit to determine whether to scan the physical unit.

本實施例以掃描一實體抹除單元為例。記憶體管理電路502會根據實體抹除單元的讀取次數及讀錯位元調整讀取次數閥值。具體而言,記憶體管理電路502根據實體抹除單元的第一閥值及最大讀錯位元決定第一讀錯相關因素。第一閥值(即讀錯位元閥值)及最大讀錯位元關聯於讀錯位元。舉例而言,記憶體管理電路502可根據以下方程式(1)來計算第一讀錯相關因素。This embodiment takes scanning a physical erasing unit as an example. The memory management circuit 502 adjusts the read count threshold according to the read count and read error 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 read error bit threshold) and the maximum read error bit are associated with the read error bit. For example, the memory management circuit 502 can calculate the first read error 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 equation (1), factor error bit represents a read error related factor, threshold error bit represents a read error bit threshold, and error bit max represents a maximum read error bit (max read error bit). The read error bit threshold is determined in advance, for example, through a series of experiments, and it 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 release the original physical erasing unit into the physical unit recycling area after erasing. The maximum read error bit is the largest read error bit in the recording entity erase unit.

接著,記憶體管理電路502會根據第二閥值(即,先前讀取次數閥值)、第三閥值(即,預設讀取次數閥值)及第一讀錯相關因素決定第四閥值(即,讀取次數閥值)。第二閥值及第三閥值關聯於該實體單元的讀取次數。舉例而言,記憶體管理電路502可根據以下方程式(2)來計算讀取次數閥值。Then, the memory management circuit 502 will determine the fourth threshold according to the second threshold (ie, the previous read times threshold), the third threshold (ie, the preset read times threshold) and the first read error-related factors. value (that is, the read count threshold). The second threshold and the third threshold are related to the reading times of the physical unit. For example, the memory management circuit 502 can calculate the read times threshold 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 value of the number of reads, threshold pre represents the threshold value of the number of times previously read, threshold normal represents the threshold value of the number of preset reads, and factor error bit represents a factor related to misreading. Specifically, the previous reading times threshold is the reading times threshold used for judging whether to scan when the memory management circuit 502 scans the physical erasing unit last time. 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 times of erasing is higher, the overall space of the physical erasing unit may become smaller or may be damaged. Therefore, the number of times of erasing is negatively correlated with the threshold value of the preset number of times of reading. That is, the more erasing times of the physical erasing unit, the lower the preset reading times threshold. In other words, the reading times threshold can be recalculated according to the erasing times of the physical erasing unit. In an exemplary embodiment, the corresponding relationship between each erasing times and the preset reading times threshold can be stored in a lookup table, and the memory management circuit 502 can input the times of erasing into the lookup table and look up the The output of the table serves as a preset read count threshold corresponding to the erasure count. The corresponding relationship between the erasing times and the preset reading times threshold is shown in Table 1 below, wherein for different memories, the relationship between the erasing times and the preset reading times threshold may also be different. For the single level cell (Single Level Cell, SLC) NAND flash memory module, the preset read count threshold will decrease as the erase count increases. On the other hand, for the Multi Level Cell (MLC) NAND flash memory module, the preset read count threshold will first increase and then decrease as the erase count 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 Erase times Preset Read 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 each erasing count and the preset read count threshold can also be calculated using an equation, which is not limited by the present invention.

在一範例實施例中,方程式(1)及(2)亦可以被調整,例如加入其他變數或調整至少部分邏輯運算元素,以符合實務需求,只要可計算出關於讀取次數閥值與實體抹除單元的最大讀錯位元呈負相關即可。In an exemplary embodiment, equations (1) and (2) can also be adjusted, such as adding other variables or adjusting at least some logical operation elements to meet practical requirements, as long as the relationship between the read times threshold and the physical wipe can be calculated It is sufficient that the maximum read error bit of the division 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 sends 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 known as the physical page) according to the read command, and updates the reading times of the physical erasing unit. Specifically, each time the memory management circuit 502 reads the physical programming unit, it will continuously accumulate the reading times of the physical erasing unit and update the reading times. 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 times is less than the read times threshold, the memory management circuit 502 continues to receive read commands from the host system 11 and continues to accumulate the read times of the physical erasing unit until it is greater than or equal to the read times threshold.

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

在本實施例提供的記憶體管理方法中,記憶體管理電路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 may also judge the operation to be performed on the physical erasing unit according to other conditions after scanning the physical erasing unit. Specifically, scanning the entity erasing unit can, for example, read all or part of the entity stylized units of the entity erase unit (for example, only read odd or even pages, every other fixed page such as three pages or five pages) read the physical programming unit), and the memory management circuit 502 can obtain the read error bit (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 read error bit is greater than a first threshold (ie, the read error bit threshold). If the memory management circuit 502 determines that the read error bit is greater than the read error bit threshold, then refresh the physical erase unit. In the refresh operation, the memory management circuit 502 copies the data in the physical erasing unit to another physical erasing unit, and releases the physical erasing unit to the recycle area of the physical erasing unit after erasing. If the memory management circuit 502 judges that the read error bit is not greater than the read error bit threshold, then record the updated reading times, and return to step S803, the memory management circuit 502 continues to receive the read command 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 read times threshold 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 read error bit is greater than the maximum read error 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, it updates the maximum read error bit 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 read times threshold after updating the maximum read error bit. Specifically, the memory management circuit 502 determines the second read error related factor according to the read error bit threshold of the physical unit and the updated maximum read error bit. Next, a fifth threshold (that is, an updated threshold of read times) is determined according to the previous read times threshold, the preset read times threshold and the second read error related factor. And when the updated reading times is not less than the updated reading times threshold, the physical unit is scanned.

圖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 , a first correlation factor is determined according to a first threshold value of a physical unit and a maximum read error bit. In step S702, a fourth threshold is determined according to the second threshold, the third threshold and the first correlation factor. In step S703, the reading instruction reads the physical unit, and updates the reading times of the physical unit. In step S704, it is determined whether the updated reading times are not less than the fourth threshold, and if the updated reading times are not less than the fourth threshold (step S704, yes), the entity unit is scanned (step S705). If the updated read times are less than the fourth threshold (step S704, no), go back 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 ~ S805 can refer to the aforementioned steps S701 ~ S705 , each step has been described in detail above, and will not be repeated here. It should be noted that, in step S803 , when reading the physical unit, in addition to updating the reading times of the physical unit, the read error bit of the physical unit is also obtained. In step S806, it is judged whether the updated read error bit is greater than the first threshold (ie, the read error threshold). If it is determined that the read error bit is greater than the first threshold (step S806, yes), then refresh the physical unit (step S807). If it is determined that the read error bit is not greater than the first threshold (step S806, no), record the updated reading times (step S808), and return to step S803. In step S809, it is judged whether the read error bit is greater than the maximum read error bit. If it is judged that the read error bit of the physical unit is greater than the maximum read error bit (step S809, yes), then update the maximum read error bit according to the read error bit (step S810). If it is judged that the read error bit of the physical unit is not greater than the maximum read error bit (step S809, judged as NO), go back to step S803.

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

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

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

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: Pen drive 202: memory card 203: SSD 204: wireless memory storage device 205: GPS 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: Connect the 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): entity 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. FIG. 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 (18)

一種記憶體管理方法,用於一記憶體儲存裝置,且該記憶體管理方法包括:接收來自主機系統的讀取指令;根據該讀取指令讀取一實體抹除單元,並更新該實體抹除單元的讀取次數;在該更新的讀取次數不小於一讀取次數閥值時掃描該實體抹除單元以讀取該實體抹除單元包括的至少一實體程式化單元,以更新該實體抹除單元的讀錯位元;以及根據該讀取次數及該讀錯位元調整該讀取次數閥值,其中根據該讀取次數及該讀錯位元調整該讀取次數閥值的步驟包括根據一先前讀取次數閥值、一預設讀取次數閥值及根據該實體抹除單元的一讀錯位元閥值及一最大讀錯位元決定的第一讀錯相關因素決定該讀取次數閥值,其中該讀取次數閥值與該實體抹除單元的最大讀錯位元呈負相關。 A memory management method for a memory storage device, and the memory management method includes: receiving a read command from a host system; reading a physical erase unit according to the read command, and updating the physical erase unit The number of reads of the unit; when the updated number of reads is not less than a read times threshold, scan the entity erasing unit to read at least one entity programming unit included in the entity erasing unit, so as to update the entity erasing unit and adjusting the read count threshold according to the read count and the read fault bit, wherein the step of adjusting the read count threshold according to the read count and the read fault bit includes according to a previous The read count threshold, a preset read count threshold, and a first read error related factor determined according to a read error bit threshold and a maximum read error bit of the physical erasing unit determine the read count threshold, Wherein the threshold value of read times is negatively correlated with the maximum read error bit of the physical erasing unit. 如申請專利範圍第1項所述的記憶體管理方法,其中該記憶體管理方法包括:根據該實體抹除單元的抹除次數決定該預設讀取次數閥值。 The memory management method described in item 1 of the scope of the patent application, wherein the memory management method includes: determining the preset reading times threshold according to the erasing times of the physical erasing unit. 如申請專利範圍第1項所述的記憶體管理方法,其中根據該讀取指令讀取該實體抹除單元,並更新該實體抹除單元的該讀取次數的步驟更包括:取得該實體抹除單元的該讀錯位元。 The memory management method described in item 1 of the scope of the patent application, wherein the step of reading the physical erasing unit according to the read command, and updating the reading times of the physical erasing unit further includes: obtaining the physical erasing unit The read error bit of the division unit. 如申請專利範圍第3項所述的記憶體管理方法,其中在該更新的讀取次數不小於該讀取次數閥值時掃描該實體抹除單元以讀取該實體抹除單元包括的該至少一實體程式化單元,以更新該實體抹除單元的該讀錯位元的步驟更包括:若該讀錯位元大於一讀錯位元閥值,則將該實體抹除單元中的資料複製至另一實體抹除單元;以及若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。 The memory management method described in item 3 of the scope of the patent application, wherein when the updated read times is not less than the read times threshold value, the physical erasing unit is scanned to read the at least A physical programming unit, the step of updating the read error bit of the physical erase unit further includes: if the read error bit is greater than a read error bit threshold, copying the data in the physical erase unit to another a physical erasing unit; and if the read error bit is not greater than the read error bit threshold, record the updated read times. 如申請專利範圍第3項所述的記憶體管理方法,其中取得該實體抹除單元的該讀錯位元的步驟更包括:若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該最大讀錯位元。 The memory management method described in item 3 of the scope of the patent application, wherein the step of obtaining the read error bit of the physical erasing unit further includes: if the read error bit is greater than a maximum read error bit, update according to the read error bit The maximum read error bit. 如申請專利範圍第5項所述的記憶體管理方法,其中該方法更包括:根據該實體抹除單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素;根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數閥值;以及在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體抹除單元。 The memory management method as described in item 5 of the scope of the patent application, wherein the method further includes: determining a second read error-related factor according to a read error bit threshold of the physical erasing unit and the updated maximum read error bit ; Determine an updated read count threshold based on a previous read count threshold, a preset read count threshold and the second read error-related factor; and when the updated read count is not less than the updated read count The physical erasing unit is scanned when the times threshold is taken. 一種記憶體儲存裝置,包括:一連接介面單元,用以耦接至一主機系統; 一可複寫式非揮發性記憶體模組;以及一記憶體控制電路單元,耦接至該連接介面單元與該可複寫式非揮發性記憶體模組,其中該記憶體控制電路單元用以接收來自該主機系統的讀取指令,該記憶體控制電路單元更用以根據該讀取指令讀取該實體抹除單元,並更新該實體抹除單元的讀取次數,該記憶體控制電路單元更用以在該更新的讀取次數不小於一讀取次數閥值時掃描該實體抹除單元以讀取該實體抹除單元包括的至少一實體程式化單元,以更新該實體抹除單元的讀錯位元,並且該記憶體控制電路單元更用以根據該讀取次數及該讀錯位元調整該讀取次數閥值,其中該記憶體控制電路單元根據該讀取次數及該讀錯位元調整該讀取次數閥值的操作包括根據一先前讀取次數閥值、一預設讀取次數閥值及根據該實體抹除單元的一讀錯位元閥值及一最大讀錯位元決定的第一讀錯相關因素決定該讀取次數閥值,其中該讀取次數閥值與該實體抹除單元的最大讀錯位元呈負相關。 A memory storage device, comprising: 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, wherein the memory control circuit unit is used to receive A read command from the host system, the memory control circuit unit is further used to read the physical erasing unit according to the read command, and update the reading times of the physical erasing unit, and the memory control circuit unit further It is used for scanning the physical erasing unit to read at least one physical programming unit included in the physical erasing unit when the updated reading times is not less than a reading times threshold, so as to update the reading of the physical erasing unit error bit, and the memory control circuit unit is further used to adjust the read count threshold according to the read count and the read error bit, wherein the memory control circuit unit adjusts the read count threshold according to the read count and the read error bit The operation of the read times threshold includes a first read based on a previous read times threshold, a preset read times threshold and a read error bit threshold and a maximum read error bit of the physical erase unit. The error correlation factor determines the read times threshold, wherein the read times threshold is negatively correlated with the maximum read error bit of the physical erasing unit. 如申請專利範圍第7項所述的記憶體儲存裝置,其中該記憶體控制電路單元根據該實體抹除單元的抹除次數決定該預設讀取次數閥值。 The memory storage device as described in item 7 of the scope of the patent application, wherein the memory control circuit unit determines the preset reading times threshold according to the erasing times of the physical erasing unit. 如申請專利範圍第7項所述的記憶體儲存裝置,其中該記憶體控制電路單元根據該讀取指令讀取該實體抹除單元,並更新該實體抹除單元的該讀取次數的操作包括:取得該實體抹除單元的該讀錯位元。 The memory storage device as described in item 7 of the patent scope of the application, wherein the memory control circuit unit reads the physical erasing unit according to the read instruction, and the operation of updating the read times of the physical erasing unit includes : Obtain the read error bit of the physical erase unit. 如申請專利範圍第9項所述的記憶體儲存裝置,其中該記憶體控制電路單元在該更新的讀取次數不小於該讀取次數閥值時掃描該實體抹除單元以讀取該實體抹除單元包括的該至少一實體程式化單元,以更新該實體抹除單元的該讀錯位元的操作更包括:若該讀錯位元大於一讀錯位元閥值,則將該實體抹除單元中的資料複製至另一實體抹除單元;以及若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。 The memory storage device as described in item 9 of the scope of the patent application, wherein the memory control circuit unit scans the physical erasing unit to read the physical erasing unit when the updated reading times is not less than the reading times threshold The at least one physical programming unit included in the erasing unit to update the read error bit of the physical erase unit further includes: if the read error bit is greater than a read error bit threshold, then erasing the entity in the unit Copy the data of the data to another physical erasing unit; and if the read error bit is not greater than the read error bit threshold, record the updated read times. 如申請專利範圍第9所述的記憶體儲存裝置,其中取得該實體抹除單元的該讀錯位元的操作包括:若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該最大讀錯位元。 The memory storage device as described in claim 9, wherein the operation of obtaining the read error bit of the physical erasing unit includes: if the read error bit is greater than a maximum read error bit, updating the maximum read error bit according to the read error bit Read wrong bit. 如申請專利範圍第11所述的記憶體儲存裝置,其中該記憶體控制電路單元更用以根據該實體抹除單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素,該記憶體控制電路單元更用以根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數 閥值,並且該記憶體控制電路單元更用以在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體抹除單元。 The memory storage device as described in claim 11 of the scope of patent application, wherein the memory control circuit unit is further used to determine a second reading according to a read error bit threshold of the physical erasing unit and the updated maximum read error bit error related factors, the memory control circuit unit is further used to determine an updated read times according to a previous read times threshold, a preset read times threshold and the second read error related factors threshold, and the memory control circuit unit is further configured to scan the physical erasing unit when the updated read times is 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, used to be coupled to the rewritable non-volatile memory module; and a memory management circuit, coupled to the host interface and the memory interface, wherein the memory control circuit unit is used To receive a read command from the host system, the memory control circuit unit is further used to read the physical erasing unit according to the read command, and update the reading times of the physical erasing unit, the memory control circuit The unit is further used to scan the physical erasing unit to read at least one physical programming unit included in the physical erasing unit when the updated reading times is not less than a reading times threshold, so as to update the physical erasing unit The read error bit, and the memory control circuit unit is further used to adjust the read count threshold according to the read count and the read error bit, wherein the memory control circuit unit is based on the read count and the read error bit The operation of adjusting the read times threshold includes: according to a previous read times threshold, a preset read times threshold and according to a read of the physical erase unit The threshold value of read times is determined by a first read error related factor determined by an error bit threshold and a maximum read error bit, wherein the read number threshold is negatively correlated with the maximum read error bit of the physical erasing unit. 如申請專利範圍第13項所述的記憶體控制電路單元,其中該記憶體控制電路單元根據該實體抹除單元的抹除次數決定該預設讀取次數閥值。 The memory control circuit unit as described in claim 13 of the patent application, wherein the memory control circuit unit determines the preset reading times threshold according to the erasing times of the physical erasing unit. 如申請專利範圍第13項所述的記憶體控制電路單元,其中該記憶體控制電路單元根據該讀取指令讀取該實體抹除單元,並更新該實體抹除單元的該讀取次數的操作包括:取得該實體抹除單元的該讀錯位元。 The memory control circuit unit as described in item 13 of the scope of the patent application, wherein the memory control circuit unit reads the physical erasing unit according to the read instruction, and updates the read times of the physical erasing unit Including: obtaining the read error bit of the physical erasing unit. 如申請專利範圍第15項所述的記憶體控制電路單元,其中該記憶體控制電路單元在該更新的讀取次數不小於該讀取次數閥值時掃描該實體抹除單元以讀取該實體抹除單元包括的該至少一實體程式化單元,以更新該實體抹除單元的該讀錯位元的操作更包括:若該讀錯位元大於一讀錯位元閥值,則將該實體抹除單元中的資料複製至另一實體抹除單元;以及若該讀錯位元不大於該讀錯位元閥值,則記錄該更新的讀取次數。 The memory control circuit unit as described in item 15 of the scope of the patent application, wherein the memory control circuit unit scans the entity erasing unit to read the entity when the updated read count is not less than the read count threshold The operation of erasing the at least one physical programming unit included in the physical erasing unit to update the read error bit of the physical erasing unit further includes: if the read error bit is greater than a read error bit threshold, then erasing the physical unit Copy the data in the data to another physical erasing unit; and if the read error bit is not greater than the read error bit threshold, record the updated read times. 如申請專利範圍第15所述的記憶體控制電路單元,其中取得該實體抹除單元的該讀錯位元的操作包括:若該讀錯位元大於一最大讀錯位元,根據該讀錯位元更新該 最大讀錯位元。 The memory control circuit unit as described in claim 15 of the patent scope of the application, wherein the operation of obtaining the read error bit of the physical erasing unit includes: if the read error bit is greater than a maximum read error bit, updating the read error bit according to the read error bit Maximum read error bits. 如申請專利範圍第17所述的記憶體控制電路單元,其中該記憶體控制電路單元更用以根據該實體抹除單元的一讀錯位元閥值及該更新的最大讀錯位元決定一第二讀錯相關因素,該記憶體控制電路單元更用以根據一先前讀取次數閥值、一預設讀取次數閥值及該第二讀錯相關因素決定一更新的讀取次數閥值,並且該記憶體控制電路單元更用以在該更新的讀取次數不小於該更新的讀取次數閥值時掃描該實體抹除單元。 The memory control circuit unit as described in claim 17 of the scope of the patent application, wherein the memory control circuit unit is further used to determine a second read error bit threshold based on the physical erasing unit and the updated maximum read error bit The error-related factor, the memory control circuit unit is further used to determine an updated read-time threshold according to a previous read-time threshold, a preset read-time threshold and the second read-error-related factor, and The memory control circuit unit is further used for scanning the physical erasing unit when the updated read times is 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 TW202125265A (en) 2021-07-01
TWI784224B true 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)

Families Citing this family (1)

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

Citations (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
TW201835769A (en) * 2017-03-16 2018-10-01 群聯電子股份有限公司 Data writing method, memory storage device and memory control circuit unit
US10310766B2 (en) * 2017-03-23 2019-06-04 Toshiba Memory Corporation Memory system and data relocating method

Patent Citations (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
TW201835769A (en) * 2017-03-16 2018-10-01 群聯電子股份有限公司 Data writing method, memory storage device and memory control circuit unit
US10310766B2 (en) * 2017-03-23 2019-06-04 Toshiba Memory Corporation Memory system and data relocating method

Also Published As

Publication number Publication date
TW202125265A (en) 2021-07-01

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
US10810121B2 (en) Data merge method for rewritable non-volatile memory storage device and memory control circuit unit
CN111258505B (en) Data merging method of flash memory, control circuit unit and storage device
TWI796882B (en) Read disturb checking method, memory storage device and memory control circuit unit
TWI717751B (en) Data writing method, memory control circuit unit and memory storage device
CN113885808B (en) Mapping information recording method, memory control circuit unit and memory device
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
TWI783522B (en) Data rebuilding method, memory storage device and memory control circuit unit
US20220164133A1 (en) Memory control method, memory storage device and memory control circuit unit
CN111831210B (en) Memory management method, memory control circuit unit and memory storage device
US20240152296A1 (en) Data reading method, memory storage device, and memory control circuit unit
CN112181859B (en) Effective data merging method, memory control circuit unit and memory device
US12008239B1 (en) Memory management method, memory storage device and memory control circuit unit
CN114138207B (en) Memory control method, memory storage device and memory control circuit unit
TWI831366B (en) Data writing method, memory storage device and memory control circuit unit
TWI841281B (en) Voltage prediction method, memory storage device and memory control circuit unit
TWI771243B (en) Memory control method, memory storage device and memory control circuit unit
US20240028506A1 (en) Mapping table re-building method, memory storage device and memory control circuit unit
CN117632038B (en) Wear leveling method, memory storage device and memory control circuit unit
TWI810719B (en) Memory management method, memory storage device and memory control circuit unit
TWI768496B (en) Read voltage control method, memory storage device and memory control circuit unit