CROSS-REFERENCE TO RELATED APPLICATIONThis application claims the priority benefit of Taiwan application serial no. 99145897, filed Dec. 24, 2010. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
BACKGROUND1. Technology Field
The present invention is related to a data management method, and more particularly, to a data management method for an embedded memory storage apparatus, and a memory controller and an embedded memory storage apparatus using the same.
2. Description of Related Art
Digital cameras, cell phones, and MP3 players have undergone rapid growth in recent years, so that consumer demand for storage media have also rapid increased. A rewritable non-volatile memory is one of the most adaptable memories for such electronic products due to its characteristics such as data non-volatility, low power consumption, small volume, non-mechanical structure, and high read-and-write speed. An embedded multi media card (eMMC) broadly applied in cell phones is a storage device that uses a flash memory as its storage medium. Therefore, the flash memory industry has become a very important part of the electronic industry in recent years.
In general, an eMMC applied in an electronic product is used to record an image file, e.g. an operating system, of the electronic product. Especially, for the facility of mass production, the image file is pre-recoded into the eMMC in advance, and then the eMMC having the pre-stored image file is soldered on a circuit board of an electronic product.
In a flash memory module, data is identified according to electric charges stored in memory cells. However, in some special circumstances to memory, e.g. when soldering, the high temperature will affect the electric charges stored in the memory cells (e.g. leakage of electricity). Thus, an error may occur accordingly in the data which is pre-stored in the eMMC.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.
SUMMARYThe present invention provides a data management method, a memory controller, and an embedded memory storage apparatus capable of re-storing data so as to efficiently use the storage space of the embedded memory storage apparatus.
The present invention provides a data management method capable of preventing data pre-stored in the embedded memory storage apparatus from losing due to soldering.
The present invention provides a memory controller and an embedded memory storage apparatus which execute a writing mechanism capable of preventing data pre-stored in the embedded memory storage apparatus from losing due to soldering.
An exemplary embodiment of the present invention provides a data management method for an embedded memory storage apparatus, wherein the embedded memory storage apparatus has a plurality of physical blocks and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. The data management method comprises detecting a status of a state indication unit, wherein when only at least a portion of the fast physical pages is used to store data, the status of the state indication unit is marked as a first status, and when at least a portion of the fast physical pages and at least a portion of the slow physical page are both used to store the data, the status of the state indication unit is marked as a second status. The data management method further comprises when the status of the state indication unit is marked as the first status, automatically reading the stored data, using the fast physical pages and slow physical pages to re-store the read data and marking the status of the state as the second status.
The exemplary embodiment of the present invention provides a memory controller for managing a rewritable non-volatile memory module of an embedded memory storage apparatus, wherein the rewritable non-volatile memory module has a plurality of physical blocks and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. This memory controller includes a host interface, a memory interface, and a memory management circuit. The host interface is configured for coupling to a host system. The memory interface is configured for coupling to the rewritable non-volatile memory module. The memory management circuit is coupled to the host interface and the memory interface. Herein, the memory management circuit is configure for detecting a status of a state indication unit, wherein when only at least a portion of the fast physical pages is used to store data, the status of the state indication unit is marked as a first status. Besides, when the status of the state indication unit is marked as the first status, the memory manager circuit automatically reads the stored data, uses the fast physical pages and slow physical pages to re-store the read data and marks the status of the state as a second status.
An exemplary embodiment of the present invention provides an embedded memory storage apparatus including a connector, a rewritable non-volatile memory storage module and a memory controller. The connector is configured for coupling to a host system. The rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. The memory controller is coupled to the connector and the rewritable non-volatile memory module. Herein, the memory controller is configure for detecting a status of a state indication unit, wherein when only the fast physical pages are used to store data, the status of the state indication unit is marked as a first status. Besides, when the status of the state indication unit is marked as the first status, the memory controller automatically reads the stored data, uses the fast physical pages and the slow physical pages to re-store the read data and marks the status of the state as a second status.
An exemplary embodiment of the present invention provides a data management method for preventing predetermined data in an embedded memory storage apparatus from losing. The embedded memory storage apparatus has a plurality of physical blocks and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. The data management method includes a burning step and a re-storing step. The burning step is used for only using the fast physical pages of the embedded memory storage apparatus to store the predetermined data and marking a status of a state indication unit as a first status, wherein the state indication unit is stored in the embedded memory storage apparatus. The re-storing step is used for using the fast physical pages and the slow physical pages of the embedded memory storage apparatus to re-store the predetermined data and marking the status of the state indication unit as a second status.
The exemplary embodiment of the present invention provides a memory controller for managing a rewritable non-volatile memory module of an embedded memory storage apparatus, wherein the rewritable non-volatile memory module has a plurality of physical blocks and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. This memory controller includes a host interface, a memory interface, and a memory management circuit. The host interface is configured for coupling to a host system. The memory interface is configured for coupling to the rewritable non-volatile memory module. The memory management circuit is coupled to the host interface and the memory interface. Herein, the memory manager circuit is configured for only using the fast physical pages to store predetermined data and mark a status of a state indication unit as a first status. Besides, the memory manager circuit is further configured for using the fast physical pages and the slow physical pages to re-store the predetermined data and marking the status of the state indication unit as a second status. Moreover, the memory manager circuit stores the state indication unit in the rewritable non-volatile memory module.
An exemplary embodiment of the present invention provides an embedded memory storage apparatus including a connector, a rewritable non-volatile memory module and a memory controller. The connector is configured for coupling to a host system. The rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of fast physical pages and a plurality of slow physical pages. The memory controller is coupled to the connector and the rewritable non-volatile memory module. Herein, the memory controller is configured for only using the fast physical pages to store predetermined data and marking a status of a state indication unit as a first status, wherein the memory controller stores the state indication unit in the rewritable non-volatile memory. Besides, the memory controller is further configured for using the fast physical pages and the slow physical pages to re-store the predetermined data and marking the status of the state indication unit as a second status.
Based on the above, the data management method, the memory controller, and the embedded memory storage apparatus of the exemplary embodiments of the present invention are capable of effectively preventing the data pre-stored in the rewritable non-volatile memory module from losing due to soldering.
It should be understood, however, that this Summary may not contain all of the aspects and embodiments of the present invention, is not meant to be limiting or restrictive in any manner, and that the present invention as disclosed herein is and will be understood by those of ordinary skill in the art to encompass obvious improvements and modifications thereto.
In order to make the aforementioned and other features and advantages of the present invention more comprehensible, embodiments accompanying figures are described in detail below.
BRIEF DESCRIPTION OF THE DRAWINGSThe accompanying drawings are included to provide a further understanding of the present invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and, together with the description, serve to explain the principles of the present invention.
FIG. 1 is an electronic device and an embedded memory storage apparatus according to the first exemplary embodiment of the present invention.
FIG. 2 is a schematic block diagram of the embedded memory storage apparatus inFIG. 1.
FIG. 3 is a schematic diagram of the physical blocks according to the first exemplary embodiment of the present invention.
FIG. 4 is a schematic block diagram of the memory controller according to the first exemplary embodiment of the present invention.
FIG. 5 is a schematic diagram illustrating data only stored in the fast physical pages according to the first exemplary embodiment of the present invention.
FIG. 6 is a schematic diagram illustrating data stored in the fast physical pages and the slow physical pages according to the first exemplary embodiment of the present invention.
FIG. 7 is a flowchart of a data management method according to the first exemplary embodiment of the present invention.
FIG. 8 is a flowchart of a data management method according to the second exemplary embodiment of the present invention.
FIG. 9 is a flow chart illustrating a burning step according to the third exemplary embodiment of the present invention.
FIG. 10 is a flowchart of re-storing the predetermined data when the write command is executed according to the third exemplary embodiment of the present invention.
DESCRIPTION OF EMBODIMENTSThe present invention provides a data management method capable of re-arranging data according to a storage status of an embedded memory storage apparatus so as to efficiently use the storage space of the embedded memory storage apparatus. Besides, the data management method of the present invention uses a burning mechanism to store predetermined data in more stable fast physical pages and uses re-storing mechanism to re-store the predetermined data in the fast physical pages and slow physical pages, such that an error bit is prevented due to special circumstances, e.g. in a high temperature causing by soldering. Several exemplary embodiments of the present invention will be described in details in the following with reference to accompany the drawings.
Embodiments of the present invention may comprise any one or more of the novel features described herein, including in the Detailed Description, and/or shown in the drawings. As used herein, “at least one”, “one or more”, and “and/or” are open-ended expressions that are both conjunctive and disjunctive in operation. For example, each of the expressions “at least on of A, B and C”, “at least one of A, B, or C”, “one or more of A, B, and C”, “one or more of A, B, or C” and “A, B, and/or C” means A alone, B alone, C alone, A and B together, A and C together, B and C together, or A, B and C together.
It is to be noted that the term “a” or “an” entity refers to one or more of that entity. As such, the terms “a” (or “an”), “one or more” and “at least one” can be used interchangeably herein.
First Exemplary EmbodimentFIG. 1 is an electronic device and an embedded memory storage apparatus according to the first exemplary embodiment of the present invention.
Referring toFIG. 1, theelectronic device1000 includes a micro-processor and a random access memory (RAM) (not shown). In the present exemplary embodiment, an embeddedmemory storage apparatus100 is embedded on a circuit board of theelectronic device1000. Data can be written into the embeddedmemory storage apparatus100 or can be read from the embeddedmemory storage apparatus100 through operations of the micro-processor and the RAM. For example, theelectronic device1000 is a smart cell phone and the embeddedmemory storage apparatus100 is configured for storing an operation system of the smart cell phone.
In the present exemplary embodiment, the embeddedmemory storage apparatus100 may be an embedded multi media card (eMMC). However, it should be understood that the present invention is not limited thereto, and in another exemplary embodiment, the embeddedmemory storage apparatus100 may be an embedded secure digital (eSD) card or another embedded non-volatile memory storage apparatus.
FIG. 2 is a schematic block diagram of the embedded memory storage apparatus inFIG. 1. Referring toFIG. 2, the embeddedmemory storage apparatus100 includes aconnector102, amemory controller104, and a rewritablenon-volatile memory module106. In an exemplary embodiment of the present invention, theconnector102, amemory controller104, and the rewritablenon-volatile memory module106 can be packaged into a single chip.
In the exemplary embodiment, theconnector102 complies with an MMC standard. Nevertheless, it should be understood that the present invention is not limited thereto, and theconnector102 may complies with an SD standard or other embedded interface standards.
Thememory controller104 is configured for executing a plurality of logic gates or control commands implemented in a hardware form or a firmware form and performs various data operations such as data writing, reading, and erasing in the rewritablenon-volatile memory module106 according to commands of theelectronic device1000.
The rewritablenon-volatile memory module106 is coupled to thememory controller104 and configured for storing data written by theelectronic device1000. Thenon-volatile memory module106 has a plurality of physical blocks. Each of the physical blocks respectively has a plurality of physical pages, wherein the physical pages belonging to the same physical block can be written individually and must be erased simultaneously. In detail, each physical block is the smallest erasing unit. Namely, each physical block contains the least number of memory cells that are erased together. Besides, one physical page is the smallest programming unit. Namely, each physical page is the smallest unit for writing data. However, it should be understood that in another exemplary embodiment of the present invention, the smallest unit for writing data may be a physical sector or another size. For example, each physical block is composed of 128 physical pages. However, it should be understood that the present invention is not limited thereto, and each physical block may be composed of 256 physical pages or any number of physical pages. Each physical page includes a user data bit area and a redundancy bit area. The user data bit area is configured for storing user data, and the redundancy bit area is configured for storing system data (e.g., an error correcting code).
In the present exemplary embodiment, the rewritablenon-volatile memory chip106 is a multi-level cell (MLC) NAND flash memory chip module. Specifically, a NAND flash memory module may be classified into an MLC NAND flash memory or a single-level cell (SLC) NAND flash memory according to the number of data bits which each memory cell thereof is capable of storing. Each memory cell of the SLC NAND flash memory can only store one bit of data, and each memory cell of the MLC NAND flash memory can store at least two bits of data. For example, taking the 4-level memory cell NAND flash memory module as an example, each memory cell may store 2 bits of data (i.e., “11”, “10”, “00” or “01”). Accordingly, for a 4 level memory cell, a data writing operation may be divided into two stages. The first stage is to write data into a lower page, and the second stage is to write data into an upper page, wherein the writing speed of the lower page is faster than the writing speed of the upper page. Therefore, physical pages of the MLC NAND may be categorized into slow physical pages (i.e., the upper pages) and fast physical pages (i.e., the lower pages). In particular, compared with the upper pages, the lower pages have higher storage reliability. Similarly, in cases of 8-level memory cell NAND flash memory module or 16-level memory cell NAND flash memory module, the memory cells can store more bits of data and the data is written in more stages. Herein, the physical pages having the fastest writing speed are referred as the lower pages, and all other pages having slower writing speed are referred as the upper pages. For example, the upper pages include a plurality of pages having different writing speeds. Additionally, in another exemplary embodiment, the upper pages may be defined as the pages having the slowest writing speed, or the pages having the slowest writing speed and some of the pages having faster writing speeds than the slowest writing speed. For example, in an 8-level memory cell NAND flash memory module, the lower pages are the pages having the fastest and the second fastest writing speed, while the upper pages are the pages having the slowest and the second slowest writing speed.
FIG. 3 is a schematic diagram of the physical blocks according to the first exemplary embodiment of the present invention.
Referring toFIG. 3, the physical blocks of a 4-level memory cell flash memory module are classified into a plurality of fastphysical pages310 and a plurality of slowphysical pages320 according to writing property, wherein the writing speed of data written into the fastphysical pages310 is faster than the writing speed of data written into the slowphysical pages320, and the reliability of the data stored in the fastphysical pages310 is higher than the reliability of the data stored in the slowphysical pages320. Besides, data must be sequentially written according serial numbers of the physical pages.
FIG. 4 is a schematic block diagram of the memory controller according to the first exemplary embodiment of the present invention.
ReferringFIG. 4, thememory controller104 includes amemory management circuit202, ahost interface204, and amemory interface206.
Thememory management circuit202 is configured for controlling the whole operation of thememory controller104. For example, thememory management circuit202 may be composed of a plurality of control modules (e.g. a writing module, a reading module, and an erasing module, etc.), and the control modules of thememory management circuit202 may performs various data operations such as data writing, reading, and erasing in thenon-volatile memory module106 according to commands of theelectronic device1000 when thememory storage apparatus100 operates.
In the exemplary embodiment, the control modules of thememory management circuit202 are implemented by program codes. For example, thememory management circuit202 has a micro-processor unit (not shown) and a read-only memory (not shown), and these control commands are burnt into the read-only memory. Herein, these program codes are also referred to as a firmware. When thememory storage apparatus100 operates, these program codes are run by the micro-processor unit to execute various operations such as data writing, reading, and erasing.
In another exemplary embodiment of the present invention, these program codes may be also stored in a specific area (e.g., a system area of the memory module exclusively used to store system data) of the rewritablenon-volatile memory module106. Additionally, thememory management circuit202 has a micro-processor unit (not shown), a read-only memory (not shown), and a random access memory (not shown). Particularly, the read-only memory has a driver code, and when thememory controller104 is enabled, the micro-processor unit runs the driver code to load the micro-programs, which are stored in thememory module106, into the random access memory of thememory management circuit202 first. Afterwards, the micro-processor unit runs the program codes so as to execute the operations of data writing, reading, and erasing, etc. Additionally, in another exemplary embodiment of the present invention, the control module of thememory management circuit202 may be implemented in a hardware form.
Thehost interface204 is coupled to thememory management circuit202, and configured for receiving and identifying commands and data transmitted from theelectronic device1000. Namely, the commands and data from theelectronic device1000 are transmitted to thememory management circuit202 through thehost interface204. In the exemplary embodiment, thehost interface204 complies with an eMMC standard. Nevertheless, it should be understood that the present invention is not limited thereto, and thehost interface204 may be an interface that complies with an eSD standard or another suitable data transmission standard.
Thememory interface206 is coupled to thememory management circuit202 and configured for accessing the rewritablenon-volatile memory module106. Namely, data to be written into the rewritablenon-volatile memory module106 is converted by thememory interface206 into a format acceptable to the rewritablenon-volatile memory module106.
An error checking and correcting (ECC)circuit208 is coupled to thememory management circuit202, and configured to execute an error checking and correcting procedure to ensure data accuracy. Specifically, when performing command writing, the error checking and correctingcircuit208 generates an error checking and correcting code corresponding to the data to be written and thememory management circuit202 writes the data and the corresponding ECC code into the rewritablenon-volatile memory module106. Afterwards, when thememory management circuit202 reads the data from the rewritablenon-volatile memory module106, thememory management circuit202 simultaneously reads the ECC code corresponding to the data, and the error checking and correctingcircuit208 executes the ECC procedure for the read data based on the corresponding ECC code.
In an exemplary embodiment of the present invention, thememory controller104 still includes abuffer memory210. Thebuffer memory210 is coupled to thememory management circuit202 and configured for temporarily storing data and commands from theelectronic device1000 or data from the rewritablenon-volatile memory module106.
In an exemplary embodiment of the present invention, thememory controller104 still includes apower management circuit212. Thepower management circuit212 is coupled to thememory management circuit202 and configured for controlling the power of the embeddedmemory storage apparatus100.
In the exemplary embodiment of the present invention, thememory management circuit202 may store a state indication unit (e.g. a flag register) in the rewritablenon-volatile memory module106 and initially mark a status of the state indication unit as an initial state. For example, in the exemplary embodiment of the present invention, thememory manager circuit202 groups the physical blocks into a storage area and a system area, and stores the state indication unit in the physical blocks. The physical blocks of the storage area is configured for storing user data (e.g. data accessed by the electronic device), and the physical blocks of the system area is configured for storing system data of the embedded memory storage apparatus100 (e.g., the number of the physical blocks and the number of the physical pages, etc.).
In particular, when only using the fast physical pages of the physical blocks to store data, thememory manager circuit202 marks the status of the state indication unit as a first status.
FIG. 5 is a schematic diagram illustrating data only stored in the fast physical pages according to the first exemplary embodiment of the present invention. For the convenience of description, here it is assumed that the size of the stored data equals to the size of the physical block and the rewritablenon-volatile memory module106 is composed ofphysical blocks502 andphysical blocks504.
Referring toFIG. 5, the data originally should be stored in the slow physical pages of thephysical blocks502 is stored in the fast physical pages of thephysical blocks504. Since the data is stored in the fast physical pages (as areas marked with oblique lines shown inFIG. 5), the probability of occurring an error bit is lower.
In addition, when the fast physical pages and the slow physical pages of the physical blocks are normally used to store data, thememory manager circuit202 marks the status of the state indication unit as a second status.
FIG. 6 is a schematic diagram illustrating data stored in the fast physical pages and the slow physical pages according to the first exemplary embodiment of the present invention.
Referring toFIG. 6, thememory manager circuit202 normally uses the fast physical pages and the slow physical page of the rewritablenon-volatile memory module106 to store data (as areas marked with oblique lines shown inFIG. 5). Since the fast physical pages and slow physical page are both used to store data, the storage space of the embeddedmemory storage apparatus100 is sufficiently used. Herein, normally using the fast physical pages and the slow physical pages of the rewritablenon-volatile memory module106 to store data is also referred to as a normal storing mechanism.
In the exemplary embodiment of the present invention, when theelectronic device1000 or another external host system receives a predetermined vendor command, thememory manager circuit202 detects the status of the state indication unit. When the status of the state indication unit is marked as the first status, thememory manager circuit202 automatically reads the data originally stored in the embeddedmemory storage apparatus100, and uses the fast physical pages and slow physical pages of the embeddedmemory storage apparatus100 to re-store the data and marks the status of the state indication unit as the second status. In other words, when the predetermined vendor command is received, thememory manager circuit202 automatically re-stores the data according the status of the embeddedmemory storage apparatus100 so as to use the storage space more efficiently.
It should be noted that the predetermined vendor command here is a predetermined command configured for activating the re-storing mechanism. However, the present invention is not limited thereto. In another exemplary embodiment of the present invention, thememory manager circuit202 may also activate the re-storing mechanism according to information of a standard command. For example, when the host system successively gives several write commands, thememory manager circuit202 activates the re-storing mechanism. Alternatively, when a write command has a specific parameter, thememory manager circuit202 activates the re-storing mechanism. Moreover, when the host system uses a standard command to be defined by a user, thememory manager circuit202 activates the re-storing mechanism.
FIG. 7 is a flowchart of a data management method according to the first exemplary embodiment of the present invention.
Referring toFIG. 7, in step S701, thememory management circuit202 determines whether the predetermined vendor command is received. When the predetermined vendor command is received, in step S703, thememory manager circuit202 determines whether the status of the state indication unit is marked as the first status.
When the status of the state indication unit is not marked as the first status, the process ofFIG. 7 is terminated. When the status of the state indication unit is marked as the first status, in step S705, thememory manager circuit202 uses the fast physical pages and the slow physical pages of the rewritablenon-volatile memory module106 to re-store the data originally stored in the fast physical pages of the embeddedmemory storage apparatus106, and marks the status of the state indication unit as the second status.
Second Exemplary EmbodimentA structure of an embedded memory storage apparatus of the second exemplary embodiment is substantially the same as that of the embedded memory storage apparatus of the second exemplary embodiment, and the difference between the first exemplary embodiment and the first exemplary embodiment is described as follows with hardware components inFIG. 2 andFIG. 3.
In the second exemplary embodiment of the present invention, the embeddedmemory storage apparatus100 is adhered to the circuit board of theelectronic device1000 in a soldering manner so as to couple to the micro-processor of theelectronic device1000. In addition, before the soldering, predetermined data (e.g. an image file of an operating system used in the electronic device1000) is stored in the rewritablenon-volatile memory module106 via the burning mechanism.
In the burning mechanism, thememory controller104 of the embeddedmemory storage apparatus100 only uses the fast physical pages of the rewritablenon-volatile memory module106 to store the predetermined data. Specifically, when the predetermined vendor command is received from a host system (not shown), thememory manager circuit202 identifies the status of the state indication unit. When the status of the state indication unit is marked as an initial status, thememory manager circuit202 only uses the fast physical pages of the rewritablenon-volatile memory module106 to store data to be written by the host system (as shown inFIG. 5), and marks the status of the state indication unit as the first status. Accordingly, since the data is stored in the fast physical pages, the data is more stable and is not damaged when the embeddedmemory storage apparatus100 is soldered on a working machine.
In addition, in the exemplary embodiment of the present invention, when the embeddedmemory storage apparatus100 is in a normal temperature or more stable working environment (e.g. after passing a soldering machine), the predetermined data is re-stored in the rewritablenon-volatile memory module106 via the re-storing mechanism as described in the first exemplary embodiment. Namely, thememory manager circuit202 uses the fast physical pages and the slow physical pages of the rewritablenon-volatile memory module106 to re-store the predetermined data originally stored in the fast physical pages of the embedded memory storage apparatus106 (as shown inFIG. 6), and marks the status of the state indication unit as the second status.
As described above, the reliability of the fast physical pages is higher than the reliability of the slow physical pages, and therefore by only using the fast physical pages to store the data before soldering, the probability of occurring an error bit in the data stored in the embeddedmemory storage apparatus100 due to high temperature of the soldering is reduced. Then, after the soldering, by using the fast physical pages and the slow physical pages to re-store the pre-stored data, the storage space of the embeddedmemory storage apparatus100 is more efficiently used.
It should be noted that the predetermined vendor command here is a predetermined command configured to activate the burning mechanism and the re-storing mechanism. However, the present invention is not limited thereto. In another exemplary embodiment of the present invention, thememory manager circuit202 may also activate the burning mechanism and the re-storing mechanism according to information of a standard command. For example, when the host system successively gives several write commands which thememory manager circuit202 identifies as a predetermined pattern, thememory manager circuit202 accordingly activates the burning mechanism and the re-storing mechanism. Alternatively, when a write command comprises a specific parameter, thememory manager circuit202 activates the burning mechanism and re-storing mechanism. Moreover, when the host system uses a standard command to be defined by a user, thememory manager circuit202 activates the burning mechanism and the re-storing mechanism.
FIG. 8 is a flowchart of a data management method according to the second exemplary embodiment of the present invention. Referring toFIG. 8, in step S801, whether the predetermined vendor command is received is determined.
When the predetermined vendor command is not received, the process ofFIG. 8 is terminated.
When the predetermined vendor command is received, in step S803, whether the status of the state indication unit is the initial status is determined.
When the status of the state indication unit is the initial status, in step S805, only the fast physical pages of the embedded memory storage apparatus are used to store the predetermined data, and the status of the state indication unit is marked as the first status. Herein, step S805 is also referred to as a burning step.
When the status of the state indication unit is not the initial status, in step S807, whether the status of the state indication unit is the first status is determined.
When the status of the state indication unit is the first status, in step S809, the fast physical pages and the slow physical pages of the embedded memory storage apparatus are used to re-store the predetermined data originally stored in the embedded memory storage apparatus, and the status of the state indication unit is marked as the second status. Herein, step S809 is also referred to as a re-storing step.
When the status of the state indication unit is not the first status, the process ofFIG. 8 is terminated. In other words, when the status of the state indication unit is not the initial status or the first status and the predetermined vendor command is received, the received predetermined vendor command is ignored.
As described above, the burning mechanism or the re-storing mechanism may be activated according to the information of the standard command. Therefore, in another exemplary embodiment of the present invention, step S801 ofFIG. 8 may be replaced by determining whether a standard command belonging to a predetermined pattern is received.
Third EmbodimentAccording to the data management method of the second exemplary embodiment, the re-storing step is executed to re-store the whole predetermined data in the physical blocks of the embedded memory storage apparatus after soldering. However, in a data management method of the third exemplary embodiment, the predetermined data stored in the fast physical pages are re-stored in batches when the write commands are subsequently executed, and the whole predetermined data are not immediately re-stored in the physical blocks of the embedded memory storage apparatus after soldering. A structure of an embedded memory storage apparatus of the third exemplary embodiment is substantially the same as that of the embedded memory storage apparatus of the first exemplary embodiment, and the difference between the third exemplary embodiment and the first exemplary embodiment is described as follows with hardware components inFIG. 2 andFIG. 3.
Similarly, in the third exemplary embodiment, whenmemory controller104 receives the predetermined vendor command and the status of the state indication unit is marked as the initial status, thememory manager circuit202 only uses the fast physical pages of the rewritablenon-volatile memory module106 to store the predetermined data (as shown inFIG. 5) and marks the status of the state indication unit as the first status.
Afterwards, when thememory controller104 receives the write command or a turn-on signal, thememory manager circuit202 determines whether the physical pages to be written store the predetermined data written via the burning mechanism. Herein, the determination may be performed via, for example, a predetermined data recover table. When the physical pages to be written have already store the predetermined data written via the burning mechanism, thememory manager circuit202 re-arranges the predetermined data while the write command is executed. In other words, when thememory manager circuit202 executes the write command, thememory manager circuit202 also uses the slow physical pages and the fast physical pages to re-store the predetermined data. Namely, thememory manager circuit202 re-stores the predetermined data written via the burning mechanism into the physical blocks in batches when a data writing operation is subsequently required.
In the third exemplary embodiment, thememory manager circuit202 establishes the predetermined data recover table configured to record the physical blocks which store the predetermined data written via the burning mechanism. Moreover, when the predetermined data stored in some physical page has been re-stored via the normal storing mechanism, thememory manager circuit202 records such information in the predetermined data recover table. In other words, thememory manager circuit202 re-stores the predetermined data which is not stored via the normal storing mechanism according to the predetermined data recover table when executing the write command.
FIG. 9 is a flow chart illustrating a burning step according to the third exemplary embodiment of the present invention.
Referring toFIG. 9, in step S901, whether the predetermined vendor command is received is determined.
When the predetermined vendor command is not received, the process ofFIG. 9 is terminated.
When the predetermined vendor command is received, in step S903, whether the status of the state indication unit is the initial status is determined.
When the status of the state indication unit is the initial status, in step S905, only the fast physical pages of the embedded memory storage apparatus are used to store the predetermined data, and the status of the state indication unit is marked as the first status. Herein, step S905 is also referred as to the burning step.
FIG. 10 is a flowchart of re-storing the predetermined data when the write command is executed according to the third exemplary embodiment of the present invention.
Referring toFIG. 10, when the write command is received, in step S1101, whether the status of the state indication unit is the first status is determined.
When the status of the state indication unit is the first status, in step S1003, thememory manager circuit202 determines whether the physical page corresponding to the write command stores the predetermined data written via the burning mechanism (i.e., the predetermined data not re-stored via the normal storing mechanism) according to the predetermined data recover table.
When the physical page corresponding to the write command stores the predetermined data written via the burning mechanism, in step S1005, the write command is executed and the normal storing mechanism is used simultaneously to re-store the predetermined data.
When the physical page corresponding to the write command does not store the predetermined data written via the recording mechanism, in step S1007, the write command is executed.
Then, in step S1009, whether all the predetermined data stored via the burning mechanism are re-stored via the normal storing mechanism is determined according to the predetermined data recover table.
When the all predetermined data are re-stored via the normal storing mechanism, in step S1011, the status of the state indication unit is marked as the second status. Afterwards, the process ofFIG. 10 is terminated.
It should be noted that in another exemplary embodiment of the present invention, when a wear-leveling procedure of the physical blocks is executed and thereby the data are required to be moved, thememory manager circuit202 may simultaneously re-store the predetermined data which are written via the recording mechanism. Thus, in another exemplary embodiment of the present invention, step S1001 and step S1003 ofFIG. 10 may be replaced by determining whether the wear-leveling procedure is executed and whether data to be moved is written via the burning mechanism. The wear-leveling procedure is well-known to those skilled in the art, and the operation thereof is thus not illustrated herein.
In summary, according to the data management method of the exemplary embodiment of the present invention, the fast physical pages and the slow physical pages are used to re-store the data which are originally only stored in the fast physical pages, and therefore the storage space of the embedded memory storage apparatus is efficiently used. Besides, according to the exemplary embodiment of the present invention, only the more stable fast physical pages of the embedded memory storage apparatus are used to store the predetermined data in the burning mechanism. Afterwards, when the embedded memory storage apparatus is adhered to the circuit board of the electronic device by soldering, data errors occur due to the high temperature can be effectively prevented. In addition, after the soldering, the embedded memory storage apparatus is capable of accessing the data normally according to commands from the electronic device via the above normal storing mechanism.
Based on the above, the data management method, the memory controller, and the embedded memory storage apparatus of the exemplary embodiment of the present invention are capable of preventing data loss causing by soldering effectively. The previously described exemplary embodiments of the present invention have the advantages aforementioned, wherein the advantages aforementioned not required in all versions of the present invention.
Although the present invention has been described with reference to the above embodiments, it will be apparent to one of the ordinary skill in the art that modifications to the described embodiment may be made without departing from the spirit of the present invention. Accordingly, the scope of the present invention will be defined by the attached claims not by the above detailed descriptions.