CN101944065A - Flash memory bad block shielding method based on section - Google Patents

Flash memory bad block shielding method based on section Download PDF

Info

Publication number
CN101944065A
CN101944065A CN 201010260306 CN201010260306A CN101944065A CN 101944065 A CN101944065 A CN 101944065A CN 201010260306 CN201010260306 CN 201010260306 CN 201010260306 A CN201010260306 A CN 201010260306A CN 101944065 A CN101944065 A CN 101944065A
Authority
CN
China
Prior art keywords
sector
physical
page
physical block
block
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.)
Granted
Application number
CN 201010260306
Other languages
Chinese (zh)
Other versions
CN101944065B (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.)
CCore Technology Suzhou Co Ltd
Original Assignee
CCore Technology Suzhou Co Ltd
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 CCore Technology Suzhou Co Ltd filed Critical CCore Technology Suzhou Co Ltd
Priority to CN 201010260306 priority Critical patent/CN101944065B/en
Publication of CN101944065A publication Critical patent/CN101944065A/en
Application granted granted Critical
Publication of CN101944065B publication Critical patent/CN101944065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a flash memory bad block shielding method based on a section, comprising the following steps: scanning each physical block of a flash memory to obtain the corresponding section state of each physical page in each physical block; determining the section mode of the physical block, wherein the section mode represents the distribution situation and the number of practical effective sections; dividing the physical blocks with the same section mode in the same group; obtaining the virtual block number, the physical page number and the page virtual section offset of the grouping by the offset; according to the virtual block number of the grouping and a physical block numbering table, obtaining the physical block number accessed by an application layer; and according to the page virtual section offset and section mode of the physical block number, obtaining a page physical section offset corresponding to the page virtual section offset. The invention maps the physical layer existing in a bad section into a continuous linear storage medium so as to furthest expand the effective volume of the storage medium.

Description

A kind of flash memory bad block screen method based on the sector
Technical field
The present invention relates to a kind of flash memory bad block screen method based on the sector.
Background technology
Flash memory Flash is as a kind of storage medium, because its high cost performance is widely used in field of storage.Because the problem of production technology, Flash supplier can't guarantee that the chip that dispatches from the factory does not have defective, and this just needs the user to discern defective memory block voluntarily in application process, and makes corresponding processing.Because but high capacity Flash is to be minimum erase unit (entire flash is made up of several pieces, and each piece is made up of several pages or leaves, and each page or leaf is made up of several bytes) with the piece, so also be to handle generally by piece to defective memory block.
But there is defective in this management method.As long as it is bad in the piece page or leaf being arranged, this piece is just handled as bad piece.In Flash bad piece more for a long time, capacity will obviously descend.Therefore how to make full use of the good page or leaf space in the storage medium, become the direction that those skilled in the art make great efforts.
Summary of the invention
The object of the invention provides a kind of flash memory bad block screen method based on the sector, and this method handle exists the Physical layer of bad sector to be mapped to continuous linear storage medium, thereby enlarges the storage medium useful capacity to greatest extent.
For achieving the above object, the technical solution used in the present invention is:
A kind of flash memory bad block screen method based on the sector may further comprise the steps:
Step 1, each physical block of scanning flash memory, obtain the corresponding sector of each Physical Page state in each physical block, this sector state table is shown distribution and the number of effective sector in this Physical Page in the Physical Page, this physical block is made up of at least one Physical Page, each Physical Page is made up of a sector at least, and sevtor address is determined by physical page number and physical sector number in the physical block;
Each Physical Page sector state is determined the sector pattern of this physical block in step 2, the comprehensive physical block, the sector pattern determines that mode is: physical sector number is identical and have at least the row of an invalid sector to be set to invalid row, identical and the whole sectors of physical sector number are that the row of effective sector are set to effective row, determine the sector pattern of this physical block then according to invalid row and effective column distribution, this sector modal representation actual effectively distribution situation and the number of sector;
Step 3, described flash memory are divided at least one group, and the physical block that the sector pattern is identical divides at same group, obtains the physical block number table;
Step 4, obtain capacities chart of described each grouping according to physical block number in described group and corresponding sector pattern, this group capacity table is represented the actual useful capacity of each group;
Step 5, determine sector number place packet number and this grouping bias internal amount of application layer visit according to described group capacity table;
Step 6, according to the sector pattern of described grouping, obtain virtual sectors side-play amount in the dummy block will number, physical page number, page or leaf of this grouping by described side-play amount;
Step 7, obtain the physical block number of application layer visit, according to virtual sectors side-play amount in the described page or leaf and obtain physical sector side-play amount in the page or leaf of virtual sectors side-play amount correspondence in the described page or leaf in conjunction with the sector pattern of this physical block number according to the dummy block will of described grouping number and in conjunction with the physical block number table;
Step 8, application layer are visited by described physical block number according to the mapping of step 4 to six, the sector that the physical sector side-play amount is located in physical page number and the page or leaf.
Related content in the technique scheme is explained as follows:
1, in the such scheme, described packet number is the grouping at the sector number place of described application layer visit, and described side-play amount is the skew number in this grouping.
2, in the such scheme, described dummy block will account form is: described side-play amount divides exactly effective number of sectors of this subregion physical block; Described physical page number account form is: described side-play amount to effective number of sectors of this subregion physical block get surplus after, divide exactly effective number of sectors of Physical Page again; The virtual sectors side-play amount is that described skew is got surplus to effective number of sectors of Physical Page in the described page or leaf.
3, in the such scheme, described invalid sector represents with a bit 0: described effective sector is represented with a bit 1.
4, in the such scheme, the capacity of described each grouping is: the physical block number of grouping multiply by effective number of sectors in this physical block.
Because the technique scheme utilization, the present invention compared with prior art has following advantage and effect:
The present invention is mapped to continuous linear storage medium to the Flash flash memory of lower floor's physical presence physics bad sector, enlarges the use capacity simultaneously to greatest extent.Upper application software can use linear address to remove to read and write the Flash flash memory pellucidly, and needn't be concerned about the bad sector on the Flash flash memory.
Description of drawings
Accompanying drawing 1 is the flash memory storage structural representation;
Accompanying drawing 2 is sector state table synoptic diagram of the present invention;
Accompanying drawing 3 is physical block number hoist pennants of the present invention;
Accompanying drawing 4 is sector of the present invention modal sets synoptic diagram;
Accompanying drawing 5 is group capacity hoist pennants of the present invention.
Embodiment
Below in conjunction with drawings and Examples the present invention is further described:
Embodiment: a kind of flash memory bad block screen method based on the sector may further comprise the steps:
Step 1, each physical block of scanning flash memory, obtain the corresponding sector of each Physical Page state in each physical block, this sector state table is shown distribution and the number of effective sector in this Physical Page in the Physical Page, this physical block is made up of at least one Physical Page, each Physical Page is made up of a sector at least, and sevtor address is determined by physical page number and physical sector number in the physical block;
Each Physical Page sector state is determined the sector pattern of this physical block in step 2, the comprehensive physical block, the sector pattern determines that mode is: be positioned at several identical physical sectors of different Physical Page and sector number as row in same, physical sector number is identical and have at least the row of an invalid sector to be set to invalid row, identical and the whole sectors of physical sector number are that the row of effective sector are set to effective row, determine the sector pattern of this physical block then according to invalid row and effective column distribution, this sector modal representation actual effectively distribution situation and the number of sector;
Step 3, described flash memory are divided at least one group, and the physical block that the sector pattern is identical divides at same group, obtains the physical block number table;
Step 4, obtain capacities chart of described each grouping according to physical block number in described group and corresponding sector pattern, this group capacity table is represented the actual useful capacity of each group;
Step 5, determine sector number place packet number and this grouping bias internal amount of application layer visit according to described group capacity table;
Step 6, according to the sector pattern of described grouping, obtain virtual sectors side-play amount in the dummy block will number, physical page number, page or leaf of this grouping by described side-play amount;
Step 7, according to the dummy block will of described grouping number and obtain the physical block number of application layer visit in conjunction with the physical block number table,, according to virtual sectors side-play amount in the described page or leaf and in conjunction with physical sector side-play amount in the page or leaf of virtual sectors side-play amount correspondence in the described page or leaf of sector pattern acquisition of this physical block number;
Step 8, application layer are visited by described physical block number according to the mapping of step 4 to six, the sector that the physical sector side-play amount is located in physical page number and the page or leaf.
Described packet number is the grouping at the sector number place of described application layer visit, and described side-play amount is the skew number in this grouping.
Described dummy block will account form is: described side-play amount divides exactly effective number of sectors of this subregion physical block; Described physical page number account form is: described side-play amount to effective number of sectors of this subregion physical block get surplus after, divide exactly effective number of sectors of Physical Page again; In the described page or leaf virtual sectors side-play amount be described side-play amount to effective number of sectors of physical block get surplus after, get surplus to effective number of sectors of Physical Page again.
Described invalid sector represents with a bit 0: described effective sector is represented with a bit 1.
The capacity of described each grouping is: the physical block number of grouping multiply by effective number of sectors in this physical block.
The concrete course of work of present embodiment foregoing is as follows.
As shown in Figure 1, a Flash flash memory has 8 physical blocks, and each physical block has 8 Physical Page, and each Physical Page has 4 physical sectors.Scan the physical sector state table that this Flash flash memory obtains all physical blocks, as shown in Figure 2.Per 1 bit is represented 1 physical sector, and each Physical Page state is represented by 4 bits, total 24=16 kind sector pattern.Representing all sectors of page or leaf as 0xF is good entirely, it is that sector 3 is bad that 0x7 represents the 4th physical sector of page or leaf, it is that sector 2 is bad that 0xB represents the 3rd physical sector of page or leaf, it is that sector 1 is bad that 0xD represents second physical sector of page or leaf, it is that sector 0 is bad that 0xE represents first physical sector of page or leaf, by that analogy.A physical block has 32 physical sectors, and just handy one 32 numerical table is shown with the distribution and the number state of imitating the sector.
Sector state table according to the Flash flash memory is divided into each group to physical block, as shown in Figure 3.It is 0 and 6 physical block that group 0 comprises physical block number; Group 1 comprises the physical block of physical block number 1,2 and 3; It is 4,5 and 6 physical block that group 2 comprises physical block number.Form sector modal sets table simultaneously, as shown in Figure 4.Group 0 sector pattern is 0xF, represents in this group all sectors of each physical block all available.Group 1 sector pattern is 0x7, and representing in this group each Physical Page of each physical block can only use first physical sector is that 0, the second physical sector in sector is that sector 1 and the 3rd physical sector are sector 2.Group 2 sector pattern is 0x6, and representing in this group each Physical Page of each physical block can only use second physical sector is that sector 1 and the 3rd physical sector are sector 2.Physical block number and sector mode computation according to each group go out useful capacity, form capacity group table, as shown in Figure 5.Group 0 is promptly good sectors, 64 effective sectors, and group 1 is promptly good sectors, 72 effective sectors, and group 2 is promptly good sectors, 48 effective sectors.
If use existing bad block management algorithm, this Flash has 256 sectors, and the available sector number is i.e. 64 sectors of 2 physical blocks.Yet use this clearly demarcated, the available sector number of this Flash reaches 184, is more than 2 times of general bad block management algorithm.
When wanting application layer to read the content of sector number 95, at first determine that according to the group capacity table corresponding group number is 1, group bias internal amount: 95-64=31; Because the sector pattern of group 1 is 0x7, so each physical block has promptly good sector, 24 effective sectors, each Physical Page has promptly good sector, 3 effective sectors, dummy block will number: 31/24=1, physical page number: (31%24)/3=2, the virtual sectors skew is (31%24) %3=1 in the page or leaf; Search the physical block number table of group 1, obtain this group dummy block will number 1 corresponding physical block number 2; Because the sector state table of physical block number 2 is 0x7, so the interior physical deflection 1 of the page or leaf of virtual shift 1 correspondence in the page or leaf.Second physical sector of the physical page number 2 that so just to obtain No. 95 sector physical address corresponding of sector number are physical block numbers 2 is sector 1, and second physical sector that reads this Physical Page is the content that sector 1 just obtains the sector number 95 of application layer visit.
The foregoing description only is explanation technical conceive of the present invention and characteristics, and its purpose is to allow the personage who is familiar with this technology can understand content of the present invention and enforcement according to this, can not limit protection scope of the present invention with this.All equivalences that spirit is done according to the present invention change or modify, and all should be encompassed within protection scope of the present invention.

Claims (5)

1. flash memory bad block screen method based on the sector is characterized in that: may further comprise the steps:
Step 1. each physical block of scanning flash memory, obtain the corresponding sector of each Physical Page state in each physical block, this sector state table is shown distribution and the number of effective sector in this Physical Page in the Physical Page, this physical block is made up of at least one Physical Page, each Physical Page is made up of a sector at least, and sevtor address is determined by physical page number and physical sector number in the physical block;
Step 2. each Physical Page sector state is determined the sector pattern of this physical block in the comprehensive physical block, the sector pattern determines that mode is: physical sector number is identical and have at least the row of an invalid sector to be set to invalid row, identical and the whole sectors of physical sector number are that the row of effective sector are set to effective row, determine the sector pattern of this physical block then according to invalid row and effective column distribution, this sector modal representation actual effectively distribution situation and the number of sector;
Step 3. described flash memory is divided at least one group, and the physical block that the sector pattern is identical divides at same group, obtains the physical block number table;
Step 4. obtain capacities chart of described each grouping according to physical block number in described group and corresponding sector pattern, this group capacity table is represented the actual useful capacity of each group;
Step 5. determine sector number place packet number and this grouping bias internal amount of application layer visit according to described group capacity table;
Step 6. according to the sector pattern of described grouping, obtain virtual sectors side-play amount in the dummy block will number, physical page number, page or leaf of this grouping by described side-play amount;
Step 7. obtain the physical block number of application layer visit according to the dummy block will of described grouping number and in conjunction with the physical block number table, according to virtual sectors side-play amount in the described page or leaf and obtain physical sector side-play amount in the page or leaf of virtual sectors side-play amount correspondence in the described page or leaf in conjunction with the sector pattern of this physical block number;
Step 8. application layer is visited by described physical block number according to the mapping of step 4 to six, the sector that the physical sector side-play amount is located in physical page number and the page or leaf.
2. method according to claim 1 is characterized in that: described packet number is the grouping at the sector number place of described application layer visit, and described side-play amount is the skew number in this grouping.
3. method according to claim 1 is characterized in that: described dummy block will account form is: described side-play amount divides exactly effective number of sectors of this subregion physical block; Described physical page number account form is: described side-play amount to effective number of sectors of this subregion physical block get surplus after, divide exactly effective number of sectors of Physical Page again; The virtual sectors side-play amount is that described skew is got surplus to effective number of sectors of Physical Page in the described page or leaf.
4. method according to claim 1 is characterized in that: described invalid sector represents with a bit 0: described effective sector is represented with a bit 1.
5. method according to claim 1 is characterized in that: the capacity of described each grouping is: the physical block number of grouping multiply by effective number of sectors in this physical block.
CN 201010260306 2010-08-24 2010-08-24 Flash memory bad block shielding method based on section Active CN101944065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010260306 CN101944065B (en) 2010-08-24 2010-08-24 Flash memory bad block shielding method based on section

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010260306 CN101944065B (en) 2010-08-24 2010-08-24 Flash memory bad block shielding method based on section

Publications (2)

Publication Number Publication Date
CN101944065A true CN101944065A (en) 2011-01-12
CN101944065B CN101944065B (en) 2012-07-04

Family

ID=43436062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010260306 Active CN101944065B (en) 2010-08-24 2010-08-24 Flash memory bad block shielding method based on section

Country Status (1)

Country Link
CN (1) CN101944065B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102623052A (en) * 2011-01-30 2012-08-01 群联电子股份有限公司 Data writing method for a non-volatile memory module, memory controller and memory storage apparatus
CN104252883A (en) * 2013-06-26 2014-12-31 深圳市江波龙电子有限公司 Flash memory management method and system
CN105718328A (en) * 2016-01-12 2016-06-29 珠海煌荣集成电路科技有限公司 Data backup method and system for memory bad block
CN105808445A (en) * 2016-03-08 2016-07-27 上海华虹宏力半导体制造有限公司 Embedded flash memory and sector processing method and device thereof
CN107783723A (en) * 2016-08-29 2018-03-09 深圳市中兴微电子技术有限公司 A kind of memory block treating method and apparatus
CN114415970A (en) * 2022-03-25 2022-04-29 北京金山云网络技术有限公司 Disk fault processing method and device for distributed storage system and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991788A (en) * 2005-12-30 2007-07-04 深圳市桑达实业股份有限公司 Method for treating broken block when using flash memory in tax-controlled cashing machine
CN101075211A (en) * 2007-06-08 2007-11-21 马彩艳 Flash memory management based on sector access
CN101339537A (en) * 2008-08-14 2009-01-07 四川登巅微电子有限公司 NAND flash memory management process using page as unit
CN101364166A (en) * 2008-09-23 2009-02-11 杭州华三通信技术有限公司 Method and device for simulating Nand flash of 2048 byte page into hard disk
US20100082883A1 (en) * 2008-10-01 2010-04-01 Ming-Dar Chen Hybrid density memory system and control method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991788A (en) * 2005-12-30 2007-07-04 深圳市桑达实业股份有限公司 Method for treating broken block when using flash memory in tax-controlled cashing machine
CN101075211A (en) * 2007-06-08 2007-11-21 马彩艳 Flash memory management based on sector access
CN101339537A (en) * 2008-08-14 2009-01-07 四川登巅微电子有限公司 NAND flash memory management process using page as unit
CN101364166A (en) * 2008-09-23 2009-02-11 杭州华三通信技术有限公司 Method and device for simulating Nand flash of 2048 byte page into hard disk
US20100082883A1 (en) * 2008-10-01 2010-04-01 Ming-Dar Chen Hybrid density memory system and control method thereof

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102623052A (en) * 2011-01-30 2012-08-01 群联电子股份有限公司 Data writing method for a non-volatile memory module, memory controller and memory storage apparatus
CN104252883A (en) * 2013-06-26 2014-12-31 深圳市江波龙电子有限公司 Flash memory management method and system
CN104252883B (en) * 2013-06-26 2017-06-13 深圳市江波龙电子有限公司 Flash memory management method and system
CN105718328A (en) * 2016-01-12 2016-06-29 珠海煌荣集成电路科技有限公司 Data backup method and system for memory bad block
CN105718328B (en) * 2016-01-12 2017-10-27 珠海煌荣集成电路科技有限公司 The data back up method and system of memory bad block
CN105808445A (en) * 2016-03-08 2016-07-27 上海华虹宏力半导体制造有限公司 Embedded flash memory and sector processing method and device thereof
CN107783723A (en) * 2016-08-29 2018-03-09 深圳市中兴微电子技术有限公司 A kind of memory block treating method and apparatus
CN114415970A (en) * 2022-03-25 2022-04-29 北京金山云网络技术有限公司 Disk fault processing method and device for distributed storage system and server

Also Published As

Publication number Publication date
CN101944065B (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN109408657B (en) Method and system for rapidly drawing super-large-scale spatial data
CN101944065B (en) Flash memory bad block shielding method based on section
CN105183764B (en) A kind of data paging method and device
US20130238835A1 (en) Burning system and method
EP1589488A3 (en) Method, computer program product and data structure for representing two- or three-dimensional object
CN103473160B (en) Testing device, CPU (central processing unit) chip and testing method for cache
CN109144886A (en) Data storage device
CN102929795A (en) NandFlash bad block management method
CN103377222A (en) Map tile generating method and device
CN102591787B (en) The data processing method of JAVA card and device
CN109118586B (en) Data processing method and device of logic map, electronic equipment and storage medium
CN104714894A (en) Layered phase-change memory abrasion equilibrating method and system based on random mapping
CN102023843A (en) Function calling method and device as well as smart card
CN103714010B (en) Storage device write-in method and storage device
CN103150273A (en) Bit-level memory controller and method thereof
CN106547701A (en) Memory device and data reading method
CN104516826B (en) The corresponding method and device of a kind of virtual big page and the big page of physics
CN109634960B (en) Key value data storage method, device, equipment and storage medium
CN106775919A (en) Status information control method and device
JP2006244480A5 (en)
CN105512047A (en) Method and device for write operation and erasure operation of Flash memory
CN104268337A (en) Method and system for generating path of simulation support platform image connecting line
US8307189B2 (en) Information processing apparatus and semiconductor storage device
CN111341374B (en) Memory test method and device and readable memory
JP2009086738A (en) Memory controller, flash memory system equipped with memory controller and method for controlling flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 215011 Zhuyuan Road 209, Suzhou High-tech Zone, Jiangsu Province 2301, Building 3, Suzhou Pioneer Park

Patentee after: Suzhou Guoxin Technology Co., Ltd.

Address before: 215011 Zhuyuan Road 209, Suzhou High-tech Zone, Jiangsu Province 2301, Building 3, Suzhou Pioneer Park

Patentee before: C*Core Technology (Suzhou) Co., Ltd.