CN105224478B - A kind of formation of mapping table, update and restoration methods and electronic equipment - Google Patents

A kind of formation of mapping table, update and restoration methods and electronic equipment Download PDF

Info

Publication number
CN105224478B
CN105224478B CN201510623694.9A CN201510623694A CN105224478B CN 105224478 B CN105224478 B CN 105224478B CN 201510623694 A CN201510623694 A CN 201510623694A CN 105224478 B CN105224478 B CN 105224478B
Authority
CN
China
Prior art keywords
mapping table
level
block
unit
physical address
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
CN201510623694.9A
Other languages
Chinese (zh)
Other versions
CN105224478A (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.)
Shenzhen Union Memory Information System Co Ltd
Original Assignee
Beijing Legend Core Technology 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 Beijing Legend Core Technology Co Ltd filed Critical Beijing Legend Core Technology Co Ltd
Priority to CN201510623694.9A priority Critical patent/CN105224478B/en
Priority to US14/978,816 priority patent/US10552335B2/en
Publication of CN105224478A publication Critical patent/CN105224478A/en
Application granted granted Critical
Publication of CN105224478B publication Critical patent/CN105224478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages

Abstract

The invention discloses a kind of formation of mapping table, update and restoration methods and electronic equipments, wherein, the mapping table includes level-one mapping table and second level mapping table, the forming method includes: that the Physical Page that all logical page (LPAGE)s on host are mapped as to NAND on solid-state memory is mapped using page grade, forms second level mapping table;Obtain the first physical address, first physical address is that first physical address and corresponding first identifier information are formed mapping relations in the map unit in level-one mapping table by the physical storage address of the first block in the second level mapping table, wherein the first identifier information is the identification information of the first block.

Description

A kind of formation of mapping table, update and restoration methods and electronic equipment
Technical field
The present invention relates to electronic technology more particularly to a kind of formation of mapping table, update and restoration methods and electronic equipments.
Background technique
The performance of solid-state memory (SSD, Solid-State Memory) is apparently higher than traditional magnetic disk storage, close several Nian Lai is had increasingly been used in personal computer (PC) and notebook due to the decline of solid-state memory cost.
The storage medium of solid-state memory itself is usually nand flash memory (flash), and metadata mainly includes hard disk note Essential information of record, such as logical-physical mapping table, other hard disk management information etc.;After solid-state memory powers on, first from Metadata about load is to RAM in nand flash memory;During the work time, metadata can be related to simultaneously to the data read-write operation of hard disk The change of (especially mapping table), in view of rate request, what these changes directly operated on RAM, it is therefore desirable to it is in due course general These metadata updates are to NAND flash, and otherwise, once there is abnormal power-down, metadata is inconsistent with data, may cause SSD can not work normally after re-powering.
There are no provide one kind to recover automatically the scheme of metadata in abnormal power-down in the prior art.
Summary of the invention
In view of this, the embodiment of the present invention be solve the problems, such as it is existing in the prior art at least one and a kind of mapping is provided Formation, update and the restoration methods and electronic equipment of table can be to recover metadata automatically in abnormal power-down, to promote number According to safety.
The technical solution of the embodiment of the present invention is achieved in that
In a first aspect, the embodiment of the present invention provides a kind of forming method of mapping table, the mapping table includes level-one mapping Table and second level mapping table, which comprises
The Physical Page that all logical page (LPAGE)s on host are mapped as to NAND on solid-state memory, shape are mapped using page grade At second level mapping table;
The first physical address is obtained, first physical address is the physical store of the first block in the second level mapping table Address,
First physical address and corresponding first identifier information are formed in the map unit in level-one mapping table Mapping relations, wherein the first identifier information is the identification information of the first block.
Second aspect, the embodiment of the present invention provide a kind of update method of mapping table, which comprises
Obtain the parameter for updating mapping table;
Judge whether the parameter meets preset condition;
When meeting the preset condition, by the map information in the second level mapping table from the random of solid-state memory On memory updating to the NAND;
The second physical address and corresponding second identifier information are obtained, second physical address is updated described The physical storage address of the upper map information as unit of block of NAND;
Second physical address is updated to the level-one mapping table according to the second identifier information.
The third aspect, the embodiment of the present invention provide a kind of restoration methods of mapping table, when the second level mapping table damage and When the level-one mapping table is complete, second level mapping table is restored according to level-one mapping table, is specifically included:
Third physical address is obtained from the level-one mapping table, the third physical address is in the level-one mapping table The physical address stored in one map unit, the third physical address are the physical address of third block;
The second level map information of third block is obtained according to the third physical address;
Third identification information is obtained from the level-one mapping table, the third identification information is corresponding to third physical address The identification information of block;
The 4th identification information is obtained from the second level map information of the third block according to third physical address;
Judge whether the third identification information with the 4th identification information indicates same block;
When being, the second level map information of the third block is read into solid-state storage from the NAND of solid-state memory In the random access memory of device.
Fourth aspect, the embodiment of the present invention provide a kind of restoration methods of mapping table, when second level mapping table has been updated It finishes, and when level-one mapping table is not updated, the level-one mapping table is restored according to the updated second level mapping table, specifically Include:
The physical address of corresponding block is obtained according to the identification information of block in the level-one mapping table;
When the number of the physical address of the block is equal to 1, level-one mapping table is written into the physical address of the block In corresponding block identification information in map unit in;
When the number of the physical address of the block is greater than 1, the time corresponding to the physical address of each block is obtained Stab information;
By the identification information of corresponding block in the physical address write-in level-one mapping table of the nearest block of timestamp information In interior map unit.
5th aspect, the embodiment of the present invention provide a kind of electronic equipment, and the mapping table includes level-one mapping table and second level Mapping table, the electronic equipment include the first formation unit, first acquisition unit and the second formation unit, in which:
Described first forms unit, deposits for all logical page (LPAGE)s on host to be mapped as solid-state using the mapping of page grade The Physical Page of NAND on reservoir forms second level mapping table;
The first acquisition unit, for obtaining the first physical address, first physical address is second level mapping The physical storage address of first block in table,
Described second forms unit, for mapping first physical address and corresponding first identifier information in level-one Mapping relations are formed in map unit in table, wherein the first identifier information is the identification information of the first block.
6th aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes second acquisition unit, the One judging unit, the first updating unit, third acquiring unit and the second updating unit, in which:
The second acquisition unit, for obtaining the parameter for updating mapping table;
First judging unit, for judging whether the parameter meets preset condition;
First updating unit, for when meeting the preset condition, by the mapping in the second level mapping table Information is updated from the random access memory of solid-state memory onto the NAND;
The third acquiring unit, for obtaining the second physical address and corresponding second identifier information, second object Manage the physical storage address that address is the map information on the updated NAND as unit of block;
Second updating unit, for being updated second physical address to described according to the second identifier information Level-one mapping table.
7th aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes the 5th acquiring unit, the Six acquiring units, the first reading unit, the 7th acquiring unit, the 8th acquiring unit, third judging unit and the second reading unit, Wherein:
5th acquiring unit, for obtaining third physical address, the third physics from the level-one mapping table Address is by the physical address that stores in a map unit in the level-one mapping table;
6th acquiring unit, for obtaining second level map information according to the third physical address;
First reading unit, it is solid for reading the second level map information from the NAND of solid-state memory In the random access memory of state memory;
7th acquiring unit, for obtaining third identification information, the third mark letter from the level-one mapping table Breath is the identification information of block corresponding to third physical address;
8th acquiring unit, for obtaining the 4th mark from the second level map information according to third physical address Know information;
The third judging unit, for judging whether the third identification information is same with the 4th identification information expression One block;When being, second reading unit is triggered;
Second reading unit, it is solid for reading the second level map information from the NAND of solid-state memory In the random access memory of state memory.
Eighth aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes the 9th acquiring unit, the One writing unit, the tenth acquiring unit and the second writing unit, in which:
9th acquiring unit, for obtaining corresponding block according to the identification information of block in the level-one mapping table Physical address;
First writing unit, for when the number of the physical address of the block be equal to 1 when, by the object of the block It manages in the map unit in address write-in level-one mapping table in the identification information of corresponding block;
Tenth acquiring unit, for obtaining each block when the number of the physical address of the block is greater than 1 Timestamp information corresponding to physical address;
Second writing unit, in the physical address write-in level-one mapping table by the nearest block of timestamp information In map unit in the identification information of corresponding block.
9th aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes solid-state memory SSD, The solid-state memory includes NAND and SSD controller, wherein
All logical page (LPAGE)s on host are mapped as solid-state storage for mapping using page grade by the SSD controller The Physical Page of NAND on device forms second level mapping table;The first physical address is obtained, first physical address is that the second level is reflected The physical storage address of first block in firing table maps first physical address and corresponding first identifier information in level-one Mapping relations are formed in map unit in table, wherein the first identifier information is the identification information of the first block.
Tenth aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes solid-state memory SSD, The solid-state memory includes NAND and SSD controller, wherein
The SSD controller, for obtaining the parameter for updating mapping table;Judge whether the parameter meets preset item Part;When meeting the preset condition, by the map information in the second level mapping table from the random storage of solid-state memory Device is updated onto the NAND;The second physical address and corresponding second identifier information are obtained, second physical address is more The physical storage address of map information on the NAND after new as unit of block;According to the second identifier information by institute The second physical address is stated to update to the level-one mapping table.
Tenth on the one hand, and the embodiment of the present invention provides a kind of electronic equipment, and the electronic equipment includes solid-state memory SSD, the solid-state memory include NAND and SSD controller, wherein
The SSD controller, for obtaining third physical address, the third physical address from the level-one mapping table By the physical address stored in a map unit in the level-one mapping table, the third physical address is third block Physical address;The second level map information of third block is obtained according to the third physical address;It is obtained from the level-one mapping table Third identification information is taken, the third identification information is the identification information of block corresponding to third physical address;According to third object Reason address obtains the 4th identification information from the second level map information of the third block;Judging the third identification information is It is no to indicate same block with the 4th identification information;When being, the second level map information of the third block is deposited from solid-state It is read in the random access memory of solid-state memory on the NAND of reservoir.
12nd aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes solid-state memory SSD, the solid-state memory include NAND and SSD controller, wherein
The SSD controller, for obtaining corresponding block according to the identification information of block in the level-one mapping table Physical address;When the number of the physical address of the block is equal to 1, level-one mapping table is written into the physical address of the block In corresponding block identification information in map unit in;When the number of the physical address of the block is greater than 1, obtain each Timestamp information corresponding to the physical address of a block;The physical address write-in level-one of the nearest block of timestamp information is reflected In map unit in firing table in the identification information of corresponding block.
Formation, update and the restoration methods and electronic equipment of mapping table provided in an embodiment of the present invention, wherein use page grade All logical page (LPAGE)s on host are mapped as the Physical Page of NAND on solid-state memory by mapping, form second level mapping table;It obtains The first physical address is taken, first physical address is that the physical storage address of the first block in the second level mapping table will be described First physical address and corresponding first identifier information form mapping relations in the map unit in level-one mapping table, wherein institute State the identification information that first identifier information is the first block;So, it is possible be in abnormal power-down recover metadata automatically, thus Promote the safety of data.
Detailed description of the invention
Fig. 1 is the implementation process schematic diagram of the forming method of one mapping table of the embodiment of the present invention;
Fig. 2 is the implementation process schematic diagram of the update method of three mapping table of the embodiment of the present invention;
Fig. 3-1 is the implementation process schematic diagram of the restoration methods of four mapping table of the embodiment of the present invention;
Fig. 3-2 is the correspondence diagram in the embodiment of the present invention four between level-one mapping table and second level mapping table;
Fig. 4 is six electronic equipment composed structure schematic diagram of the embodiment of the present invention;
Fig. 5 is seven electronic equipment composed structure schematic diagram of the embodiment of the present invention;
Fig. 6 is the composed structure schematic diagram of solid-state memory in the embodiment of the present invention.
Specific embodiment
Only one page of grade mapping table of SSD in the prior art is first introduced in SSD before lobby page grade mapping table Basic conception:
1) physical block and Physical Page
Because the institutional framework of nand flash memory cell limits, it is impossible for individually reading and writing a flash cell.NAND dodges Memory cell is to carry out tissue with physical block.The minimum unit that can be read and write in physical block is known as Physical Page.Physical Page cannot be independent Erasing, can only monolith erasing.The physical page size of nand flash memory may be it is different, the physical page size of most hard disks is 2KB, 4KB, 8KB or 16KB.The block of most of SSD has 128 or 256 Physical Page, this indicates that the size of physical block is also likely to be Different value between 256KB and 4MB.Such as the physics block size of 840 EVO of Samsung SSD is 2048KB, and each physics Block has the Physical Page of 256 8KB.
Reading and writing is aligned with physical page size;Primary reading is impossible less than the content of a Physical Page.Operation System can of course simply request a byte, but SSD can access entire Physical Page, force to read remote super required data.It will count When according to write-in SSD, the increment of write-in is also physical page size.Even if a therefore write operation affects only a word Section, entire Physical Page can all be written anyway.The behavior than required more data is written and is referred to as write-in amplification.
Physical Page cannot be replicated;In nand flash memory Physical Page only its " free time " when could be written.Work as number After change, the content of this Physical Page is copied into an internal register, and data update at this time and the data of new version store In the Physical Page of one " free time ", this is referred to as " read-modify-write " operation.Data not update on the spot, because of the object of " free time " The Physical Page for managing page and original storing data is not the same Physical Page.Once data are saved by hard disk, original Physical Page quilt Labeled as " stale (corrupt or stale) ", until it is wiped free of.
Erasing is aligned with physical block;Physical Page cannot be replicated, once and its become stale, allow its again the free time get off Unique method be to wipe them.But to single physical page carry out erasing be it is impossible, can only once wipe entire physics Block.From the user's point of view, there was only reading and write order when accessing data.Erasing order is then when SSD controller needs to recycle Stale Physical Page is come when obtaining free space, by its garbage reclamation process triggers.
The small write-in of cachingization;For maximize handling capacity, small data is written in RAM caching as far as possible, when caching is full After execute a big write-in merging all small write-ins.
2) wear leveling;
Nand flash memory cell has P/E circulation limitation that it is caused to have life limitation because of it.There is a SSD, data are always same It is written on one physical block.This physical block will quickly reach the limitation of its P/E circulation, exhaust.And SSD controller well marks it to be Unavailable, the capacity of such hard disk will reduce.Therefore, a main target of SSD controller be realize wear leveling, be by P/E circulates between physical block mean allocation as far as possible.Ideally, all physical blocks can reach P/E circulation in the same time The upper limit simultaneously exhausts.In order to reach best global wear leveling, SSD controller needs the wise selection physical block to be written, And may need to move between several physical blocks, internal process will lead to the increase of write-in amplification.Therefore, physical block Management is to maximize the tradeoff between wear leveling and minimum words write-in amplification.
3) flash translation layer (FTL) (FTL)
Flash translation layer (FTL) is a component of SSD controller, its effect is for will be from host logically Location is mapped as the physical address on hard disk, and FTL is garbage reclamation there are one effect.
4) page grade maps
Logical page (LPAGE) (LBA) from hosting space is converted to the Physical Page in physics nand flash memory space by page grade mapping (PBA).For access speed, this page of grade mapping table is stored in the RAM of SSD, and is saved in a flash memory with power fail-safe. After SSD starting, this page of grade mapping table is rebuild from reading in flash memory and in the RAM of SSD.
Page grade mapping method provides great flexibility, however primary disadvantage is that mapping table needs a large amount of memory, This can increase production cost significantly.To prevent the workload of a large amount of small updates, no matter whether Physical Page is full, whole flash memories Physical block can all be written.
As described above, page grade mapping table in the prior art is very huge, during the work time, generally require all to add It carries, not only needs a large amount of memory in this way, but also error rate is relatively high.In order to solve aforementioned technical problem, the present invention is implemented Example first provides a kind of second level mapping table mechanism, and the second level mapping table mechanism using page grade mapping table above-mentioned as second level in addition to mapping Except table, a level-one mapping table is extracted also according to second level mapping table, each map unit in the level-one mapping table In be stored with mapping relations in second level mapping table between the physical address of each block and the identification information of the block.It is simple next It says, is exactly then to be divided using second level mapping table as data according to block, simultaneously using second level mapping table as a kind of data Identification information is put on to ready-portioned block, it is then that the identification information filling mapping of the physical address of block and corresponding block is single In member, then these map units just constitute level-one mapping table.
The technical solution of the present invention is further elaborated in the following with reference to the drawings and specific embodiments.
Embodiment one
The embodiment of the present invention provides a kind of forming method of mapping table, is applied to electronic equipment, the formation side of the mapping table The function that method is realized can realize that certain program code can by the SSD controller caller code in electronic equipment To be stored in computer storage medium, it is seen then that the electronic equipment includes at least SSD controller and storage medium.
Fig. 1 is the implementation process schematic diagram of the forming method of one mapping table of the embodiment of the present invention, as shown in Figure 1, this method Include:
Step S101 is mapped using page grade all logical page (LPAGE)s on host being mapped as NAND on solid-state memory Physical Page forms second level mapping table;
Here, the mapping table includes level-one mapping table and second level mapping table;The host refers to relative to solid-state storage Electronic equipment for device generally forms page grade mapping table using page grade mapping method, in the embodiment of the present invention in the prior art In, using this page of grade mapping table as the second level mapping table in the embodiment of the present invention in second level mapping mechanism.
Step S102, obtains the first physical address, and first physical address is the first block in the second level mapping table Physical storage address;
Here, it needs to divide the second level mapping table in step S101, the unit of division is block, i.e., according to block Second level mapping table is divided, the second level mapping table after being divided.During specific implementation, the block can be Physical Page perhaps physical block or be less than Physical Page.As long as the physical address for representing the block can be found.Described first Block is any one block in the second level mapping table after dividing, and in other words, first block is second level mapping Any one block when map information in table is stored as unit of block.
Step S103, by the mapping list of first physical address and corresponding first identifier information in level-one mapping table Mapping relations are formed in member, wherein the first identifier information is the identification information of the first block;
Here, for the second level mapping table after being divided according to block, to all blocks all allocation identification information, then will Physical address (i.e. the first physical address) and the mark of corresponding block of first block in the second level mapping table that step S102 is obtained Know information (first identifier information) to be mapped, to form mapping relations in every map unit of level-one mapping table.
In the embodiment of the present invention, the method also includes: step S111 will be used to indicate single in the second level mapping table The map information of position block is stored on NAND as a whole;
It is smaller to existing SSD improvement in this way using Physical Page as the block as preferred embodiment, existing Read and write in technology all is with physics page alignment.
In the embodiment of the present invention, the method also includes: step S112 deposits the level-one mapping table as a whole It is stored on NAND.In embodiments of the present invention due to level-one mapping table be extracted according to second level mapping table, so, level-one mapping The occupied space of table is very small, therefore during the loading process, level-one mapping table can be carried out as a whole read and It writes.
It should be noted that the embodiment of the present invention is also needed in the prior art as second level mapping in the embodiment of the present invention The page grade mapping table of table makes certain improvement, i.e., after being divided with block to second level mapping table, maps in the second level of each block In the map information of table, retain the identification information that a storage unit out is used to store the block, therefore, in the embodiment of the present invention Second level mapping table in the first block map information in further include first identifier information.
In the embodiment of the present invention, if the system normal shutdown of electronic equipment, when powering on next time, operating system can be first Level-one mapping table is loaded, the mode of second level mapping table is then loaded.
Embodiment two
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of forming method of mapping table, is applied to electronic equipment, The function that the forming method of the mapping table is realized can be by the SSD controller caller code in electronic equipment come real Existing, certain program code can be stored in computer storage medium, it is seen then that the electronic equipment include at least SSD controller and Storage medium.
This method comprises:
Step S201 is mapped using page grade all logical page (LPAGE)s on host being mapped as NAND on solid-state memory Physical Page forms second level mapping table;
Here, the mapping table includes level-one mapping table and second level mapping table;The host refers to relative to solid-state storage Electronic equipment for device generally forms page grade mapping table using page grade mapping method, in the embodiment of the present invention in the prior art In, using this page of grade mapping table as the second level mapping table in the embodiment of the present invention in second level mapping mechanism.
Step S202, obtains the first physical address, and first physical address is the first block in the second level mapping table Physical storage address;
Here, it needs to divide the second level mapping table in step S201, the unit of division is block, i.e., according to block Second level mapping table is divided, the second level mapping table after being divided.During specific implementation, the block can be Physical Page perhaps physical block or be less than Physical Page.As long as the physical address for representing the block can be found.Described first Block is any one block in the second level mapping table after dividing, and in other words, first block is second level mapping Any one block when map information in table is stored as unit of block.
Step S203, by the mapping list of first physical address and corresponding first identifier information in level-one mapping table Mapping relations are formed in member;
Here, the first identifier information is the identification information of the first block;
Step S204, the NAND timestamp that the map information flush of the first block of record enters the solid-state memory are believed The information such as breath and version flag;
Step S205 obtains the first identifier information of the first block from second level mapping mark;
Step S206 obtains the first map unit according to level-one mapping table described in the first identifier information searching;
The timestamp information and version stamp information are recorded in the first map unit by step S207.
It can be seen that in each of level-one mapping table map unit according to the method that above embodiments two provide and also wrap Include the timestamp information and version for entering the NAND of the solid-state memory for recording the map information flush as unit of block The information such as this label.It is further to note that equally recording the time for having the block in each block of second level mapping table Stab information and version information.
In the prior art, after SSD is powered on, loaded page grade mapping table is to RAM from nand flash memory;During the work time, The change of page grade mapping table can be related to simultaneously to the data read-write operation of hard disk, after when one section, in order to guarantee page in RAM The synchronism of grade mapping table and page grade mapping table on NAND, generally just synchronizes the page grade mapping table on NAND, works as synchronization After the completion, will timestamp information to the block and version information record, and by the timestamp information and version of block Information is documented in level-one mapping table, in this way to be retained in level-one mapping table.
Why the timestamp information and version information for having block all recorded in level-one mapping table and second level mapping table, The reason is that: in abnormal power-down, level-one mapping table can be restored according to the second level mapping table in flush to NAND, If necessary to restore the level-one mapping table of latest edition, version information and timestamp in second level mapping table can use (timestamp) information, then recover newest level-one mapping table.Below in an example, will be described in how basis Level-one mapping table restores second level mapping table, and how to restore level-one mapping table according to second level mapping table, in the mistake of recovery Cheng Zhong requires to use above-mentioned version information and timestamp information.
Embodiment three
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of update method of mapping table, is applied to electronic equipment, The function that the forming method of the mapping table is realized can be by the SSD controller caller code in electronic equipment come real Existing, certain program code can be stored in computer storage medium, it is seen then that the electronic equipment include at least SSD controller and Storage medium.
Fig. 2 is the implementation process schematic diagram of the update method of three mapping table of the embodiment of the present invention, as shown in Fig. 2, the mapping The update method of table includes:
Step S301 obtains the parameter for updating mapping table;
Here, the mapping table includes level-one mapping table and second level mapping table, wherein level-one mapping table and second level mapping table Relationship referring to embodiment one above-mentioned and embodiment two, the parameter for updating mapping table may include a variety of, for example, rewriting Ratio, rewriting number or time cycle etc..It wherein rewrites ratio and refers to that the part being written in mapping table accounts for sum Ratio.
Step S302, judges whether the parameter meets preset condition;
Here, continue to accept the example in above-mentioned steps S301, for rewriting ratio, it is assumed that preset condition is 20%, the rewriting ratio of current mapping table is obtained, judges to rewrite whether ratio is greater than 20%, when being greater than, is determined as meeting pre- If condition, when be less than when, determine be less than preset condition.
Step S303 deposits the map information in the second level mapping table from solid-state when meeting the preset condition The random access memory of reservoir is updated onto the NAND;
Step S304, obtains the second physical address and corresponding second identifier information, and second physical address is to update The physical storage address of map information on the NAND afterwards as unit of block;
Here, it should be noted that the write-in of cover type is unable in SSD, so for the first block, if updated The physical address of preceding first block is the first physical address, then the physical address of updated first block is no longer just first Physical address, in other words, the second physical address in step S304 are different from the first physical address.In general, block Identification information will not generally become, and in other words, the identification information of block only will increase, disappear, and increase i.e. as according to original mark Know information and divide out new identification information, then the identification information for only needing newly to classify and corresponding physical address insert level-one New map unit in mapping table, if original block is deleted, block will be set to stale, that This goes the identification information of block that can be reused or directly disappear, accordingly, in level-one mapping table, if should The identification information of block is reused, then new physical address will be received in corresponding map unit, if by this If the identification information of block is not enabled, then original corresponding map unit should be deleted.
Step S305 updates second physical address to the level-one mapping table according to the second identifier information.
Here, judge that second identifier information whether there is in level-one mapping table;If it is present being believed according to second identifier Breath searches level-one mapping table, obtains the second map unit, and second map unit then is written in the second physical address.If Second identifier information is not present in the level-one mapping table, then second identifier information and the write-in of the second physical address is new In map unit, to form the mapping relations of the block of update in the new map unit.
In the embodiment of the present invention, the method also includes:
Step S306, judges whether the second level mapping table all updates from the random access memory of solid-state memory to described On NAND;
Step S307 when being, then obtains second physical address and second identifier information.
Step S308, when no, continue to update by the second level mapping table from the random access memory of solid-state memory update to On the NAND.
Example IV
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of restoration methods of mapping table, is applied to electronic equipment, The function that the forming method of the mapping table is realized can be by the SSD controller caller code in electronic equipment come real Existing, certain program code can be stored in computer storage medium, it is seen then that the electronic equipment include at least SSD controller and Storage medium.
Restoration methods provided in an embodiment of the present invention, when second level mapping table damage, the level-one mapping table is complete When, second level mapping table can be restored according to level-one mapping table, such as power off in system exception, just will do it after powering on next time extensive Multiple, this is just to directly acquire newest level-one mapping table in NAND to be loaded.It at this time can be in two kinds of situation: situation one, when being System power-off occurred in the non-metadata updates stage, and such case is fairly simple, directly loaded second level mapping table from level-one mapping table ?;Situation two is needed to push away level-one mapping table by second level mapping table is counter, be walked below if occurring during metadata updates Suddenly will be used to give information on the situation the restoration methods of two lower mapping tables, and the restoration methods of the mapping table include:
Fig. 3-1 is the implementation process schematic diagram of the restoration methods of four mapping table of the embodiment of the present invention, as shown in figure 3-1, should Method includes:
Step S401 obtains third physical address from the level-one mapping table;
Here, the third physical address in a map unit in the level-one mapping table by storing physically Location;The third physical address is the physical address of third block.
Step S402 obtains the second level map information on third block according to the third physical address;
Here, what second level mapping table actually stored is some metadata informations, if according to block to second level mapping table After being divided, then the information stored on each block is known as second level map information.
Step S403 reads the second level map information on the third block solid from the NAND of solid-state memory In the random access memory of state memory;
Step S404 obtains third identification information from the level-one mapping table, and the third identification information is third physics The identification information of block corresponding to address;
Step S405 obtains the 4th mark according to third physical address from the second level map information of the third block Information;
Step S406 judges whether the third identification information is identical as the 4th identification information;
Here, when identical, whether third identification information with the 4th identification information indicates same block;
When being, the second level map information of the third block is read from the NAND of solid-state memory by step S407 Onto the random access memory of solid-state memory.
When no, the physical address of corresponding block is obtained according to the third identification information by step S407;
The physical address of the block is written one when the number of the physical address of the block is equal to 1 by step S408 In map unit in grade mapping table in third identification information;
Step S409, when the number of the physical address of the block is greater than 1, the physical address institute for obtaining each block is right The timestamp information answered;
Step S410, by third identification information in the physical address write-in level-one mapping table of the nearest block of timestamp information In interior map unit.
It represents block below with Physical Page to be illustrated, technical method provided in an embodiment of the present invention includes:
Second level mapping table is divided into as shown in figure 3-2 with 1 Physical Page (mapping table by step S421 Page it) is stored for several units of unit, forms the new mapping table of a physical address index to the storage of second level mapping table, That is level-one mapping table;
Step S422 distributes an identification information to Physical Page in each second level mapping table, at the same record this page of flush into Enter the timestamp information of NAND;
Step S423 is complete after to be done using first local updating second level mapping table when more new strategy sets out primary update Office updates level-one mapping table, then updates miscdata key metadata;
Step S424 can restore second level according to the level-one mapping table in flush to NAND when powering off generation Mapping table, even if new modification can also carry out two with the second level mapping table of legacy version since power-off does not update in NAND also The reconstruct of grade mapping table;
Step S425 can use the mark letter of second level mapping table if necessary to restore the level-one mapping table of latest edition Breath and timestamp information scan entire second level mapping table section, by updated second level mapping table reconstruct and other Legacy version mapping table combines, and generates the level-one mapping table of special version, to reduce power down loss;
It from the above, it can be seen that when need to restore the level-one mapping table of latest edition, can use each and grade is reflected The identification information (coding index) of Physical Page, timestamp (timestamp) information in firing table, then recover newest level-one and reflect Firing table.The map information for managing SSD with second level mapping mechanism in embodiments of the present invention, in this way in abnormal power-down, It can restore level-one mapping table according to the second level mapping table in flush to NAND, if necessary to restore latest edition Level-one mapping table, can use coding index, timestamp (timestamp) information of each level-one mapping table page, then restore Newest mapping table out.
Embodiment five
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of restoration methods of mapping table, is applied to electronic equipment, The function that the forming method of the mapping table is realized can be by the SSD controller caller code in electronic equipment come real Existing, certain program code can be stored in computer storage medium, it is seen then that the electronic equipment include at least SSD controller and Storage medium.
Restoration methods provided in an embodiment of the present invention are finished when second level mapping table has been updated, and level-one mapping table is not When being updated, the level-one mapping table is restored according to the updated second level mapping table, the restoration methods of the mapping table, specifically Include:
Step S501 obtains the physical address of corresponding block according to the identification information of block in the level-one mapping table;
The physical address of the block is written one when the number of the physical address of the block is equal to 1 by step S502 In map unit in grade mapping table in the identification information of corresponding block;
Step S503, when the number of the physical address of the block is greater than 1, the physical address institute for obtaining each block is right The timestamp information answered;
Step S504, by corresponding block in the physical address write-in level-one mapping table of the nearest block of timestamp information In map unit in identification information.
Embodiment six
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment, included the in the electronic equipment One formation unit, first acquisition unit and second, which form unit, to be realized by the SSD controller in electronic equipment, when It can also so be realized by specific logic circuit;During specific embodiment, processor can be central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA) etc..
Fig. 4 is six electronic equipment composed structure schematic diagram of the embodiment of the present invention, as shown in figure 4, the electronic equipment 400 includes First forms unit 401, first acquisition unit 402 and second forms unit 403, in which:
Described first forms unit 401, solid for being mapped as all logical page (LPAGE)s on host using the mapping of page grade The Physical Page of NAND on state memory forms second level mapping table;
The first acquisition unit 402, for obtaining the first physical address, first physical address is that the second level is reflected The physical storage address of first block in firing table;
Described second forms unit 403, is used for first physical address and corresponding first identifier information in level-one Mapping relations are formed in map unit in mapping table, wherein the first identifier information is the identification information of the first block.
It further include first identifier letter in the map information of the first block in the second level mapping table in the embodiment of the present invention Breath.
In the embodiment of the present invention, the electronic equipment further includes the first storage unit and the second storage unit, in which:
First storage unit, for making the map information for being used to indicate unit block in the second level mapping table It is entirely stored on NAND for one;
Second storage unit, for the level-one mapping table to be stored in NAND as a whole.
In the embodiment of the present invention, the electronic equipment further includes the first recording unit, the 12nd acquiring unit, searching unit With the second recording unit, in which:
First recording unit, the map information flush for recording the first block enter the solid-state memory The information such as NAND timestamp information and version flag;
11st acquiring unit, for obtaining the first identifier information of the first block from second level mapping mark;
The searching unit is used for the level-one mapping table according to the first identifier information searching, obtains the first mapping Unit;
Second recording unit, for the timestamp information and version stamp information to be recorded in the first map unit In.
From the above, it can be seen that further including for recording the mapping letter as unit of block in each described map unit Cease timestamp information and version flag that flush enters the NAND of the solid-state memory.
It need to be noted that: the above electronic equipment implements the description of item, is similar, tool with above method description There is the identical beneficial effect of same embodiment of the method, therefore does not repeat them here.For undisclosed in electronic equipment embodiment of the present invention Technical detail, those skilled in the art please refer to the description of embodiment of the present invention method and understand, to save length, here not It repeats again.
Embodiment seven
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment, included the in the electronic equipment The units such as two acquiring units, the first judging unit, the first updating unit, third acquiring unit and the second updating unit, are ok It is realized by the SSD controller in electronic equipment, can also be realized certainly by specific logic circuit;In specific embodiment In the process, processor can for central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or scene Program gate array (FPGA) etc..
Fig. 5 is seven electronic equipment composed structure schematic diagram of the embodiment of the present invention, as shown in figure 5, the electronic equipment 500 includes Second acquisition unit 501, the first judging unit 502, the first updating unit 503, third acquiring unit 504 and the second updating unit 505, in which:
The second acquisition unit 501, for obtaining the parameter for updating mapping table;
First judging unit 502, for judging whether the parameter meets preset condition;
First updating unit 503, for when meeting the preset condition, by reflecting in the second level mapping table Information is penetrated to update from the random access memory of solid-state memory onto the NAND;
The third acquiring unit 504, for obtaining the second physical address and corresponding second identifier information, described second Physical address is the physical storage address of the map information on the updated NAND as unit of block;
Second updating unit 505, for being arrived second physical address update according to the second identifier information The level-one mapping table.
In the embodiment of the present invention, the electronic equipment further includes that second judgment unit, the 4th acquiring unit and third update Unit, wherein
The second judgment unit, for judging the second level mapping table whether all from the random storage of solid-state memory Device is updated onto the NAND;When being, the 4th acquiring unit is triggered, when no, triggers the third updating unit;
4th acquiring unit, for obtaining second physical address and second identifier information again.
The third updating unit, for continuing to update the random access memory by the second level mapping table from solid-state memory It updates on the NAND.
It need to be noted that: the above electronic equipment implements the description of item, is similar, tool with above method description There is the identical beneficial effect of same embodiment of the method, therefore does not repeat them here.For undisclosed in electronic equipment embodiment of the present invention Technical detail, those skilled in the art please refer to the description of embodiment of the present invention method and understand, to save length, here not It repeats again.
Embodiment seven
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment, included the in the electronic equipment Five acquiring units, the 6th acquiring unit, the first reading unit, the 7th acquiring unit, the 8th acquiring unit, third judging unit and The units such as the second reading unit can be realized by the SSD controller in electronic equipment, certainly can also be by specifically patrolling Circuit is collected to realize;During specific embodiment, processor can be central processing unit (CPU), microprocessor (MPU), number Word signal processor (DSP) or field programmable gate array (FPGA) etc..
The electronic equipment include the 5th acquiring unit, the 6th acquiring unit, the first reading unit, the 7th acquiring unit, 8th acquiring unit, third judging unit and the second reading unit, in which:
5th acquiring unit, for obtaining third physical address, the third physics from the level-one mapping table Address is by the physical address that stores in a map unit in the level-one mapping table;The third physical address is third area The physical address of block;
6th acquiring unit, the second level mapping table for obtaining third block according to the third physical address are believed Breath;
First reading unit, for the NAND by the second level map information of the third block from solid-state memory On read in the random access memory of solid-state memory;
7th acquiring unit, for obtaining third identification information, the third mark letter from the level-one mapping table Breath is the identification information of block corresponding to third physical address;
8th acquiring unit, for according to third physical address from the second level map information of the third block Obtain the 4th identification information;
The third judging unit, for judging whether the third identification information is same with the 4th identification information expression One block;When being, second reading unit is triggered;
Second reading unit, it is solid for reading the second level map information from the NAND of solid-state memory In the random access memory of state memory.
In the embodiment of the present invention, the electronic equipment further includes the 9th acquiring unit, the first writing unit, the tenth acquisition list Member and the second writing unit, in which:
9th acquiring unit, for obtaining corresponding block according to third identification information in the level-one mapping table Physical address;
First writing unit, for when the number of the physical address of the block be equal to 1 when, by the object of the block It manages in the map unit in address write-in level-one mapping table in third identification information;
Tenth acquiring unit, for obtaining each block when the number of the physical address of the block is greater than 1 Timestamp information corresponding to physical address;
Second writing unit, in the physical address write-in level-one mapping table by the nearest block of timestamp information In map unit in third identification information.
It need to be noted that: the above electronic equipment implements the description of item, is similar, tool with above method description There is the identical beneficial effect of same embodiment of the method, therefore does not repeat them here.For undisclosed in electronic equipment embodiment of the present invention Technical detail, those skilled in the art please refer to the description of embodiment of the present invention method and understand, to save length, here not It repeats again.
Embodiment eight
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment, included the in the electronic equipment The units such as nine acquiring units, the first writing unit, the tenth acquiring unit and the second writing unit, can be by electronic equipment SSD controller realize, certainly can also be realized by specific logic circuit;During specific embodiment, processor It can be central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA) etc..
The electronic equipment includes the 9th acquiring unit, the first writing unit, the tenth acquiring unit and the second writing unit, Wherein:
9th acquiring unit, for obtaining corresponding block according to the identification information of block in the level-one mapping table Physical address;
First writing unit, for when the number of the physical address of the block be equal to 1 when, by the object of the block It manages in the map unit in address write-in level-one mapping table in the identification information of corresponding block;
Tenth acquiring unit, for obtaining each block when the number of the physical address of the block is greater than 1 Timestamp information corresponding to physical address;
Second writing unit, in the physical address write-in level-one mapping table by the nearest block of timestamp information In map unit in the identification information of corresponding block.
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment, and the electronic equipment includes that solid-state is deposited Reservoir SSD, Fig. 6 is the composed structure schematic diagram of solid-state memory in the embodiment of the present invention, as shown in fig. 6, the solid-state storage Device 600 includes NAND 601 and SSD controller 602, wherein
All logical page (LPAGE)s on host are mapped as solid-state storage for mapping using page grade by the SSD controller The Physical Page of NAND on device forms second level mapping table;The first physical address is obtained, first physical address is that the second level is reflected The physical storage address of first block in firing table maps first physical address and corresponding first identifier information in level-one Mapping relations are formed in map unit in table, wherein the first identifier information is the identification information of the first block.
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment again, and the electronic equipment includes solid-state Memory SSD, the solid-state memory include NAND and SSD controller, wherein
The SSD controller, for obtaining the parameter for updating mapping table;Judge whether the parameter meets preset item Part;When meeting the preset condition, by the map information in the second level mapping table from the random storage of solid-state memory Device is updated onto the NAND;The second physical address and corresponding second identifier information are obtained, second physical address is more The physical storage address of map information on the NAND after new as unit of block;According to the second identifier information by institute The second physical address is stated to update to the level-one mapping table.
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment again, and the electronic equipment includes solid-state Memory SSD, the solid-state memory include NAND and SSD controller, wherein
The SSD controller, for obtaining third physical address, the third physical address from the level-one mapping table By the physical address stored in a map unit in the level-one mapping table, the third physical address is third block Physical address;The second level map information of third block is obtained according to the third physical address;It is obtained from the level-one mapping table Third identification information is taken, the third identification information is the identification information of block corresponding to third physical address;According to third object Reason address obtains the 4th identification information from the second level map information of the third block;Judging the third identification information is It is no to indicate same block with the 4th identification information;When being, the second level map information of the third block is deposited from solid-state It is read in the random access memory of solid-state memory on the NAND of reservoir.
Based on embodiment above-mentioned, the embodiment of the present invention provides a kind of electronic equipment again, and the electronic equipment includes solid-state Memory SSD, the solid-state memory include NAND and SSD controller, wherein
The SSD controller, for obtaining corresponding block according to the identification information of block in the level-one mapping table Physical address;When the number of the physical address of the block is equal to 1, level-one mapping table is written into the physical address of the block In corresponding block identification information in map unit in;When the number of the physical address of the block is greater than 1, obtain each Timestamp information corresponding to the physical address of a block;The physical address write-in level-one of the nearest block of timestamp information is reflected In map unit in firing table in the identification information of corresponding block.
It need to be noted that: the above electronic equipment implements the description of item, is similar, tool with above method description There is the identical beneficial effect of same embodiment of the method, therefore does not repeat them here.For undisclosed in electronic equipment embodiment of the present invention Technical detail, those skilled in the art please refer to the description of embodiment of the present invention method and understand, to save length, here not It repeats again.
It should be understood that " one embodiment " or " embodiment " that specification is mentioned in the whole text mean it is related with embodiment A particular feature, structure, or characteristic is included at least one embodiment of the present invention.Therefore, occur everywhere in the whole instruction " in one embodiment " or " in one embodiment " not necessarily refer to identical embodiment.In addition, these specific features, knot Structure or characteristic can combine in any suitable manner in one or more embodiments.It should be understood that in various implementations of the invention In example, magnitude of the sequence numbers of the above procedures are not meant that the order of the execution order, and the execution sequence of each process should be with its function It can determine that the implementation process of the embodiments of the invention shall not be constituted with any limitation with internal logic.The embodiments of the present invention Serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.Apparatus embodiments described above are merely indicative, for example, the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can combine, or It is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed each composition portion Mutual coupling or direct-coupling or communication connection is divided to can be through some interfaces, the INDIRECT COUPLING of equipment or unit Or communication connection, it can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit;Both it can be located in one place, and may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, which exists When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: movable storage device, read-only deposits The various media that can store program code such as reservoir (Read Only Memory, ROM), magnetic or disk.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product When selling or using, it also can store in a computer readable storage medium.Based on this understanding, the present invention is implemented Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words, The computer software product is stored in a storage medium, including some instructions are used so that computer equipment (can be with It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention. And storage medium above-mentioned includes: various Jie that can store program code such as movable storage device, ROM, magnetic or disk Matter.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (21)

1. a kind of forming method of mapping table, which is characterized in that the mapping table includes level-one mapping table and second level mapping table, institute The method of stating includes:
The Physical Page that all logical page (LPAGE)s on host are mapped as to NAND on solid-state memory is mapped using page grade, forms two Grade mapping table;
Obtain the first physical address, first physical address is the physical store of the first block in the second level mapping table Location, wherein first block is any when the map information in the second level mapping table is stored as unit of block One block;
First physical address and corresponding first identifier information are formed into mapping in the map unit in level-one mapping table Relationship, wherein the first identifier information is the identification information of the first block.
2. the method according to claim 1, wherein in the second level mapping table in the map information of the first block It further include first identifier information.
3. the method according to claim 1, wherein in each of described level-one mapping table map unit also Including for record map information flush as unit of block enter the solid-state memory NAND timestamp information and Version flag.
4. method according to any one of claims 1 to 3, which is characterized in that the method also includes:
It will be used to indicate that the map information of unit block to be stored in NAND as a whole in the second level mapping table;
The level-one mapping table is stored on NAND as a whole.
5. a kind of update method of mapping table, which is characterized in that the described method includes:
Obtain the parameter for updating mapping table;
Judge whether the parameter meets preset condition;
When meeting the preset condition, more from the random access memory of solid-state memory by the map information in second level mapping table Newly on NAND;
The second physical address and corresponding second identifier information are obtained, second physical address is on the updated NAND The physical storage address of map information as unit of block;
Second physical address is updated to level-one mapping table according to the second identifier information.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
Judge whether the second level mapping table all updates from the random access memory of solid-state memory onto the NAND;
When being, then obtain second physical address and second identifier information.
7. according to the method described in claim 6, it is characterized in that, which comprises
When no, continue to update by the second level mapping table from the update to the NAND of the random access memory of solid-state memory.
8. a kind of restoration methods of mapping table, which is characterized in that when second level mapping table damages and level-one mapping table is complete, according to Level-one mapping table restores second level mapping table, specifically includes:
Third physical address is obtained from the level-one mapping table, the third physical address is one in the level-one mapping table The physical address stored in map unit, the third physical address are the physical address of third block;
The second level map information of third block is obtained according to the third physical address;
Third identification information is obtained from the level-one mapping table, the third identification information is block corresponding to third physical address Identification information;
The 4th identification information is obtained from the second level map information of the third block according to third physical address;
Judge whether the third identification information with the 4th identification information indicates same block;
When being, the second level map information of the third block is read into solid-state memory from the NAND of solid-state memory In random access memory.
9. according to the method described in claim 8, it is characterized in that, the method also includes:
When no, the physical address of corresponding block is obtained according to the third identification information;
When the number of the physical address of the block is equal to 1, by the physical address of block write-in level-one mapping table the In map unit in three identification informations;
When the number of the physical address of the block is greater than 1, the letter of timestamp corresponding to the physical address of each block is obtained Breath;
By the map unit in the physical address write-in level-one mapping table of the nearest block of timestamp information in third identification information In.
10. a kind of restoration methods of mapping table, which is characterized in that it is finished when second level mapping table has been updated, and level-one maps When table is not updated, the level-one mapping table is restored according to the updated second level mapping table, is specifically included:
The physical address of corresponding block is obtained according to the identification information of block in the level-one mapping table;
It, will be right in the physical address write-in level-one mapping table of the block when the number of the physical address of the block is equal to 1 In map unit in the identification information for the block answered;
The physical address of the nearest block of timestamp information is written in level-one mapping table in the identification information of corresponding block In map unit.
11. a kind of electronic equipment, which is characterized in that mapping table includes level-one mapping table and second level mapping table, the electronic equipment Unit is formed including first, first acquisition unit and second forms unit, in which:
Described first forms unit, and all logical page (LPAGE)s on host are mapped as solid-state memory for mapping using page grade The Physical Page of upper NAND forms second level mapping table;
The first acquisition unit, for obtaining the first physical address, first physical address is in the second level mapping table The physical storage address of first block, wherein first block is that the map information in the second level mapping table is with block Any one block when unit is stored;
Described second forms unit, is used for first physical address and corresponding first identifier information in level-one mapping table Map unit in form mapping relations, wherein the first identifier information be the first block identification information.
12. electronic equipment according to claim 11, which is characterized in that the electronic equipment further includes the first storage unit With the second storage unit, in which:
First storage unit, for using the map information for being used to indicate unit block in the second level mapping table as one It is a to be entirely stored on NAND;
Second storage unit, for the level-one mapping table to be stored in NAND as a whole.
13. a kind of electronic equipment, which is characterized in that the electronic equipment includes second acquisition unit, the first judging unit, first Updating unit, third acquiring unit and the second updating unit, in which:
The second acquisition unit, for obtaining the parameter for updating mapping table;
First judging unit, for judging whether the parameter meets preset condition;
First updating unit, for when meeting the preset condition, by the map information in second level mapping table from solid The random access memory of state memory is updated onto NAND;
The third acquiring unit, for obtaining the second physical address and corresponding second identifier information, described second physically Location is the physical storage address of the map information on the updated NAND as unit of block;
Second updating unit is mapped for being updated second physical address to level-one according to the second identifier information Table.
14. electronic equipment according to claim 13, which is characterized in that the electronic equipment further includes the second judgement list Member, the 4th acquiring unit and third updating unit, wherein
The second judgment unit, for judge the second level mapping table whether all from the random access memory of solid-state memory more Newly on the NAND;When being, the 4th acquiring unit is triggered, when no, triggers the third updating unit;
4th acquiring unit, for obtaining second physical address and second identifier information again;
The third updating unit updates the second level mapping table from the random access memory of solid-state memory for continuing to update Onto the NAND.
15. a kind of electronic equipment, which is characterized in that the electronic equipment includes the 5th acquiring unit, the 6th acquiring unit, first Reading unit, the 7th acquiring unit, the 8th acquiring unit, third judging unit and the second reading unit, in which:
5th acquiring unit, for obtaining third physical address from level-one mapping table, the third physical address is institute State the physical address stored in a map unit in level-one mapping table;
6th acquiring unit, for obtaining second level map information according to the third physical address;
First reading unit is deposited for the second level map information to be read solid-state from the NAND of solid-state memory In the random access memory of reservoir;
7th acquiring unit, for obtaining third identification information from the level-one mapping table, the third identification information is The identification information of block corresponding to third physical address;
8th acquiring unit, for obtaining the 4th mark letter from the second level map information according to third physical address Breath;
The third judging unit, for judging whether the third identification information with the 4th identification information indicates same area Block;When being, second reading unit is triggered;
Second reading unit is deposited for the second level map information to be read solid-state from the NAND of solid-state memory In the random access memory of reservoir.
16. electronic equipment according to claim 15, which is characterized in that the electronic equipment further includes that the 9th acquisition is single Member, the first writing unit, the tenth acquiring unit and the second writing unit, in which:
9th acquiring unit, for obtaining the physics of corresponding block according to third identification information in the level-one mapping table Address;
First writing unit, for when the number of the physical address of the block be equal to 1 when, physically by the block Location is written in the map unit in level-one mapping table in third identification information;
Tenth acquiring unit, for obtaining the physics of each block when the number of the physical address of the block is greater than 1 Timestamp information corresponding to address;
Second writing unit, for third in the physical address write-in level-one mapping table by the nearest block of timestamp information In map unit in identification information.
17. a kind of electronic equipment, which is characterized in that the electronic equipment includes the 9th acquiring unit, the first writing unit, the tenth Acquiring unit and the second writing unit, in which:
9th acquiring unit, for obtaining corresponding block physically according to the identification information of block in level-one mapping table Location;
First writing unit, for when the number of the physical address of the block be equal to 1 when, physically by the block Location is written in the map unit in level-one mapping table in the identification information of corresponding block;
Second writing unit, for corresponding in the physical address write-in level-one mapping table by the nearest block of timestamp information Block identification information in map unit in.
18. a kind of electronic equipment, which is characterized in that the electronic equipment includes solid-state memory SSD, the solid-state memory packet NAND and SSD controller are included, wherein
All logical page (LPAGE)s on host are mapped as solid-state memory for mapping using page grade by the SSD controller The Physical Page of NAND forms second level mapping table;The first physical address is obtained, first physical address is the second level mapping table In the first block physical storage address, by first physical address and corresponding first identifier information in level-one mapping table Map unit in form mapping relations, wherein first block be the second level mapping table in map information with block Any one block when being stored for unit, the first identifier information are the identification information of the first block.
19. a kind of electronic equipment, which is characterized in that the electronic equipment includes solid-state memory SSD, the solid-state memory packet NAND and SSD controller are included, wherein
The SSD controller, for obtaining the parameter for updating mapping table;Judge whether the parameter meets preset condition;When When meeting the preset condition, the map information in second level mapping table is updated from the random access memory of solid-state memory to institute It states on NAND;The second physical address and corresponding second identifier information are obtained, second physical address is updated described The physical storage address of the upper map information as unit of block of NAND;According to the second identifier information by second physics Address is updated to level-one mapping table.
20. a kind of electronic equipment, which is characterized in that the electronic equipment includes solid-state memory SSD, the solid-state memory packet NAND and SSD controller are included, wherein
The SSD controller, for obtaining third physical address from level-one mapping table, the third physical address is described one The physical address stored in a map unit in grade mapping table, the third physical address be third block physically Location;The second level map information of third block is obtained according to the third physical address;Third is obtained from the level-one mapping table Identification information, the third identification information are the identification information of block corresponding to third physical address;According to third physical address The 4th identification information is obtained from the second level map information of the third block;Judge the third identification information whether with institute Stating the 4th identification information indicates same block;When being, by the second level map information of the third block from solid-state memory In the random access memory for reading solid-state memory on NAND.
21. a kind of electronic equipment, which is characterized in that the electronic equipment includes solid-state memory SSD, the solid-state memory packet NAND and SSD controller are included, wherein
The SSD controller, for obtaining the physical address of corresponding block according to the identification information of block in level-one mapping table; It, will be corresponding in the physical address write-in level-one mapping table of the block when the number of the physical address of the block is equal to 1 In map unit in the identification information of block;When the number of the physical address of the block is greater than 1, each block is obtained Timestamp information corresponding to physical address;It will be right in the physical address write-in level-one mapping table of the nearest block of timestamp information In map unit in the identification information for the block answered.
CN201510623694.9A 2015-09-25 2015-09-25 A kind of formation of mapping table, update and restoration methods and electronic equipment Active CN105224478B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510623694.9A CN105224478B (en) 2015-09-25 2015-09-25 A kind of formation of mapping table, update and restoration methods and electronic equipment
US14/978,816 US10552335B2 (en) 2015-09-25 2015-12-22 Method and electronic device for a mapping table in a solid-state memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510623694.9A CN105224478B (en) 2015-09-25 2015-09-25 A kind of formation of mapping table, update and restoration methods and electronic equipment

Publications (2)

Publication Number Publication Date
CN105224478A CN105224478A (en) 2016-01-06
CN105224478B true CN105224478B (en) 2019-01-22

Family

ID=54993460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510623694.9A Active CN105224478B (en) 2015-09-25 2015-09-25 A kind of formation of mapping table, update and restoration methods and electronic equipment

Country Status (1)

Country Link
CN (1) CN105224478B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808378B (en) 2016-02-26 2018-10-30 华为技术有限公司 Metadata restorative procedure and device
CN112433889B (en) * 2016-06-29 2024-04-12 北京忆恒创源科技股份有限公司 Log generation method and device based on FTL table
CN106649129A (en) * 2016-09-28 2017-05-10 深圳市金泰克半导体有限公司 Solid state disk with function of version management based on FTL and implement method of solid state disk
CN106802777A (en) * 2017-01-20 2017-06-06 杭州电子科技大学 A kind of flash translation layer (FTL) control method for solid storage device
KR20180128588A (en) * 2017-05-24 2018-12-04 에스케이하이닉스 주식회사 Memory system and method thereof
CN107391393A (en) * 2017-07-28 2017-11-24 郑州云海信息技术有限公司 A kind of statistical method and device of FTL mapping tables
CN108121670B (en) * 2017-08-07 2021-09-28 鸿秦(北京)科技有限公司 Mapping method for reducing solid state disk metadata back-flushing frequency
CN108804033B (en) * 2018-05-18 2021-04-20 记忆科技(深圳)有限公司 Full-disk scanning method and device based on power-off continuation, computer equipment and medium
CN110515861B (en) * 2018-05-21 2022-08-05 北京忆芯科技有限公司 Memory device for processing flash command and method thereof
CN109189484B (en) * 2018-08-03 2021-04-20 深圳忆联信息系统有限公司 Method and system for rapidly starting solid state disk
CN109388524B (en) * 2018-10-09 2021-10-01 郑州云海信息技术有限公司 Virtual disk format addressing method and computer readable storage medium
CN110543434B (en) * 2019-09-05 2022-07-01 北京兆易创新科技股份有限公司 NAND flash device, memory table management method, device and storage medium
CN110704337B (en) * 2019-09-23 2021-01-19 深圳忆联信息系统有限公司 Mapping table reconstruction method and device based on solid state disk and computer equipment
CN112100091A (en) * 2020-09-17 2020-12-18 深圳佰维存储科技股份有限公司 Two-level mapping table data mapping method and device, storage medium and electronic equipment
CN113485948B (en) * 2021-06-29 2023-11-14 成都忆芯科技有限公司 NVM bad block management method and control part
CN114168077A (en) * 2021-12-07 2022-03-11 深圳忆联信息系统有限公司 Timestamp management method and device for solid state disk, computer equipment and storage medium
CN114692229B (en) * 2022-03-30 2023-11-10 中国电信股份有限公司 Hard disk unauthorized access detection method, device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425605A (en) * 2013-07-26 2013-12-04 记忆科技(深圳)有限公司 Solid-state disk power failure protection and quick start method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9417803B2 (en) * 2011-09-20 2016-08-16 Apple Inc. Adaptive mapping of logical addresses to memory devices in solid state drives
US9218281B2 (en) * 2012-05-04 2015-12-22 Seagate Technology Llc Maintaining ordering via a multi-level map of a solid-state media
CN104598386B (en) * 2013-10-31 2018-03-27 Lsi公司 By following the trail of and reusing solid-state drive block using two level map index

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425605A (en) * 2013-07-26 2013-12-04 记忆科技(深圳)有限公司 Solid-state disk power failure protection and quick start method and system

Also Published As

Publication number Publication date
CN105224478A (en) 2016-01-06

Similar Documents

Publication Publication Date Title
CN105224478B (en) A kind of formation of mapping table, update and restoration methods and electronic equipment
CN105243025B (en) A kind of formation of mapping table and loading method, electronic equipment
CN105122220B (en) Atom writing commands in solid state drive are supported
CN107608908B (en) Wear leveling method for data storage device
US9092323B2 (en) Systems and methods for recovering addressing data
CN102855193B (en) Go during the carry of untapped logical address in Nonvolatile memory system to map
US9244833B2 (en) Data-storage device and flash memory control method
TWI596480B (en) Memory storage system, and central control device, management method and recovery method
CN108733510A (en) Data storage device and mapping table reconstruction method
CN103150125B (en) Method for prolonging service life of power-down protection date buffer memory and smart card
CN104756088A (en) Flexible wear management for non-volatile memory
KR20110117099A (en) Mapping address table maintenance in a memory device
CN106155915B (en) Data storage processing method and device
CN106201335B (en) Storage system
CN101169751A (en) System with flash memory device and data recovery method thereof
CN1936853B (en) Data cut-off protection and repairing method of inlaid apparatus
CN103164342A (en) Mount-time reconciliation of data availability
CN105912475A (en) System and method for copy on write on an SSD
CN103577574A (en) High-reliability linear file system based on nand flash
WO2016111702A1 (en) Persistent memory garbage collection
US10552335B2 (en) Method and electronic device for a mapping table in a solid-state memory
EP3054626A1 (en) Data processing method, device and system for storage unit
US11640244B2 (en) Intelligent block deallocation verification
CN109669889B (en) Light Nor Flash control method and device
US20120047108A1 (en) Point-in-time (pit) based thin reclamation support for systems with a storage usage map api

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20170302

Address after: The 100176 branch of the Beijing economic and Technological Development Zone fourteen Street No. 99 building 33 building D No. 2226

Applicant after: Beijing legend core technology Co., Ltd.

Address before: 100085 Haidian District West Road, Beijing, No. 6

Applicant before: Lenovo (Beijing) Co., Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190808

Address after: 518067 Dongjiaotou Workshop D24/F-02, Houhai Avenue, Shekou Street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Yi Lian Information System Co., Ltd.

Address before: The 100176 branch of the Beijing economic and Technological Development Zone fourteen Street No. 99 building 33 building D No. 2226

Patentee before: Beijing legend core technology Co., Ltd.