1. Field of the Invention
The invention relates to a mobile electronic device, and particularly relates to a method for clearing memory blocks of the mobile electronic device.
2. Description of Related Art
A characteristic of the flash memory is that units for data programming and data erasing are not symmetrical. Specifically, the unit for data programming is the memory page, which is smaller, and the unit for data erasing is the memory block, which is larger. Thus, when the content of the file is modified, the original memory pages A1 to E1 are not overwritten. Instead, the modified file is written to subsequent memory pages A2 to E2, as shown in
The conventional mobile electronic device uses flash memory as the main storage device, e.g. solid state disks (SSD) or embedded multimedia cards (eMMC), for storing an operating system, applications, and a variety of data. However, fragmentation, as shown in
To recycle the memory pages A1 to E1 and A2 to E2 taken up by the invalid data, the valid data in the memory pages A3 to E3 may be copied to another memory block 120, and then the memory block 110 is erased, as shown in
The invention provides a mobile electronic device and a method for clearing memory blocks that are capable of solving problems caused by fragmentation while maintaining the user experience.
The mobile electronic device includes an interface unit, a semiconductor storage device and a processor. The interface unit provides a user interface to receive a user input. The semiconductor storage device includes a controller and a non-volatile memory. The non-volatile memory is coupled with the controller and includes a plurality of memory blocks. The processor is coupled with the interface unit and the semiconductor storage device and sends a signal to the semiconductor storage device in response to the user input. The controller thus clears at least one of the memory blocks in response to the signal.
The method for clearing the memory blocks provided in the invention is executed by a mobile electronic device and includes steps as follows: providing a user interface to receive a user input; sending a signal in response to the user input; and clearing at least one of the memory blocks of the non-volatile memory in response to the signal.
In view of the foregoing, the memory block clearing according to the invention is activated by the user input from the user interface. Therefore, the user may decide when to clear the memory blocks, and the use of the mobile electronic device is thus not influenced.
In order to make the aforementioned and other features and advantages of the invention comprehensible, several exemplary embodiments accompanied with figures are described in detail below.
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
The interface unit 410 provides a user interface for the user to operate. The user interface includes an input part and an output part. Regarding the output part, the user interface provided by the interface unit 410 may output a variety of messages to the user by means of image, voice, or braille, etc. Regarding the input part, the user interface provided by the interface unit 410 may receive a user input through a touch panel, a touch display, a virtual key, 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 may execute the operating system and the plurality of applications.
The semiconductor storage device 430 may be a solid state disk (SSD) or an embedded multimedia card (eMMC). The controller 432 manages the non-volatile memory 434. The controller 432 may be considered as a bridge between the processor 420 and the non-volatile memory 434. The non-volatile memory 434 may be a flash memory or other kinds of non-volatile memory having asymmetrical data programming and data erasing units.
When the non-volatile memory 434 receives a data from the processor 424, a part of the data is directly stored in the user region 510. However, another part of the data is temporarily stored in the internal buffer 525, and then moved from the internal buffer 525 to be stored in the user region 510 after a writing process is completed. Smaller data that are constantly modified during operation of the operating system and the applications of the mobile electronic device 400, such as journal records of a file system, may be stored in the internal buffer 525. The journal records may include information such as file size, file modification time, file establishment time and logical address of file data in the non-volatile memory 434, etc.
Then, at Step 630, after receiving the signal 440, the controller 432 checks whether power supply of the mobile electronic device 400 is enough to finish clearing the memory blocks, which may be partial or whole memory blocks, of the non-volatile memory 434. If the power supply in the battery of the mobile electronic device 400 is enough, or the mobile electronic device 400 is being charged, or the mobile electronic device 400 is synchronizing data with a personal computer, the controller 432 then determines that the power supply is enough to finish clearing the memory blocks and Step 640 is executed. Otherwise, the process is terminated without clearing the memory blocks. Checking at Step 630 is to prevent data stored in the non-volatile memory 434 from being damaged due to power outage.
At Step 640, the controller 432 further checks whether the number of free blocks in the region to be cleared (i.e. the user region 510, the system region 520, or the internal buffer 525) is smaller than a predetermined threshold value. If the number of free blocks in the region to be cleared is smaller than the predetermined threshold value, fragmentation is identified, and Step 650 is executed. Otherwise, it is not necessary to clear the memory blocks, and the process is terminated.
Then, at Step 650, the controller 432 clears at least one of the memory blocks of the non-volatile memory 432 in response to the signal 440. The memory block that is cleared may belong to the user region 510, the system region 520, or the internal buffer 525. The clearing mentioned above may be garbage collection shown in
If the memory block that is cleared belongs to the internal buffer 525, another way of clearing may be used. The data in the internal buffer 525 are only temporarily stored without having to be permanently kept. Therefore, for each of the memory block to be cleared, the controller 432 may store valid data of the memory block to be cleared, erase data of the memory block, and mark the memory block as a free block. The controller 432 may clear all memory blocks of the internal buffer 525 in this way, or only clear a part of the memory blocks of the internal buffer 525. If each of the memory blocks of the internal buffer 525 is cleared in this way, the internal buffer 525 is cleared to be an initial state as dispatched from the factory.
The user may operate the user interface 700 to choose one option. If the user chooses the agreeing option 741 (Yes), it is indicated that the user agrees to completely clear the internal buffer 525. The processor 420 may send the signal 440 to notify the controller 432 to completely clear the internal buffer 525. Alternatively, the signal 440 may include the time duration of the information 730, so as to designate a time duration for the controller 432 to clear the internal buffer 525. No matter whether a goal of clearing is finished or not, the controller 432 may stop clearing the internal buffer 525 after the designated time duration lapses, such that the mobile electronic device 400 may be operated normally. If the user chooses the disagreeing option 742 (No), it is indicated that the user disagrees to perform the clearing step mentioned above. Thus, the processor 420 does not send the signal 440, so the controller 432 does not clear the memory blocks.
Which memory blocks are to be cleared within the limited time duration may be determined by the processor 420 or the controller 432. If the processor 420 makes the determination, the processor 420 may choose a part of memory blocks that need to be cleared in the internal buffer 525 based on the time duration chosen by the user. In addition, the number of the part of the memory blocks is positively proportional to the time duration. The signal 440 may include the time duration and a physical address of the part in the non-volatile memory 434. The controller 432 may clear the part of the memory blocks within the time duration in response to the signal 440.
In view of the foregoing, the invention allows the user to decide whether to clear the non-volatile memory by him/herself, and also allows the user to decide the time duration for clearing the non-volatile memory by him/herself. Thus, the invention not only solves the fragmentation of the non-volatile memory but facilitates the user experience.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Name | Date | Kind |
---|---|---|---|
7774390 | Shin | Aug 2010 | B2 |
8285869 | Graetz | Oct 2012 | B1 |
20030023410 | Roth | Jan 2003 | A1 |
20030156347 | Ishii | Aug 2003 | A1 |
20040145952 | Chen et al. | Jul 2004 | A1 |
20060101400 | Capek | May 2006 | A1 |
20070174579 | Shin | Jul 2007 | A1 |
20090198887 | Watanabe et al. | Aug 2009 | A1 |
20090259896 | Hsu et al. | Oct 2009 | A1 |
20090319720 | Stefanus et al. | Dec 2009 | A1 |
20100180066 | Powell | Jul 2010 | A1 |
20110231599 | Kawamura et al. | Sep 2011 | A1 |
20110320700 | Bronson et al. | Dec 2011 | A1 |
20120110247 | Eleftheriou et al. | May 2012 | A1 |
20120110249 | Jeong et al. | May 2012 | A1 |
20120191937 | Feldman et al. | Jul 2012 | A1 |
20130060904 | Ur | Mar 2013 | A1 |
20130124785 | Xiong et al. | May 2013 | A1 |
20130166818 | Sela | Jun 2013 | A1 |
Number | Date | Country |
---|---|---|
102073571 | May 2011 | CN |
102306095 | Jan 2012 | CN |
102622310 | Aug 2012 | CN |
103577240 | Feb 2014 | CN |
103608866 | Feb 2014 | CN |
2011159065 | Aug 2011 | JP |
200951711 | Dec 2009 | TW |
201411346 | Mar 2014 | TW |
Entry |
---|
DiskEraser. Article [online]. University of Delaware, Jun. 26, 2013 [retrieved on Aug. 13, 2015]. Retrieved from the internet <https://web.archive.org/web/20130626225453/http://www.udel.edu/it/help/pii/erasing/wde—windows.html>. |
SSDToolbox. Article [online]. PC perspective, Oct. 27, 2011 [retrieved on Aug. 13, 2015]. Retrieved from the internet <http://www.pcper.com/news/Storage/Intel-Releases-Updated-SSD-Toolbox>. |
Jurgens, Gabriel. ‘jquery execute function when two conditions are met’ [online]. stackoverflow, Jun. 1, 2012 at 15:18 [retrieved on May 21, 2016]. Retrieved from the Internet <http://stackoverflow.com/questions/10852561/query-execute-function-when-two-conditions-are-met>. |
“Office Action of German Counterpart Application”, dated Jan. 19, 2016, p. 1-p. 10. |
“Office Action of China Counterpart Application,” dated Jun. 20, 2017, p. 1-p. 12, in which the listed references were cited. |
Number | Date | Country | |
---|---|---|---|
20150269070 A1 | Sep 2015 | US |