CN108710472A - For the abrasion equilibrium management method and distributed memory system inside storage unit - Google Patents

For the abrasion equilibrium management method and distributed memory system inside storage unit Download PDF

Info

Publication number
CN108710472A
CN108710472A CN201810394073.1A CN201810394073A CN108710472A CN 108710472 A CN108710472 A CN 108710472A CN 201810394073 A CN201810394073 A CN 201810394073A CN 108710472 A CN108710472 A CN 108710472A
Authority
CN
China
Prior art keywords
data
storage unit
record
offset
write
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.)
Pending
Application number
CN201810394073.1A
Other languages
Chinese (zh)
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.)
PKU-HKUST SHENZHEN-HONGKONG INSTITUTION
Peking University Shenzhen Graduate School
Original Assignee
PKU-HKUST SHENZHEN-HONGKONG INSTITUTION
Peking University Shenzhen Graduate School
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 PKU-HKUST SHENZHEN-HONGKONG INSTITUTION, Peking University Shenzhen Graduate School filed Critical PKU-HKUST SHENZHEN-HONGKONG INSTITUTION
Priority to CN201810394073.1A priority Critical patent/CN108710472A/en
Publication of CN108710472A publication Critical patent/CN108710472A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention provides a kind of abrasion equilibrium management method for inside storage unit and distributed memory system, the abrasion equilibrium management method include the following steps:Step S1 receives and judges the type of request of data, and go to step S2 when receiving data record write request, and go to step S3 when receiving data record access request;Current data record is written according to the offset record of a upper data record in step S2, and after current data record is written, the end position for preserving current data record is noted down as the offset of next data recording;Step S3, the offset of storage unit where reading it according to data record access request records, and the data in data record are started reading out from offset.The present invention passes through the read-write situation inside record storage unit so that can preferentially be write completely the inside of whole memory cell to the continuous write operation of the storage unit, can extend the cycle reading-writing life-span of storage unit, improve readwrite performance.

Description

For the abrasion equilibrium management method and distributed memory system inside storage unit
Technical field
The present invention relates to a kind of abrasion equilibrium management method more particularly to a kind of abrasion equilibriums for inside storage unit Management method, and be related to using the distributed memory system for the abrasion equilibrium management method inside storage unit.
Background technology
Nonvolatile memory(Non-Volatile Memory, NVM)It is a kind of novel memory technology, with traditional SRAM/ DRAM is compared, have many advantages, such as it is non-volatile, by byte access, high storage density, low speed paper tape reader static power disspation, readwrite performance close to DRAM but Data can be kept for a long time, but there is also readwrite performance asymmetry, the problem of reading far faster than writing, restricted lifetime being written. In the storage device be made of NVM, if there are larger gaps for the erasable update times between different address, part area will be caused Domain abrasion is very fast and quickly forms bad block, and other region is then seldom wiped;As long as and have the generation of bad BOB(beginning of block), NVM deposits The performance of storage equipment will be gradually reduced and become unavailable.Unbalanced so erasable lead to NVM entirety life to reduce The drawbacks of cycle time, needs Wear leveling algorithm(Wear-Levelling)To solve the problems, such as this.Existing abrasion equilibrium Algorithm is mainly to ensure that all storage units statistically by equably erasable to postpone the generation of bad block, and it is not intended that The abrasion condition of storage unit interior zone.Because for general storage system, most data are more single than storage Member is much bigger, so only considering the equilibrium between storage unit.Such as file system storage unit in storage file is 4KB sizes, and general file size all be much larger than 4KB, the storage unit largely used all write it is full, so and being not required to Specially to consider the abrasion equilibrium problem inside storage unit.On the other hand, Flash flash memories are based on for very widely used today Storage device for, it is erasable inherently press block carry out, so the state of wear inside monoblock storage unit is protected substantially It holds consistent.But reality can also have many specific application scenarios in the middle, need frequently largely to tie using with persistent storage The small data of structure, and these small datas are also not suitable for compression and are packaged storage, for example the newer transaction record of high frequency, disappear online Breath, high speed information caching etc..In these scenes, when the known most of data record size to be written is all significantly less than depositing When storage unit size, the space to front is actually all only used by a large amount of storage units of existing mode, and trailing space does not all have Used, be written in this way it is unbalanced front space abrasion will be caused very fast, as a result storage unit is write as a whole Indegree early arrives at the upper limit and becomes bad block.
But since existing Wear leveling algorithm is not directed to the scene optimization of a large amount of small datas storage.
It is to realize that the abrasion between storage unit is equal by controlling the migration of cold and hot data now with a kind of technical solution Weighing apparatus.Data in the few storage unit of write-in number are known as cold data, i.e. data are seldom updated, and storage list often is written Data in member are known as dsc data, i.e. data are often updated.It is to establish a record to deposit wherein to have a kind of Wear leveling algorithm The table of number is written in storage unit, and the exchange of cold and hot data is carried out by Management Controller to realize between storage unit based on the table Erasable equilibrium.Specifically, when the difference of the write-in number of any two storage unit is more than a given threshold value, or work as When the write-in number of some storage unit is more than the average write-in number of all storage units, starts abrasion equilibrium processing, will write The data in the storage unit of data and write-in often in the few storage unit of indegree swap.Separately there is a kind of abrasion Equalization algorithm Start-Gap algorithms do not consider the number of writing of storage unit, periodically move storage unit to adjacent position It is dynamic so that the erasable number of data block where cold and hot data is balanced.
The shortcomings that this scheme, is, only considered and how to carry out abrasion equilibrium between storage unit, and there is no consider Space inside to storage unit whether abrasion equilibrium, so being not particularly suited for towards the mill inside a large amount of small data storage units Damage is balanced;In addition, such scheme needs to carry out data copy operation introducing time overhead when carrying out cold and hot data exchange.
It is for storage component part is due to quality and durability degree is inconsistent causes using that the prior art, which also has a kind of scheme, The problem that the grade different band of mistake is come occurs in the process;Memory block is subdivided into multiple pages, according to error rate as unit of page The step of specific a page is written in a non-uniform manner, so that multiple pages of abrasion achievees the effect that equilibrium in block.Because The loss of page in the block of memory etc be non-uniform, different page in the case that the loss of identical write-in number may also It is different.Page error rate situation will be caused different so evenly distributing page write operation, be had when carrying out erasable operation different It is lost situation, this scheme is using unbalanced write-in come so that not reaching the relatively uniform of the bit error rate between same page in block and can Control;The error occurred in them is monitored by being uniformly written memory page in the block in advance, the error of not same page is obtained with this Behavior;Then load sharing algorithm is called to execute page write-in distribution heterogeneous according to page error behavior, write operation is main It is directed to and does not allow to be also easy to produce those of error page, it is intended to realize abrasion relatively impartial between page in block.
But this scheme is directed to lead to unit internal error rate etc. due to device quality itself and durability degree difference The inconsistent situation of grade is substantially still regarded memory as minimum memory unit of uniform size form, is not considered The case where practical read-write data are less than minimum memory unit-sized.
Invention content
It is a kind of a large amount of small for existing in the data to be written the technical problem to be solved by the present invention is to need to provide Data, and then storage unit can be overcome often to write abrasion equilibrium that is discontented and making its internal front and back unbalanced drawback of abrasion Management method, and further provide for using the distributed storage system for the abrasion equilibrium management method inside storage unit System.
In this regard, the present invention provides a kind of abrasion equilibrium management method for inside storage unit, include the following steps:
Step S1 receives and judges the type of request of data, gos to step when request of data is data record write request S2, go to step S3 when request of data is data record access request;
Step S2 is written current data record according to the offset record of a upper data record, and current data is being written After record, the end position for preserving current data record is noted down as the offset of next data recording;
Step S3, the offset of storage unit where reading it according to data record access request are recorded, are recorded from inclined according to offset Shifting amount starts reading out the data in data record, and the offset record includes offset and data size information.
Further improvement of the present invention is that the step S2 includes following sub-step:
Step S201 obtains memory unit address according to a upper data record;
Step S202 reads a upper data and is recorded in offset record in the storage unit;
Step S203 accesses the storage unit, and current data record is written since the offset of a upper data record And the offset record of next data recording.
Further improvement of the present invention is, in the step S203, since the offset of a upper data record, first Write-in notes down information for the flag of scanning recognition and the offset for generating next data recording, then is written current Data record;The offset record information for generating next data recording includes the sequence number sum number of current data record According to size.
Further improvement of the present invention is, in the step S203, if the storage unit is begun with from offset Success is then written for storing complete current data record in enough spaces;Otherwise, real by being sequentially written in or folding write-in Existing write operation.
Further improvement of the present invention is, realizes that the process of write operation is by being sequentially written in:Application one is new Storage unit, the partial data that do not stored during current data is recorded are stored in new storage unit, and two storages of label Correlativity between unit and precedence;Realize that the process of write operation is by folding to be written:Current data is recorded In the partial data do not stored be stored in the head space of the storage unit.
Further improvement of the present invention is, in the step S3, if the size of data of current data record is less than institute The space size that the offset of storage unit starts is stated, then directly accesses and realizes digital independent;Otherwise basis is sequentially written in or rolls over Corresponding data read process is realized in folded write-in.
Further improvement of the present invention is, when the step S203 is using the write operation being sequentially written in, institute It states step S3 and first reads the partial data stored in current storage unit, then according to the relationship between two storage units Record finds the new storage unit where remainder data, after accessing the new storage unit and reading data, most Merged afterwards by data and returns to complete reading result;When the step S203 is using the write operation for folding write-in, The step S3 first reads the partial data that current storage unit is stored since offset, then jumps to current storage list Remaining partial data is read in the head control of member, and result is read finally by data merging return is complete.
Further improvement of the present invention is, identification information is first read when powering on, if identification information does not include being written more New success flag is then judged as improper power down, and is scanned to the storage unit, according to the flag in storage unit Correctly offset record is found, address reconstruct offset is specified to record corresponding offset information table in memory.
Further improvement of the present invention is, before realizing data record write-in, by the memory allocation of memory at N number of Isometric storage unit, and establish a memory unit address for recording each storage unit and its partially in memory simultaneously Move the record sheet of record;N is natural number.
The present invention also provides a kind of distributed memory system, the abrasion as described above for inside storage unit is applied Balanced management method.
Compared with prior art, the beneficial effects of the present invention are:By the read-write situation inside record storage unit, make It obtains and the continuous write operation of the storage unit can preferentially be write the inside of whole memory cell completely, rather than as the prior art It has from the beginning write repeatedly every time, and then has substantially prolonged the cycle of storage unit by the abrasion equilibrium management inside storage unit Reading-writing life-span improves readwrite performance.
Also, the abrasion equilibrium management method proposed by the present invention for inside storage unit can be with present for depositing Wear leveling algorithm between storage unit is used in combination, and compatibility is strong, on the basis of maintaining lower time and space expense, Abrasion is balancedly distributed in all areas of entire storage device in more fine granularity, to extend the whole longevity of storage device Life, effectively improves the performance of storage device and reduces use cost, can also be applied to structure distributed memory system, Jin Erti The service life and storage performance of high distributed memory system.
Description of the drawings
Fig. 1 is the workflow schematic diagram of an embodiment of the present invention;
Fig. 2 is the principle schematic of storage unit record data in an embodiment of the present invention;
Fig. 3 is the distribution of an embodiment of the present invention and the workflow schematic diagram of write storage unit;
Fig. 4 is the principle schematic diagram of the data recording of an embodiment of the present invention;
Fig. 5 is the principle schematic diagram of the record sheet of an embodiment of the present invention;
Fig. 6 is the principle schematic that an embodiment of the present invention realizes data recording write-in by continuous two storage units;
Fig. 7 is principle schematic of an embodiment of the present invention when receiving new data record write request;
Fig. 8 is the principle schematic that an embodiment of the present invention realizes write operation by being sequentially written in;
Fig. 9 is the principle schematic that an embodiment of the present invention determines offset in being sequentially written in operation.
Specific implementation mode
Below in conjunction with the accompanying drawings, the preferably embodiment of the present invention is described in further detail.
As shown in Figure 1, this example provides a kind of abrasion equilibrium management method for inside storage unit, including following step Suddenly:
Step S1 receives and judges the type of request of data, gos to step when request of data is data record write request S2, go to step S3 when request of data is data record access request;
Step S2 is written current data record according to the offset record of a upper data record, and current data is being written After record, the end position for preserving current data record is noted down as the offset of next data recording;
Step S3, the offset of storage unit where reading it according to data record access request are recorded, are recorded from inclined according to offset Shifting amount starts reading out the data in data record, and the offset record includes offset and data size information.
It is noted that this example is directed to the situation for carrying out abrasion equilibrium inside unit memory space, without It is the abrasion equilibrium between storage unit.In practical applications, there are a large amount of small datas for the data to be written in storage device, and The size of small data is significantly smaller than the size of unit memory space, and shown unit storage control referred to as stores single in this example Member, the storage unit is the least unit that system accesses storage device, and often as unit of page, size is 4KB or more.
Existing Wear leveling algorithm works as major part mainly for the consistency for keeping the degree of wear between storage unit When storage unit writes discontented for a long time due to storage small data, the memory space of storage unit tail portion often takes less than, will Notable unbalanced on leading to the wasting of resources and wearing, i.e., existing Wear leveling algorithm is directed to the storage of a large amount of small datas Scene optimizes, therefore, the abrasion equilibrium management method for coming balanced storage unit inner space that this example proposes.
That is, for there are a large amount of small datas in the data to be written, i.e., very multidata length is less than storage Cell size and these data records must structuring storage, and then when leading to carry out data storage, storage unit is often write It is discontented with and makes its internal front and back unbalanced situation of abrasion;Common example has small documents in file system, NOSQL data Library, operation log information and network packet caching etc..This example can on the basis of maintaining lower room and time expense, Uniformly using all spaces inside storage unit, the whole service life of storage unit is improved.
More specifically, step S2 described in this example includes following sub-step:
Step S201 obtains memory unit address according to a upper data record, i.e., directly uses a upper number in storage device According to the memory unit address of record;
Step S202 reads a upper data and is recorded in offset record in the storage unit;
Step S203 accesses the storage unit, and current data record is written since the offset of a upper data record And the offset record of next data recording.
In step S203 described in this example, since the offset of a upper data record, first write-in is for scanning recognition Information is noted down in flag and offset for generating next data recording, then current data record is written;It is described to be used for The offset record information for generating next data recording includes the sequence number and size of data of current data record, for reconstructing partially Move record.
In step S203 described in this example, if the storage unit begins with enough spaces for storing completely from offset Current data record, then be written success, feedback write-in is updated successfully mark;Otherwise, real by being sequentially written in or folding write-in Existing write operation.Wherein, realize that the process of write operation is by being sequentially written in:Apply for a new storage unit, it will be current The partial data that do not stored in data record is stored in new storage unit, and the related pass between two storage units of label System and precedence;Realize that the process of write operation is by folding to be written:The part number that do not stored during current data is recorded According to the head space for being stored in the storage unit;Realize that the requirement for folding write-in is:If the size of partial data is strictly little In storage unit size, the head space of the storage unit can be re-used, the data failed to lay down are deposited since 0 offset It puts.
In step S203 described in this example, after completing data write-in, the respective offsets of the storage unit in memory are updated Record, offset record includes other necessary record information such as offset, size of data and mark of correlation.
Step S3 described in this example accesses the storage unit, and data are started reading out from offset according to offset record;Described In step S3, if the size of data of current data record is less than the space size that the offset of the storage unit starts, It directly accesses and realizes digital independent;Otherwise basis is sequentially written in or folds write-in and realizes corresponding data read process.
More specifically, when the step S203 is using the write operation being sequentially written in, the step S3 is first read The partial data stored in current storage unit is taken, residue is then found according to the relation record between two storage units New storage unit where partial data is closed after accessing the new storage unit and reading data finally by data And return to complete reading result;When the step S203 is using the write operation for folding write-in, the step S3 is first The partial data that current storage unit is stored since offset is read, then jumps to the head control of current storage unit Remaining partial data is read, merges finally by data and returns to complete reading result.The current storage unit is referred to as Current memory cell.
In the case of normal shutdown, this example by memory offsetting record with the rule structuralisation arranged in advance it The spatial dimension arranged in advance in non-volatile memory apparatus is deposited in afterwards, and update identification information confirms that backup write-in is updated successfully. Then when powering on next time, identification information is read, if it is backup success status, is engaged in the spatial dimension extraction structure first arranged The offset of change records information, and also referred to as offset records offset record information, can be understood and be discharged by the rule arranged in advance Specified address in memory;Final updating identification information confirms that backup is read successfully.
In the case of improper power down, this example first reads identification information when powering on, if identification information does not include write-in It is updated successfully mark, then is judged as improper power down, and be scanned to the storage unit, according to the mark in storage unit Position finds correctly offset record, and address reconstruct offset is specified to record corresponding offset information table in memory.
That is, step S2 and step S3 described in this example are not sequential steps, belong to by judging request of data into The step of entering;After the step S2 and step S3, it is further preferably provided with the step of judging whether normal powering down, and then realize More humanized abrasion equilibrium management.
It is noted that before realizing data record write-in, by the memory allocation of memory at N number of isometric storage Unit, and establish the note of a memory unit address and its offset record for recording each storage unit in memory simultaneously Table is recorded, and then can quickly position current memory cell offset;N is natural number.
This example also provides a kind of distributed memory system, applies as described above equal for the abrasion inside storage unit Weigh management method.
Therefore, this example can pass through the read-write situation inside record storage unit so that be write to the continuous of the storage unit Operation can preferentially write the inside of whole memory cell completely, rather than from the beginning write repeatedly every time as the prior art, into And the cycle reading-writing life-span of storage unit is substantially prolonged by the abrasion equilibrium management inside storage unit, improve read-write property Energy.
Also, what this example proposed can be with present for storing for the abrasion equilibrium management method inside storage unit Wear leveling algorithm between unit is used in combination, and compatibility is strong, will on the basis of maintaining lower time and space expense Abrasion is balancedly distributed in all areas of entire storage device in more fine granularity, to extend the whole longevity of storage device Life, effectively improves the performance of storage device and reduces use cost, can also be applied to structure distributed memory system, Jin Erti The service life and storage performance of high distributed memory system.
This example is without establishing large-scale physical address to virtual address mapping table and storage unit write-in number record Table need to only establish simple offset record for quickly positioning, effectively reduce space expense in memory;And the program Without carrying out moving for cold and hot data, processing time expense is efficiently avoided, various to data persistence and access performance Performance requirement can be met under the scene that has certain requirements, processing delay is effectively reduced, improve handling capacity.
In order to clearly illustrate that the technical solution and its effect of this example, this example also pass through example in greater detail below It is illustrated, in the case where being commonly used for the scene of storage of storage configuration data record, is come due to can not learn in advance Each data record length, generally distribute isometric storage unit by its possible largest amount.Assuming that the storage of distribution Space includes N number of storage unit that size is S.A record sheet is established in memory simultaneously for recording each storage unit to work as The offsets such as preceding offset record information, as shown in Fig. 2, Buffer 1 and Buffer 2 expressions is that two continuous storages are single Member, Buffer are storage unit.M, n and P is natural number.
When first round data record reaches, wherein first data record will be stored in the stem of Buffer1, number is built It is stored according to the metadata of record in its head space m, then there are the stems of Buffer2 for second data record, equally By its metadata, there are in its head space m on ground;And it is inclined that the presently written positions each Buffer are recorded in memory record sheet Shifting amount offset.Include the information such as the label and data length for being used for scan rebuilding in head space m.When Buffer1 is arrived After all storage units of Buffer N all write data, the storage of new round data will be again since Buffer1.
Certainly, between use other units in storage device if abrasion equilibrium strategy, completely according to list Wear leveling algorithm selects next storage unit used between member;But the operation inside each storage unit and foregoing description phase Together.
When storage unit is used again, the data record that newly arrives(N+1 as shown in Figure 2), according in record sheet Offset is written since the last round of data record end positions of Buffer1;Similarly, subsequent data record is successively from each The last round of data record end positions of Buffer start to be written, and so on, as shown in Figure 2.
Come as the m+1 data of Round 3 of Fig. 2 are recorded, when data record size is more than that current memory cell is remaining Free space size when the data record can not be left completely, needs to be classified as two parts:First half is write completely currently stored Next storage unit (Buffer2) or write-in current memory cell is either written in the remaining space of unit, latter half (Buffer1) front end(Claim to fold write-in at this time).In the first scenario, the data due to being stored in current memory cell And it is imperfect, it needs flag is arranged in the metadata and continuously reads and writes multiple storage units convenient for upper layer application to obtain complete number According to, or judged according to the data size information in metadata.The data record of next arrival(m+2)It writes backward In Buffer3.In the latter case, upper layer application need to only access the storage unit and can be obtained required data, but before use It needs to re-assembly;The data record (m+2) of next arrival is still stored using Buffer2;Round is wheel, indicates number According to the number of record.
For the first above-mentioned situation, when storing the latter half of the m+1 data record using Buffer2, such as Fig. 2 Round 4 shown in, next round data record arrival after ,+1 data record of pth will be stored to the initial position of Buffer1, + 2 data records of pth since Buffer2 is last round of from the end of the m+1 data record deposit, if remaining space is not It reaches, data is respectively present in two storage units by the way being divided into two with last round of similar use.By this method, It can ensure that all storage units will be equably written into from the beginning to the end, reach the abrasion equilibrium inside storage unit.
In this example, by selecting target storage devices of the NVM as network data transmission, network is received with realizing The purpose that preserves of the quick persistence of data, the occasion for being mainly directed towards high performance distributed key assignments storage and issued transaction makees Illustrate for specific scene example.
In these application scenarios, key assignments data or transaction journal are not of uniform size, therefore in storage management generally all Larger storage unit can be distributed by the upper limit, very strong small data feature is embodied in the use of memory space, leads to NVM There are the unbalanced problems of unit inter deterioration for equipment.Since the access of these key assignments or transaction instruction generally all can be respectively encapsulated in It is transmitted in independent network packet, selects 2KB as minimum storage unit in this example, be used for storing data packet, work enough Flow chart is each to store as shown in figure 3, the storage unit for distributing respective numbers on NVM first is used for storing write-in data Cell size is 2KB and recycles.When data packet reaches, it will the storage of distribution is in turn written according to Wear leveling algorithm In unit.
For ease of the lookup and access of data, the storage organization for needing design data to record.The example of one structure such as Fig. 4 Shown, wherein metadata size is 20B, and metadata size is also referred to as size of data, including pattern pattern, Data Identification amount d_ Three domains such as state and size of data d_size are used for the management of follow-up buffering area, and retain a privately owned domain private and be used for User Defined management.Because network packet is up to 1500B, data payload payload sizes 1500B with It is interior.
According to the Wear leveling algorithm of this example, storage location of the data packet in storage unit can constantly change, so needing Safeguard the data offset being had been written into each storage unit.This example preferably carrys out centralized maintenance using a record sheet in memory The offset of each storage unit, so that next round can quickly position the position of write-in.And the record sheet in memory in order to prevent It is lost after the improper power down of system, needs to scan and rebuild each storage using the domains pattern when recovery record table again The offset information of unit.In addition, when size of data is less than the trailing space of active cell, remainder data are stored to by selection In next data cell, so the data of a unit storage may be imperfect, need one and show whether data are complete The domains mark amount d_state are identified, also to show if imperfect current data block be first half data or after Half part.And show that the domain d_size of size of data is applied not only to data access, it is additionally operable to calculate the next round storage unit and write Enter the offset of position.
Due to data packet Length discrepancy and maximum only 1500B, the metadata size for being stored in buffer area is 20B, and for ground The purpose of location alignment(Page is generally 4KB sizes)Storage unit is sized to 2KB, so each storage unit can be complete Whole deposit puts a data packet and has remaining space.So if each storage unit is the sky of tail portion if from the beginning having write Between cannot will use forever.Therefore this example need to use the abrasion equilibrium management method to make all spaces inside storage unit It is uniformly written.
Safeguard that the record sheet structure of current memory cell offset is illustrated in fig. 5 shown below in memory, what buf_index was indicated is Storage unit serial number;Data_offset is the unit current offset, for the quick access to data.Flag is data shape State, for showing that the data in the storage unit are normal network data or wrong data.After system improper power down, It can find metadata token by scanning all NVM buffering areas and rebuild record sheet.The data record includes metadata mark Note.
When data packet arrival, the position of write-in data packet is determined using the abrasion equilibrium management method, such as Fig. 6 institutes Show, this example uses 10 storage units, selects to recycle side of the continuous storage unit as abrasion equilibrium between storage unit Case;Buffer 1 and Buffer 2 wherein shown in fig. 6 is two continuous units.When first round data packet reaches, wherein First data package size is that 1KB will be stored in the stem of Buffer 1, and before the metadata of data packet is stored in data In size portion space m, record 1 writing positions of Buffer offset is 1020B.Then second data package size exists for 800B The stem of Buffer 2, similarly leaves metadata.And the presently written position offsets of the Buffer in record sheet are set.
After the stem of 10 all buffering areas of Buffer 1 to Buffer has all deposited data packet, new round data packet is deposited Storage is again since Buffer 1.The data packet newly to arrive(Serial number n+1 data packets shown in Fig. 7)Inquire Buffer in record sheet 1 current offset data_offset is 1020B, data is then written from 1 deviation post 1020B of Buffer.Similarly, after Continuous data packet is written according to offset in record sheet from the last round of data packet end positions of each Buffer successively, and updates correspondence Memory record sheet, as shown in Figure 7.
As shown in figure 8, third round data packet reaches, the m+1 data package size is 800B, and size is more than currently to be written Storage unit residue free space size, a storage unit can not leave, need current data packet being divided into two completely Point, first half 440B writes full current memory cell remaining space, and latter half 360B is written next storage unit and updates Record sheet.Due to the data deposited in active cell and imperfect, so needing flag is arranged in the metadata makes upper layer application It knows how to re-assembly data packet before handling data packet.The data packet of next arrival(m+2)Next deposit is write backward In storage unit Buffer 3.
As shown in figure 9, after the arrival of new round data packet ,+1 data packet of pth is stored to the initial position of Buffer 1, the P+2 data packet since Buffer 2 is last round of from the end of the m+1 data packet deposit, if remaining space is inadequate, will Data are respectively present in two storage units by the way being divided into two with last round of similar use.It, can be with by this method Ensure that all NVM storage units all can be equably written into from the beginning to the end, reaches the abrasion equilibrium inside storage unit.
In conclusion main problem and technical essential that this example is solved include:Abrasion equilibrium between storage unit Algorithm be compatible with, can ensure the abrasion equilibrium inside storage unit, on the whole ensure storage unit inside and storage unit it Between write-in be all uniform, to realize that balance of the entire memory space in more fine granularity uses.
The second, due to the least unit that storage unit is storage device read-write, when new data record reaches, existing side Case can distribute a new storage unit and store data record since unit header;When storage unit use is finished by again When sub-distribution, cause storage unit back space that cannot often use due to being written since storage unit head repeatedly Unbalanced write-in problem.Unlike the prior art, this example can record the data after data record is written in storage unit The end position of record is as offset;The remaining space of the storage unit is reused next time a new data are written Record, to avoid the above problem, improves write-in uniformity when new data record is written since the offset.
Third, since data record can be from being write the centre of storage unit, there are remaining spaces in storage unit not The case where being enough completely to accommodate current data record needs correctly to dispose.This example proposes two kinds of processing sides for this problem Method:The first is to use the remaining data record of next unit records, be for second by remaining data record again from Unit header starts to be written in this storage unit(Fold write-in).The streaming that first method is suitable for data is written, such as The situation that write operation cannot support flexible address to redirect by hardware completion;Second method can keep the neat of read-write operation Secondary property, at this moment each data record be stored in as possible in the same storage unit, condition is the big of requirement data record It is small to be no more than storage unit size.
4th, how to record, the write-in offset information safeguarding and efficiently inquire each storage unit will directly influence The efficiency and correctness of the storage unit inter deterioration balanced management.The offsets such as offset are recorded information in memory by this example It safeguards, the access price and time delay for being firstly because current NVM and other non-volatile storage technologies are higher than memory, use memory Obviously it can accelerate the speed of read-write operation.On the other hand, due to every time to storage data access be required for obtain and(Write-in When)Offset is changed, if saved it in storage device, fixed area specified in advance can only be stored in(Otherwise right Read-write of offset information itself needs first to obtain the corresponding offset information of its specific deposit position again), offset is stored in this way The use intensity in region to be significantly higher than other regions, lead to increasingly complex abrasion problem of non-uniform.
5th, in order to solve the problems, such as that offset record is lost in memory after power down, this example proposes two methods.First such as Fruit is normal shutdown, can will offset record entirety and import storage device fixed area from memory in order to power on reading next time It takes, since the operation can only execute during shutdown, the influence to storage device overall wear can be ignored.If be it is non-just Normal power down needs reconstruction offset to record at this time since the offset record stored in storage device is no longer newest.This example exists Mark is done in the data record beginning of each storage unit in advance, and only need to scan all storage units finds the mark in this way Perfect reconstruction offset record.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that The specific implementation of the present invention is confined to these explanations.For those of ordinary skill in the art to which the present invention belongs, exist Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to the present invention's Protection domain.

Claims (10)

1. a kind of abrasion equilibrium management method for inside storage unit, which is characterized in that include the following steps:
Step S1 receives and judges the type of request of data, gos to step when request of data is data record write request S2, go to step S3 when request of data is data record access request;
Step S2 is written current data record according to the offset record of a upper data record, and current data is being written After record, the end position for preserving current data record is noted down as the offset of next data recording;
Step S3, the offset of storage unit where reading it according to data record access request are recorded, are recorded from inclined according to offset Shifting amount starts reading out the data in data record, and the offset record includes offset and data size information.
2. the abrasion equilibrium management method according to claim 1 for inside storage unit, which is characterized in that the step Rapid S2 includes following sub-step:
Step S201 obtains memory unit address according to a upper data record;
Step S202 reads a upper data and is recorded in offset record in the storage unit;
Step S203 accesses the storage unit, and current data record is written since the offset of a upper data record And the offset record of next data recording.
3. the abrasion equilibrium management method according to claim 2 for inside storage unit, which is characterized in that the step In rapid S203, since the offset of a upper data record, first write-in is for the flag of scanning recognition and for generating Information is noted down in the offset of next data recording, then current data record is written;It is described to be used to generate next data recording Offset record information include current data record sequence number and size of data.
4. the abrasion equilibrium management method according to claim 2 or 3 for inside storage unit, which is characterized in that In the step S203, if the storage unit begins with enough spaces for storing complete current data note from offset Record, then be written success;Otherwise, write operation is realized by being sequentially written in or folding write-in.
5. the abrasion equilibrium management method according to claim 4 for inside storage unit, which is characterized in that by suitable Sequence write-in realizes that the process of write operation is:Apply for a new storage unit, the part that do not stored during current data is recorded Data are stored in new storage unit, and the correlativity between two storage units of label and precedence;Pass through folding Write-in realizes that the process of write operation is:The partial data that do not stored during current data is recorded is stored in the head of the storage unit Portion space.
6. the abrasion equilibrium management method according to claim 4 for inside storage unit, which is characterized in that the step In rapid S3, if the size of data of current data record is less than the space size that the offset of the storage unit starts, directly Realization digital independent is asked in receiving;Otherwise basis is sequentially written in or folds write-in and realizes corresponding data read process.
7. the abrasion equilibrium management method according to claim 6 for inside storage unit, which is characterized in that when described When step S203 is using the write operation being sequentially written in, the step S3 is first read to be stored in current storage unit Then partial data finds the new storage list where remainder data according to the relation record between two storage units Member after accessing the new storage unit and reading data, merges finally by data and returns to complete reading result;Work as institute When stating step S203 using the write operation for folding write-in, the step S3 first reads current storage unit from offset Start the partial data of storage, then jump to the remaining partial data of head control reading of current storage unit, finally leads to It crosses data and merges the complete reading result of return.
8. the abrasion equilibrium management method being used for inside storage unit according to claims 1 to 3 any one, feature Be, identification information first read when powering on, if identification information do not include write-in be updated successfully mark, be judged as it is improper fall Electricity, and the storage unit is scanned, correctly offset record is found according to the flag in storage unit, in memory In specify address reconstruct offset record corresponding offset information table.
9. the abrasion equilibrium management method being used for inside storage unit according to claims 1 to 3 any one, feature Be, realize data record write-in before, by the memory allocation of memory at N number of isometric storage unit, and simultaneously including Deposit the middle record sheet for establishing a memory unit address and its offset record for recording each storage unit;N is natural number.
10. a kind of distributed memory system, which is characterized in that apply and be used to deposit as described in claim 1 to 9 any one Abrasion equilibrium management method inside storage unit.
CN201810394073.1A 2018-04-27 2018-04-27 For the abrasion equilibrium management method and distributed memory system inside storage unit Pending CN108710472A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810394073.1A CN108710472A (en) 2018-04-27 2018-04-27 For the abrasion equilibrium management method and distributed memory system inside storage unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810394073.1A CN108710472A (en) 2018-04-27 2018-04-27 For the abrasion equilibrium management method and distributed memory system inside storage unit

Publications (1)

Publication Number Publication Date
CN108710472A true CN108710472A (en) 2018-10-26

Family

ID=63867615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810394073.1A Pending CN108710472A (en) 2018-04-27 2018-04-27 For the abrasion equilibrium management method and distributed memory system inside storage unit

Country Status (1)

Country Link
CN (1) CN108710472A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258919A (en) * 2018-12-03 2020-06-09 爱思开海力士有限公司 Storage device and operation method thereof
CN112148645A (en) * 2019-06-28 2020-12-29 北京忆芯科技有限公司 De-allocation command processing method and storage device thereof
CN113297309A (en) * 2021-05-31 2021-08-24 平安证券股份有限公司 Stream data writing method, device, equipment and storage medium
WO2021195979A1 (en) * 2020-03-31 2021-10-07 华为技术有限公司 Data storage method and related device
CN114924690A (en) * 2022-02-23 2022-08-19 华东师范大学 Read performance optimization method based on non-equilibrium wear flash memory
CN116880772A (en) * 2023-08-10 2023-10-13 广州菲利斯太阳能科技有限公司 Method for saving generated energy based on flash

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779180A (en) * 2012-06-29 2012-11-14 华为技术有限公司 Operation processing method of data storage system and data storage system
US20140297946A1 (en) * 2013-03-28 2014-10-02 Fujitsu Limited Storage system and method for managing storage apparatuses
CN106354662A (en) * 2015-07-17 2017-01-25 陕西千山航空电子有限责任公司 NAND FLASH data storage method
CN106569748A (en) * 2016-10-27 2017-04-19 南方电网科学研究院有限责任公司 Data processing method and device of Flash file system
CN107015763A (en) * 2017-03-03 2017-08-04 北京中存超为科技有限公司 Mix SSD management methods and device in storage system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779180A (en) * 2012-06-29 2012-11-14 华为技术有限公司 Operation processing method of data storage system and data storage system
US20140297946A1 (en) * 2013-03-28 2014-10-02 Fujitsu Limited Storage system and method for managing storage apparatuses
CN106354662A (en) * 2015-07-17 2017-01-25 陕西千山航空电子有限责任公司 NAND FLASH data storage method
CN106569748A (en) * 2016-10-27 2017-04-19 南方电网科学研究院有限责任公司 Data processing method and device of Flash file system
CN107015763A (en) * 2017-03-03 2017-08-04 北京中存超为科技有限公司 Mix SSD management methods and device in storage system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258919A (en) * 2018-12-03 2020-06-09 爱思开海力士有限公司 Storage device and operation method thereof
CN112148645A (en) * 2019-06-28 2020-12-29 北京忆芯科技有限公司 De-allocation command processing method and storage device thereof
WO2021195979A1 (en) * 2020-03-31 2021-10-07 华为技术有限公司 Data storage method and related device
CN113297309A (en) * 2021-05-31 2021-08-24 平安证券股份有限公司 Stream data writing method, device, equipment and storage medium
CN113297309B (en) * 2021-05-31 2023-11-10 平安证券股份有限公司 Stream data writing method, device, equipment and storage medium
CN114924690A (en) * 2022-02-23 2022-08-19 华东师范大学 Read performance optimization method based on non-equilibrium wear flash memory
CN114924690B (en) * 2022-02-23 2024-04-19 华东师范大学 Method for optimizing read performance of flash memory based on unbalanced wear
CN116880772A (en) * 2023-08-10 2023-10-13 广州菲利斯太阳能科技有限公司 Method for saving generated energy based on flash
CN116880772B (en) * 2023-08-10 2024-06-07 广州菲利斯太阳能科技有限公司 Method for saving generated energy based on flash

Similar Documents

Publication Publication Date Title
CN108710472A (en) For the abrasion equilibrium management method and distributed memory system inside storage unit
CN107967124B (en) Distributed persistent memory storage system and method
CN104794070B (en) Solid state flash memory write buffer system and method based on dynamic non-covered RAID technique
JP3892851B2 (en) Memory card and semiconductor device
CN104778126B (en) Transaction Information storage optimization method and system in non-volatile main
US8312326B2 (en) Delta checkpoints for a non-volatile memory indirection table
JP5603997B2 (en) Storage apparatus and data control method
JP4248510B2 (en) Computer system, disk device, and data update control method
CN104503706B (en) A kind of data storage and read method based on disk array
CN100541453C (en) Large capacity cache implementation method and storage system
US20220413770A1 (en) Method for controlling write and read operations in the nonvolatile memory by a host, using an identifier for a region
US20100042774A1 (en) Block management method for flash memory, and storage system and controller using the same
CN107357680A (en) Data processing equipment and the method for data processing
JP2007199905A (en) Method for controlling semiconductor storage device
CN100383792C (en) Buffer data base data organization method
CN110347613B (en) Method for realizing RAID in multi-tenant solid-state disk, controller and multi-tenant solid-state disk
CN109582219A (en) Storage system, computing system and its method
CN101019098A (en) File storage device, host apparatus, method for formatting nonvolatile semiconductor memory, and method of writing data in nonvolatile semiconductor memory
US7058784B2 (en) Method for managing access operation on nonvolatile memory and block structure thereof
US9959044B2 (en) Memory device including risky mapping table and controlling method thereof
CN107203331A (en) Write the method and device of data
CN108733324A (en) A kind of data read-write method of solid state disk, device, equipment and storage medium
CN104937576B (en) Coordinate the duplication for the data being stored in the system based on nonvolatile memory
CN102122284A (en) Compound document storage and read-write method and compound document storage and read-write device
CN109521957A (en) A kind of data processing method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181026