TWI548989B - Mobile electronic device and method for clearing memory blocks - Google Patents

Mobile electronic device and method for clearing memory blocks Download PDF

Info

Publication number
TWI548989B
TWI548989B TW103110318A TW103110318A TWI548989B TW I548989 B TWI548989 B TW I548989B TW 103110318 A TW103110318 A TW 103110318A TW 103110318 A TW103110318 A TW 103110318A TW I548989 B TWI548989 B TW I548989B
Authority
TW
Taiwan
Prior art keywords
memory
memory block
controller
cleaning
area
Prior art date
Application number
TW103110318A
Other languages
Chinese (zh)
Other versions
TW201537348A (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 TW103110318A priority Critical patent/TWI548989B/en
Publication of TW201537348A publication Critical patent/TW201537348A/en
Application granted granted Critical
Publication of TWI548989B publication Critical patent/TWI548989B/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Description

行動電子裝置與清理記憶區塊的方法 Mobile electronic device and method for cleaning memory blocks

本發明是有關於一種行動電子裝置,且特別是有關於清理該行動電子裝置的記憶區塊的方法。 The present invention relates to a mobile electronic device, and more particularly to a method of cleaning a memory block of the mobile electronic device.

圖1是習知的一種快閃記憶體(flash memory)100的示意圖。快閃記憶體100包括兩個記憶區塊(memory block)110與120,每個記憶區塊包括十六個記憶分頁(memory page)。一開始,一個檔案占用記憶區塊110的五個記憶分頁A1~E1,如圖1所示。 FIG. 1 is a schematic diagram of a conventional flash memory 100. The flash memory 100 includes two memory blocks 110 and 120, each of which includes sixteen memory pages. Initially, one file occupies five memory pages A1~E1 of memory block 110, as shown in FIG.

快閃記憶體的一項特色是資料燒錄(programming)與資料抹除(erasing)的單位並不對稱,資料燒錄是以較小的記憶分頁為單位,而資料抹除是以較大的記憶區塊為單位。因此,當上述檔案的內容變更時,不會覆蓋原有的記憶分頁A1~E1,而是將新版的檔案寫入後面的記憶分頁A2~E2,如圖2所示。如果上述檔案的內容再度變更,新版的檔案會被寫入更後面的記憶分頁A3~E3,依此類推。記憶分頁A1~E1與A2~E2的舊版資料也稱為無效資料(invalid data)。 One of the characteristics of flash memory is that the data is programmed and erasing units are asymmetrical. Data burning is based on smaller memory pages, and data erasing is larger. The memory block is a unit. Therefore, when the content of the above file is changed, the original memory page A1~E1 will not be overwritten, but the new version file will be written to the following memory page A2~E2, as shown in FIG. If the contents of the above file are changed again, the new version of the file will be written to the next memory page A3~E3, and so on. The old version of the memory pages A1~E1 and A2~E2 is also called invalid data.

目前的行動電子裝置使用快閃記憶體做為主要的儲存裝置,例如固態硬碟(SSD:solid state disk)或內嵌式多媒體記憶卡(eMMC:embedded multimedia card),用以儲存作業系統(operating system)、應用程式、以及各種資料。但是快閃記憶體使用一段時間之後,就會發生如圖2所示的碎裂(fragmentation)現象,也就是記憶區塊內儲存了大量的無效資料。若不加以清理,無效資料會越累積越多,可用的記憶區塊也就越來越少。 Current mobile electronic devices use flash memory as the main storage device, such as solid state disk (SSD: solid state disk) or embedded multimedia card (eMMC: embedded multimedia card) for storing operating systems (operating) System), applications, and various materials. However, after a period of use of the flash memory, a fragmentation phenomenon as shown in FIG. 2 occurs, that is, a large amount of invalid data is stored in the memory block. If not cleaned up, the more accumulated data will be accumulated, and the available memory blocks will be less and less.

為了回收無效資料佔用的記憶分頁A1~E1與A2~E2,可將記憶分頁A3~E3的有效資料複製到另一個記憶區塊120,然後再抹除記憶區塊110,如圖3所示。這樣的回收程序稱為垃圾收集(garbage collection)。垃圾收集通常需要漫長的時間,可能會造成行動電子裝置的反應遲緩,甚至功能停頓,影響使用者的使用觀感。 In order to recover the memory pages A1~E1 and A2~E2 occupied by the invalid data, the valid data of the memory pages A3~E3 can be copied to another memory block 120, and then the memory block 110 is erased, as shown in FIG. Such a recycling program is called a garbage collection. Garbage collection usually takes a long time, which may cause the response of the mobile electronic device to be sluggish, or even the function pauses, affecting the user's perception of use.

本發明提供一種行動電子裝置與清理記憶區塊的方法,可解決上述的碎裂問題,並兼顧使用者的使用觀感。 The invention provides a mobile electronic device and a method for cleaning a memory block, which can solve the above-mentioned fragmentation problem and take into account the user's use perception.

本發明的行動電子裝置包括介面單元、半導體儲存裝置與處理器。介面單元提供使用者介面以接收使用者輸入。半導體儲存裝置包括控制器與非揮發記憶體(non-volatile memory),非揮發記憶體耦接控制器並包括多個記憶區塊。處理器耦接介面單元與半導體儲存裝置,因應上述使用者輸入而發送一訊號至半導體 儲存裝置。控制器因應此訊號而清理至少一個上述記憶區塊。 The mobile electronic device of the present invention includes an interface unit, a semiconductor storage device, and a processor. The interface unit provides a user interface to receive user input. The semiconductor storage device includes a controller and a non-volatile memory, and the non-volatile memory is coupled to the controller and includes a plurality of memory blocks. The processor is coupled to the interface unit and the semiconductor storage device, and sends a signal to the semiconductor according to the user input Storage device. The controller cleans up at least one of the above memory blocks in response to the signal.

本發明的清理記憶區塊的方法是由行動電子裝置執行,並包括以下步驟:提供使用者介面以接收使用者輸入;因應此使用者輸入而發送訊號;以及因應此訊號而清理非揮發記憶體的至少一個記憶區塊。 The method for cleaning a memory block of the present invention is performed by a mobile electronic device, and includes the steps of: providing a user interface to receive user input; transmitting a signal according to the user input; and cleaning the non-volatile memory according to the signal At least one memory block.

基於上述,本發明的記憶區塊的清理是由使用者介面的使用者輸入來啟動,因此使用者可決定何時清理記憶區塊,不至於影響行動電子裝置的使用。 Based on the above, the cleaning of the memory block of the present invention is initiated by the user input of the user interface, so that the user can decide when to clear the memory block without affecting the use of the mobile electronic device.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.

100‧‧‧快閃記憶體 100‧‧‧flash memory

110、120‧‧‧記憶區塊 110, 120‧‧‧ memory blocks

400‧‧‧行動電子裝置 400‧‧‧Mobile electronic devices

410‧‧‧介面單元 410‧‧‧Interface unit

420‧‧‧處理器 420‧‧‧ processor

430‧‧‧半導體儲存裝置 430‧‧‧Semiconductor storage device

432‧‧‧控制器 432‧‧‧ Controller

434‧‧‧非揮發記憶體 434‧‧‧ Non-volatile memory

440‧‧‧電子訊號 440‧‧‧Electronic signal

510‧‧‧非揮發記憶體的使用者區 510‧‧‧User area of non-volatile memory

520‧‧‧非揮發記憶體的系統區 520‧‧‧Systematic area of non-volatile memory

525‧‧‧內部暫存區 525‧‧‧Internal temporary storage area

610~650‧‧‧流程步驟 610~650‧‧‧ Process steps

700、800、900‧‧‧使用者介面 700, 800, 900‧‧‧ user interface

710、730、810、910、930‧‧‧使用者介面的訊息 710, 730, 810, 910, 930‧‧‧ user interface messages

720、920‧‧‧長條圖 720, 920‧‧‧ bar chart

741~742、821~823、941~944‧‧‧使用者介面的選項 741~742, 821~823, 941~944‧‧‧ user interface options

A1~A3、B1~B3、C1~C3、D1~D3、E1~E3‧‧‧記憶分頁 A1~A3, B1~B3, C1~C3, D1~D3, E1~E3‧‧‧ memory page

圖1至圖3是習知的一種快閃記憶體的垃圾收集示意圖。 1 to 3 are schematic diagrams of a conventional garbage collection of a flash memory.

圖4是依照本發明的一實施例的一種行動電子裝置的示意圖。 4 is a schematic diagram of a mobile electronic device in accordance with an embodiment of the present invention.

圖5是依照本發明的一實施例的一種非揮發記憶體的示意圖。 Figure 5 is a schematic illustration of a non-volatile memory in accordance with an embodiment of the present invention.

圖6是依照本發明的一實施例的一種清理記憶區塊的方法的流程圖。 6 is a flow chart of a method of cleaning a memory block in accordance with an embodiment of the invention.

圖7至圖9是依照本發明的不同實施例的使用者介面的示意圖。 7 through 9 are schematic illustrations of user interfaces in accordance with various embodiments of the present invention.

圖4是依照本發明的一實施例的一種行動電子裝置400的示意圖。行動電子裝置400可以是行動電話、個人數位助理(PDA:personal digital assistant)、平板電腦、或智慧型穿戴式電子裝置。行動電子裝置400包括介面單元410、處理器420、以及半導體儲存裝置430。處理器420耦接介面單元410與半導體儲存裝置430。半導體儲存裝置430包括控制器432與非揮發記憶體(non-volatile memory)434。非揮發記憶體434耦接控制器432,非揮發記憶體434包括多個記憶區塊。 4 is a schematic diagram of a mobile electronic device 400 in accordance with an embodiment of the present invention. The mobile electronic device 400 can be a mobile phone, a personal digital assistant (PDA), a tablet computer, or a smart wearable electronic device. The mobile electronic device 400 includes an interface unit 410, a processor 420, and a semiconductor storage device 430. The processor 420 is coupled to the interface unit 410 and the semiconductor storage device 430. The semiconductor storage device 430 includes a controller 432 and a non-volatile memory 434. The non-volatile memory 434 is coupled to the controller 432, and the non-volatile memory 434 includes a plurality of memory blocks.

介面單元410可提供使用者介面以供使用者操作。上述使用者介面可分輸出與輸入兩部分。在輸出部分,介面單元410所提供的使用者介面可用影像、聲音、或盲人點字等方式向使用者輸出各種訊息。在輸入部分,介面單元410所提供的使用者介面可透過觸控面板、觸控螢幕、虛擬按鍵、或實體按鍵等方式接收一使用者輸入。行動電子裝置400更包括一作業系統與複數個應用程式儲存於非揮發記憶體434中。處理器420可執行該作業系統與複數個應用程式。 The interface unit 410 can provide a user interface for the user to operate. The above user interface can be divided into two parts: output and input. In the output part, the user interface provided by the interface unit 410 can output various messages to the user by means of images, sounds, or blind words. In the input portion, the user interface provided by the interface unit 410 can receive a user input through a touch panel, a touch screen, a virtual button, or a physical button. The mobile electronic device 400 further includes an operating system and a plurality of applications stored in the non-volatile memory 434. The processor 420 can execute the operating system and a plurality of applications.

半導體儲存裝置430可以是固態硬碟(SSD)或內嵌式多媒體記憶卡(eMMC)。控制器432管理非揮發記憶體434,控制器432可說是處理器420與非揮發記憶體434之間的橋樑。非揮發記憶體434可以是快閃記憶體,或其他具有不對稱的資料燒錄單位與 資料抹除單位的非揮發記憶體。 The semiconductor storage device 430 can be a solid state drive (SSD) or an embedded multimedia memory card (eMMC). The controller 432 manages the non-volatile memory 434, which can be said to be a bridge between the processor 420 and the non-volatile memory 434. The non-volatile memory 434 can be a flash memory, or other asymmetric data burning unit and Data is erased from the unit's non-volatile memory.

圖5是依照本發明的一實施例的非揮發記憶體434的示意圖。非揮發記憶體434包括使用者區510與系統區520。使用者區510供行動電子裝置400的使用者與處理器420使用。於此實施例中,使用者區510儲存行動電子裝置400的作業系統與複數個應用程式,以及和作業系統與應用程式相關的各種資料。另外,系統區520是由控制器432使用,處理器420不能直接存取系統區520。系統區520儲存控制器432所執行的韌體(firmware),以及控制器432管理非揮發記憶體434所需的資訊,例如非揮發記憶體434的損壞區塊資訊(bad block information)與位址轉譯表(address translation table)。此外,系統區520還包括一個內部暫存區525。使用者區510、系統區520、以及內部暫存區525都是由多個記憶區塊組成。於一實施例中,非揮發記憶體434是快閃記憶體,快閃記憶體的每一記憶區塊包括複數個記憶分頁(memory page),且每一記憶區塊的容量大小相同。 FIG. 5 is a schematic illustration of a non-volatile memory 434 in accordance with an embodiment of the present invention. The non-volatile memory 434 includes a user area 510 and a system area 520. User area 510 is for use by user of mobile electronic device 400 and processor 420. In this embodiment, the user area 510 stores the operating system of the mobile electronic device 400 and a plurality of applications, and various materials related to the operating system and the application. Additionally, system area 520 is used by controller 432, which is not directly accessible by processor 420. The system area 520 stores the firmware executed by the controller 432, and the information required by the controller 432 to manage the non-volatile memory 434, such as the bad block information and address of the non-volatile memory 434. Address translation table. In addition, system area 520 also includes an internal temporary storage area 525. User area 510, system area 520, and internal temporary storage area 525 are all composed of a plurality of memory blocks. In one embodiment, the non-volatile memory 434 is a flash memory. Each memory block of the flash memory includes a plurality of memory pages, and each memory block has the same capacity.

當非揮發記憶體434由處理器420接收一資料時,該資料有一部分是直接存入使用者區510,不過,上述資料有另一部分是先暫存於內部暫存區525,等寫入完畢後,才由內部暫存區525搬移並存入使用者區510。在行動電子裝置400的作業系統與應用程式執行時經常變更的小筆資料,例如檔案系統(file system)的摘要記錄(journal),就可以先暫存在內部暫存區525。上述的摘要記錄可包括檔案大小、檔案的修改時間、建立時間、以及檔案資料 在非揮發記憶體434之內的邏輯位址(logical address)等資訊。 When the non-volatile memory 434 receives a data from the processor 420, a portion of the data is directly stored in the user area 510. However, another portion of the data is temporarily stored in the internal temporary storage area 525, and the writing is completed. After that, it is moved by the internal temporary storage area 525 and stored in the user area 510. The small data that is frequently changed during the execution of the operating system and the application of the mobile electronic device 400, such as the summary of the file system, may be temporarily stored in the internal temporary storage area 525. The above summary records may include file size, file modification time, creation time, and file data. Information such as logical addresses within the non-volatile memory 434.

圖6是依照本發明的一實施例的一種清理記憶區塊的方法的流程圖,此方法可由行動電子裝置400執行。在步驟610,介面單元410提供使用者介面以接收使用者輸入。例如介面單元410可提供多個選項以詢問使用者是否願意讓控制器432清理非揮發記憶體434,或詢問使用者願意分派多少時間讓控制器432清理非揮發記憶體434,使用者輸入可包括選擇多個選項的其中一個。因為清理非揮發記憶體434可能需要不少時間,在這期間行動電子裝置400的操作可能遲緩甚至停頓,所以有必要詢問使用者的意願。在步驟620,處理器420因應上述使用者輸入而發送一個訊號440至半導體儲存裝置430。訊號440是用來指示使用者的輸入。 FIG. 6 is a flow diagram of a method of cleaning a memory block, which may be performed by mobile electronic device 400, in accordance with an embodiment of the present invention. At step 610, interface unit 410 provides a user interface to receive user input. For example, the interface unit 410 can provide a number of options to ask the user if they are willing to let the controller 432 clean the non-volatile memory 434, or ask the user how much time the user is willing to assign to the controller 432 to clean the non-volatile memory 434, which may include Select one of several options. Since cleaning the non-volatile memory 434 may take a long time, during which the operation of the mobile electronic device 400 may be slow or even paused, it is necessary to ask the user's wishes. At step 620, the processor 420 sends a signal 440 to the semiconductor storage device 430 in response to the user input. Signal 440 is used to indicate the user's input.

接下來,在步驟630,控制器432在接收訊號440之後檢查行動電子裝置400的供電是否足以完成非揮發記憶體434的記憶區塊清理(這可以是完全清理或部分清理)。如果行動電子裝置400的電池電量足夠,或行動電子裝置400正在充電,或行動電子裝置400正在和個人電腦同步資料,則控制器432判定供電足以完成上述記憶區塊清理,流程進入步驟640。否則流程直接結束,不進行記憶區塊清理。步驟630的檢查是為了避免非揮發記憶體434儲存的資料因為斷電而損毀。 Next, at step 630, the controller 432 checks whether the power supply of the mobile electronic device 400 is sufficient to complete the memory block cleaning of the non-volatile memory 434 after receiving the signal 440 (this may be a complete cleanup or a partial cleanup). If the battery power of the mobile electronic device 400 is sufficient, or the mobile electronic device 400 is charging, or the mobile electronic device 400 is synchronizing data with the personal computer, the controller 432 determines that the power supply is sufficient to complete the above-described memory block cleaning, and the flow proceeds to step 640. Otherwise, the process ends directly, and the memory block is not cleaned up. The inspection of step 630 is to prevent the data stored in the non-volatile memory 434 from being destroyed due to power failure.

在步驟640,控制器432進一步檢查將被清理的區域(即使用者區510、系統區520、或內部暫存區525)的可用區塊(free block)的數量是否小於預設的臨界值。如果是,表示有碎裂現象, 流程進入步驟650。否則表示沒必要進行記憶區塊清理,流程直接結束。 At step 640, controller 432 further checks if the number of free blocks of the area to be cleaned (ie, user area 510, system area 520, or internal temporary storage area 525) is less than a predetermined threshold. If it is, it means there is a fragmentation phenomenon. The flow proceeds to step 650. Otherwise, it means that there is no need to clear the memory block and the process ends directly.

接下來,在步驟650,控制器432因應訊號440而清理非揮發記憶體434的至少一個記憶區塊。被清理的記憶區塊可屬於使用者區510、系統區520、或內部暫存區525。上述的清理可以是如圖3所示的垃圾收集。 Next, at step 650, controller 432 cleans at least one memory block of non-volatile memory 434 in response to signal 440. The cleaned memory block can belong to user area 510, system area 520, or internal temporary storage area 525. The above cleaning can be garbage collection as shown in FIG.

如果被清理的記憶區塊屬於內部暫存區525,則可用另一種清理方式。由於內部暫存區525的資料只是暫存,不必長期保留,所以對於將被清理的每一上述記憶區塊,控制器432可以將欲被清理的該記憶區塊的有效資料存入使用者區510,抹除該記憶區塊的資料並標示該記憶區塊為可用區塊。控制器432可藉由此方式清理內部暫存區525的全部記憶區塊,或僅清理內部暫存區525的部分記憶區塊。如果內部暫存區525的每一記憶區塊都這樣清理,就能將內部暫存區525清空到出廠時的初始狀態。 If the cleaned memory block belongs to the internal temporary storage area 525, another cleaning method can be used. Since the data of the internal temporary storage area 525 is only temporarily stored and does not need to be retained for a long time, the controller 432 can store the valid data of the memory block to be cleaned into the user area for each of the above-mentioned memory blocks to be cleaned. 510. Erasing the data of the memory block and marking the memory block as an available block. The controller 432 can clean all the memory blocks of the internal temporary storage area 525 in this way, or only the partial memory blocks of the internal temporary storage area 525. If each memory block of the internal temporary storage area 525 is thus cleaned, the internal temporary storage area 525 can be emptied to the initial state at the time of shipment.

圖7是依照本發明的一實施例的一種使用者介面700的示意圖,使用者介面700可來自行動電子裝置400的作業系統或應用程式。使用者介面700可由介面單元410的觸控螢幕顯示,以供使用者操作,並藉由觸控螢幕接收一使用者輸入。使用者介面700包括訊息710、730、長條圖720、以及兩個選項741~742。訊息710與長條圖720指出內部暫存區525的記憶區塊利用率。訊息730指出完全清理內部暫存區525所需的時間長度(15分鐘),並詢問使用者是否願意讓控制器432完全清理內部暫存區 525。 FIG. 7 is a schematic diagram of a user interface 700, which may be from an operating system or application of the mobile electronic device 400, in accordance with an embodiment of the invention. The user interface 700 can be displayed by the touch screen of the interface unit 410 for the user to operate and receive a user input through the touch screen. The user interface 700 includes messages 710, 730, a bar graph 720, and two options 741-742. Message 710 and bar graph 720 indicate the memory block utilization of internal temporary storage area 525. Message 730 indicates the length of time (15 minutes) required to completely clean internal temporary storage area 525, and asks the user if they are willing to let controller 432 completely clean up the internal temporary storage area. 525.

使用者可操作使用者介面700以選擇一個選項。若使用者選擇同意選項(是)741,表示同意完全清理內部暫存區525。處理器420可發送訊號440以通知控制器432進行內部暫存區525的完全清理。或者,訊號440可包括訊息730中的時間長度,以限定控制器432清理內部暫存區525的時間。無論清理的目標完成與否,控制器432會在指定的時間長度結束時停止清理,讓行動電子裝置400恢復正常操作。若使用者選擇不同意選項(否)742,表示不同意上述清理,則處理器420不發送訊號440,所以控制器432不進行記憶區塊清理。 The user can operate the user interface 700 to select an option. If the user chooses the consent option (Yes) 741, it agrees to completely clean up the internal temporary storage area 525. The processor 420 can send a signal 440 to notify the controller 432 to perform a full cleanup of the internal temporary storage area 525. Alternatively, signal 440 can include the length of time in message 730 to define when controller 432 clears internal temporary storage area 525. Regardless of whether the cleaned up target is completed or not, the controller 432 will stop cleaning at the end of the specified length of time to allow the mobile electronic device 400 to resume normal operation. If the user chooses the disagree option (No) 742, indicating that the above cleaning is not agreed, the processor 420 does not send the signal 440, so the controller 432 does not perform the memory block cleaning.

圖8是依照本發明的另一實施例的一種使用者介面800的示意圖。使用者介面800包括訊息810與三個選項821~823。訊息810提示使用者選擇給予控制器432以清理內部暫存區525的時間長度。如圖8所示,選項821~823分別對應不同的時間長度。使用者選擇的時間越長,對行動電子裝置400的操作的妨礙越大,但清理記憶區塊的效果越佳。當使用者選擇其中一個選項,處理器420會將該選項對應的時間長度包含在訊號440之中,發送給控制器432。因此,訊號440可限定控制器432清理內部暫存區525的記憶區塊的時間長度。控制器432所清理的記憶區塊數量會與此時間長度成正比。 FIG. 8 is a schematic illustration of a user interface 800 in accordance with another embodiment of the present invention. User interface 800 includes message 810 and three options 821-823. The message 810 prompts the user to select the length of time that the controller 432 is given to clear the internal temporary storage area 525. As shown in Figure 8, options 821~823 correspond to different lengths of time. The longer the user selects, the greater the hindrance to the operation of the mobile electronic device 400, but the better the effect of cleaning the memory block. When the user selects one of the options, the processor 420 will include the length of time corresponding to the option in the signal 440 and send it to the controller 432. Thus, signal 440 can define the length of time that controller 432 cleans the memory block of internal temporary storage area 525. The number of memory blocks cleaned by controller 432 will be proportional to the length of time.

在有限的時間長度內清理哪些記憶區塊可由處理器420或控制器432決定。若是由處理器420決定,則處理器420可根 據使用者選擇的時間長度,選擇內部暫存區525的需要清理的記憶區塊其中的一部分,該部分的記憶區塊數量與該時間長度成正比。訊號440可包含該時間長度與該部分在非揮發記憶體434之內的實體位址(physical address)。控制器432可因應訊號440在該時間長度之內清理該部分的記憶區塊。 Which memory blocks are cleaned up for a limited length of time may be determined by processor 420 or controller 432. If determined by the processor 420, the processor 420 can be rooted According to the length of time selected by the user, a part of the memory block of the internal temporary storage area 525 that needs to be cleaned is selected, and the number of memory blocks of the part is proportional to the length of the time. Signal 440 can include the length of time and the physical address of the portion within non-volatile memory 434. The controller 432 can clean the memory block of the portion within the length of time corresponding to the signal 440.

圖9是依照本發明的另一實施例的一種使用者介面900的示意圖。使用者介面900包括訊息910、930、長條圖920、以及四個選項941~944。訊息910與長條圖920指出內部暫存區525的記憶區塊利用率。訊息930指出完全清理內部暫存區525所需的時間長度,並詢問使用者是否願意讓控制器432完全清理內部暫存區525。使用者可選擇選項941~943其中之一,以限定清理的時間長度。使用者也可選擇選項944以取消此次清理。 9 is a schematic diagram of a user interface 900 in accordance with another embodiment of the present invention. The user interface 900 includes messages 910, 930, a bar graph 920, and four options 941-944. The message 910 and the bar graph 920 indicate the memory block utilization of the internal temporary storage area 525. Message 930 indicates the length of time required to completely clean internal staging area 525 and asks the user if he or she would like controller 432 to completely clean internal staging area 525. The user can select one of options 941~943 to limit the length of time for cleaning. The user can also select option 944 to cancel the cleanup.

綜上所述,本發明可讓使用者自行決定是否清理非揮發記憶體,也可讓使用者自行決定清理的時間長度。因此,本發明不僅可解決非揮發記憶體的碎裂問題,也可提高使用者的觀感。 In summary, the present invention allows the user to decide whether to clean the non-volatile memory, and allows the user to determine the length of the cleaning time. Therefore, the present invention can not only solve the problem of fragmentation of the non-volatile memory, but also improve the look and feel of the user.

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

610~650‧‧‧方法步驟 610~650‧‧‧ method steps

Claims (16)

一種行動電子裝置,包括:一介面單元,提供一使用者介面以接收一使用者輸入;一半導體儲存裝置,包括一控制器與一非揮發記憶體,該非揮發記憶體耦接該控制器並包括多個記憶區塊;以及一處理器,耦接該介面單元與該半導體儲存裝置,因應該使用者輸入而發送一訊號至該半導體儲存裝置,該控制器因應該訊號而檢查該行動電子裝置的供電是否足以完成清理至少一上述記憶區塊,並且該控制器僅在上述供電足以完成上述清理時進行上述清理。 A mobile electronic device includes: an interface unit providing a user interface to receive a user input; a semiconductor storage device including a controller and a non-volatile memory coupled to the controller and including a plurality of memory blocks; and a processor coupled to the interface unit and the semiconductor storage device to send a signal to the semiconductor storage device according to a user input, the controller checking the mobile electronic device according to the signal Whether the power supply is sufficient to complete cleaning of at least one of the above memory blocks, and the controller performs the above cleaning only when the power supply described above is sufficient to complete the cleaning. 如申請專利範圍第1項所述的行動電子裝置,其中該非揮發記憶體為一快閃記憶體。 The mobile electronic device of claim 1, wherein the non-volatile memory is a flash memory. 如申請專利範圍第1項所述的行動電子裝置,更包括一作業系統與複數個應用程式,其中該非揮發記憶體包括一使用者區與一系統區,該使用者區儲存該作業系統與該複數個應用程式,該系統區儲存該控制器管理該非揮發記憶體所需的資訊,該控制器清理的該至少一記憶區塊屬於該系統區。 The mobile electronic device of claim 1, further comprising an operating system and a plurality of applications, wherein the non-volatile memory comprises a user area and a system area, wherein the user area stores the operating system and the a plurality of applications, the system area stores information required by the controller to manage the non-volatile memory, and the at least one memory block cleaned by the controller belongs to the system area. 如申請專利範圍第3項所述的行動電子裝置,其中該系統區包括一內部暫存區,該控制器清理的該至少一記憶區塊屬於該內部暫存區。 The mobile electronic device of claim 3, wherein the system area comprises an internal temporary storage area, and the at least one memory block cleaned by the controller belongs to the internal temporary storage area. 如申請專利範圍第4項所述的行動電子裝置,其中當該非揮發記憶體接收一資料時,該資料的一部分是直接存入該使用者 區,上述資料的另一部分是先暫存於該內部暫存區然後由該內部暫存區搬移並存入該使用者區。 The mobile electronic device of claim 4, wherein when the non-volatile memory receives a data, a part of the data is directly stored in the user. The other part of the above information is temporarily stored in the internal temporary storage area and then moved by the internal temporary storage area and stored in the user area. 如申請專利範圍第4項所述的行動電子裝置,其中該控制器藉由將欲被清理的該記憶區塊的有效資料存入該使用者區,抹除該記憶區塊的資料並標示該記憶區塊為可用區塊來清理該記憶區塊。 The mobile electronic device of claim 4, wherein the controller erases the data of the memory block and marks the data by storing the valid data of the memory block to be cleaned into the user area. The memory block is an available block to clean the memory block. 如申請專利範圍第4項所述的行動電子裝置,其中該介面單元提供至少一選項,該使用者輸入包括選擇上述至少一選項其中之一,該處理器根據該被選擇選項而決定一時間長度,該訊號指示該時間長度,該控制器在該時間長度之內清理該至少一記憶區塊。 The mobile electronic device of claim 4, wherein the interface unit provides at least one option, the user input comprising selecting one of the at least one of the options, the processor determining a length of time according to the selected option The signal indicates the length of time, and the controller clears the at least one memory block within the length of time. 如申請專利範圍第7項所述的行動電子裝置,其中該處理器根據該時間長度選擇該內部暫存區的其中的一部分的記憶區塊,該部分的記憶區塊數量與該時間長度成正比,該訊號指示該時間長度與該部分的實體位址,該控制器因應該訊號在該時間長度之內清理該部分的記憶區塊。 The mobile electronic device of claim 7, wherein the processor selects a memory block of a portion of the internal temporary storage area according to the length of time, and the number of memory blocks of the portion is proportional to the length of time The signal indicates the length of time and the physical address of the part, and the controller clears the memory block of the part within the length of time according to the signal. 如申請專利範圍第4項所述的行動電子裝置,其中該控制器在接收該訊號之後檢查該內部暫存區的可用區塊數量是否小於一臨界值,該控制器僅在該可用區塊數量小於該臨界值時進行上述清理。 The mobile electronic device of claim 4, wherein the controller checks whether the number of available blocks in the internal temporary storage area is less than a critical value after receiving the signal, and the controller only has the number of available blocks. The above cleaning is performed when the threshold is less than this threshold. 一種清理記憶區塊的方法,由一行動電子裝置執行,該行動電子裝置具有一半導體儲存裝置,該半導體儲存裝置包括一 控制器與一非揮發記憶體,該非揮發記憶體耦接該控制器並包括多個記憶區塊,該方法包括:提供一使用者介面以接收一使用者輸入;因應該使用者輸入而發送一訊號;以及因應該訊號檢查該行動電子裝置的供電是否足以完成清理該非揮發記憶體的至少一記憶區塊;以及僅在上述供電足以完成上述清理時進行上述清理。 A method of cleaning a memory block is performed by a mobile electronic device having a semiconductor storage device, the semiconductor storage device including a The controller is coupled to the non-volatile memory, the non-volatile memory is coupled to the controller and includes a plurality of memory blocks, the method comprising: providing a user interface to receive a user input; transmitting a user input And detecting, by the signal, whether the power supply of the mobile electronic device is sufficient to complete cleaning of the at least one memory block of the non-volatile memory; and performing the cleaning only when the power supply is sufficient to complete the cleaning. 如申請專利範圍第10項所述的清理記憶區塊的方法,其中該非揮發記憶體包括一使用者區與一系統區,該使用者區儲存該行動電子裝置的一作業系統與複數個應用程式,該系統區儲存該控制器管理該非揮發記憶體所需的資訊,被清理的該至少一記憶區塊屬於該系統區,且其中該系統區包括該非揮發記憶體的損壞區塊資訊、該非揮發記憶體的位址轉譯表、以及一內部暫存區,被清理的該至少一記憶區塊屬於該內部暫存區。 The method of cleaning a memory block according to claim 10, wherein the non-volatile memory comprises a user area and a system area, wherein the user area stores an operating system and a plurality of applications of the mobile electronic device. The system area stores information required by the controller to manage the non-volatile memory, and the cleaned at least one memory block belongs to the system area, and wherein the system area includes damaged block information of the non-volatile memory, the non-volatile The address translation table of the memory and an internal temporary storage area, the at least one memory block being cleaned belongs to the internal temporary storage area. 如申請專利範圍第11項所述的清理記憶區塊的方法,更包括:藉由該非揮發記憶體接收一資料;將該資料的一部分直接存入該使用者區;將該資料的另一部分暫存於該內部暫存區;及將該資料的另一部分由該內部暫存區搬移並存入該使用者區。 The method for cleaning a memory block according to claim 11, further comprising: receiving a data by the non-volatile memory; depositing a part of the data directly into the user area; and temporarily storing another part of the data Stored in the internal temporary storage area; and another part of the data is moved from the internal temporary storage area and stored in the user area. 如申請專利範圍第11項所述的清理記憶區塊的方法,其 中清理該非揮發記憶體的至少一記憶區塊的步驟更包括:將欲被清理的該記憶區塊的有效資料存入該使用者區;抹除該記憶區塊的資料;以及標示該記憶區塊為可用區塊。 A method of cleaning a memory block as described in claim 11 of the patent application, The step of cleaning at least one memory block of the non-volatile memory further includes: storing valid data of the memory block to be cleaned into the user area; erasing data of the memory block; and marking the memory area The block is an available block. 如申請專利範圍第11項所述的清理記憶區塊的方法,更包括:透過該使用者介面提供至少一選項,其中該使用者輸入包括選擇上述至少一選項其中之一;根據該被選擇選項而決定一時間長度,其中該訊號指示該時間長度;以及在該時間長度之內清理該至少一記憶區塊。 The method for cleaning a memory block according to claim 11, further comprising: providing at least one option through the user interface, wherein the user input comprises selecting one of the at least one of the options; according to the selected option And determining a length of time, wherein the signal indicates the length of time; and clearing the at least one memory block within the length of time. 如申請專利範圍第14項所述的清理記憶區塊的方法,更包括:根據該時間長度選擇該內部暫存區的其中的一部分的記憶區塊,其中該部分的記憶區塊數量與該時間長度成正比,該訊號指示該時間長度與該部分的實體位址;以及因應該訊號在該時間長度之內清理該部分的記憶區塊。 The method for cleaning a memory block according to claim 14, further comprising: selecting a memory block of a part of the internal temporary storage area according to the length of time, wherein the number of memory blocks of the part is related to the time The length is proportional to the length of the time and the physical address of the part; and the memory block of the part is cleaned up within the length of time. 如申請專利範圍第11項所述的清理記憶區塊的方法,更包括:在接收該訊號之後檢查該內部暫存區的可用區塊數量是否小於一臨界值;以及僅在該可用區塊數量小於該臨界值時進行上述清理。 The method for cleaning a memory block according to claim 11, further comprising: checking whether the number of available blocks in the internal temporary storage area is less than a critical value after receiving the signal; and only the number of available blocks The above cleaning is performed when the threshold is less than this threshold.
TW103110318A 2014-03-19 2014-03-19 Mobile electronic device and method for clearing memory blocks TWI548989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW103110318A TWI548989B (en) 2014-03-19 2014-03-19 Mobile electronic device and method for clearing memory blocks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW103110318A TWI548989B (en) 2014-03-19 2014-03-19 Mobile electronic device and method for clearing memory blocks

Publications (2)

Publication Number Publication Date
TW201537348A TW201537348A (en) 2015-10-01
TWI548989B true TWI548989B (en) 2016-09-11

Family

ID=54850892

Family Applications (1)

Application Number Title Priority Date Filing Date
TW103110318A TWI548989B (en) 2014-03-19 2014-03-19 Mobile electronic device and method for clearing memory blocks

Country Status (1)

Country Link
TW (1) TWI548989B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI792534B (en) * 2021-04-25 2023-02-11 慧榮科技股份有限公司 Method of performing garbage collection with partial clean operation and related controller and storage system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200951711A (en) * 2008-06-02 2009-12-16 A Data Technology Co Ltd Method for memory space management
CN102306095A (en) * 2011-07-21 2012-01-04 宇龙计算机通信科技(深圳)有限公司 Application management method and terminal
US20130326168A1 (en) * 2012-05-31 2013-12-05 Wen-Yen CHANG Memory management methods and systems for mobile devices
TW201411346A (en) * 2012-09-11 2014-03-16 Etron Technology Inc Method capable of increasing performance of a memory and related memory system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200951711A (en) * 2008-06-02 2009-12-16 A Data Technology Co Ltd Method for memory space management
CN102306095A (en) * 2011-07-21 2012-01-04 宇龙计算机通信科技(深圳)有限公司 Application management method and terminal
US20130326168A1 (en) * 2012-05-31 2013-12-05 Wen-Yen CHANG Memory management methods and systems for mobile devices
TW201411346A (en) * 2012-09-11 2014-03-16 Etron Technology Inc Method capable of increasing performance of a memory and related memory system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI792534B (en) * 2021-04-25 2023-02-11 慧榮科技股份有限公司 Method of performing garbage collection with partial clean operation and related controller and storage system
US11580018B2 (en) 2021-04-25 2023-02-14 Silicon Motion, Inc. Method and apparatus for page validity management and related storage system

Also Published As

Publication number Publication date
TW201537348A (en) 2015-10-01

Similar Documents

Publication Publication Date Title
TWI519950B (en) Dynamic and static data for a system having non-volatile memory
TWI533308B (en) Method for managing memory, memory storage device and memory control circuit unit
TWI489373B (en) Data storage device and method for managing blocks of a flash memory
JP4192129B2 (en) Memory management device
JP5696118B2 (en) Weave sequence counter for non-volatile memory systems
US8463826B2 (en) Incremental garbage collection for non-volatile memories
TW201737094A (en) Memory devices including dynamic superblocks, and related methods and electronic systems
US8402202B2 (en) Input/output control method and apparatus optimized for flash memory
TWI501243B (en) Data writing method, memory storage device and memory controlling circuit unit
TWI479313B (en) Data writing method, memory controller and memory storage device
TW201401050A (en) Data writing method, memory controller and memory storage device
JP5183662B2 (en) Memory control device and memory control method
CN108415663A (en) The operating method of data storage device
JP2010287049A (en) Memory system and memory system management method
TW201007740A (en) Method for managing data and storage apparatus thereof and controller thereof
TWI792534B (en) Method of performing garbage collection with partial clean operation and related controller and storage system
TWI533309B (en) Data writing method, memory storage device and memory control circuit unit
TWI548989B (en) Mobile electronic device and method for clearing memory blocks
TWI554884B (en) Memory management method, memory control circuit unit and memory storage device
CN104932981B (en) Electronic apparatus and the method for cleaning memory block
JP6012432B2 (en) Semiconductor memory device
US9811458B2 (en) Mobile electronic device and method for clearing memory blocks based on processor determination of physical block to erase in response to GUI input from user specified time and directing controller to erase within the specified time
JP2017138636A (en) Memory management method, program for memory management, and memory management apparatus
JP2009301491A (en) Memory controller, flash memory system equipped with memory controller, and control method for flash memory