CN101727397B - Block management and change method, flash memory storage system and controller thereof - Google Patents

Block management and change method, flash memory storage system and controller thereof Download PDF

Info

Publication number
CN101727397B
CN101727397B CN2008101690831A CN200810169083A CN101727397B CN 101727397 B CN101727397 B CN 101727397B CN 2008101690831 A CN2008101690831 A CN 2008101690831A CN 200810169083 A CN200810169083 A CN 200810169083A CN 101727397 B CN101727397 B CN 101727397B
Authority
CN
China
Prior art keywords
physical
physical location
physical blocks
flash memory
blocks
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN2008101690831A
Other languages
Chinese (zh)
Other versions
CN101727397A (en
Inventor
朱健华
叶志刚
颜鸿圣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Phison Electronics Corp
Original Assignee
Phison Electronics Corp
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 Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to CN2008101690831A priority Critical patent/CN101727397B/en
Publication of CN101727397A publication Critical patent/CN101727397A/en
Application granted granted Critical
Publication of CN101727397B publication Critical patent/CN101727397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention relates to a block management and change method for a flash memory, a flash memory storage system and a controller thereof. The block management and change method comprises the following steps of: dividing multiple physical blocks of the flash memory into multiple physical units, and grouping into a using area and a substituting area, wherein the physical blocks of each physical unit can be accessed by using a multi-block surface access order; when the physical blocks of the physical units of the using area are damaged, if the alternate area stores good physical units, changing the damaged physical units by taking the physical units as units, and recording undamaged physical blocks of the substituted physical units; if the alternate area does not store the good physical units but good physical blocks, changing the damaged physical blocks by taking the physical blocks as units, thus the access efficiency of the flash memory is enhanced, and the service life of the flash memory is prolonged.

Description

Block management and replacing method, flash memory system and controller thereof
Technical field
The flash memory system and the controller thereof that the present invention relates to a kind of block management that is used for flash memory and replacing method and use the method particularly relate to a kind of block management of the flash chip that is used to have the multi-tiling face and the flash memory system and the controller thereof of replacing method and use the method.
Background technology
Digital camera, mobile phone camera and MP3 are very rapid in growth over the years, make the consumer also increase rapidly the demand of Storage Media.Because flash memory (Flash Memory) has that data are non-volatile, power saving, volume is little and the characteristic of no mechanical structure etc., suitable portable use, the most suitable being used on the portable battery-powered product of this type.Solid state hard disc is exactly a kind of with the storage device of nand flash memory as Storage Media.
In general, the flash memory crystal grain (die) in the flash chip of flash memory system (chip) can be divided into a plurality of physical locations (physical unit), and these physical locations are generally can be made up of a physical blocks or a plurality of physical blocks.These physical locations can be defined as data field (data area) and spare area (sparearea).Classify as and to store in the physical location of data field by writing the valid data that instruction writes, and the physical location in the spare area is the physical location in the replacement data district when writing instruction in execution.Specifically; When flash memory system receive host computer system writing the instruction and desire is write fashionable to the physical location of data field; Flash memory system can be from the spare area extracts physical unit and will the physical location that desire is upgraded in the data field in effective legacy data write to the physical location that from the spare area, extracts with the new data of desiring to write and the physical location that will write new data is associated as the data field, and the spare area is wiped and be associated as to the physical location of data field originally.In order to let the physical location of host computer system access successfully with the mode storage data of rotating; Flash memory system can configuration logic unit carry out access for host computer system, and wherein logical block is to dispose according to the size of physical location with one or more physical blocks.That is to say; Flash memory system can be set up logical-physical address bitmap (logical-physical address mapping table); And record reflects rotating of physical location with enantiomorphic relationship between the physical location that upgrades logical block and data field in this table, and flash memory system can come the physical location of institute's mapping is read or write data according to the logical-physical address bitmap so host computer system only need be directed against that the logical block that provides is carried out access.
In addition, the physical location of meeting reserve part is as an alternate area in the general flash chip (chip), and it is to continue running in order to replacing damaged physical location when the physical location in data field or the spare area damages.Particularly; At the flash chip of tool multi-tiling face in order to utilize the lifting access speed, generally can be to belong to the different blocks face and can carry out the physical location that a plurality of physical blocks of multi-tiling face access instruction (multi-planes accessingcommand) formed and carry out access.In this example, if when one of them physical blocks in the physical location is damaged, flash memory system can with whole physical location be unit change damage physical location so that its can continue to carry out access with multi-tiling face access instruction.The action of this replacing can be performed till the alternate area does not have available physical location and can come replacing damaged physical location, and this moment, flash memory system will and can't continue to use by the declaration damage again.
Yet, still have unspoiled physical blocks in the damage physical location that in fact is replaced, but therefore carry out the management of block and the waste that replacing can cause the storage area of flash memory system in the above described manner, and can shorten the life-span of flash memory system.
Summary of the invention
In view of this, the present invention provides a kind of block management and replacing method, and its data that can promote flash memory system write efficient and prolong the life-span of flash memory system.
In addition, the present invention provides a kind of controller, and it uses above-mentioned block management and replacing method to manage flash chip, and its data that can promote flash memory system write efficient and prolong the life-span of flash memory system.
Moreover the present invention provides a kind of stocking system, and it uses above-mentioned block management and replacing method to manage flash chip, and its data that can promote flash memory system write efficient and prolong the life-span of flash memory system.
The present invention proposes a kind of block management and replacing method; Be applicable to flash memory system; Wherein this flash memory system has a plurality of physical blocks; This block management and replacing method comprise physical blocks is divided into a plurality of physical locations and is grouped into uses district and alternate area, and wherein the physical blocks in each physical unit can be by using multi-tiling face access (multi-planes accessing) instruction come access.This block management and replacing method also comprise when one of them physical blocks in belonging to the physical location that uses the district is damaged; Whether the number of judging unspoiled physical location in the alternate area is greater than a predetermined threshold; Wherein when the number of unspoiled physical location in the alternate area during greater than this predetermined threshold, then from the alternate area, selecting unspoiled physical location is that unit replaces the physical location of the physical blocks that tool damages in the general district and writes down the physical blocks of not damaging or damaging in the substituted physical location with the physical location.And when the number of unspoiled physical location in the alternate area was not more than this predetermined threshold, then from the alternate area, selecting unspoiled physical blocks was the replacing damaged physical blocks of unit with the physical blocks.
In one embodiment of this invention, above-mentioned block management and replacing method also comprise trivial data field and the spare area of being divided into of use, the physical location that wherein belongs to the spare area in order to the physical location that belongs to the data field ground storage data of rotating.
In one embodiment of this invention, each above-mentioned physical blocks has a redundant area, and the step of unspoiled physical blocks is included in record one mark in the redundant area of unspoiled physical blocks in the substituted physical location of above-mentioned record.
In one embodiment of this invention, the step of unspoiled said physical blocks is included in the unspoiled physical blocks of record in the replacing table in the above-mentioned substituted physical location of record.
The present invention also provides a kind of flash memory system and controller thereof, and this flash memory system comprises flash chip, connector and controller, and wherein flash chip has a plurality of physical blocks.This controller is to be electrically connected to above-mentioned flash chip and connector, and this controller the flash interface module, memory buffer, host interface module and the memory management module that comprise microprocessor unit and be coupled to microprocessor unit.Particularly, this memory management module has a plurality of machine instructions that can be carried out by microprocessor unit flash memory is accomplished above-mentioned block management and replacing method.
In one embodiment of this invention, above-mentioned flash memory system is carry-on dish, flash card or solid state hard disc.
In one embodiment of this invention, above-mentioned physical blocks is to belong to a plurality of block faces, and each physical location is made up of two physical blocks that belong to the different blocks face at least.
In one embodiment of this invention, above-mentioned block face is to belong to a flash memory crystal grain.
In one embodiment of this invention, above-mentioned block face is to belong to a plurality of flash memory crystal grain.
In one embodiment of this invention, above-mentioned flash memory crystal grain is to belong to a plurality of flash chips.
In one embodiment of this invention, above-mentioned flash memory crystal grain is to belong to a flash chip.
Method provided by the present invention can still have in the alternate area can the access of multi-tiling face access instruction physical blocks form physical location the time be that unit changes the physical blocks of having damaged with the physical location when being the physical location that unit changes the physical blocks damaged and physical blocks that can not the access of multi-tiling face access instruction in the alternate area is formed with the physical blocks, therefore can promote the access efficiency of flash memory system effectively and prolong life-span of flash memory system.
For making the above-mentioned feature and advantage of the present invention can be more obviously understandable, hereinafter is special lifts preferred embodiment, and is described with reference to the accompanying drawings as follows.
Description of drawings
Fig. 1 is the summary calcspar according to the flash memory system shown in one embodiment of the invention.
Fig. 2 is the calcspar according to the flash chip shown in the embodiment of the invention.
Fig. 3 A is general district and the alternate area according to the flash chip shown in the embodiment of the invention.
Fig. 3 B carries out the synoptic diagram that block is changed according to general district shown in the embodiment of the invention and alternate area.
Fig. 3 C is the running synoptic diagram according to physical location in the general district shown in the embodiment of the invention.
Fig. 3 D is the example schematic that writes according to physical location among Fig. 3 C shown in the embodiment of the invention.
Fig. 4 is according to block management shown in the embodiment of the invention and the process flow diagram of changing step.
The reference numeral explanation
100: flash memory system
110: controller
110a: microprocessor unit
110b: memory management module
110c: flash interface module
110d: memory buffer
110e: host interface module
120: connector
130: flash chip
130a: the first block face
130b: the second block face
200: host computer system
210-1~210-M: logical block
300: bus
302: general district
312: the alternate area
304: system region
306: the data field
308: the spare area
310-(1), 310-(2), 310-(P), 310-(P+1), 310-(P+2), 310-(N): physical location
350: the replacement physical location
S401, S403, S405, S407, S409, S411, S413, S415, S417: block management and replacing step
Embodiment
Fig. 1 is the summary calcspar according to the flash memory system shown in one embodiment of the invention.Please with reference to Fig. 1, flash memory system 100 comprises controller (also claiming controller system) 110, connector 120 and flash chip 130.
Usually flash memory system 100 can use with host computer system 200, so that host computer system 200 can write to flash memory system 100 or reading of data from flash memory system 100 with data.In the present embodiment, flash memory system 100 be solid state hard disc (Solid State Drive, SSD).But it must be appreciated that flash memory system 100 can also be storage card or coil with oneself in another embodiment of the present invention.
Controller 110 can carry out with hardware pattern or the real a plurality of instructions done of firmware pattern with matching connector 120 and flash chip 130 carry out data storage, running such as read and wipe.Controller 110 comprises microprocessor unit 110a, memory management module 110b, flash interface module 110c, memory buffer 110d and host interface module 110e.
Microprocessor unit 110a in order to cooperative cooperatings such as memory management module 110b, flash interface module 110c, memory buffer 110d and host interface module 110e to carry out the various runnings of flash memory system 100.
Memory management module 110b is coupled to microprocessor unit 110a.Memory management module 110b has a plurality of machine instructions that can be carried out by microprocessor unit 110a with management flash chip 130, the for example machine instruction of average abrasion, block management function, service logic-physical address bitmap (mapping table) function etc.Particularly, in embodiments of the present invention, memory management module 110b comprises the block management and the machine instruction of changing step that can accomplish according to present embodiment.
In the present embodiment; Memory management module 110b is embodied in the controller 110 with a firmware pattern; For example write associated mechanical instruction and be stored in the formula storer that (for example, ROM (read-only memory) (Read Only Memory, ROM)) is implemented memory management module 110b with programming language.When flash memory system 100 runnings; A plurality of machine instructions of memory management module 110b can be loaded among the memory buffer 110d indirectly, and are carried out or directly carried out to accomplish above-mentioned average abrasion function, bad block management function, service logic-physical blocks bitmap function etc. by microprocessor unit 110a by microprocessor unit 110a.Particularly, controller 110 comes this to accomplish block management and replacing step according to the embodiment of the invention by a plurality of mechanical orders of execute store administration module 110b.
In another embodiment of the present invention, the mechanical order of memory management module 110b can also the firmware pattern be stored in the specific region (for example, being exclusively used in the system region of storage system data in the flash memory) of flash chip 130.Same, when flash memory system 100 runnings, a plurality of machine instructions of memory management module 110b can be loaded among the memory buffer 110d and by microprocessor unit 110a to be carried out.In addition, in another embodiment of the present invention, memory management module 110b can also a hardware pattern be implemented in the controller 110.
Flash interface module 110c is coupled to microprocessor unit 110a and in order to access flash chip 130.Just, the data of desiring to write to flash chip 130 can convert 130 receptible forms of flash chip into via flash interface module 110c.
Memory buffer 110d is coupled to microprocessor unit 110a and in order to temporarily stocking system data (for example logical-physical address bitmap) or 200 data that read or write of host computer system.In the present embodiment, memory buffer 110d be static RAM (static random accessmemory, SRAM).Yet; It must be appreciated; The invention is not restricted to this, and dynamic RAM (Dynamic Random Access memory, DRAM), reluctance type storer (Magnetoresistive Random Access Memory; MRAM), phase transition storage (PhaseChange Random Access Memory, PRAM) or other storeies that are fit to also can be applicable to the present invention.
The instruction that host interface module 110e is coupled to microprocessor unit 110a and is transmitted in order to reception and identification host computer system 200.Just, the instruction and the data that are transmitted of host computer system 200 can be sent to microprocessor unit 110a through host interface module 110e.In the present embodiment, host interface module 110e is the SATA interface.Yet; It must be appreciated to the invention is not restricted to this that host interface module 110e can also be USB interface, IEEE1394 interface, PCI Express interface, MS interface, MMC interface, SD interface, CF interface, ide interface or other data transmission interfaces that is fit to.Particularly, host interface module 110e can be corresponding with connector 120.Just, host interface module 110e must arrange in pairs or groups mutually with connector 120.
In addition, though unshowned in present embodiment, controller 110 can comprise also that error correction module and power management module etc. are used to control the general utility functions module of flash memory.
Connector 120 is in order to connect host computer system 200 through bus 300.In the present embodiment, connector 120 is the SATA connector.Yet; It must be appreciated to the invention is not restricted to this that connector 120 can also be USB connector, IEEE1394 connector, PCI Express connector, MS connector, MMC connector, SD connector, CF connector, IDE connector or other connectors that is fit to.
Flash chip 130 is to be electrically connected to controller 110 and in order to storage data.Flash chip 130 is multilayer storage unit (Multi Level Cell, a MLC) nand flash memory in this enforcement.Yet, it must be appreciated, the invention is not restricted to this.In another embodiment of the present invention, (Single Level Cell, SLC) nand flash memory also can be applicable to the present invention to the individual layer storage unit.
Flash chip 130 comprises first block face (plane) 130a and the second block face 130b in the present embodiment, comprises a plurality of physical blocks respectively among the first block face 130a and the second block face 130b.Particularly, the first block face and the second block face can be physics or virtual cutting apart to each other.
What deserves to be mentioned is, though present embodiment is to describe with two block faces, yet the invention is not restricted to this, the present invention also can be applicable to have the flash chip of the block face of any number.In addition, be that the first block face 130a and the second block face 130b of the flash memory crystal grain (not indicating) with flash chip 130 describes in the present embodiment, yet the present invention also can be applicable to the flash chip of a plurality of flash memory crystal grain of tool.Similarly, describe though present embodiment is a flash chip, the present invention also can be applicable to have the flash memory system of a plurality of flash chips.
Physical blocks is the least unit of wiping in flash memory.That is each physical blocks contains the storage unit that is wiped free of in the lump of minimal amount.Each physical blocks can be divided into a plurality of page addresses (page) usually.The page address is generally the minimum unit of programming (program).But what specify is in some different flash memory design, and minimum unit of program also can be a sector (sector).That is to say the minimum unit that in page address a plurality of sectors is arranged and be programming with a sector.In other words, the page address is the minimum unit that writes data or reading of data.Each page address generally includes user data field D and redundant area R.The user data field is in order to storage user's data, and redundant area is in order to data (for example, the error-correcting code (error correcting code, ECC)) of stocking system.
Be sector (sector) size corresponding to disc driver, generally speaking, user data field D is generally 512 bytes, and redundant area R is generally 16 bytes.Just, a page address is a sector.Yet, can also form a page address in a plurality of sectors.In the present embodiment, flash memory block page address is to comprise 4 sectors.
Generally speaking, physical blocks can be made up of the page address of arbitrary number, for example 64 page addresses, 128 page addresses, 256 page addresses etc.In addition; Physical blocks in the first block face 130a or the second block face 130b also can be grouped into several zones (zone) usually, and coming diode-capacitor storage with the zone is to operate independently of one another with the parallel degree of increase operation execution and the complexity of streamlining management in a way.
In addition, controller 110 can be configured to a physical location with a plurality of physical blocks among the first block face 130a and the second block face 130b and manage, and for example a physical location comprises two physical blocks.Because when managing with physical location, controller 110 is to come service logic-physical address bitmap with bigger unit (being physical location), therefore can save the space of required use memory buffer 110d.
Particularly, in the present embodiment since controller 110 can multi-tiling face access (multi-planesaccessing) pattern the particular physical block among the access first block face 130a and the second block face 130b simultaneously.That is to say that particular physical block in flash chip 130 among the first block face 130a and the particular physical block of the second block face 130b can be operated (for example, carry out and write, read and wipe) by multi-tiling face access instruction simultaneously.Therefore, in the present embodiment controller 110 more can be respectively the physical blocks of operative relationship is configured to a physical location with having simultaneously.Specifically, in specific flash memory chip circuit design, can make the mode of (or synchronously) of overlapping actuation time that some block faces can at least a portion come access data to shorten the required time of access data.Therefore, claim particular block face that these can part method of synchronization access data for having operative relationship simultaneously at this, and be called multi-tiling face access mode with the access mode of part method of synchronization access data.
Fig. 2 is the calcspar according to the flash chip shown in the embodiment of the invention.Please with reference to Fig. 2, the physical blocks of the first block face 130a and the second block face 130b is formed physical location 310-1~310-N discriminably.
Fig. 3 A~3D is according to the running synoptic diagram of physical location in the first block face 130a and the second block face 130b shown in the embodiment of the invention.
It must be appreciated, when this describes the running of flash memory with " extraction ", " moving ", " exchange ", " replacement ", " rotating ", " cut apart ", " division " and etc. the speech physical blocks of operating flash chip 130 are notions in logic.That is to say that the physical location of the physical blocks of flash memory is not changed, but in logic the physical blocks of flash memory is operated.What deserves to be mentioned is that following running is that the mechanical order of controller 110 execute store administration module 110b is accomplished.
Fig. 3 A is general district and the alternate area according to the flash chip shown in the embodiment of the invention.
Please with reference to Fig. 3 A, in embodiments of the present invention, for (that is, the writing) data of programming efficiently, controller 110 can logically be grouped into general district 302 and alternate area 312 with physical location shown in Figure 2.
Physical location 310-(1)~310-(P) in general district 302 is the flash memory system 100 normal physical locations that use.That is to say that controller 110 can write to the physical location that belongs to general district 302 with data.
Physical location 310-(P+1) in alternate area 312~310-(N) is the alternate physical unit.Flash chip 130 can be reserved 4% physical blocks as changing use when dispatching from the factory, that is to say that when the physical blocks in the general district 302 was damaged, the physical blocks of reserving in alternate area 312 can be in order to replacing damaged physical blocks.Therefore, if when still having available physical blocks in the alternate area 312, controller 110 can extract available physical blocks and change the physical blocks of damage from alternate area 312 when the physical blocks damage takes place.If during no available physical blocks, flash memory system 100 will can't be re-used by declaration when the physical blocks damage takes place in the alternate area 312.In general, controller 110 can be set judge the predetermined threshold whether flash chip 130 can continue to use, if then judge extracts physical block from alternate area 312 again during less than this predetermined threshold when the number of physical blocks available in the alternate area 312.In the present embodiment, this predetermined threshold is to be set at 0.Yet, the invention is not restricted to this, this predetermined threshold can be set at 1 or greater than 1 integer.
Particularly, in the present embodiment, controller 110 can be from alternate area 312 is that unit or physical blocks are the replacing that unit damages physical location or physical blocks with the physical location.
Fig. 3 B carries out the synoptic diagram that block is changed according to general district shown in the embodiment of the invention and alternate area.
Please with reference to Fig. 3 B, when having physical blocks to be damaged in the general district 302, the controller 110 of present embodiment can be changed the physical blocks of damage in two ways.For example; When supposing physical blocks a (1) damage of the first block face 130a; In first kind of mode, the physical location 310-(P+1) that controller 110 is understood with the physical blocks b (P+1) of the physical blocks a (P+1) that comprises the first block face 130a and the second block face 130b changes whole physical location 310-1 (shown in Fig. 3 B (a)).That is to say that when controller 110 need use physical location 310-(1), controller 110 can use physical location 310-(P+1) through the record that reads replacing afterwards.For example, this changes in the redundant area that writes down the physical blocks that can be recorded in physical location 310-1.In addition, in the second way, controller 110 only can be changed the physical blocks a (1) of the first block face 130a that has damaged with physical blocks a (P+1).That is to say, when controller 110 access physical location 310-(1), if the address of access during for the address of physical blocks a (1) originally then controller 110 can change to access physical blocks a (P+1).Similarly, for example this replacing record can be recorded in the redundant area of physical blocks a (1).
What deserves to be mentioned is; According to present embodiment when controller 110 uses first kind of mode to change the block of damage; Owing to (for example still have normal physical blocks in the physical location that is replaced; Physical blocks b shown in Fig. 3 B (1)), therefore can special this information of record according to the controller 110 of the embodiment of the invention.For example, can change this information of record in the table one in an embodiment of the present invention, perhaps also can use the redundant area of physical blocks b (1) to write down this information.
Controller 110 according to the embodiment of the invention can use above-mentioned dual mode to change the physical blocks of having damaged, and its concrete function mode will specify below in conjunction with Fig. 4.
In an embodiment of the present invention, when flash memory system 100 runnings, controller 110 can more be grouped into system region, data field and spare area with the physical location in the general district 302 of flash chip 130.Fig. 3 C is the running synoptic diagram according to physical location in the general district shown in the embodiment of the invention.Please with reference to Fig. 3 C; System region 304 comprises physical location 310-(1)~physical location 310-(S); Data field 306 comprises physical location 310-(S+1)~physical location 310-(S+M), and spare area 308 comprises physical location 310-(S+M+1)~physical location 310-(P).In the present embodiment, above-mentioned S, M and P are positive integer, the physical blocks quantity of each district's configuration of its representative, and it can be set according to the capacity of employed flash memory by the manufacturer of flash memory system.
Physical location in the system region 304 is in order to the register system data, and this system data comprises about the logical-physical address bitmap of page address number, record logical address and the physical address enantiomorphic relationship of the number of regions of the first block face 130a, physical blocks number that each is regional, each physical blocks etc.
In general physical location in the data field 306 is exactly the block of the blocks institute mapping of 200 accesses of host computer system in order to store user's data.
Therefore physical blocks in the spare area 308 is in order to the physical location in the data field 306 of rotating, and the physical blocks in spare area 206a be sky or spendable block, i.e. no record data or be labeled as invalid data useless.That is to say that data field 306 can store the data that 200 pairs of flash memory systems 100 of host computer system write with the mode of rotating with the physical blocks of spare area 308.
As previously mentioned; The physical location of flash chip 130 can provide host computer system to come storage data with the mode of rotating; Therefore controller 110 can provide logical block 210-1~210-M to host computer system 200 carrying out data access, and write down the physical location of logical block institute mapping through service logic-physical address bitmap (logical-physical addressmapping table).
Fig. 3 D is according among Fig. 3 C shown in the embodiment of the invention physical location being carried out the example schematic that writes instruction.
Please with reference to Fig. 3 D, for example, when host computer system desired to write data to logical block 210-1, controller 110 can learn that logical block is the physical location 310-(S+1) in the mapping data field 306 at present through the logical-physical address bitmap.Therefore, flash memory system 100 will upgrade the data among the physical location 310-(S+1), during, controller 110 can be from spare area 308 the rotate physical location 310-(S+1) of data field 306 of extracts physical unit 310-(S+M+1).Yet, when new data being write to physical location 310-(S+M+1), can at once all valid data among the physical location 310-(S+1) not moved to physical location 310-(S+M+1) and wipe physical location 310-(S+1).Specifically; Controller 110 can write page address valid data before (promptly with desiring among the physical location 310-(S+1); Page or leaf P0 and P1) be copied to physical location 310-(S+M+1) (like (a) of Fig. 3 D); And (that is, page or leaf P2 and the P3 of physical location 310-(S+M+1)) writes to physical location 310-(S+M+1) (like (b) of Fig. 3 D) with new data.The physical location 310-(S+M+1) that at this moment, will contain effective legacy data and the new data that writes of part temporarily is associated as and replaces physical location 350.This is because the valid data among the physical location 310-(S+1) might be in next operation (for example; Write instruction) in become invalidly, therefore at once all valid data among the physical location 310-(S+1) are moved to replacement physical location 310-(S+M+1) and may be caused meaningless moving.In this embodiment, the content integration of physical location 310-(S+1) and replacement physical location 310-(S+M+1) gets up to be only the complete content of the mapping logical block 210-1 of institute.The transient state relation of this mother-child relationship (MCR) (that is, physical location 310-(S+1) and replacement physical location 310-(S+M+1)) can be decided according to the size of memory buffer 110d in the controller 110, for example is to use five groups to implement in the present embodiment.The action of temporarily keeping this kind transient state relation generally can be described as unlatching (open) mother and child blocks.
Afterwards; In the time need physical location 310-(S+1) really being merged with the content of replacing physical location 310-(S+M+1); Controller 110 just can be whole and be a physical location with replacement physical location 310-(S+M+1) with physical location 310-(S+1); Promote the service efficiency of block thus, the action of this merging can be described as again closes (close) mother and child blocks.For example; Shown in Fig. 3 D (c), when closing mother and child blocks, controller 110 can be with remaining valid data among the physical location 310-(S+1) (promptly; Page or leaf P4~PN) is copied to replacement physical location 310-(S+M+1); Then physical location 310-(S+1) is wiped and be associated as spare area 308, simultaneously, will replace physical location 310-(S+M+1) and be associated as data field 306; And the mapping with logical block 210-1 in the logical-physical address bitmap changes to physical location 310-(S+M+1), accomplishes the action of closing mother and child blocks thus.
What deserves to be mentioned is, because each physical location is made up of the physical blocks that belongs to the different blocks face in the present embodiment.Therefore, when a plurality of physical blocks in the physical location were carried out access, in general controller 110 must be accomplished each physical blocks fill order block face access (single-plane accessing) instruction respectively with mode repeatedly and write or read.This kind successively only the pattern of a physical blocks of access be called single block face access mode.Yet; As stated because when the circuit layout (lay out) of storage unit manufacture process; Belong to and have operative relationship simultaneously between the physical blocks of different blocks face; When therefore if operative relationship is grouped into a physical location with the corresponding physical block simultaneously according to this, then when a plurality of physical blocks in this physical location were carried out access, controller 110 just can be carried out multi-tiling face access instruction to physical blocks wherein simultaneously and accomplish the efficient that writes or read with the lifting access.This kind is called multi-tiling face access mode to the mode that a plurality of physical blocks are carried out access simultaneously.
Therefore; In the present embodiment when the physical blocks damage takes place in flash chip 130; Controller 110 can be changed the physical location (shown in Fig. 3 B (a)) that tool damages physical blocks from the physical location that preferential selection the alternate area 312 can be carried out the access of multi-tiling face, guarantees that thus flash memory system 100 is in the access of carrying out that it(?) still can more efficient multi-tiling face access mode carry out after bad block is changed data.
Fig. 4 is according to block management shown in the embodiment of the invention and the process flow diagram of changing step, and wherein these steps are that the mechanical order of the microprocessor unit 110a execute store administration module 110b of controller 110 is accomplished.It must be appreciated that block management step proposed by the invention is not limited to execution sequence shown in Figure 4, those skilled in the art can change the order of block management step according to spirit of the present invention arbitrarily.
Please with reference to Fig. 4; When flash memory system 100 is connected to host computer system 200 and start; Controller 110 can carry out initialization; Wherein can be with can be in the first block face 130a and the second block face 130b by using multi-tiling face access instruction to come the physical blocks of access to be grouped into a plurality of physical locations severally and dividing into and use district 302 and alternate area 312 (step S401); Particularly in the present embodiment, controller 110 also can be with using district 302 to divide into system region 304, data field 306 and spare area 308.
Then, in the operation of flash memory system 100, whether controller 110 can be judged constantly in general district 302 has physical blocks to damage (step S403).Specifically, can confirm at the example middle controller that writes data 110 whether write state is normal, and whether correct at the example middle controller 110 meeting specified data readouts of sense data, decide the physical blocks of institute's access whether to damage thus.If when controller 110 finds to have physical blocks to damage; Whether (this predetermined threshold is 0 in the present embodiment greater than predetermined threshold then to understand the number that judge unspoiled physical location in the alternate area 312 at step S405 middle controller 110; Wherein this predetermined threshold can be set up on their own by the user and be other values; For example 1,2 or other suitable round valuess), wherein so-called unspoiled physical location representes that all physical blocks in this physical location are all normal and can carry out access to it through multi-tiling face access mode.Specifically, step S405 judges whether there are enough unspoiled physical locations in the alternate area 312.
If the number of unspoiled physical location greater than predetermined threshold (promptly in alternate area 312; The situation that has enough unspoiled physical locations in the alternate area 312) time; Be that unit replaces the physical location that has damaged then, and can in changing table (unshowned), write down the information of being correlated with at step S409 middle controller 110 in one of them of the unspoiled physical location of step S407 middle controller 110 meeting selections and with whole physical location.For example, in changing table, can write down still normal physical blocks in this substituted physical location in an embodiment of the present invention.For example, in another embodiment of the present invention the physical location that record is replaced in the replacing table, come the still spendable physical blocks of identification through the mark in the redundant area in each physical blocks then.In addition; Except using above-mentioned replacing table; In another embodiment of the present invention step S409 also can under not using above-mentioned replacing table, only be utilized in the redundant area of unspoiled physical blocks record one mark come annotation this for normal physical blocks or in damage physics block redundancy district record one mark come this physical blocks of annotation for damaging; Mark all in addition also or in two blocks, and when controller 100 is carried out initialization in flash memory system 100 each starts, can learn the state of physical blocks through scanning and the redundant area that reads physical blocks.
If the number of unspoiled physical location is not more than predetermined threshold (promptly in alternate area 312; Do not have the situation that has enough unspoiled physical locations in the alternate area 312) time, then can judge whether there is unspoiled physical blocks in the alternate area 312 through the record of replacing table at step S411 middle controller 110.
If in step S411, judge when having unspoiled physical blocks in the alternate area 312; Then in step S413, can select one of them unspoiled physical blocks and be that unit replaces the physical blocks of having damaged with the physical blocks, and step S415 middle controller 110 can be in the record of changing table the selected physical blocks of deletion.If in step S411, judging in the alternate area 312 does not have when having unspoiled physical blocks, then can send error messages and inform host computer system 200 flash memory systems 100 storage data again at step S417 middle controller 110.
Though it is unshowned in Fig. 4; But the block management that those skilled in the art can understand Fig. 4 easily with change step except finishing the program of Fig. 4 when can't change the physical blocks of damage, when receiving the instruction of shutdown or power interruption, also can finish the program of Fig. 4.
In sum, the present invention will have the physical blocks of can multi-tiling face access mode carrying out access to be grouped into physical location when the flash memory system initialization, come that with multi-tiling face access mode flash chip is carried out access thus and promote access efficiency.In addition; When the physical blocks damage takes place when; When having the physical location that can multi-tiling face access mode carries out access in the alternate area the present invention be with the physical location by unit change tool the physical location of damage physical blocks, and can continue to carry out access with multi-tiling face access mode.In addition; The present invention can write down in the physical location that is replaced still spendable physical blocks and when taking place physical blocks to damage when the alternate area does not have normal physical location; The present invention can change the physical blocks of being damaged with the still spendable physical blocks of write down, and prolongs the life-span of flash memory system thus.
Though the present invention discloses as above with preferred embodiment; Right its is not in order to limit the present invention; Those skilled in the art can do some changes and retouching under the premise without departing from the spirit and scope of the present invention, so protection scope of the present invention is as the criterion with claim of the present invention.

Claims (18)

1. block management and replacing method are applicable to a flash memory system, and wherein this flash memory system has a plurality of physical blocks, and this block management and replacing method comprise:
Said physical blocks is divided into a plurality of physical locations and is grouped into a use district and an alternate area, and wherein the physical blocks of each said physical location can be by using a multi-tiling face access instruction come access; And
When one of them physical blocks of one of them physical location in the physical location that belongs to this use district was damaged, whether the number of then judging unspoiled physical location in the physical location of this alternate area greater than a predetermined threshold,
Wherein when the number of unspoiled physical location in this alternate area during greater than this predetermined threshold; Then from the physical location of this alternate area, select a unspoiled physical location; And be that unit replaces in this use district the physical location that damages and writes down the physical blocks of not damaging or damaging in the substituted said physical location with selected physical location, and
When the number of unspoiled physical location in this alternate area is not more than this predetermined threshold; Then from the physical blocks of this alternate area, select a unspoiled physical blocks, and be that unit replaces the physical blocks of damaging in the physical location of damage in this uses district with selected physical blocks.
2. block management as claimed in claim 1 and replacing method also comprise this use zoning is divided into a data field and a spare area, and use the physical location that belongs to this spare area to come storage data to belong to the physical location of this data field to rotate.
3. block management as claimed in claim 1 and replacing method; Wherein each physical blocks has a redundant area, and the step that writes down unspoiled said physical blocks in the substituted said physical location is included in record one mark in the said redundant area of unspoiled said physical blocks.
4. block management as claimed in claim 1 and replacing method, the step that wherein writes down unspoiled said physical blocks in the substituted said physical location is included in the unspoiled said physical blocks of record in the replacing table.
5. a controller is applicable to a flash memory system, and wherein this flash memory system has a plurality of physical blocks, and this controller comprises:
One microprocessor unit;
One host interface module is coupled to this microprocessor unit;
One flash interface is coupled to this microprocessor unit;
One memory buffer is coupled to this microprocessor unit; And
One memory management module is coupled to this microprocessor unit, and has a plurality of machine instructions that can be carried out by this microprocessor unit, this flash memory system being accomplished a plurality of block managements and to be changed step, said block management with change step and comprise:
Said physical blocks is divided into a plurality of physical locations and is grouped into a use district and an alternate area, and wherein the physical blocks of each said physical location can be by using a multi-tiling face access instruction come access; And
When one of them physical blocks of one of them physical location in the physical location that belongs to this use district was damaged, whether the number of then judging unspoiled physical location in the physical location of this alternate area greater than a predetermined threshold,
Wherein when the number of unspoiled physical location in this alternate area during greater than this predetermined threshold; Then from the physical location of this alternate area, select a unspoiled physical location; And be that unit replaces in this use district the physical location that damages and writes down the physical blocks of not damaging or damaging in the substituted said physical location with selected physical location, and
When the number of unspoiled physical location in this alternate area is not more than this predetermined threshold; Then from the physical blocks of this alternate area, select a unspoiled physical blocks, and be that unit replaces the physical blocks of damaging in the physical location of damage in this uses district with selected physical blocks.
6. controller as claimed in claim 5 also comprises and divides a data field and a spare area with this use zoning, and the physical location that wherein belongs to this spare area is rotated in order to storage data and belonged to the physical location of this data field.
7. controller as claimed in claim 5; Wherein each said physical blocks has a redundant area, and the step that writes down unspoiled said physical blocks in the substituted said physical location is included in record one mark in the said redundant area of unspoiled said physical blocks.
8. controller as claimed in claim 5, the step that wherein writes down unspoiled said physical blocks in the substituted said physical location is included in the unspoiled said physical blocks of record in the replacing table.
9. controller as claimed in claim 5, wherein this flash memory system is dish, a flash memory cards or a solid state hard disc with oneself.
10. flash memory system comprises:
A plurality of physical blocks;
A connector; And
One controller is electrically connected to said physical blocks and this connector, and this controller can be carried out a plurality of machine instructions of a memory management module to accomplish a plurality of block managements and to change step, and said block management comprises with the replacing step:
Said physical blocks is divided into a plurality of physical locations and is grouped into a use district and an alternate area, and wherein the physical blocks of each said physical location can be by using a multi-tiling face access instruction come access; And
When one of them physical blocks of one of them physical location in the physical location that belongs to this use district was damaged, whether the number of then judging unspoiled physical location in the physical location of this alternate area greater than a predetermined threshold,
Wherein when the number of unspoiled physical location in the physical blocks of this alternate area during greater than this predetermined threshold; Then from the physical location of this alternate area, select a unspoiled physical location; And be that unit replaces in this use district the physical location that damages and writes down the physical blocks of not damaging or damaging in the substituted said physical location with selected physical location, and
When the number of unspoiled physical location in this alternate area is not more than this predetermined threshold; Then from the physical blocks of this alternate area, select a unspoiled physical blocks, and be that unit replaces the physical blocks of damaging in the physical location of damage in this uses district with selected physical blocks.
11. flash memory system as claimed in claim 10 also comprises a trivial data field and the spare area of being divided into of this use, the physical location that wherein belongs to this spare area is rotated in order to storage data and is belonged to the physical location of this data field.
12. flash memory system as claimed in claim 10; Wherein each said physical blocks has a redundant area, and the step that writes down unspoiled said physical blocks in the substituted said physical location is included in record one mark in the said redundant area of unspoiled said physical blocks.
13. flash memory system as claimed in claim 10, the step that wherein writes down unspoiled said physical blocks in the substituted said physical location is included in the unspoiled said physical blocks of record in the replacing table.
14. flash memory system as claimed in claim 10, wherein said physical blocks belong to a plurality of block faces, and each said physical location is made up of two physical blocks that belong to different said block faces at least.
15. flash memory system as claimed in claim 14, wherein said block face belongs to a flash memory crystal grain.
16. flash memory system as claimed in claim 14, wherein said block face belongs to a plurality of flash memory crystal grain.
17. flash memory system as claimed in claim 16, wherein said flash memory crystal grain belongs to a plurality of flash chips.
18. flash memory system as claimed in claim 16, wherein said flash memory crystal grain belongs to a flash chip.
CN2008101690831A 2008-10-20 2008-10-20 Block management and change method, flash memory storage system and controller thereof Active CN101727397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101690831A CN101727397B (en) 2008-10-20 2008-10-20 Block management and change method, flash memory storage system and controller thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101690831A CN101727397B (en) 2008-10-20 2008-10-20 Block management and change method, flash memory storage system and controller thereof

Publications (2)

Publication Number Publication Date
CN101727397A CN101727397A (en) 2010-06-09
CN101727397B true CN101727397B (en) 2012-06-27

Family

ID=42448315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101690831A Active CN101727397B (en) 2008-10-20 2008-10-20 Block management and change method, flash memory storage system and controller thereof

Country Status (1)

Country Link
CN (1) CN101727397B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102456401B (en) * 2010-10-26 2015-04-22 群联电子股份有限公司 Block management method, memory controller and memory storage device
CN103713969A (en) * 2013-12-30 2014-04-09 华为技术有限公司 Method and device for improving reliability of solid state disk
CN108038065B (en) * 2017-12-22 2021-11-12 湖南国科微电子股份有限公司 Method, device and system for improving Block utilization rate
US11074989B2 (en) 2017-12-29 2021-07-27 Micron Technology, Inc. Uncorrectable ECC
CN110364216B (en) * 2018-04-09 2022-03-01 合肥沛睿微电子股份有限公司 Solid state disk and operation method thereof
CN113207225A (en) * 2021-03-16 2021-08-03 合肥致存微电子有限责任公司 Chip-replaceable storage device and chip replacement, verification and manufacturing method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591330B2 (en) * 2001-06-18 2003-07-08 M-Systems Flash Disk Pioneers Ltd. System and method for flexible flash file
CN1967504A (en) * 2005-11-18 2007-05-23 凌阳科技股份有限公司 Control apparatus and method of flash memory
CN101198939A (en) * 2005-05-12 2008-06-11 晟碟以色列有限公司 Flash memory management method that is resistant to data corruption by power loss

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591330B2 (en) * 2001-06-18 2003-07-08 M-Systems Flash Disk Pioneers Ltd. System and method for flexible flash file
CN101198939A (en) * 2005-05-12 2008-06-11 晟碟以色列有限公司 Flash memory management method that is resistant to data corruption by power loss
CN1967504A (en) * 2005-11-18 2007-05-23 凌阳科技股份有限公司 Control apparatus and method of flash memory

Also Published As

Publication number Publication date
CN101727397A (en) 2010-06-09

Similar Documents

Publication Publication Date Title
CN101483067B (en) Flash memory data writing method and flash memory controller
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN102292711B (en) Solid state memory formatting
CN101640069B (en) Average wear method and average wear system for flash memory
CN101634967B (en) Block management method for flash memory, storage system and controller
CN101556555B (en) Block managing method for flash memory as well as controller and storage system thereof
US20100042774A1 (en) Block management method for flash memory, and storage system and controller using the same
CN101169760B (en) Electronic hard disk storage room management method
US8074128B2 (en) Block management and replacement method, flash memory storage system and controller using the same
CN101630233B (en) Data access method used for flash memory, storage system and controller
CN102073600B (en) Data backup method, flash memory controller and flash memory storage system
CN101727397B (en) Block management and change method, flash memory storage system and controller thereof
CN101661431B (en) Block management method for flash memory, flash storage system and controller
CN101667157A (en) Flash memory data transmission method, flash memory storage system and controller
CN101567220A (en) Bad block identifying method, storage system and controller thereof for flash memory
CN101408864B (en) Data protection method for current failure and controller using the same
CN101957797A (en) Logic block management method for flash memory as well as control circuit and storage system thereof
CN102866861B (en) Flash memory system, flash controller and method for writing data
CN101425338A (en) Writing method for nonvolatile memory and controller using the method
CN101625661B (en) Data management method, storage system and controller used for flash memory
CN101425334B (en) Method for implementing NOR FLASH bad block management and control circuit thereof
CN102402396B (en) Combined type storage device as well as combined type storage media controller and addressing method thereof
CN101661432B (en) Flash memory block management method, flash memory storage system and controller
CN101957799B (en) Data writing method used for flash memory, control circuit and storage system thereof
CN101882111B (en) Data access method, storage system and controller for flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant