CN109491927A - Data storage, read method, device and electronic equipment - Google Patents

Data storage, read method, device and electronic equipment Download PDF

Info

Publication number
CN109491927A
CN109491927A CN201811311003.1A CN201811311003A CN109491927A CN 109491927 A CN109491927 A CN 109491927A CN 201811311003 A CN201811311003 A CN 201811311003A CN 109491927 A CN109491927 A CN 109491927A
Authority
CN
China
Prior art keywords
layer
mapping table
map unit
layer mapping
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.)
Granted
Application number
CN201811311003.1A
Other languages
Chinese (zh)
Other versions
CN109491927B (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.)
Rongming Microelectronics Jinan Co ltd
Original Assignee
Qingdao Rongming Semiconductor 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 Qingdao Rongming Semiconductor Co Ltd filed Critical Qingdao Rongming Semiconductor Co Ltd
Priority to CN201811311003.1A priority Critical patent/CN109491927B/en
Publication of CN109491927A publication Critical patent/CN109491927A/en
Application granted granted Critical
Publication of CN109491927B publication Critical patent/CN109491927B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention has invented a kind of storage of data, the method, apparatus read and electronic equipment.Wherein, date storage method, comprising: be multiple first layer map units by logical block addresses Range-partition in response to write operation;Judge whether first layer map unit is continuous and complete;Discontinuous or incomplete first layer map unit is divided into multiple second layer map units;It is physical address by the address of cache of the logical blocks;The corresponding first layer mapping table of discontinuous or incomplete first layer map unit is directed toward second layer mapping table;Second layer mapping table is written into the physical address of logical blocks in first layer map unit.Avoid the problem of writing amplification.

Description

Data storage, read method, device and electronic equipment
Technical field
The present invention relates to reading and writing data fields more particularly to a kind of storage of data, the method, apparatus of reading and electronics to set It is standby.
Background technique
Solid state hard disk system generally includes host interface protocol layer, flash translation layer (FTL) (FTL, Flash Translation ) and flash interface protocol layer Layer.One major function of flash translation layer (FTL) is to carry out in host interface protocol logically The mapping between the physical address of flash memory is arrived in location (LBA, Logical Block Address).Logical address arrives physical address Mapping table (Logical to Physical Address Mapping Table, or L2P table) is flash translation layer (FTL) Key data structure.With the increase of the capacity of solid state hard disk, the memory space that L2P mapping table needs is also increasing, to solid The system design of state hard disk causes difficulty.The memory space of mapping table can be reduced by simply increasing mapping granule, but can be made The problem of at amplification is write.
Summary of the invention
In view of this, the present invention provides a kind of storage of data, the method, apparatus read and electronic equipments, at least partly Solution problems of the prior art.
In a first aspect, the present invention provides a kind of date storage methods, comprising:
It is multiple first layer map units by logical block addresses Range-partition in response to write operation;
Judge whether first layer map unit is continuous and complete;
Discontinuous or incomplete first layer map unit is divided into multiple second layer map units;
It is physical address by the address of cache of the logical blocks;
The corresponding first layer mapping table of discontinuous or incomplete first layer map unit is directed toward second layer mapping Table;
The second layer is written into the physical address of logical blocks in discontinuous or incomplete first layer map unit Mapping table.
As a specific embodiment of the present invention, the address of cache by the logical blocks is physical address After step, comprising:
By the physical address write-in first layer mapping of the logical blocks in continuous and complete first layer map unit Table.
It is described to judge whether first layer map unit is continuous and complete as a specific embodiment of the present invention The step of after, further includes:
Such as first layer map unit is continuous and complete, then judges whether first layer map unit has correspondence Second layer mapping table;
If first layer map unit is that have corresponding second layer mapping table, then the second layer mapping table is discharged;
First layer map unit is mapped directly into physical address, and updates the first layer mapping table.
It is described by discontinuous or incomplete first layer map unit as a specific embodiment of the present invention Corresponding first layer mapping table is directed toward second layer mapping table, comprising:
Judge whether the corresponding first layer mapping table of discontinuous or incomplete first layer map unit has been directed to Second layer mapping table,
The corresponding first layer mapping table of first layer map unit as described in discontinuous or incomplete is not directed toward the second layer Mapping table then distributes corresponding second layer mapping table for first layer map unit.
As a specific embodiment of the present invention, the second layer mapping table is stored in second layer mapping table resource pool It is interior.
As a specific embodiment of the present invention, when needing second layer mapping table, from the second layer mapping table Second layer mapping table is distributed in resource pool;
When the second layer mapping table is not needed, then the second layer mapping table is discharged into the second layer mapping table Resource pool.
Second layer mapping table as a specific embodiment of the present invention, in the second layer mapping table resource pool When being reduced to threshold value, map unit union operation is carried out.
As a specific embodiment of the present invention, the map unit union operation, comprising:
Data in all logical blocks for being under the jurisdiction of same first layer map unit are read out,
The data of reading are reconsolidated;
The data reconsolidated are put into first layer map unit, and first layer map unit is passed through first Layer mapping table is mapped as physical address, reflects so that the second layer mapping table that the first layer mapping table is directed toward is discharged into the second layer In firing table resource pool.
As a specific embodiment of the present invention, the triggering of the map unit union operation in not storing data Threshold value is less than the activation threshold value of map unit union operation when storing data.
As a specific embodiment of the present invention, the size of the map unit of the first layer is logical blocks size Integral multiple, the size of second layer map unit is identical with the size of logical blocks.
As a specific embodiment of the present invention, the first layer mapping table is array, the first layer mapping table Array in element be physical address or second layer mapping table address, the quantity of element in the array of the first layer mapping table It is the quantity of first layer map unit of logical block addresses Range-partition.
As a specific embodiment of the present invention, the second layer mapping table is array, the second layer mapping table Array in element be physical address, the quantity of element is that first layer mapping is single in the array of the second layer mapping table The quantity for the logical blocks that member is included.
As a specific embodiment of the present invention, the first layer mapping of second layer map unit can be divided into The quantity of unit is equipped with upper limit value.
As a specific embodiment of the present invention, comprising:
It is multiple first layer map units by logical block addresses Range-partition in response to write operation;
First layer map unit is divided into multiple second layer map units;
Second layer map unit is divided into multiple third layer map units;
Until
The n-th layer map unit is divided into multiple (n+1)th layer map units.
As a specific embodiment of the present invention, the n-th layer map unit size is (n+1)th layer of map unit The integral multiple of size, and described (n+1)th layer of map unit size is identical as logical blocks size.
Second aspect, the present invention also provides a kind of method for reading data, comprising:
It is the first layer map unit by logical block addresses Range-partition in response to read operation;
Inquire the corresponding first layer mapping table of first layer map unit;
The corresponding physical address of logical blocks is such as inquired in the first layer mapping table, then directly from the first layer Physical address is read in mapping table, and data are then read by the physical address in the first layer mapping table;
The corresponding physical address of logical blocks is not inquired in the first layer mapping table such as, then from the first layer The address of second layer mapping table is read in mapping table, then reads physical address from second layer mapping table;Then pass through described the The physical address in two layers of mapping table reads data.
The third aspect, the present invention also provides a kind of data storage devices, use the date storage method of first aspect;
With or
The method for reading data of second aspect.
Fourth aspect, the present invention also provides a kind of electronic equipment, use the data storage device of the third aspect.
Data provided by the invention storage, the method, apparatus read and electronic equipment, wherein the date storage method passes through Second layer map unit is divided into the first layer map unit, and the corresponding first layer mapping table of the first layer map unit is directed toward Second layer mapping table, so that second layer mapping table is written in the physical address of the logical blocks in first layer map unit. When only writing data into a logical blocks, by being further split to the first layer map unit, first layer mapping table First layer map unit is directed toward second layer mapping table, to only need the logical blocks being newly written second layer mapping table is written Interior physical address.It reads, avoids out of flash memory without the logical blocks in the first layer map unit that will be saved originally When only writing data into a logical blocks, the logical blocks in same first layer map unit are read out of flash memory Out, after the data being then written by the data of reading and newly merge, it is mapped as physical address again, writes data into new Physical address, thus caused by the problem of writing amplification.
The above description is only an overview of the technical scheme of the present invention, in order to better understand technological means of the invention, and It can be implemented in accordance with the contents of the specification, and to allow above and other objects, features and advantages of the invention can be brighter Show understandable, it is special below to lift preferred embodiment, and cooperate attached drawing, detailed description are as follows.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this field For those of ordinary skill, without creative efforts, it can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is a kind of flow chart of date storage method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of release second layer mapping table provided in an embodiment of the present invention;
Fig. 3 is the flow chart of date storage method concrete application provided in an embodiment of the present invention;
Fig. 4 is the structural block diagram of single layer mapping table provided in an embodiment of the present invention and the double-deck mapping table;
Fig. 5 is the flow chart of mapping union operation provided in an embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that illustrating embodiments of the present invention below by way of specific specific example, those skilled in the art can By content disclosed by this specification, other advantages and efficacy of the present invention can be easily understood.Obviously, described embodiment is only It is only a part of the embodiment of the present invention, instead of all the embodiments.The present invention can also pass through in addition different specific implementations Mode is embodied or practiced, and the various details in this specification can also be based on different viewpoints and application, without departing from this Various modifications or alterations are carried out under the spirit of invention.It should be noted that in the absence of conflict, following embodiment and embodiment In feature can be combined with each other.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creativeness Every other embodiment obtained, shall fall within the protection scope of the present invention under the premise of labour.
It should be noted that the various aspects of embodiment within the scope of the appended claims are described below.Ying Xian And be clear to, aspect described herein can be embodied in extensive diversified forms, and any specific structure described herein And/or function is only illustrative.Based on the present invention, it will be understood by one of ordinary skill in the art that one described herein Aspect can be independently implemented with any other aspect, and can combine the two or both in these aspects or more in various ways. For example, carry out facilities and equipments in terms of any number set forth herein can be used and/or practice method.In addition, can make With other than one or more of aspect set forth herein other structures and/or it is functional implement this equipment and/or Practice the method.
It should also be noted that, illustrating the basic structure that only the invention is illustrated in a schematic way provided in following embodiment Think, only shown in schema with it is of the invention in related component rather than component count, shape and size when according to actual implementation draw System, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its assembly layout kenel can also It can be increasingly complex.
In addition, in the following description, specific details are provided for a thorough understanding of the examples.However, fields The skilled person will understand that the aspect can be practiced without these specific details.
Mapping granule: i.e. the size of map unit, refer to logical address to physical address map minimum unit.
Solid state hard disk does storage medium using flash memory, and flash memory must be wiped first before writing, and wipe granularity (block, Block) much larger than the granularity (page, page) of write-in.Due to the characteristic of flash memory, host logically address write-in data when, FTL Algorithm logical address is mapped as to the physical address of flash memory, flash memory then is written into according to physical address in data again;Work as host When repeating that data are written to identical logical address, it can be mapped as different physical address every time.Solid state hard disk L2P Mapping table come record logical address to physical address mapping relations.
Logical address to physical address mapping granularity (namely size of map unit) be usually fixed (such as 4KB).If ranges of logical addresses (i.e. the capacity of solid state hard disk) is L, and (i.e. solid state hard disk storage is situated between the range of physical address The actual capacity of matter) it is P, the size of map unit is U, then the size of mapping table can be indicated by big O labelling method are as follows:
S=O (L/U*log (P/U)),
It can be seen that mapping table is smaller if mapping granule is bigger.
Mapping table is commonly stored in the SDRAM of solid state hard disk.Due to the limitation of SDRAM memory space, mapping table it is big It is small cannot be too big, therefore the capacity of solid state hard disk is also restrained.If solid state hard disk capacity is too big so that SDRAM is stored not Map unit is usually expanded as the size that mapping table is reduced comprising multiple logical blocks by lower mapping table, FTL algorithm.At this In the case of kind, if host only writes data into one of logical blocks, FTL algorithm usually require by data from other It is read out positioned at having been written into the logical blocks of flash memory for same mapping unit, merges with the data being newly written, remap Then new physical address is written in data after merging by new physical address.The write-in of one logical blocks of host computer side in this way, It needs to read multiple logical blocks in flash memory side, and multiple logical blocks is written, cause to write amplification.If map unit includes N A logical blocks, then writing amplification factor caused by this mapping algorithm is also N.
FTL natively exists when handling the write-in of logic random address writes amplification, this to write amplification and solid state hard disk Excessive accomodation coefficient (Over-Provisioning Ratio) it is related.Map unit comprising N number of logical blocks can make originally It is existing to write N times of further expansion of amplification, to cause very big influence to the performance of random address write-in.
Embodiment one:
As shown in Figure 1, a kind of date storage method, comprising:
Step S101: being multiple first layer map units by logical block addresses Range-partition in response to write operation;
Logical block addresses range includes multiple logical blocks, and ranges of logical addresses is the capacity of solid state hard disk.For dividing Being segmented into multiple in multiple first layer map units includes one or more, is divided into one if inadequate one.
Step S102: judge whether first layer map unit is continuous and complete;Continuously refer to the logic of write-in data Whether address is continuous, when data are written in host, it may be possible to random address write-in, it is also possible to multiple logical blocks are continuously written into, In random address write-in, it is discontinuous to will cause the first layer map unit, for being completely, if the data of host write-in cannot Gather together enough first layer map unit, then the first layer map unit be exactly it is imperfect, instead then, if write-in data can gather together enough One the first layer map unit, then first layer map unit is complete.
Step S103: discontinuous or incomplete first layer map unit is divided into multiple second layers and maps list Member;
Second layer map unit can be smaller than the first layer map unit, therefore imperfect or discontinuous first layer is mapped list Member is divided into lesser second layer map unit.
In a preferred embodiment, the size of the map unit of first layer is the integral multiple of logical blocks size, the The size of two layer map units and the size of logical blocks are identical.Because of the size of the second layer map unit and the size of logical blocks Identical, then discontinuous for the map unit of first layer or incomplete write-in data can be divided into complete and continuous Two layer map units.
Step S104: being physical address by the address of cache of the logical blocks;
Address of cache by the logical blocks of host write-in is the physical address of flash memory in solid state hard disk, that is, is first had to write The address allocated physical address of the logical blocks entered.
Step S105: the corresponding first layer mapping table of discontinuous or incomplete first layer map unit is directed toward the Two layers of mapping table;
If the logical blocks of host write-in are continuous and completely by the first layer map unit i.e. by logical blocks Address is mapped as physical address by first layer mapping table, but if be it is incomplete, first layer mapping table be directed toward will not be Physical address, but second layer mapping table.
Step S106: the physical address of the logical blocks in discontinuous or incomplete first layer map unit is write Enter second layer mapping table, after first layer mapping table is directed toward second layer mapping table, logical blocks are final or to store flash memory It is interior, therefore storage is the physical address of flash memory in second layer mapping table, the address of such logical blocks passes through the first mapping table It is directed toward second layer mapping table, then physical address is directed toward by second layer mapping table, and logical blocks storage is mapped to the second layer In the physical address that table is directed toward.
As a specific embodiment of the present invention, it is by the address of cache of the logical blocks described in the step S104 After the step of physical address, comprising:
By the physical address write-in first layer mapping of the logical blocks in continuous and complete first layer map unit Table.
Physical address is directly just mapped as by first layer mapping table if it is continuous and complete first layer map unit.
The present invention directly will be just mapped as physical address by first layer mapping table and be known as single layer mapping, and will pass through first Mapping table is directed toward second layer mapping table, then the referred to as double-deck mapping of physical address is directed toward by second layer mapping table.
As a specific embodiment of the present invention, step S102 judge first layer map unit it is whether continuous and After complete step, further includes:
Step S201: such as first layer map unit is continuous and complete, then judges first layer map unit Whether corresponding second layer mapping table is had;
Step S202: if first layer map unit is that have corresponding second layer mapping table, then the second layer is reflected Firing table release;
Step S203: being mapped directly into physical address for first layer map unit, and updates the first layer mapping Table.
As a specific embodiment of the present invention, step S105 maps the discontinuous or incomplete first layer The corresponding first layer mapping table of unit is directed toward second layer mapping table, comprising:
Judge whether the corresponding first layer mapping table of discontinuous or incomplete first layer map unit has been directed to Second layer mapping table,
The corresponding first layer mapping table of first layer map unit as described in discontinuous or incomplete is not directed toward the second layer Mapping table then distributes corresponding second layer mapping table for first layer map unit.
As shown in figure 3, host or FTL write operation are responded, by logical block addresses model in a specific application scenarios It encloses and is divided into multiple first layer map units;
Judge whether the first layer map unit is continuous and complete;
If it is judged that be yes, then judge whether this first layer map unit has done the double-deck mapping, if The double-deck mapping has been done, then has been discharged the corresponding second layer mapping table of this first layer map unit, can preferably be discharged into the In two layers of mapping table resource pool.
If it is determined that whether the first layer map unit continuous and complete result be it is no, then judge the mapping of this first layer singly Whether member has done the double-deck mapping, if not doing the double-deck mapping, distributes second layer mapping for this first layer map unit Table is preferably chosen in second layer mapping table resource pool and is allocated.
Then judge whether this first layer map unit has done single layer mapping, such as done single layer mapping, then by Physical address in one layer map unit reads from first layer mapping table and is converted into the physical address of each logical blocks.
Then the logical block addresses being newly written are mapped as physical address, this first layer map unit is judged if After result is the step of being in the step of whether having done the double-deck mapping, or whether to judge this first layer map unit Through done single layer mapping result be it is no after step after, the logical block addresses for being required to newly to be written are mapped as physical address.
The first layer map unit is directed toward second layer mapping table in first layer mapping table.
And second layer mapping table is written into the physical address of each logical blocks in the first layer map unit, to will count According in the flash memory for being written to solid state hard disk.
In a specific application scenarios when operation of host or FTL itself triggering write-in flash memory, FTL first will even Continuous logical block addresses are cut into the first layer map unit one by one, and these map units are mapped as physical address, Then mapping relations are recorded in the mapping table of first layer;If the logical blocks of write-in are big less than the first layer map unit Small, this first layer map unit is just first directed toward a second layer mapping table in first layer mapping table by FTL, then again In two layers of mapping table the logical blocks in the first layer map unit are mapped as physical address one by one, then record mapping relations In the mapping table of the second layer.
In a specific application scenarios, first layer mapping table only one.Therefore it is described in technical solution of the present invention The corresponding first layer mapping table of the first layer map unit is directed toward second layer mapping table, refer to by first layer mapping table with the The corresponding part of one layer map unit.
As a specific embodiment of the present invention, first layer mapping table can be an array when implementing, and Element in array is physical address or second layer mapping table address, if the element in single layer mapping array is exactly physical address, Such as using the double-deck mapping, then the element in array is exactly second layer mapping table address, the quantity of element is exactly logic in array The quantity of the first layer map unit of address.Such as A, that is, logical address, B, that is, physical address, mapping relations are: A0-B4, A1- > B9, A2- > B3, A3- > B5 just only need [B4, B9, B3, B5] in that mapping table.The index of mapping table is exactly logical address, content It is exactly physical address.
If logical block addresses range is L, the size of the first layer map unit is U1, then the quantity of element is in array L/U1。
If the data of write-in include one or more complete first layer map units, each first layer mapping is single Member can disposably be mapped as physical address, and element corresponding with these first layer map units is just in first layer mapping table It is corresponding physical address.
If range of physical addresses is P, physical address can be divided into P/U1 the first layer map units, therefore the The physical address of one layer map unit needs log2 (P/U1)/8 byte to indicate.
The storage size that first layer mapping table needs is at least are as follows:
S1=L/U1*log2 (P/U1)/8.
As soon as if the data of host write-in cannot gather together enough first layer map unit, then this first layer map unit It cannot be mapped according to single layer;In this case, in first layer mapping table, this first layer map unit institute is right The element answered just is not directed to physical address, and is directed to second layer mapping table.Each second layer mapping table is also a number Group, the element in array is physical address, and the quantity of element is exactly the logic area that the first layer map unit is included in array The quantity of block.
It is specifically as shown in Figure 4 for the relationship of the first layer map unit, first layer mapping table and second layer mapping table.
As a specific embodiment of the present invention, the first layer mapping of second layer map unit can be divided into The quantity of unit is equipped with upper limit value.
I.e. each first layer logical mappings unit that cannot do single layer mapping has a corresponding second layer mapping table. For save mapping table memory space, to cannot do single layer mapping first layer logical mappings unit limited amount system.If At most allow there are the J first layer logical mappings units that cannot do single layer mapping, then being up to J second layer mapping in system Table.
If the first layer map unit includes M the second layer map units, in that second layer mapping table, the quantity of element is just It is M.
If range of physical addresses is P, the second layer map unit size is U2, then each element needs in second layer mapping table Log2 (P/U2)/8 byte is wanted to indicate.
The storage size that second layer mapping table needs in system is at least are as follows:
S2=J*M*log2 (P/U2)/8.
As a specific embodiment of the present invention, the second layer mapping table is stored in second layer mapping table resource pool It is interior.
As a specific embodiment of the present invention, when needing second layer mapping table, from the second layer mapping table Second layer mapping table is distributed in resource pool;
When the second layer mapping table is not needed, then the second layer mapping table is discharged into the second layer mapping table Resource pool.
All second layer mapping tables are placed in a resource pool by FTL, from money when needing to carry out the double-deck mapping Second layer mapping table is distributed in the pond of source, is released into resource pool if the second layer mapping table no longer needs.
It, may be to script single layer when host carries out random address write-in in a specific application scenarios Data (the corresponding data of logical address) in first layer map unit of mapping are modified, this map unit just needs in this way It to be mapped from single layer and be changed to the double-deck mapping.In this case, a second layer is first distributed from second layer mapping table resource pool Mapping table, original physical address of the second layer map unit (i.e. logical blocks) that data are not changed is from first layer mapping table It copies and is transformed into second layer mapping table, then there is the second layer map unit of change to reflect again data in second layer mapping It penetrates as new physical address and is recorded in second layer mapping table, the first layer map unit is directed toward this in first layer mapping table Second layer mapping table.
When host carries out sequence address write-in, the multiple second layers mapping for needing the double-deck mapping originally may be made Unit can be with Continuous Mappings for first layer map unit, that is to say, that change into single layer mapping by the original double-deck mapping. In this case, first original second layer mapping table is discharged into second layer mapping table resource pool, then by corresponding first Map unit is once mapped as physical address and updates into first layer mapping table.
Second layer mapping table as a specific embodiment of the present invention, in the second layer mapping table resource pool When being reduced to threshold value, map unit union operation is carried out.
As a specific embodiment of the present invention, the map unit union operation, comprising:
Data in all logical blocks for being under the jurisdiction of same first layer map unit are read out,
The data of reading are reconsolidated;
The data reconsolidated are put into first layer map unit, and first layer map unit is passed through first Layer mapping table is mapped as physical address, reflects so that the second layer mapping table that the first layer mapping table is directed toward is discharged into the second layer In firing table resource pool.
As a specific embodiment of the present invention, the triggering of the map unit union operation in not storing data Threshold value is less than the activation threshold value of map unit union operation when storing data.
In a specific application scenarios, as shown in Figure 5.When host carries out random address write-in, FTL is used The quantity of second layer mapping table will increase, the resource quantity in second layer mapping table resource pool can be reduced in other words;Work as host When being sequentially written in, the quantity for the second layer mapping table that FTL is used can be reduced, in other words second layer mapping table resource pool In resource quantity will increase.When the resource quantity in second layer mapping table resource pool be reduced to certain thresholding (threshold value) when It waits, FTL will start map unit union operation, that is, the institute for being under the jurisdiction of same first layer map unit that bilayer is mapped There are the data in logical blocks to read out from flash memory, reconsolidates and carry out single layer mapping, reflected to discharge the original second layer Firing table is into second layer mapping table resource pool.And judge whether the second layer mapping table resource in second layer mapping table resource pool is high In terminate thresholding, as be higher than end thresholding if terminate map unit union operation, be such as not above end thresholding, can such as continue into Row map unit union operation.
FTL usage threshold when idle state is different from the thresholding that working condition uses, and makes it in idle state ratio Map unit merging is more energetically carried out in working condition.Idle state is in no progress write operation, and working condition is When carrying out write operation.Host will not trigger FTL when doing random writing whithin a period of time and do map unit merging;And it is writing After entering stopping, it is possible to triggering map unit merging.If host continuously does random writing, FTL eventually because Second layer mapping table reduces too many and starts map unit union operation.
The scheme of storing data as a preferred option can be carried out further on the basis of the above-mentioned double-deck mapping Multi-level mapping specifically includes:
It is multiple first layer map units by logical block addresses Range-partition in response to write operation;
First layer map unit is divided into multiple second layer map units;
Second layer map unit is divided into multiple third layer map units;
Etc. until,
The n-th layer map unit is divided into multiple (n+1)th layer map units.
In the mapping scheme of multilayer: n-th layer map unit size is the integral multiple of (n+1)th layer of map unit size, And the last layer map unit size is identical as logical blocks size;N-th layer map unit is in n-th layer mapping table or is directed toward Physical address (if the logical blocks that the map unit includes are continuous and complete) or (n+1)th layer of mapping table of direction be not (if The map unit can be mapped directly into physical address);First layer mapping table can be a fixed array, and other layers reflect Firing table then dynamically can distribute and merge.Multi-level mapping is that the double-deck extension mapped, principle and method are mapped with double-deck, This is repeated no more.
Embodiment two:
Corresponding with date storage method in embodiment one, the present invention also provides a kind of method for reading data, comprising:
It is the first layer map unit by logical block addresses Range-partition in response to read operation;
Inquire the corresponding first layer mapping table of first layer map unit;
The corresponding physical address of logical blocks is such as inquired in the first layer mapping table, then directly from the first layer Physical address is read in mapping table, and data are then read by the physical address in the first layer mapping table;
The corresponding physical address of logical blocks is not inquired in the first layer mapping table such as, then from the first layer The address of second layer mapping table is read in mapping table, then reads physical address from second layer mapping table;Then pass through described the The physical address in two layers of mapping table reads data.
When host carries out read operation, logical block addresses are first divided into the first layer map unit by FTL, are then looked into First layer mapping table;If it find that being single layer mapping, physical address is directly read from mapping table;It is mapped if it is bilayer, first The address of second layer mapping table is read from first layer mapping table, then reads physical address from second layer mapping table;Then lead to It crosses physical address and reads data.
Embodiment three:
The present invention also provides a kind of data storage devices, use the date storage method for implementing one;
With or
Implement two method for reading data.
Such as solid state hard disk or other data storage devices based on solid state hard disk, or the storage principle with solid state hard disk The same data storage device, such as data storage of existing mobile phone or tablet computer.
Example IV:
The present invention also provides a kind of electronic equipment, use the data storage device of embodiment three.
Such as mobile phone, computer, VR equipment.
In specific application, host whithin a period of time random writing when will not trigger map unit merging, from Amplification is write without additionally increasing, will not influence the performance of host random writing;When host computer side stops being written, FTL can Map unit merging can be triggered, more second layer mapping tables is discharged, writes amplification although will cause this when, still Due to occurring during idle time, the performance that host is write is nor affected on.
If host continuously carries out random writing, that FTL is eventually because remaining second layer mapping table is very little And map unit merging is carried out while being forced in host write-in.But this write mode is the extreme situation of comparison, very much It will not occur in actual operation flow.
Basic principle of the invention is described in conjunction with specific embodiments above, however, it is desirable to, it is noted that in the present invention The advantages of referring to, advantage, effect etc. are only exemplary rather than limitation, must not believe that these advantages, advantage, effect etc. are of the invention Each embodiment is prerequisite.In addition, the detail of foregoing invention is merely to exemplary effect and the work being easy to understand With, rather than limit, above-mentioned details is not intended to limit the present invention as that must realize using above-mentioned concrete details.
In the present invention, relational terms such as first and second and the like be used merely to by an entity or operation with Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities The relationship or sequence on border, the present invention involved in device, device, equipment, system block diagram be only used as illustrative example And it is not intended to require or imply to be attached in such a way that box illustrates, arrange, configure.Such as those skilled in the art What member will be recognized, it can be connected by any way, arrange, configure these devices, device, equipment, system.Such as " comprising ", The word of "comprising", " having " etc. is open vocabulary, is referred to " including but not limited to ", and can be used interchangeably with it.Here institute The vocabulary "or" and "and" used refers to vocabulary "and/or", and can be used interchangeably with it, unless context be explicitly indicated be not as This.Vocabulary " such as " used herein above refers to phrase " such as, but not limited to ", and can be used interchangeably with it.
In addition, as used herein, the "or" instruction separation used in the enumerating of the item started with "at least one" It enumerates, so that enumerating for such as " at least one of A, B or C " means A or B or C or AB or AC or BC or ABC (i.e. A and B And C).In addition, wording " exemplary " does not mean that the example of description is preferred or more preferable than other examples.
It may also be noted that in the system and method for the present invention, each component or each step are can to decompose and/or again Combination nova.These, which decompose and/or reconfigure, should be regarded as equivalent scheme of the invention.
The technology instructed defined by the appended claims can not departed from and carried out to the various of technology described herein Change, replace and changes.In addition, the scope of the claims of the invention is not limited to process described above, machine, manufacture, thing Composition, means, method and the specific aspect of movement of part.Can use carried out to corresponding aspect described herein it is essentially identical Function or realize essentially identical result there is currently or later to be developed processing, machine, manufacture, event group At, means, method or movement.Thus, appended claims include such processing, machine, manufacture, event within its scope Composition, means, method or movement.
The above description of invented aspect is provided so that any person skilled in the art can make or use this Invention.Various modifications in terms of these are readily apparent to those skilled in the art, and are defined herein General Principle can be applied to other aspect without departing from the scope of the present invention.Therefore, the present invention is not intended to be limited to Aspect shown in this, but according to the principle and the consistent widest range of novel feature in the invention.
In order to which purpose of illustration and description has been presented for above description.In addition, this description is not intended to reality of the invention It applies example and is restricted to form in the invention.Although already discussed above multiple exemplary aspects and embodiment, this field skill Its certain modifications, modification, change, addition and sub-portfolio will be recognized in art personnel.

Claims (18)

1. a kind of date storage method characterized by comprising
It is multiple first layer map units by logical block addresses Range-partition in response to write operation;
Judge whether first layer map unit is continuous and complete;
Discontinuous or incomplete first layer map unit is divided into multiple second layer map units;
It is physical address by the address of cache of the logical blocks;
The corresponding first layer mapping table of discontinuous or incomplete first layer map unit is directed toward second layer mapping table;
By the physical address write-in second layer mapping of the logical blocks in discontinuous or incomplete first layer map unit Table.
2. date storage method according to claim 1, which is characterized in that the address of cache by the logical blocks After the step of for physical address, comprising:
First layer mapping table is written into the physical address of logical blocks in continuous and complete first layer map unit.
3. date storage method according to claim 1, which is characterized in that described to judge that first layer map unit is After no continuous and complete step, further includes:
As first layer map unit be it is continuous and complete, then judge whether first layer map unit has corresponding the Two layers of mapping table;
If first layer map unit is that have corresponding second layer mapping table, then the second layer mapping table is discharged;
First layer map unit is mapped directly into physical address, and updates the first layer mapping table.
4. date storage method according to claim 1, it is characterised in that: it is described will be discontinuous or incomplete described The corresponding first layer mapping table of one layer map unit is directed toward second layer mapping table, comprising:
Judge whether the corresponding first layer mapping table of discontinuous or incomplete first layer map unit has been directed to second Layer mapping table,
The corresponding first layer mapping table of first layer map unit as described in discontinuous or incomplete is not directed toward second layer mapping Table then distributes corresponding second layer mapping table for first layer map unit.
5. date storage method according to claim 1, which is characterized in that the second layer mapping table is stored in the second layer In mapping table resource pool.
6. date storage method according to claim 5, it is characterised in that:
When needing second layer mapping table, second layer mapping table is distributed from the second layer mapping table resource pool;
When the second layer mapping table is not needed, then the second layer mapping table is discharged into the second layer mapping table resource Pond.
7. date storage method according to claim 6, it is characterised in that:
When the second layer mapping table in the second layer mapping table resource pool is reduced to threshold value, carries out map unit and merge behaviour Make.
8. date storage method according to claim 7, which is characterized in that the map unit union operation, comprising:
Data in all logical blocks for being under the jurisdiction of same first layer map unit are read out,
The data of reading are reconsolidated;
The data reconsolidated are put into first layer map unit, and first layer map unit is reflected by first layer Firing table is mapped as physical address, so that the second layer mapping table that the first layer mapping table is directed toward is discharged into second layer mapping table In resource pool.
9. date storage method according to claim 7, it is characterised in that:
In not storing data, the activation threshold value of the map unit union operation is less than map unit when storing data and closes And the activation threshold value operated.
10. date storage method according to claim 1, it is characterised in that:
The size of the map unit of the first layer is the integral multiple of logical blocks size, the size of second layer map unit It is identical with the size of logical blocks.
11. date storage method according to claim 1, it is characterised in that:
The first layer mapping table is array, and the element in the array of the first layer mapping table is that physical address or the second layer reflect Firing table address, the quantity of element is the first layer of logical block addresses Range-partition in the array of the first layer mapping table The quantity of map unit.
12. date storage method according to claim 11, it is characterised in that:
The second layer mapping table is array, and the element in the array of the second layer mapping table is physical address, described second The quantity of element is the quantity for the logical blocks that first layer map unit is included in the array of layer mapping table.
13. date storage method according to claim 1, it is characterised in that:
The quantity that the first layer map unit of second layer map unit can be divided into is equipped with upper limit value.
14. date storage method according to claim 1, it is characterised in that: include:
It is multiple first layer map units by logical block addresses Range-partition in response to write operation;
First layer map unit is divided into multiple second layer map units;
Second layer map unit is divided into multiple third layer map units;
Until
The n-th layer map unit is divided into multiple (n+1)th layer map units.
15. date storage method according to claim 14, it is characterised in that:
The n-th layer map unit size is the integral multiple of (n+1)th layer of map unit size, and (n+1)th layer of the mapping Cell size is identical as logical blocks size.
16. a kind of method for reading data characterized by comprising
It is the first layer map unit by logical block addresses Range-partition in response to read operation;
Inquire the corresponding first layer mapping table of first layer map unit;
The corresponding physical address of logical blocks is such as inquired in the first layer mapping table, then is directly mapped from the first layer Physical address is read in table, and data are then read by the physical address in the first layer mapping table;
The corresponding physical address of logical blocks is not inquired in the first layer mapping table such as, then is mapped from the first layer The address of second layer mapping table is read in table, then reads physical address from second layer mapping table;Then pass through the second layer The physical address in mapping table reads data.
17. a kind of data storage device, which is characterized in that use data storage side described in claim 1 to claim 15 Method;
With or
Method for reading data described in claim 16.
18. a kind of electronic equipment, which is characterized in that use the data storage device described in claim 17.
CN201811311003.1A 2018-11-06 2018-11-06 Data storage method, data reading method, data storage device, data reading device and electronic equipment Active CN109491927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811311003.1A CN109491927B (en) 2018-11-06 2018-11-06 Data storage method, data reading method, data storage device, data reading device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811311003.1A CN109491927B (en) 2018-11-06 2018-11-06 Data storage method, data reading method, data storage device, data reading device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109491927A true CN109491927A (en) 2019-03-19
CN109491927B CN109491927B (en) 2023-02-03

Family

ID=65693914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811311003.1A Active CN109491927B (en) 2018-11-06 2018-11-06 Data storage method, data reading method, data storage device, data reading device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109491927B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347614A (en) * 2019-07-08 2019-10-18 青岛镕铭半导体有限公司 Memory space mapping algorithm, buffer status machine, storage device, storage medium
CN111158584A (en) * 2019-11-26 2020-05-15 国网江苏省电力有限公司盐城供电分公司 Distribution network construction safety quality control platform big data storage method and system based on ubiquitous power Internet of things
CN111897745A (en) * 2019-05-05 2020-11-06 北京兆易创新科技股份有限公司 Data storage method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110283052A1 (en) * 2010-05-14 2011-11-17 Tdk Corporation Memory controller, flash memory system with memory controller, and method of controlling flash memory
CN102819496A (en) * 2012-08-16 2012-12-12 无锡紫芯集成电路系统有限公司 Address translation method of flash FTL (Flash Translation Layer)
CN104133779A (en) * 2013-05-02 2014-11-05 擎泰科技股份有限公司 Non-volatile memory and method of dynamically adjusting mapping manner of same
US20160048448A1 (en) * 2013-03-25 2016-02-18 Ajou University Industry-Academic Cooperation Foundation Method for mapping page address based on flash memory and system therefor
CN106547703A (en) * 2016-10-08 2017-03-29 华中科技大学 A kind of FTL optimization methods based on block group structure
US20170235488A1 (en) * 2016-02-11 2017-08-17 SK Hynix Inc. Window based mapping

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110283052A1 (en) * 2010-05-14 2011-11-17 Tdk Corporation Memory controller, flash memory system with memory controller, and method of controlling flash memory
CN102819496A (en) * 2012-08-16 2012-12-12 无锡紫芯集成电路系统有限公司 Address translation method of flash FTL (Flash Translation Layer)
US20160048448A1 (en) * 2013-03-25 2016-02-18 Ajou University Industry-Academic Cooperation Foundation Method for mapping page address based on flash memory and system therefor
CN104133779A (en) * 2013-05-02 2014-11-05 擎泰科技股份有限公司 Non-volatile memory and method of dynamically adjusting mapping manner of same
US20170235488A1 (en) * 2016-02-11 2017-08-17 SK Hynix Inc. Window based mapping
CN106547703A (en) * 2016-10-08 2017-03-29 华中科技大学 A kind of FTL optimization methods based on block group structure

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897745A (en) * 2019-05-05 2020-11-06 北京兆易创新科技股份有限公司 Data storage method and device, electronic equipment and storage medium
CN111897745B (en) * 2019-05-05 2024-04-05 兆易创新科技集团股份有限公司 Data storage method and device, electronic equipment and storage medium
CN110347614A (en) * 2019-07-08 2019-10-18 青岛镕铭半导体有限公司 Memory space mapping algorithm, buffer status machine, storage device, storage medium
CN110347614B (en) * 2019-07-08 2022-08-12 镕铭微电子(济南)有限公司 Storage space mapping algorithm, cache state machine, storage device, and storage medium
CN111158584A (en) * 2019-11-26 2020-05-15 国网江苏省电力有限公司盐城供电分公司 Distribution network construction safety quality control platform big data storage method and system based on ubiquitous power Internet of things
CN111158584B (en) * 2019-11-26 2022-09-30 国网江苏省电力有限公司盐城供电分公司 Distribution network construction safety quality control platform big data storage method and system based on ubiquitous power Internet of things

Also Published As

Publication number Publication date
CN109491927B (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US7962687B2 (en) Flash memory allocation for improved performance and endurance
US8010770B2 (en) Caching device for NAND flash translation layer
CN108021510A (en) The method for operating the storage device being managed to multiple name space
US7761648B2 (en) Caching method for NAND flash translation layer
TWI494761B (en) Method of partitioning physical block and memory system thereof
US20140089564A1 (en) Method of data collection in a non-volatile memory
CN109491927A (en) Data storage, read method, device and electronic equipment
US20090037648A1 (en) Input/output control method and apparatus optimized for flash memory
CN104866428A (en) Data access method and data access device
US20180129602A1 (en) Garbage collection method for data storage device
US20190391756A1 (en) Data storage device and cache-diversion method thereof
CN111240601B (en) Method, device, equipment and storage medium for determining superblock of partitioned space
CN102541755B (en) The method of flash memories and reception data thereof
CA2758235A1 (en) Device and method for storage, retrieval, relocation, insertion or removal of data in storage units
CN109582219A (en) Storage system, computing system and its method
JP2010515162A5 (en)
CN101673246A (en) High-efficient first-in first-out (FIFO) data pool reading and writing method
US20120131264A1 (en) Storage device
WO2020192710A1 (en) Method for processing garbage based on lsm database, solid state hard disk, and storage apparatus
CN107329909B (en) Data management method and device
CN105630410B (en) The method for managing file storage area using non-volatile random read-write storage chip dynamic
CN113918087B (en) Storage device and method for managing namespaces in the storage device
CN105630697B (en) A kind of storage device using MRAM storage small documents
CN114003169B (en) Data compression method for SSD
CN117616377A (en) Superblock allocation across superdevices in ZNS SSDs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20211209

Address after: 250100 room 2-302-131, building 7, North District, Shandong design creative industrial park, No. 868, Tangye West Road, Jinan area, free trade pilot zone, Jinan, Shandong Province

Applicant after: Rongming Microelectronics (Jinan) Co.,Ltd.

Address before: 266100 blue Silicon Valley entrepreneurship center, No. 1, Keji Road, Jimo District, Qingdao, Shandong

Applicant before: QINGDAO RONGMING SEMICONDUCTOR Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant