CN101788955B - Access method of flash data, storage system and control system thereof - Google Patents

Access method of flash data, storage system and control system thereof Download PDF

Info

Publication number
CN101788955B
CN101788955B CN2009100098723A CN200910009872A CN101788955B CN 101788955 B CN101788955 B CN 101788955B CN 2009100098723 A CN2009100098723 A CN 2009100098723A CN 200910009872 A CN200910009872 A CN 200910009872A CN 101788955 B CN101788955 B CN 101788955B
Authority
CN
China
Prior art keywords
physical
page
page address
physical page
those
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
CN2009100098723A
Other languages
Chinese (zh)
Other versions
CN101788955A (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 CN2009100098723A priority Critical patent/CN101788955B/en
Publication of CN101788955A publication Critical patent/CN101788955A/en
Application granted granted Critical
Publication of CN101788955B publication Critical patent/CN101788955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses an access method of flash data, a storage system and a control system thereof, which are used for writing data in a plurality of physical page addresses of a plurality of physical blocks of a flash memory chip. The data access method comprises the steps of providing a plurality of logical page addresses of a host system and establishing a logical page-to-physical page mapping table and a physical page-to-logical page mapping table so as to record the mapping of logical page addresses and physical page addresses. The data access method also comprises the steps of writing data in physical page addresses when the host system writes data in the logical page addresses and updating the logical page-to-physical page mapping table and the physical page-to-logical page mapping table. The data access method also comprises the step of comparing the logical page-to-physical page mapping table with the physical page-to-logical page mapping table so as to determine invalid and valid physical page addresses of the written data.

Description

The access method of flash data and stocking system thereof and controller system
Technical field
The invention relates to a kind of flash memory system and flash controller that is used for the data access method of flash memory and uses 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 applications, the most suitable being used on the battery-powered product of this type Portable.Solid state hard disc is exactly a kind of with the storage device of nand flash memory as Storage Media.
In general, the flash chip of flash memory system (chip) can be divided into a plurality of physical blocks, and wherein physical blocks more is divided into a plurality of page or leaf, and physical blocks be the unit of erasing and the page or leaf of flash memory is the unit of writing of flash memory.Because when the mnemon of sequencing flash memory; Only can the fill order to sequencing (that is, only can the value of mnemon be turned to 0 by 1 program), therefore can't be (promptly to the page or leaf of sequencing; The page or leaf that has legacy data) directly write, but sequencing again after must earlier this page or leaf being erased.Particularly, because erasing of flash memory be to be unit with the physical blocks, the page or leaf that therefore will have a legacy data when desire is carried out and is erased when operating, and must erase to the whole physical blocks under this page.Therefore, the writing mechanism of flash memory can be that carry out on the basis with the physical blocks traditionally.For example; In traditional wiring method, can these a little physical blocks can be defined as data field (data area) and spare area (spare area); Wherein classify as and to store in the physical blocks of data field by writing the valid data that instruction writes, and the physical blocks in the spare area is the physical blocks 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 blocks of data field; Flash memory system can from the spare area, extract physical blocks and will be in the data field effective legacy data in the physical blocks upgraded of desire write to the physical blocks of from the spare area, extracting with the new data of desiring to write and the physical blocks that will write new data is associated as the data field, and the physical blocks of data field is erased and is associated as the spare area originally.In order to let the physical blocks of host computer system access successfully with the mode storage data of rotating; Flash memory system can carry out access for host computer system by the configuration logic block, and wherein blocks is to dispose according to the size of physical blocks with one or more physical blocks.That is to say; Flash memory system can be set up blocks-physical blocks bitmap (logical block-physical block mapping table); And record reflects rotating of physical blocks with enantiomorphic relationship between the physical blocks of upgrading blocks and data field in this table, and flash memory system can come the physical blocks of institute's mapping is read or write data practically according to blocks-physical blocks bitmap so host computer system only need be directed against that the blocks that provides is carried out access.
Therefore when host computer system was only upgraded a part of data in the blocks, above-mentioned data access method also must comprise the action of moving the effective legacy data in the physical blocks except the action that writes new data.Particularly, when the data updated amount is more little, cause required effective legacy data amount of moving more for a long time, the required time of accomplishing above-mentioned write activity can significantly increase.Particularly; The computing machine Development Trend gradually with flash memory (promptly at present; Solid state hard disc) as the Primary Hard Drive of computer system; Simultaneous computer operating system has the characteristic of upgrading low volume data continually, so the writing speed of flash chip will have a strong impact on the operational paradigm of overall calculation machine system.Therefore, the data access method that needs development one cover can reduce data-moving is arranged, write the speed of data to flash memory with lifting.
Summary of the invention
The present invention provides a kind of data access method, and it can reduce the data-moving action when writing data to flash chip, and then promotes the writing speed of flash memory.
The present invention provides a kind of controller system, and it can reduce the data-moving action when writing data to flash chip, and then promotes the writing speed of flash memory.
The present invention provides a kind of flash memory system, and it can reduce the data-moving action when writing data, and then promotes the writing speed of flash memory.
The present invention proposes a kind of data access method, and it is to be carried out in a plurality of physical page address (physical page address) of a plurality of physical blocks of at least one flash chip, to write data by a flash controller.This data access method comprises provides a plurality of logical page addresses of host computer system (logical page address); Setting up logical page (LPAGE) changes physical page bitmap (logical page to physical page mapping table) writing down the physical page address of logical page address institute mapping respectively, and sets up physical page and change logical page (LPAGE) bitmap (physical page to logical page mapping table) to write down the logical page address of physical page address institute mapping respectively.This data access method also comprises: host computer system reception is from then on desired to write data and and is desired to write logical page address; Write this and desire to write data in a physical page address; Change at above-mentioned logical page (LPAGE) and to upgrade this in the physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data; And above-mentioned physical page change upgrade in the logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address.This data access method also comprises that the comparison logical page (LPAGE) changes the physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap is judged invalid physical page address and effective physical page address among the physical page address of written data.
In one embodiment of this invention; Above-mentioned data access method more comprises sets up the invalid page address count table of physical blocks writing down the number of physical page address invalid in each physical blocks, and in the invalid page address count table of this physical blocks, is updated in the above-mentioned number of desiring to write physical page address invalid in the physical page address of the original mapping of logical page address.
In one embodiment of this invention; Above-mentioned data access method more comprises sets up physical blocks active page address count table writing down in each physical blocks the effectively number of physical page address, and in this physical blocks active page address count table, is updated in the above-mentioned physical page address of desiring to write the original mapping of logical page address the effectively number of physical page address.
In one embodiment of this invention; Above-mentioned data access method comprises more whether number that judgement does not write those physical blocks of data is less than a no datat physical blocks and counts threshold value; Wherein when the number of the physical blocks that does not write data is less than this no datat physical blocks and counts threshold value; Then carry out the invalid data program of erasing, wherein this invalid data program of erasing comprises: among the physical blocks of written data, select at least one first physical blocks according to the invalid page address count table of above-mentioned physical blocks; Never select at least one second physical blocks among writing the physical blocks of data; Data in the effective physical page address in this first physical blocks are copied in the physical page address that belongs to second physical blocks; Upgrade above-mentioned logical page (LPAGE) and change physical page bitmap, physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of physical blocks; And this first physical blocks of erasing.
In one embodiment of this invention, wherein among the physical blocks of written data above-mentioned first physical blocks have the effective physical page of minimized number address.
In one embodiment of this invention, above-mentioned data access method more comprises sets up a no datat physical blocks admin table, does not write the physical blocks of data with record.
In one embodiment of this invention, this logical page (LPAGE) of above-mentioned comparison changes physical page bitmap and this physical page changes the logical page (LPAGE) bitmap and judge that those invalid among those physical page addresses of written data physical page addresses and the effective step of those physical page addresses comprise: selection one waits to judge the physical page address among the physical page address; Change the logical page address that the inquiry of logical page (LPAGE) bitmap waits to judge the mapping of physical page address according to physical page; Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to logical page (LPAGE); Whether the physical page address that judgement is inquired about is same as is waited to judge the physical page address.Wait to judge the physical page address if the physical page address of in this judges, being inquired about is same as, then wait to judge the physical page address for effectively, and if the physical page address of being inquired about be different from and wait to judge the physical page address, wait then to judge that the physical page address is invalid.
In one embodiment of this invention; Whether above-mentioned data access method more comprises according to the invalid page address count table judgement of the above-mentioned physical blocks ratio that invalid physical page address accounts for its all physical page addresses at least one first physical blocks among the physical blocks of written data above an invalid physical page address threshold value; When the ratio that wherein accounts for its all physical page addresses when physical page address invalid in this first physical blocks surpasses this invalid physical page address threshold value; Then carry out the invalid data program of erasing, wherein this invalid data program of erasing comprises: select at least one second physical blocks among never writing the physical blocks of data; Data in effective those physical page addresses in this first physical blocks are copied in the physical page address that belongs to this second physical blocks; Upgrade above-mentioned logical page (LPAGE) and change physical page bitmap, physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of physical blocks; And this first physical blocks of erasing.
In one embodiment of this invention; Above-mentioned data access method more comprises according to the invalid page address count table of above-mentioned physical blocks judging among the physical blocks of written data, whether not have any effectively those physical page addresses at least one first physical blocks; Wherein when in this first physical blocks during no effective physical page address, first physical blocks of then erasing and upgrade the invalid page address count table of above-mentioned physical blocks.
In one embodiment of this invention, above-mentioned data access method comprises that more setting up one can write the physical page pointer, with the next writeable physical page of mark address.
The present invention proposes a kind of controller system; Be useful in a plurality of physical page address of a plurality of physical blocks of at least one flash chip and write data; This controller system comprises microprocessor unit, in order to the host interface unit that connects host computer system, in order to connecting the flash interface unit of flash chip, in order to memory buffer, the logical page (LPAGE) of temporal data change the physical page bitmap, physical page is changeed logical page (LPAGE) bitmap and page management module.Microprocessor unit desires to write logical page address in order to desire to write data and from host computer system reception one; It is the physical page address in order to the mapping of record logical page address institute that logical page (LPAGE) changes the physical page bitmap, and physical page commentaries on classics logical page (LPAGE) bitmap is the logical page address in order to the mapping of record physical page address institute.The page management module desires to write data in a physical page address in order to write this; Change at above-mentioned logical page (LPAGE) and to upgrade this in the physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data, and above-mentioned physical page change upgrade in the logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address.In addition, page management module can compare logical page (LPAGE) commentaries on classics physical page bitmap and physical page is changeed invalid physical page address and effective physical page address among the physical page address of logical page (LPAGE) bitmap judgement written data.
In one embodiment of this invention; Above-mentioned controller system more comprises the invalid page address count table of a physical blocks; In order to write down the number of physical page address invalid in each physical blocks, wherein page management module is more in order to be updated in the above-mentioned number of desiring to write physical page address invalid in the physical page address of the original mapping of logical page address in the invalid page address count table of this physical blocks.
In one embodiment of this invention; Above-mentioned controller system more comprises a physical blocks active page address count table; In order to writing down in each physical blocks the effectively number of physical page address, wherein page management module is more in order to be updated in the above-mentioned physical page address of desiring to write the original mapping of logical page address the effectively number of physical page address in this physical blocks active page address count table.
In one embodiment of this invention; Whether above-mentioned page management module more is less than a no datat physical blocks in order to the number of judging the physical blocks that does not write data is counted threshold value; Wherein when the number of those physical blocks that do not write data is less than this no datat physical blocks and counts threshold value; This page management module is more in order to select at least one first physical blocks according to the invalid page address count table of above-mentioned physical blocks among the physical blocks of written data; Never select at least one second physical blocks among writing the physical blocks of data; Data in the effective physical page address in this first physical blocks are copied in the physical page address that belongs to this second physical blocks; Upgrading above-mentioned logical page (LPAGE) changes physical page bitmap, physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of physical blocks, and this first physical blocks of erasing.
In one embodiment of this invention, above-mentioned first physical blocks and second physical blocks has the effective physical page of minimized number address among those physical blocks of written data.
In one embodiment of this invention, above-mentioned controller system more comprises a no datat physical blocks admin table, does not write the physical blocks of data in order to record.
In one embodiment of this invention; Above-mentioned page management module is to wait to judge the physical page address through selection one from the physical page address; This waits to judge the logical page address of physical page address mapping to change the inquiry of logical page (LPAGE) bitmap according to above-mentioned physical page; Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to this logical page (LPAGE); And judge whether the physical page address inquired about is same as this and waits to judge that the physical page address judges invalid physical page address and effective physical page address, waits to judge the physical page address if the physical page address of wherein being inquired about is same as this, then this waits to judge that the physical page address is for effectively; And if the physical page address of being inquired about is different from this and waits to judge the physical page address, then this waits to judge that the physical page address is invalid.
In one embodiment of this invention; Above-mentioned page management module is more in order to judge according to above-mentioned physical blocks invalid page address count table among the physical blocks of written data whether the ratio that invalid physical page address at least one first physical blocks accounts for its all physical page addresses surpasses an invalid physical page address threshold value; Above-mentioned page management module was selected at least one second physical blocks among more in order to the physical blocks that never writes data when the ratio that wherein accounts for its all those physical page addresses when those invalid in this first physical blocks physical page addresses surpassed this invalid physical page address threshold value; Data in the effective physical page address in this first physical blocks are copied in the physical page address that belongs to this second physical blocks; Upgrading above-mentioned logical page (LPAGE) changes physical page bitmap, physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of physical blocks, and this first physical blocks of erasing.
In one embodiment of this invention; Above-mentioned page management module is more in order to judge among those physical blocks of written data, whether not having any effectively those physical page addresses at least one first physical blocks according to above-mentioned physical blocks invalid page address count table, wherein when effective those physical page addresses of nothing this first physical blocks in above-mentioned page management module more in order to erase this first physical blocks and upgrade the invalid page address count table of above-mentioned physical blocks.
In one embodiment of this invention, above-mentioned controller system comprises that more one can write the physical page pointer, in order to the next writeable physical page of mark address.
The present invention proposes a kind of flash memory system, it comprises a plurality of physical page address of belonging to a plurality of physical blocks, in order to the connector that connects host computer system, flash controller, the logical page (LPAGE) of connector change the physical page bitmap and physical page is changeed the logical page (LPAGE) bitmap therewith to be electrically connected to the physical page address.It is the physical page address in order to the mapping of record logical page address institute that logical page (LPAGE) changes the physical page bitmap, and physical page commentaries on classics logical page (LPAGE) bitmap is the logical page address in order to the mapping of record physical page address institute.Flash controller is desired to write data and in order to host computer system reception from then on and is desired to write logical page address.In addition; Flash memory desires to write data in a physical page address in order to write this; Change at above-mentioned logical page (LPAGE) and to upgrade this in the physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data, and above-mentioned physical page change upgrade in the logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address.In addition, flash controller is in order to invalid physical page address and effective physical page address among the physical page address of comparing logical page (LPAGE) commentaries on classics physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap judgement written data.
In one embodiment of this invention; Above-mentioned flash memory system more comprises the invalid page address count table of a physical blocks; In order to write down the number of physical page address invalid in each physical blocks, wherein work as above-mentioned flash controller more in order in the invalid page address count table of this physical blocks, to be updated in the number of desiring to write physical page address invalid in the physical page address of the original mapping of logical page address.
In one embodiment of this invention; Above-mentioned flash memory system; More comprise a physical blocks active page address count table; In order to write down in each physical blocks the effectively number of those physical page addresses, wherein flash controller is more in order to be updated in the physical page address of desiring to write the original mapping of logical page address the effectively number of physical page address in this physical blocks active page address count table.
In one embodiment of this invention; Whether above-mentioned flash controller more is less than a no datat physical blocks with the number of judging the physical blocks that does not write data is counted threshold value; Wherein when the number of those physical blocks that do not write data is less than this no datat physical blocks and counts threshold value; Flash controller is more in order to select at least one first physical blocks according to the invalid page address count table of above-mentioned physical blocks among the physical blocks of written data; Never select at least one second physical blocks among writing the physical blocks of data; Data in the effective physical page address in this first physical blocks are copied in the physical page address that belongs to this second physical blocks, upgrade above-mentioned logical page (LPAGE) and change physical page bitmap, physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of physical blocks, and this first physical blocks of erasing.
In one embodiment of this invention; Above-mentioned flash controller is through among the physical page address, selecting one to wait to judge the physical page address; This waits to judge the logical page address of physical page address mapping to change the inquiry of logical page (LPAGE) bitmap according to above-mentioned physical page; Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to this logical page (LPAGE); And judge whether the physical page address inquired about is same as this and waits to judge that the physical page address judges invalid physical page address and effective physical page address, waits to judge the physical page address if the physical page address of wherein being inquired about is same as this, then this waits to judge that the physical page address is for effectively; And if the physical page address of being inquired about is different from this and waits to judge the physical page address, then this waits to judge that the physical page address is invalid.
Based on above-mentioned; The present invention uses logical page (LPAGE) to change the physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap writes down the enantiomorphic relationship of logical page address and physical page address; Can for basic flash chip be write by page or leaf thus, can promote the usefulness of flash memory system effectively.
For letting the above-mentioned feature and advantage of the present invention can be more obviously understandable, hereinafter is special lifts embodiment, and conjunction with figs. elaborates as follows.
Description of drawings
Fig. 1 is the summary calcspar that illustrates flash memory system according to one embodiment of the invention.
Fig. 2 is the summary calcspar that one exemplary embodiment illustrates flash chip according to the present invention.
Fig. 3 is the schematic diagram that exemplary embodiment illustrates storage area in the flash chip according to the present invention.
Fig. 4 A~Fig. 4 C is that one exemplary embodiment illustrates the example that logical page (LPAGE) changes physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap according to the present invention.
Fig. 5 is the process flow diagram of the access running of one flash memory system that exemplary embodiment illustrates according to the present invention.
Fig. 6 is the summary calcspar that illustrates flash memory system according to another embodiment of the present invention.
Fig. 7 is the example that one exemplary embodiment illustrates the invalid page address count table of physical blocks according to the present invention.
Fig. 8 is the process flow diagram of the access running of the flash memory system that another exemplary embodiment illustrates according to the present invention.
Fig. 9 is the process flow diagram of the access running of the flash memory system that another exemplary embodiment illustrates according to the present invention.
Figure 10 is the process flow diagram of the access running of flash memory that another exemplary embodiment the illustrates system according to the present invention.
Embodiment
Fig. 1 is the summary calcspar that illustrates flash memory system according to one embodiment of the invention.Please with reference to Fig. 1, flash memory system 100 has connector 110, flash chip 120 and comprises that flash controller 130, logical page (LPAGE) change physical page bitmap 140 and change the controller system of logical page (LPAGE) bitmap 150 with physical page.
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 this exemplary 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 carry-on dish in another embodiment of the present invention.
Connector 110 is to be electrically connected to flash controller 130, and connects host computer system 200 in order to see through bus 300.In this exemplary embodiment, connector 110 is the SATA connector.Yet; It must be appreciated to the invention is not restricted to this that connector 110 can also be USB connector, IEEE 1394 connectors, PCI Express connector, MS connector, MMC connector, SD connector, CF connector, IDE connector or other connector that is fit to.
Flash chip 120 is to be electrically connected to flash controller 130 and in order to storage data.Flash chip 120 is multilayer mnemon (Multi Level Cell, a MLC) nand flash memory in this example is implemented.Yet, it must be appreciated that 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 individual layer mnemon.
Fig. 2 is the summary calcspar that one exemplary embodiment illustrates flash chip according to the present invention.It must be appreciated that the physical blocks of when this describes the running of flash chip, operating flash chip 120 with speech such as " selection ", " moving ", " division ", " replacement ", " rotating ", " groupings " is 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 the running of flash chip 120 (running such as for example, write, read, erase) is to be controlled by flash controller 130.
Please with reference to Fig. 2, flash chip 120 has a plurality of physical blocks (physical block) 120-0~120-N.Generally speaking, in flash memory, physical blocks is the least unit of erasing.That is each physical blocks contains the mnemon of being erased in the lump of minimal amount.Physical blocks 120-0~120-N has 128 pages or leaves (page) respectively in this exemplary embodiment, and wherein page or leaf is the minimum unit of sequencing (program).Change speech, page or leaf is for writing the minimum unit of data or reading of data.Each page or leaf comprises user data field D and redundant area R.User data field D is in order to storing user's data, and redundant area R is in order to the data of stocking system (for example, the logical page address of ECC sign indicating number, the mapping of physical page address institute etc.).In this exemplary embodiment, user data field D is 512 bytes, and redundant area R is 16 bytes.
Physical blocks 120-0~120-N can logically be grouped into system region 210, storage area 220 and alternate area 230.
Physical blocks 120-0~physical blocks the 120-S that is grouped into system region 210 is in order to the stocking system data, and this system data comprises that logical page (LPAGE) changes the page address number of the physical blocks number of physical page bitmap 140, physical page commentaries on classics logical page (LPAGE) bitmap 150, flash chip 120, each physical blocks, writes down the relation of logical page address and physical page address etc.
Physical blocks 120-(the S+1)~physical blocks 120-(S+D) that is grouped into storage area 220 is in order to store the data that host computer system 200 is write.That is to say that flash memory system 100 can use physical blocks 120-(the S+1)~physical blocks 120-(S+D) that is grouped into storage area 220 to store practically the data that host computer system 200 is write.
Physical blocks 120-(the S+D)~physical blocks 120-N that is grouped in the alternate area 230 substitutes physical blocks.Specifically, flash chip 120 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 storage area 220 was damaged, the physical blocks of reserving in alternate area 230 can be in order to replacing damaged physical blocks.Therefore, if when the physical blocks in the storage area 220 takes place still to have available physical blocks in damage and the alternate area 230, flash controller 130 can extract available physical blocks and change the physical blocks of damage from alternate area 230.If when no available physical blocks took place in damage and the alternate area 230 physical blocks in the storage area 220, flash memory system 100 will be declared to re-use.
Fig. 3 is the schematic diagram that exemplary embodiment illustrates storage area in the flash chip according to the present invention.
Please with reference to Fig. 3; Each physical blocks of storage area 220 comprises 127 physical page addresses; Therefore physical blocks 120-(the S+1)~physical blocks 120-(S+D) of storage area 220 comprises (127 * D) individual physical page addresses altogether; Wherein physical page address 0~physical page address 127 belongs to physical blocks 120-(S+1), and 128~physical page address, physical page address 254 belongs to physical blocks 120-(S+2), and 255~physical page address, physical page address 381 belongs to physical blocks 120-(S+3); ..., physical page address (127 (D-1)+1)~physical page address 127D belongs to physical blocks 120-(S+D).In addition, in exemplary embodiment of the present invention, logical page address 0~logical page address L of physical page address that flash memory system 100100 can provide mapping storage area 220 to host computer system 200 to carry out access.In exemplary embodiment of the present invention, S, D and L are integer, and it is to be set by the deviser according to the capacity of flash chip 120, and in general, the number of physical page address is the number greater than logical page address.
Please refer again to Fig. 1, flash controller 130 can be carried out with the real a plurality of instructions done of hardware pattern, software pattern or firmware pattern to accomplish the storage of data, the running of reading and erase etc. with connector 110 and flash chip 120.Flash controller 130 comprises microprocessor unit 130a, memory buffer 130b, host interface unit 130c and flash block 130130d.
Microprocessor unit 130a is in order to the running of control flash controller 130, for example with cooperative cooperatings such as memory buffer 130b, host interface unit 130c, flash interface module 130d and page management module 130e with to instructions such as flash memory system 100 write, reads, erases.
Memory buffer 130b is coupled to microprocessor unit 130a and in order to 200 data that read or write of stocking system data or host computer system temporarily.In this exemplary embodiment, memory buffer 130b be static random access memory (static random access memory, SRAM).Yet; It must be appreciated; The invention is not restricted to this, and DRAM (Dynamic Random Access memory, DRAM), reluctance type internal memory (Magnetoresistive Random Access Memory; MRAM), phase-change memory element (Phase Change Random Access Memory, PRAM) or other internal memory that is fit to also can be applicable to the present invention.
Host interface unit 130c is the instruction that is coupled to microprocessor unit 130a and is transmitted in order to reception and identification host computer system 200.Just, the instruction that transmitted of host computer system 200 and data can see through host interface unit 130c and be sent to microprocessor unit 130a.In this exemplary embodiment, host interface unit 130c is the SATA interface.Yet; It must be appreciated to the invention is not restricted to this that host interface unit 130c can also be USB interface, IEEE 1394 interfaces, PCI Express interface, MS interface, MMC interface, SD interface, CF interface, ide interface or other data transmission interface that is fit to.Particularly, host interface unit 130c can be corresponding with connector 110.Just, host interface unit 130c must arrange in pairs or groups mutually with connector 110.
Flash interface module 130d is coupled to microprocessor unit 130a and in order to access flash chip 120.Just, the data of desiring to write to flash chip 120 can convert 120 receptible forms of flash chip into via flash interface module 130d.Specifically, flash interface module 130d can support the flash interface signal, for example; The flash interface signal comprises chip enable signal/CE, order latch-up signal/CLE, address latch signal/ALE; Data read control signal/RE; Data write control signal/WE, write protect signal/WP, chip status signal R/B and a plurality of data are exported into signal/IO etc.
Page management module 130e is in order to management flash chip 120 under the control of microprocessing unit 130a unit.
In exemplary embodiment of the present invention, page management module 130e is embodied in the flash controller 130 with a firmware pattern.For example; The page management module 130e that will comprise a plurality of programmed instruction (for example is burned onto a program internal memory; ROM (read-only memory) (Read Only Memory; ROM)) be embedded in the flash controller 130 in and with this program internal memory, wherein when flash memory system 100 running, microprocessor unit 130a from then in the program internal memory loaded page administration module 130e come flash chip 120 is carried out runnings such as erasing, read, write.
In addition; In another exemplary embodiment of the present invention; Page management module 130e can also be stored in flash chip 120 with the software pattern the specific region (for example; System region 210 in flash chip 120) in, wherein when flash memory system 100 runnings, page management module 130e can be loaded among the memory buffer 130b and by microprocessor unit 130a and carry out with runnings such as erasing, read, write.
Moreover, in another embodiment of the present invention, page management module 130e can also a hardware pattern (for example, logic lock) directly layout (lay out) in flash controller 130.
In addition, though be not illustrated in this exemplary embodiment, flash controller 130 also can comprise more that error correction module and power management module etc. are used to control the general utility functions module of flash memory.
It is to operate the physical page address with the mapping of record logical page address 0~logical page address L institute by microprocessor unit 130a via carrying out page management module 130e that logical page (LPAGE) changes physical page bitmap 140, and physical page commentaries on classics logical page (LPAGE) bitmap 150 is to operate the logical page address with the mapping of record 0~physical page address, physical page address 127D institute by microprocessor unit 130a via carrying out page management module 130e.For example; It is to be stored in the system region 210 of flash chip 120 with physical page commentaries on classics logical page (LPAGE) bitmap 150 that logical page (LPAGE) changes physical page bitmap 140; And when flash memory system 100 runnings; Logical page (LPAGE) commentaries on classics physical page bitmap 140 can be loaded among the memory buffer 130b and by page management module 130e with physical page commentaries on classics logical page (LPAGE) bitmap 150 and operate; And can be returned to not timing and deposited system region 210, cut off the power supply to avoid flash memory system 100 undesiredly, and lose the content of wherein having upgraded to flash chip 120.
Specifically; In exemplary embodiment of the present invention; When host computer system 200 write data in any logical page address 0~logical page address L, the programmed instruction of the programmed instruction of the page management module 130e that microprocessor unit 130a institute flash controller 130 is performed can write to data in the physical page address in physical blocks 120-(S+1)~physical blocks 120-(S+D) in order.Specifically; When the programmed instruction of the programmed instruction of page management module 130e brings into use physical blocks 120-(S+1) to store the data that host computer system 200 desires to write; No matter host computer system 200 is to write that logical page address, the programmed instruction of the programmed instruction of page management module 130e all can write to 0~physical page address, physical page address 127 with data in order; And when the programmed instruction of the programmed instruction of page management module 130e brings into use physical blocks 120-(S+2) to store the data that host computer system 200 desires to write; No matter host computer system 200 is to write that logical page address, the programmed instruction of the programmed instruction of page management module 130e all can write to 128~physical page address, physical page address 254 with data in order.That is to say; When writing the data that host computer system 200 desires to write; The coded program instruction of page management module 130e uses the physical page address in the physical blocks to write data in order; And after the physical page address in this physical blocks is used up, just can select the physical blocks of another no datat again, and in the physical page address of the new physical blocks of selecting, continue to write in order data.
Particularly; After the programmed instruction of page management module 130e write to the physical page address with data, the programmed instruction of page management module 130e can upgrade logical page (LPAGE) commentaries on classics physical page bitmap 140 changeed logical page (LPAGE) bitmap 150 correctly to write down the enantiomorphic relationship of logical page address and physical page address with physical page.
What deserves to be mentioned is; In the present invention's one exemplary embodiment; Comprise more that in page management module 130e one can write physical page pointer (Available Physical Page Pointer), in order to indicating next writeable physical page address, base this; When the programmed instruction of carrying out page management module 130e when flash controller 130 writes the data that host computer system 200 desires to write, can in order data be write in the physical page address of flash chip 120 according to the mark that can write the physical page pointer.
In addition; What be worth explanation is, in another embodiment, and when flash chip 120 is multilayer mnemon (Multi Level Cell; MLC) nand flash memory chip; And writing mode is when specifying the nextpage (lower page) that upward page (upper page) is fast that writes in the more same physical blocks of writing speed in the physical blocks, because the physical page address of these nextpages and discontinuous, so the programmed instruction of page management module 130e can be according to the physical page address of the nextpage in this physical blocks; By little to writing data greatly, and this can write the physical page pointer also can be according to the physical page address of nextpage by little to the next writeable physical page of big indication address.
In addition; When this physical page pointer desire changes when pointing to another physical blocks from a physical blocks; The minimum material page address of the physical blocks that the order that can be among the physical blocks of no datat state be erased according to these physical blocks is selected to be erased the earliest desires to write the physical page address of data for next, and wherein these physical blocks order of being erased can be write down (not illustrating) and learnt by the block order of erasing.
Fig. 4 A~Fig. 4 C is that one exemplary embodiment illustrates the example that logical page (LPAGE) changes physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap according to the present invention.
Please with reference to Fig. 4 A; Logic of propositions page address 0~logical page address L is the address of mapping physical page respectively 0~physical page address L; Just, 0~physical page address L in physical page address stores the data that host computer system 200 writes respectively in logical page address 0~logical page address L.Therefore, logical page (LPAGE) change physical page bitmap 140 and physical page change logical page (LPAGE) bitmap 150 can these a little enantiomorphic relationship of record, and can write the physical page pointer this moment and can point to physical page address (L+1).
When if host computer system 200 is desired to write data to logical page address 1; The programmed instruction of page management module 130e can write in the physical page address (L+1) according to writing the data that the physical page pointer desires host computer system 200 to write, and can write the physical page pointer and change into and point to physical page address (L+2).At this moment; The programmed instruction of page management module 130e can be updated to physical page address (L+1) in the mapping that logical page (LPAGE) changes in the physical page bitmap 140 logical page address 1, and the mapping of changeing in the logical page (LPAGE) bitmap 150 physical page address (L+1) in physical page is updated to logical page address 1 (shown in Fig. 4 B).
Then; When if host computer system 200 is desired to write data to logical page address 129; The programmed instruction of page management module 130e can write in the physical page address (L+2) according to writing the data that the physical page pointer desires host computer system 200 to write, and can write the physical page pointer and change into and point to physical page address (L+3).At this moment; The programmed instruction of page management module 130e can be updated to physical page address (L+2) in the mapping that logical page (LPAGE) changes in the physical page bitmap 140 logical page address 129, and the mapping of changeing in the logical page (LPAGE) bitmap 150 physical page address (L+2) in physical page is updated to logical page address 129 (shown in Fig. 4 C).
Fig. 5 is the process flow diagram of the access running of one flash memory system that exemplary embodiment illustrates 100 according to the present invention.
Please, when flash memory system 100 is connected with host computer system 200 and activates, in step S501, can provide a plurality of logical page addresses for host computer system 200 accesses with reference to Fig. 5.Then, in step S503, can set up logical page (LPAGE) and change physical page bitmap 140 and physical page commentaries on classics logical page (LPAGE) bitmap 150.Afterwards, in step S505, can await orders and judge the instruction that is received.
If when in step S505, receiving reading command; Then in step S507, can change the physical page bitmap 140 from logical page (LPAGE) and read the physical page address of mapping, and in step S509, send host computer system to from the physical page address reading data of mapping and with these data according to the logical page address of desiring to read.Afterwards, returning step S505 awaits orders.For example; When the storage area 220 at flash chip 140 is that the state and the host computer system 200 that are in Fig. 4 (b) is when desiring to read the data of logical page address 1; It is physical page address (L+1) that the programmed instruction of page management module 130e can change the physical page address of reading mapping logical page address 1 the physical page bitmap 140 from logical page (LPAGE), and from physical page address (L+1) reading of data and send data to host computer system 200.
If in step S505, receive when writing instruction, then in step S511, can data be write to and to write physical page pointer physical page address pointed.Then, in step S513, can change in the physical page bitmap 140 physical page address with the logical page address institute mapping of desiring to write data at logical page (LPAGE) is updated to and can writes physical page pointer physical page address pointed.Then, in step S515, change the logical page address that upgrades the physical page address institute mapping that writes these data in the logical page (LPAGE) bitmap 150, and in step S517, can write the next writeable physical page of physical page pointed address in physical page.At last, in step S519, judge and record effective physical page address and invalid physical page address, return step S505 afterwards.For example; When the storage area 220 at flash chip 140 is state and host computer systems 200 of being in Fig. 4 B when desiring to write data to logical page address 129, the programmed instruction of page management module 130e can write to data in the physical page address (L+2) and shown in Fig. 4 C, upgrades logical page (LPAGE) and change physical page bitmap 140 and change logical page (LPAGE) bitmap 150 with physical page.
What deserves to be mentioned is; In exemplary embodiment of the present invention; The programmed instruction of page management module 130e can judge that which physical page address is invalid physical page address and effective physical page address through the record that the comparison logical page (LPAGE) changes in physical page bitmap 140 and the physical page commentaries on classics logical page (LPAGE) bitmap 150; Wherein so-called invalid physical page address is meant that wherein stored data are invalid legacy data, and effectively the physical page address is meant that wherein stored data are valid data of mapping current logic page address.
For example; With Fig. 4 C is example; When desire judges whether physical page address 0 is effective physical page address; The programmed instruction of page management module 130e can change that to read physical page address 0 the logical page (LPAGE) bitmap 150 be mapping logical page address 0 from physical page, and changeing physical page bitmap 140 according to logical page address 0 from logical page (LPAGE), to read logical page address 0 be mapping physical page address 0, so physical page address 0 is effective physical page address.In addition; When desire judges whether physical page address 1 is effective physical page address; The programmed instruction of page management module 130e can change that to read physical page address 1 the logical page (LPAGE) bitmap 150 be mapping logical page address 1 from physical page; And reading logical page address 1 according to logical page address 1 from logical page (LPAGE) commentaries on classics physical page bitmap 140 is mapping physical page address (L+1), so physical page address 1 is invalid physical page address.Similarly; When desire judges whether physical page address 129 is effective physical page address; The programmed instruction of page management module 130e can change that to read physical page address 129 the logical page (LPAGE) bitmap 150 are mapping logical page addresses 129 from physical page; And reading logical page address 129 according to logical page address 129 from logical page (LPAGE) commentaries on classics physical page bitmap 140 is mapping physical page addresses (L+2), so physical page address 129 is invalid physical page address.That is to say; The programmed instruction of page management module 130e can see through the physical page address that physical page is changeed logical page (LPAGE) bitmap 150 and logical page (LPAGE) changes the logical page address institute mapping of physical page bitmap 140 inquiries physical page address mapping to be judged according to physical page address to be judged; If physical page address to be judged is during with the physical page address matches of being inquired about; Then this physical page address to be judged is effective physical page address, and anti-then is invalid physical page address.
What deserves to be mentioned is; Since flash chip 120 be with physical blocks as the least unit of erasing, so the programmed instruction of page management module 130e can merge the data in the effective physical page address to discharge invalid physical page address and writes new data through above-mentioned comparison.For example; The programmed instruction of page management module 130e can copy to the data in effective physical page address at least one physical blocks in the physical page address of the physical blocks that does not write any data; And, can the valid data that disperse be merged and invalid physical page address discharged (below be called invalid data erase program) thus the running of erasing of this physical blocks.What deserves to be mentioned is; Merge with after discharging invalid physical page address carrying out valid data, the programmed instruction of page management module 130e can upgrade physical page changes the enantiomorphic relationship that logical page (LPAGE) bitmap 150 and logical page (LPAGE) change logical page address and physical page address in the physical page bitmap 140.
In the present invention's one exemplary embodiment; Controller system more comprises the invalid page address count table 170 of physical blocks (shown in the flash memory system 100 ' of Fig. 6) writing down the number of physical page address invalid among each physical blocks 120-0~140-(S+D), with as the data in the effective physical page address are merged to discharge the foundation of invalid physical page address.Similarly; Be to be stored in the system region 210 of flash chip 120; And when flash memory system 100 runnings, the invalid page address count table 170 of physical blocks can be loaded among the memory buffer 130b and by the programmed instruction of flash controller 130 execution page management module 130e and operate, and can be returned to not timing and deposit the system region 210 to flash chip 120; Avoiding flash memory system 100 to cut off the power supply undesiredly, and lose the content of wherein having upgraded.
Fig. 7 is the example that one exemplary embodiment illustrates the invalid page address count table of physical blocks according to the present invention, wherein the invalid page address count table 170 of the physical blocks example that is corresponding diagram 4.
Please with reference to (a) and Fig. 4 A of Fig. 7, under the state shown in the corresponding diagram 4A, the count value that the invalid page address count table 170 of physical blocks can write down the invalid physical page address of each physical blocks 120-0~120-(S+D) is 0.
Please with reference to Fig. 7 (b) and Fig. 4 B; Under the state shown in the corresponding diagram 4B; Because the data of host computer system 200 logical page address 1 desiring to write are written into physical page address (L+1), so mapping and physical page that the programmed instruction of page management module 130e can upgrade logical page (LPAGE) and change logical page address 1 in the physical page bitmap 140 are changeed the mapping of physical page address (L+1) in the logical page (LPAGE) bitmap 150.Particularly, can to read the physical page address of logical page address 1 former mapping before changeing physical page bitmap 140 be physical page address 1 and in the invalid page address count table 170 of physical blocks, will add 1 about the count value of the invalid physical page address of the physical blocks 120-(S+1) under the physical page address 1 to upgrade logical page (LPAGE) at the programmed instruction of page management module 130e.
Similarly; Please with reference to Fig. 7 (c) and Fig. 4 C; Under the state shown in the corresponding diagram 4C; Because the data of host computer system 200 logical page address 129 desiring to write are written into physical page address (L+2), so mapping and physical page that the programmed instruction of page management module 130e can upgrade logical page (LPAGE) and change logical page address 129 in the physical page bitmap 140 are changeed the mapping of physical page address (L+2) in the logical page (LPAGE) bitmap 150.Particularly, can to read the physical page address of logical page address 129 former mappings before changeing physical page bitmap 140 be physical page address 129 and in the invalid page address count table 170 of physical blocks, will add 1 about the count value of the invalid physical page address of the physical blocks 120-(S+1) under the physical page address 129 to upgrade logical page (LPAGE) at the programmed instruction of page management module 130e.
For example, in the present invention's one exemplary embodiment, when carrying out to carry out the data consolidation procedure according at least one physical blocks that the invalid page address count table 170 of physical blocks is selected to have the effective physical page of minimized number address when invalid data is erased program.
What deserves to be mentioned is that above-mentioned exemplary embodiment is to count the number of physical page address invalid in the physical blocks to set up the invalid page address count table 170 of physical blocks.Yet; In another embodiment of the present invention; Can also set up physical blocks active page address count table and count in the physical blocks the effectively number of physical page address, to select the physical blocks of valid data minimum data to come data to merge thus carrying out the invalid data program of erasing.
In addition, in the present invention's one exemplary embodiment, controller system upgrades and comprises that no datat physical blocks admin table (not illustrating) does not write the physical blocks of any data with record.That is to say that the physical blocks that is recorded in the no datat physical blocks admin table has been erased to supply to write the physical blocks of data.Particularly, the programmed instruction of page management module 130e can upgrade according to the information in the no datat physical blocks admin table can write the physical page pointer.For example; Pointed to physical page address 127D and carry out when writing instruction can writing the physical page pointer, the programmed instruction of page management module 130e can one of them write first physical page address of the physical blocks of any data according to writing the physical page pointed in the no datat physical blocks admin table.
Particularly; Ought carry out the invalid data physical blocks that not to write any data in the program of erasing as stated and write the data in effective physical page address; Therefore in the present invention's one exemplary embodiment; The programmed instruction of page management module 130e can then can carry out invalid data and erase program to discharge invalid physical page address when judge only surplus 1 physical blocks that does not write any data in the no datat physical blocks admin table.What deserves to be mentioned is, the invention is not restricted to when not writing the physical blocks of any data for surplus 1, to carry out invalid data and erase.
In addition; In another exemplary embodiment of the present invention; When the programmed instruction of page management module 130e also can judge that the ratio of invalid physical page address at least one physical blocks surpasses an invalid physical page address threshold value according to the count value in the invalid page address count table 170 of physical blocks, then carry out data and merge to discharge the program of invalid physical page address.At this, this invalid physical page address threshold value is to be set up on their own by the user, and wherein when this invalid physical page address threshold value was low more, the frequency of then carrying out the data consolidation procedure was high more, otherwise, then low more.In the present invention's one exemplary embodiment, this invalid physical page address threshold value is to be set at 80%.
In addition; In another exemplary embodiment of the present invention; When the programmed instruction of page management module 130e also can be judged in arbitrary physical blocks no any effective physical page address according to the count value in the invalid page address count table 170 of physical blocks; Then this physical blocks of not having any effective physical page address is carried out the running of erasing discharging invalid physical page address, and this physical blocks is recorded in the no datat physical blocks admin table.
Fig. 8 is the process flow diagram of the access running of one flash memory system 100 ' that exemplary embodiment illustrates according to the present invention.
Please, when flash memory system 100 is connected with host computer system 200 and activates, in step S801, can provide a plurality of logical page addresses for host computer system 200 accesses with reference to Fig. 8.Then, in step S803, can set up logical page (LPAGE) and change physical page bitmap 140, physical page commentaries on classics logical page (LPAGE) bitmap 150 and the invalid page address count table 170 of physical blocks.Afterwards, in step S805, can await orders and judge the instruction that is received.
If when in step S805, receiving reading command; Then in step S807, can change physical page bitmap 140 from logical page (LPAGE) and read the physical page address of mapping, and in step S809, send host computer system to from the physical page address reading data of mapping and with these data according to the logical page address of desiring to read.Afterwards, returning step S805 awaits orders.
If in step S805, receive when writing instruction, then in step S811, can data be write to and to write physical page pointer physical page address pointed.Then, can be in the invalid page address count table 170 of physical blocks in step S813 the count value of the invalid physical page address of the physical blocks of the present institute of the logical page address mapping of desiring to write data be added 1.Afterwards, in step S815, can change in the physical page bitmap 140 physical page address with the logical page address institute mapping of desiring to write data at logical page (LPAGE) is updated to and can writes physical page pointer physical page address pointed.Then, in step S817, change the logical page address that upgrades the physical page address institute mapping that writes these data in the logical page (LPAGE) bitmap 150, and in step S819, can write the next writeable physical page of physical page pointed address in physical page.
Particularly after accomplishing write activity, meeting judges whether the number of the physical blocks that does not write data is less than the no datat physical blocks and counts threshold value (for example, as stated, this exemplary embodiment is to be set at 1) in step S821.If in step S821, judge when the physical blocks do not write data is less than the no datat physical blocks and counts threshold value, then can carry out the invalid data program of erasing.For example, in step S823, can from the physical blocks of written data, select 2 physical blocks according to the invalid page address count table 170 of physical blocks.For example; 2 physical blocks that have the effective physical page of minimized number address among the physical blocks that selected 2 physical blocks are written data, and comparison logical page (LPAGE) commentaries on classics physical page bitmap 140 is changeed logical page (LPAGE) bitmap 150 to judge the effective physical page address in selected 2 physical blocks with physical page in step S825.
Then; In step S827, can from flash chip 120, select 1 physical blocks that does not write data, and the data in the effective physical page address that in step S829, will in step S825, be judged copy in the physical page address of selected physical blocks in step S827.Then, in step S831, selected 2 physical blocks among the step S823 are erased running to discharge available storage area.At last, upgrade in step S833 that logical page (LPAGE) changes physical page bitmap 140, physical page is changeed logical page (LPAGE) bitmap 150 and the invalid page address count table 170 of physical blocks, and accomplish erase program and return step S805 and await orders of invalid data.
It must be appreciated; Though being 2 physical blocks selecting written data, Fig. 8 carries out the invalid data program of erasing with 1 physical blocks that does not write data; Yet the invention is not restricted to this; Carry out invalid data when the physical blocks of carrying out to select when invalid data is erased program one or more written data and erase, and can select one or more physical blocks that do not write data to store the valid data that merged.
Fig. 9 is the process flow diagram of the access running of the flash memory system 100 ' that another exemplary embodiment illustrates according to the present invention.
Please with reference to Fig. 9, step S901, S903, S905, S907, S909, S911, S913, S915, S917 and S919 are same as step S801, S803, S805, S807, S809, S811, S813, S815, S817 and S819, repeat no more at this.
In step S921, can judge whether that the ratio of invalid physical page address in the physical blocks surpasses invalid physical page address threshold value (for example, this exemplary embodiment is to set 80%) according to the invalid page address count table 170 of physical blocks.If in step S921, judge when the ratio that invalid physical page address at least 1 physical blocks is arranged surpasses invalid physical page address threshold value, then can carry out invalid data program (for example, the step S923~S929) that erases.
In step S923, can comparison logical page (LPAGE) commentaries on classics physical page bitmap 140 change effective physical page address that logical page (LPAGE) bitmap 150 is judged in this physical blocks with physical page.
Then; The physical blocks number that in step S925, can surpass invalid physical page address threshold value according to the ratio of judge invalid physical page address is selected at least 1 physical blocks that does not write data from flash chip 120, and the data in the effective physical page address that in step S927, will in step S923, be judged copy in the physical page address of selected physical blocks in step S925.Then, in step S927, the physical blocks of being judged among the step S921 is erased running to discharge available storage area.At last, upgrade in step S929 that logical page (LPAGE) changes physical page bitmap 140, physical page is changeed logical page (LPAGE) bitmap 150 and the invalid page address count table 170 of physical blocks, and accomplish erase program and return step S905 and await orders of invalid data.
Figure 10 is the process flow diagram of the access running of the flash memory system 100 ' that another exemplary embodiment illustrates according to the present invention.
Please with reference to Figure 10; Step S1001, S1003, S1005, S1007, S1009, S1011, S1013, S1015, S1017 and S1019 are same as step S801, S803, S805, S807, S809, S811, S813, S815, S817 and S819, repeat no more at this.
In step S1021, can judge whether to have any its physical page address according to the invalid page address count table 170 of physical blocks and be all invalid physical blocks.If when judging that in step S1021 having the physical page address is all invalid physical blocks, then in step S1023, can the physical page address be all invalid physical blocks and carry out the running of erasing to discharge available storage area.At last, in step S1025, upgrade the invalid page address count table of physical blocks, and accomplish the data consolidation procedure and return step S1005 and await orders.
It must be appreciated, though in above-mentioned Fig. 5, Fig. 8, Fig. 9 and Figure 10, do not illustrate the step that finishes running, these those skilled in the art can understand easily in flash memory system this a little flow processs that decommission and can stop.In addition, the order of this exemplary embodiment Fig. 5, Fig. 8, Fig. 9 and the said step of Figure 10 and non-limiting the present invention, art is known in this field can come the real the present invention that does with non-the described order of exemplary embodiment easily according to spirit of the present invention.
In sum; The present invention uses logical page (LPAGE) to change the physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap writes down the enantiomorphic relationship of logical page address and physical page address; Can for basic flash chip be write by page or leaf thus, can promote the usefulness of flash memory system effectively.In addition, tranmittance is that the data merging is carried out to discharge invalid physical page address with effective physical page address in the invalid physical page address of decidable to logical page (LPAGE) commentaries on classics physical page bitmap and physical page commentaries on classics logical page (LPAGE) bitmap.Moreover the present invention uses the invalid page address count table of physical blocks to write down the number of invalid physical page address in each physical blocks, can judge the physical blocks that can discharge more space in the back of erasing thus apace, to promote the usefulness of flash memory system.
Though the present invention discloses as above with embodiment; Right its is not in order to limit the present invention; Has common knowledge the knowledgeable in the technical field under any; Do not breaking away from the spirit and scope of the present invention, when doing a little change and retouching, so protection scope of the present invention is when being as the criterion with what claim defined.

Claims (25)

1. data access method, it is carried out with access data in a plurality of physical page address of a plurality of physical blocks of at least one flash chip by a flash controller, and this data access method comprises:
A plurality of logical page addresses are provided, for a host computer system access;
Set up a logical page (LPAGE) and change the physical page bitmap to write down those physical page addresses of those logical page address institute mappings respectively;
Set up a physical page and change the logical page (LPAGE) bitmap to write down those logical page addresses of those physical page address institute mappings respectively;
Desire to write data and from this host computer system reception one and desire to write logical page address; Write this and desire to write data in a physical page address; And change at this logical page (LPAGE) and to upgrade this in physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data, and this physical page change upgrade in logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address; And
Compare this logical page (LPAGE) commentaries on classics physical page bitmap and this physical page and change invalid those physical page addresses and effective those physical page addresses among those physical page addresses of logical page (LPAGE) bitmap judgement written data.
2. data access method as claimed in claim 1 is characterized in that, more comprises:
Set up the invalid page address count table of a physical blocks to write down the number of those invalid in each those physical blocks physical page addresses; And
In the invalid page address count table of this physical blocks, be updated in the number that this desires to write those invalid in the physical page address of the original mapping of logical page address physical page addresses.
3. data access method as claimed in claim 1 is characterized in that, more comprises:
Set up a physical blocks active page address count table to write down the number of effective those physical page addresses in each those physical blocks; And
In this physical blocks active page address count table, be updated in this physical page address of desiring to write the original mapping of logical page address the effectively number of those physical page addresses.
4. data access method as claimed in claim 2 is characterized in that, more comprises:
Whether the number of judging those physical blocks do not write data is less than a no datat physical blocks is counted threshold value,
Wherein when the number of those physical blocks that do not write data is less than this no datat physical blocks and counts threshold value, then carry out the invalid data program of erasing, this invalid data program of erasing comprises:
Among those physical blocks of written data, select at least one first physical blocks according to the invalid page address count table of this physical blocks;
Never select at least one second physical blocks among writing those physical blocks of data;
Data in effective those physical page addresses in this at least one first physical blocks are copied in those physical page addresses that belong to this at least one second physical blocks;
Upgrade this logical page (LPAGE) and change physical page bitmap, this physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of this physical blocks; And
This at least one first physical blocks of erasing.
5. data access method as claimed in claim 4 is characterized in that, this at least one first physical blocks has effectively those physical page addresses of minimized number among those physical blocks of written data.
6. data access method as claimed in claim 4 is characterized in that, more comprises setting up a no datat physical blocks admin table, does not write those physical blocks of data with record.
7. data access method as claimed in claim 1; It is characterized in that, compare this logical page (LPAGE) and change physical page bitmap and this physical page and change the logical page (LPAGE) bitmap and judge that those invalid among those physical page addresses of written data physical page addresses and the step of effective those physical page addresses comprise:
Among those physical page addresses, select one to wait to judge the physical page address;
This waits to judge the logical page address of physical page address mapping to change the inquiry of logical page (LPAGE) bitmap according to this physical page;
Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to this logical page (LPAGE);
Judge whether the physical page address of being inquired about is same as this and waits to judge the physical page address; If the physical page address of wherein being inquired about is same as this and waits to judge the physical page address; Then this waits to judge that the physical page address is for effective; And if the physical page address of being inquired about is different from this and waits to judge the physical page address, then this waits to judge that the physical page address is invalid.
8. data access method as claimed in claim 2 is characterized in that, more comprises:
Judge according to the invalid page address count table of this physical blocks whether the ratio that those invalid physical page addresses at least one first physical blocks account for its all those physical page addresses surpasses an invalid physical page address threshold value in those physical blocks of written data
When the ratio that wherein accounts for its all those physical page addresses when those invalid in this at least one first physical blocks physical page addresses surpasses this invalid physical page address threshold value, then carry out the invalid data program of erasing, this invalid data program of erasing comprises:
Never select at least one second physical blocks among writing those physical blocks of data;
Data in effective those physical page addresses in this at least one first physical blocks are copied in those physical page addresses that belong to this at least one second physical blocks;
Upgrade this logical page (LPAGE) and change physical page bitmap, this physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of this physical blocks; And
This at least one first physical blocks of erasing.
9. data access method as claimed in claim 2 is characterized in that, more comprises:
Judge among those physical blocks of written data, whether not have any effectively those physical page addresses at least one first physical blocks according to the invalid page address count table of this physical blocks,
Wherein when not having effectively those physical page addresses in this at least one first physical blocks, this at least one first physical blocks of then erasing and upgrade the invalid page address count table of this physical blocks.
10. data access method as claimed in claim 1 is characterized in that, comprises that more setting up one can write the physical page pointer, with next writeable those physical page addresses of mark.
11. a controller system is useful in a plurality of physical page address of a plurality of physical blocks of at least one flash chip and writes data, this controller system comprises:
One host interface unit is in order to connect a host computer system;
One microprocessor unit desires to write logical page address in order to desire to write data and from this host computer system reception one;
One flash interface unit is in order to connect this at least one flash chip;
One memory buffer is in order to temporal data;
One logical page (LPAGE) changes the physical page bitmap, in order to write down those physical page addresses of those logical page address institute mappings;
One physical page is changeed the logical page (LPAGE) bitmap, in order to write down those logical page addresses of those physical page address institute mappings; And
One page administration module; Desire to write data in a physical page address in order to write this; And change at this logical page (LPAGE) and to upgrade this in physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data; And this physical page change upgrade in logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address
Wherein this logical page (LPAGE) commentaries on classics physical page bitmap of this page management module comparison and this physical page commentaries on classics logical page (LPAGE) bitmap are judged invalid those physical page addresses and effective those physical page addresses among those physical page addresses of written data.
12. controller system as claimed in claim 11 is characterized in that, more comprises the invalid page address count table of a physical blocks, in order to writing down the number of those invalid in each those physical blocks physical page addresses,
Wherein this page management module is more in order to be updated in the number that this desires to write those invalid in the physical page address of the original mapping of logical page address physical page addresses in the invalid page address count table of this physical blocks.
13. controller system as claimed in claim 11 is characterized in that, more comprises a physical blocks active page address count table, in order to writing down in each those physical blocks the effectively number of those physical page addresses,
Wherein this page management module is more in order to be updated in this physical page address of desiring to write the original mapping of logical page address the effectively number of those physical page addresses in this physical blocks active page address count table.
14. controller system as claimed in claim 12 is characterized in that, whether this page management module more is less than a no datat physical blocks in order to the number of judging those physical blocks that do not write data is counted threshold value,
Wherein when the number of those physical blocks that do not write data is less than this no datat physical blocks and counts threshold value; This page management module is more in order to select at least one first physical blocks according to the invalid page address count table of this physical blocks among those physical blocks of written data; Never select at least one second physical blocks among writing those physical blocks of data; Data in effective those physical page addresses in this at least one first physical blocks are copied in those physical page addresses that belong to this at least one second physical blocks; Upgrading this logical page (LPAGE) changes physical page bitmap, this physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of this physical blocks, and this at least one first physical blocks of erasing.
15. controller system as claimed in claim 14 is characterized in that, this at least one first physical blocks has effectively those physical page addresses of minimized number among those physical blocks of written data.
16. controller system as claimed in claim 14 is characterized in that, more comprises a no datat physical blocks admin table, does not write those physical blocks of data in order to record.
17. controller system as claimed in claim 11; It is characterized in that; This page management module is through among those physical page addresses, selecting one to wait to judge the physical page address; This waits to judge the logical page address of physical page address mapping to change the inquiry of logical page (LPAGE) bitmap according to this physical page; Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to this logical page (LPAGE), and judge whether the physical page address of being inquired about is same as this and waits to judge that the physical page address judges those invalid physical page addresses and effective those physical page addresses
If the physical page address of wherein being inquired about is same as this and waits to judge the physical page address, then this waits to judge the physical page address for effectively, and if the physical page address of being inquired about be different from this and wait to judge the physical page address, then this waits to judge that the physical page address is invalid.
18. controller system as claimed in claim 12; It is characterized in that; This page management module is more in order to judge according to the invalid page address count table of this physical blocks among those physical blocks of written data whether the ratio that those invalid physical page addresses at least one first physical blocks account for its all those physical page addresses surpasses an invalid physical page address threshold value
When the ratio that wherein accounts for its all those physical page addresses when those invalid in this at least one first physical blocks physical page addresses surpasses this invalid physical page address threshold value; This page management module is more in order to select at least one second physical blocks among those physical blocks that never write data; Data in effective those physical page addresses in this at least one first physical blocks are copied in those physical page addresses that belong to this at least one second physical blocks; Upgrading this logical page (LPAGE) changes physical page bitmap, this physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of this physical blocks, and this at least one first physical blocks of erasing.
19. controller system as claimed in claim 12; It is characterized in that; This page management module is more in order to judge among those physical blocks of written data, whether not having any effectively those physical page addresses at least one first physical blocks according to the invalid page address count table of this physical blocks
Wherein when not having effectively those physical page addresses in this at least one first physical blocks, this page management module is more in order to erase this at least one first physical blocks and upgrade the invalid page address count table of this physical blocks.
20. controller system as claimed in claim 11 is characterized in that, comprises that more one can write the physical page pointer, in order to next writeable those physical page addresses of mark.
21. a flash memory system comprises:
A plurality of physical page address, wherein those physical page addresses belong to a plurality of physical blocks;
A connector is in order to connect a host computer system;
One logical page (LPAGE) changes the physical page bitmap, in order to write down those physical page addresses of those logical page address institute mappings;
One physical page is changeed the logical page (LPAGE) bitmap, in order to write down those logical page addresses of those physical page address institute mappings; And
One flash controller is electrically connected to those physical page addresses and this connector, and desires to write logical page address in order to desire to write data and from this host computer system reception one,
Wherein this flash controller more desires to write data in a physical page address in order to write this; And change at this logical page (LPAGE) and to upgrade this in physical page bitmap to desire to write logical page address be the physical page address that mapping writes these data; And this physical page change upgrade in logical page (LPAGE) bitmap write this physical page address of desiring to write data be mapping this desire to write logical page address
Wherein this logical page (LPAGE) commentaries on classics physical page bitmap of this flash controller comparison and this physical page commentaries on classics logical page (LPAGE) bitmap are judged invalid those physical page addresses and effective those physical page addresses among those physical page addresses of written data.
22. flash memory system as claimed in claim 21 is characterized in that, more comprises the invalid page address count table of a physical blocks, in order to writing down the number of those invalid in each those physical blocks physical page addresses,
Wherein this flash controller is more in order to be updated in the number that this desires to write those invalid in the physical page address of the original mapping of logical page address physical page addresses in the invalid page address count table of this physical blocks.
23. flash memory system as claimed in claim 21 is characterized in that, more comprises a physical blocks active page address count table, in order to writing down in each those physical blocks the effectively number of those physical page addresses,
Wherein this flash controller is more in order to be updated in this physical page address of desiring to write the original mapping of logical page address the effectively number of those physical page addresses in this physical blocks active page address count table.
24. flash memory system as claimed in claim 22 is characterized in that, whether this flash controller more is less than a no datat physical blocks in order to the number of judging those physical blocks that do not write data is counted threshold value,
Wherein when the number of those physical blocks that do not write data is less than this no datat physical blocks and counts threshold value; This flash controller is more in order to select at least one first physical blocks according to the invalid page address count table of this physical blocks among those physical blocks of written data; Never select at least one second physical blocks among writing those physical blocks of data; Data in effective those physical page addresses in this at least one first physical blocks are copied in those physical page addresses that belong to this at least one second physical blocks; Upgrading this logical page (LPAGE) changes physical page bitmap, this physical page commentaries on classics logical page (LPAGE) bitmap and the invalid page address count table of this physical blocks, and this at least one first physical blocks of erasing.
25. flash memory system as claimed in claim 21; It is characterized in that; This flash controller is through among those physical page addresses, selecting one to wait to judge the physical page address; This waits to judge the logical page address of physical page address mapping to change the inquiry of logical page (LPAGE) bitmap according to this physical page; Change the physical page address of the logical page address mapping of physical page bitmap inquiry institute mapping according to this logical page (LPAGE), and judge whether the physical page address of being inquired about is same as this and waits to judge that the physical page address judges those invalid physical page addresses and effective those physical page addresses
If the physical page address of wherein being inquired about is same as this and waits to judge the physical page address, then this waits to judge the physical page address for effectively, and if the physical page address of being inquired about be different from this and wait to judge the physical page address, then this waits to judge that the physical page address is invalid.
CN2009100098723A 2009-01-23 2009-01-23 Access method of flash data, storage system and control system thereof Active CN101788955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100098723A CN101788955B (en) 2009-01-23 2009-01-23 Access method of flash data, storage system and control system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100098723A CN101788955B (en) 2009-01-23 2009-01-23 Access method of flash data, storage system and control system thereof

Publications (2)

Publication Number Publication Date
CN101788955A CN101788955A (en) 2010-07-28
CN101788955B true CN101788955B (en) 2012-05-02

Family

ID=42532175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100098723A Active CN101788955B (en) 2009-01-23 2009-01-23 Access method of flash data, storage system and control system thereof

Country Status (1)

Country Link
CN (1) CN101788955B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375779B (en) * 2010-08-16 2015-08-19 深圳市朗科科技股份有限公司 A kind of data processing method and data processing module
WO2012049711A1 (en) * 2010-10-14 2012-04-19 Hitachi, Ltd. Data migration system and data migration method
CN102779551B (en) * 2011-05-10 2015-01-07 群联电子股份有限公司 Data writing method, storage controller and memory storage device
CN103226516A (en) * 2012-01-31 2013-07-31 上海华虹集成电路有限责任公司 Method for sequencing physical blocks of NandFlash according to number of invalid pages
CN105183660B (en) * 2012-03-23 2018-07-13 群联电子股份有限公司 Method for reading data, Memory Controller and storage device
TWI448891B (en) * 2012-09-06 2014-08-11 Silicon Motion Inc Data storage device and flash memory control method
US9244833B2 (en) 2012-05-30 2016-01-26 Silicon Motion, Inc. Data-storage device and flash memory control method
CN104424110B (en) * 2013-09-10 2017-11-14 Lsi公司 The active recovery of solid-state drive
KR102225618B1 (en) * 2014-09-30 2021-03-12 한화테크윈 주식회사 Space-Efficient Recovery of Time-Related Metadata Of Recorded Data From Failure Scenarios
CN106326134B (en) * 2015-06-30 2019-10-01 华为技术有限公司 The method and device of FTL address of cache
CN107632943B (en) * 2017-08-30 2020-09-11 记忆科技(深圳)有限公司 Solid state disk data protection method and solid state disk
CN110633224A (en) * 2018-06-01 2019-12-31 深圳大心电子科技有限公司 Logic-to-entity table updating method and storage controller
CN112286721A (en) * 2019-07-23 2021-01-29 慧荣科技股份有限公司 Instantaneous power failure recovery processing method, computer readable storage medium and device
CN112764670A (en) * 2019-11-04 2021-05-07 深圳宏芯宇电子股份有限公司 Flash memory device and flash memory management method
CN113223584A (en) * 2021-05-26 2021-08-06 合肥康芯威存储技术有限公司 Memory and data reading method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101176074A (en) * 2005-12-09 2008-05-07 松下电器产业株式会社 Nonvolatile memory device, method of writing data, and method of reading out data
CN101187898A (en) * 2006-11-20 2008-05-28 三星电子株式会社 Apparatus and method of managing nonvolatile memory
CN101329656A (en) * 2008-05-06 2008-12-24 无锡紫芯集成电路系统有限公司 Management method of Nand-Flash memory system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101176074A (en) * 2005-12-09 2008-05-07 松下电器产业株式会社 Nonvolatile memory device, method of writing data, and method of reading out data
CN101187898A (en) * 2006-11-20 2008-05-28 三星电子株式会社 Apparatus and method of managing nonvolatile memory
CN101329656A (en) * 2008-05-06 2008-12-24 无锡紫芯集成电路系统有限公司 Management method of Nand-Flash memory system

Also Published As

Publication number Publication date
CN101788955A (en) 2010-07-28

Similar Documents

Publication Publication Date Title
CN101788955B (en) Access method of flash data, storage system and control system thereof
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN100487632C (en) Dual media storage device
CN101169760B (en) Electronic hard disk storage room management method
US8234466B2 (en) Flash memory storage system applying SLC NAND flash memory and MLC NAND flash memory and data writing method thereof
US8131911B2 (en) Data writing method, and flash storage system and controller using the same
CN101571832B (en) Data writing method, quick flashing memory system using same and a controller thereof
US20100042774A1 (en) Block management method for flash memory, and storage system and controller using the same
CN101640069B (en) Average wear method and average wear system for flash memory
CN101556555B (en) Block managing method for flash memory as well as controller and storage system thereof
CN107590080B (en) Mapping table updating method, memory control circuit unit and memory storage device
US8074128B2 (en) Block management and replacement method, flash memory storage system and controller using the same
CN101661431B (en) Block management method for flash memory, flash storage system and controller
CN101957797A (en) Logic block management method for flash memory as well as control circuit and storage system thereof
CN101630233A (en) Data access method used for flash memory, storage system and controller
CN101727397B (en) Block management and change method, flash memory storage system and controller thereof
CN102866861B (en) Flash memory system, flash controller and method for writing data
CN102200946B (en) Data access method, memory controller and storage system
CN102800357A (en) Program code loading and accessing methods, memory controller and storage device of memory
CN102591738B (en) Data managing method, Memory Controller and in-line memory storage device
CN102467459B (en) Data write method, memory controller and memory device
CN101957799B (en) Data writing method used for flash memory, control circuit and storage system thereof
CN102650971A (en) Memory managing method, memory controller and memory storing device
CN110442300B (en) Sorting instruction recording method, memory control circuit unit and memory device
CN102043588B (en) Data reading method, flash memory controller and flash memory storage system

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