CN108984131A - Data operation processing method and related device - Google Patents

Data operation processing method and related device Download PDF

Info

Publication number
CN108984131A
CN108984131A CN201810829407.3A CN201810829407A CN108984131A CN 108984131 A CN108984131 A CN 108984131A CN 201810829407 A CN201810829407 A CN 201810829407A CN 108984131 A CN108984131 A CN 108984131A
Authority
CN
China
Prior art keywords
block
reading times
data
reading
random number
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
CN201810829407.3A
Other languages
Chinese (zh)
Other versions
CN108984131B (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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201810829407.3A priority Critical patent/CN108984131B/en
Publication of CN108984131A publication Critical patent/CN108984131A/en
Application granted granted Critical
Publication of CN108984131B publication Critical patent/CN108984131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0604Improving or facilitating administration, e.g. storage management
    • 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/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • 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/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System (AREA)

Abstract

The embodiment of the application discloses a data operation processing method and a related device, which are used for triggering garbage recovery operation when a block in a solid state disk generates reading interference in reading operation, so that the efficiency of data operation is ensured. The method in the embodiment of the application comprises the following steps: acquiring a generation value of a random number generator; judging whether the generated value is equal to a preset value or not; if the generated value is equal to the preset value, acquiring the reading times of the block; and performing garbage collection processing on the data in the block according to the reading times of the block.

Description

The processing method and relevant apparatus of data manipulation
Technical field
The invention relates to field of data storage more particularly to the processing methods and relevant apparatus of data manipulation.
Background technique
Solid state hard disk (solid state drives, SSD), refers to the hard disk made of solid-state electronic storage chip array, It is made of control unit and storage unit.It include multiple blocks in flash chip (flash memory) in solid state hard disk (block), include in each block multiple pages (page).It, may be to the same area when repeatedly carrying out data manipulation to page The data manipulation of other pages interferes in block, causes to read corrupt data.Then it needs that invalid data and significant figure will be contained According to page in valid data move in new block, vacate so that invalid data be taken up space so that valid data make With this process is known as garbage reclamation.
In the prior art, SSD master controller is after reading a data in page, all from memory (double data Rate, DDR) in obtain a reading times then trigger garbage reclamation when the reading data number of this page reaches preset value. In the prior art, read operation of the every execution of user, SSD master controller can all obtain the number that the page in the block is read Summation will trigger at garbage reclamation when the summation for the number that the page in accumulative a certain block is read reaches preset value Manage process.
In above scheme, the summation for the number that the page in block is read is stored in memory, and therefore, user often holds As soon as row time read operation, SSD master controller needs to access a DDR.In practical applications, when time that the page in the block is read Garbage reclamation process can be just triggered when several summations reaches the larger value, therefore, before triggering garbage reclamation process, SSD master control Device processed just needs repeatedly to read DDR, this needs to expend long time, will substantially reduce the efficiency of data manipulation.
Summary of the invention
The embodiment of the present application provides the processing method and relevant apparatus of a kind of data manipulation, for when in solid state hard disk Block when reading interference occurring in read operation, garbage collection operation is triggered, to guarantee the efficiency of data manipulation.
In a first aspect, the embodiment of the present application provides a kind of processing method of data manipulation, comprising:
When the phenomenon that reading interference occurs in the read operation of the page in flash memory, to avoid reading interference from reducing data manipulation Efficiency, processing unit will acquire the generation value of random number generator, which can be by setting algorithm certain At least one random number is generated in range, which can be different and different according to the algorithm of setting.
After the generation value for obtaining random number generator, processing unit may determine that this was generated by random number generator Whether generation value is equal to preset value, which set by the way that algorithm is arranged.
If the result judged as the generation value be equal to the preset value, the reading times of the available block of processing unit, The reading times refer to the summation of the number of the read operation of all pages in a block.
Processing unit, can be according to the reading times of the block in the block after obtaining the reading times of block Data carry out garbage reclamation processing, garbage reclamation processing can be by the data preparation in the block, to obtain more Memory space.
In the embodiment of the present application, then processing unit judges the generation value by the generation value of acquisition random number generator Whether it is equal to preset value, illustrates that the read operation meets the condition that triggering obtains reading times if the generation value is equal to preset value. When the read operation, which meets triggering, obtains the condition of reading times, processing unit just obtains reading times and according to the reading times Garbage reclamation processing is carried out, a processing unit read operation of every progress is avoided and all obtains a reading times, therefore, the application The reading times that page is obtained in embodiment reduce processing unit compared with the existing technology and obtain the time spent by reading times, To improve the efficiency of data manipulation.
According in a first aspect, in second of embodiment of the embodiment of the present application first aspect, the reading according to the block Take number in the block data carry out garbage reclamation GC processing include:
Judge the reading times whether within a preset range;
If the reading times are moved to target block in the preset range, by the valid data in the block, and wipe Except the invalid data in the block.
In the embodiment of the present application, the processing mode that garbage reclamation is carried out according to the reading times of the block is specified, it can be with Whether within a preset range first judge the reading times, if the reading times in the preset range, by having in the block Effect data are moved to target block, and wipe the invalid data in the block, therefore can be improved the feasibility of scheme.
According to second of embodiment of first aspect, in the third embodiment of the embodiment of the present application first aspect, The generation value is that the raw device of random number generates, which is (a, b), which generates the probability of the preset value P meets following condition:
1-(1-P)(b-a)→1。
In the embodiment of the present application, proposes the random number generator and generate the probability P of the preset value, and give detailed Calculation formula, therefore can be improved the feasibility of scheme.
According to the third embodiment of first aspect, in the 4th kind of embodiment of the embodiment of the present application first aspect, The random number generator is equiprobability random number generator.
In the embodiment of the present application, specify that random number generator is equiprobability random number generator, therefore the side of can be improved The feasibility of case.
According in a first aspect, in the 5th kind of embodiment of the embodiment of the present application first aspect, the reading of the acquisition block Before number, this method further include:
Obtain the address of the block;
It is counted by reading times of the memAdd function to the address.
In the embodiment of the present application, the step of increasing before the reading times for obtaining block, in the reading for obtaining the block Before taking number, processing unit should also first obtain the address of the block, then pass through memAdd function to the ground according to the address The reading times of location are counted, therefore can be improved the feasibility of scheme.
Second aspect, the embodiment of the present application provide a kind of processing unit characterized by comprising
First acquisition unit, for obtaining the generation value of random number generator;
Judging unit, for judging whether the generation value is equal to preset value;
Second acquisition unit, for obtaining the reading times of block when the generation value is equal to the preset value;
Recovery unit, for carrying out garbage reclamation processing to the data in the block according to the reading times of the block.
In the embodiment of the present application, first acquisition unit passes through the generation value for obtaining random number generator, then judging unit Judge whether the generation value is equal to preset value, illustrates that the read operation meets triggering and obtains reading if the generation value is equal to preset value The condition of number.When the read operation, which meets triggering, obtains the condition of reading times, second acquisition unit just obtains reading times And garbage reclamation processing is carried out according to the reading times, it avoids a processing unit read operation of every progress and all obtains primary reading Number, therefore, the reading times that page is obtained in the embodiment of the present application reduce processing unit compared with the existing technology and obtain reading Time spent by number, to improve the efficiency of data manipulation.
According to second aspect, in the first embodiment of the embodiment of the present application second aspect, which includes:
Judgment sub-unit, for judging the reading times whether within a preset range;
Mobile subelement, is used for when the reading times are in the preset range, and the valid data in the block are mobile To target block;
Subelement is wiped, for wiping after the valid data in the block are moved to target block by mobile subelement Except the invalid data in the block.
In the embodiment of the present application, the processing mode that garbage reclamation is carried out according to the reading times of the block, judgement are specified Whether within a preset range subelement can first judge the reading times, if the reading times move in the preset range Valid data in the block are moved to target block by subelement, and erasing subelement wipes the invalid data in the block, because This can be improved the feasibility of scheme.
According to second aspect, in second of embodiment of the embodiment of the present application second aspect, the processing unit further include:
Third acquiring unit, for obtaining the address of the block;
Computing unit, for being counted by reading times of the memAdd function to the address.
In the embodiment of the present application, the step of increasing before the reading times for obtaining block, in the reading for obtaining the block Before taking number, third acquiring unit obtains the address of the block, and then computing unit passes through memAdd function according to the address The reading times of the address are counted, therefore can be improved the feasibility of scheme.
According to appointing in second of embodiment of the first embodiment of second aspect, second aspect to second aspect A kind of embodiment, in the third embodiment of the embodiment of the present application second aspect, which is that the raw device of random number generates , which is (a, b), and the probability P which generates the preset value meets following condition:
1-(1-P)(b-a)→1。
In the embodiment of the present application, proposes the random number generator and generate the probability P of the preset value, and give detailed Calculation formula, therefore can be improved the feasibility of scheme.
According to appointing in the third embodiment of the first embodiment of second aspect, second aspect to second aspect A kind of embodiment, in the 4th kind of embodiment of the embodiment of the present application second aspect, the random number generator be equiprobability with Machine number generator.
In the embodiment of the present application, specify that random number generator is equiprobability random number generator, therefore the side of can be improved The feasibility of case.
The third aspect, the embodiment of the present application provides a kind of computer readable storage medium, including instruction, when it is being calculated When being run on machine, so that computer executes the method such as first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer program product comprising instruction, when it is in computer When upper operation, so that computer executes the method such as first aspect.
5th aspect, the embodiment of the present application provide a kind of chip system, which includes processor, for supporting The network equipment realizes function involved in above-mentioned aspect, for example, send or the processing above method involved in data and/or Information.In a kind of possible design, which further includes memory, the memory, for saving network equipment necessity Program instruction and data.The chip system, can be made of chip, also may include chip and other discrete devices.
As can be seen from the above technical solutions, the embodiment of the present application has the advantage that
In the embodiment of the present application, then processing unit judges the generation value by the generation value of acquisition random number generator Whether it is equal to preset value, illustrates that the read operation meets the condition that triggering obtains reading times if the generation value is equal to preset value. When the read operation, which meets triggering, obtains the condition of reading times, processing unit just obtains reading times and according to the reading times Garbage reclamation processing is carried out, a processing unit read operation of progress is avoided and all obtains a reading times, therefore, the application is real The reading times for applying acquisition page in example reduce processing unit compared with the existing technology and obtain the time spent by reading times, from And improve the efficiency of data manipulation.
Detailed description of the invention
Fig. 1 is a network architecture schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 2 is a flow chart of the processing method of data manipulation in the embodiment of the present application;
Fig. 3 is another flow chart of the processing method of data manipulation in the embodiment of the present application;
Fig. 4-1 is one embodiment schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 4-2 is another embodiment schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 4-3 is another embodiment schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 4-4 is another embodiment schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 4-5 is another embodiment schematic diagram of the processing method of data manipulation in the embodiment of the present application;
Fig. 5 is one embodiment schematic diagram of processing unit in the embodiment of the present application.
Specific embodiment
The embodiment of the present application provides the processing method and relevant apparatus of a kind of data manipulation, for when in solid state hard disk Block when reading interference occurring in read operation, garbage collection operation is triggered, to guarantee the efficiency of data manipulation.
Below to the invention relates to some terms be introduced:
Nand flash memory (NAND flash memory): nand flash memory is a kind of nonvolatile storage technologies, that is, after powering off still Data can be saved.The developing goal of nand flash memory is exactly to reduce every bit storage cost and raising memory capacity.
Reading interference (read disturb): the problem of reading interference is less generation, but still can occur: flash memory is with more Secondary reading will lead to the similar memory unit content changing (becoming write activity) in same block.This is so-called Reading interference.
Garbage reclamation (garbage collection, GC): refer to and the invalid data in block is moved to another block In, the erasing of former block is then become into a blank block again, so that the blank block can be written into data again, entirely Process is referred to as garbage reclamation.
Error checking and correction (error correcting code, ECC): refer to ECC memory i.e. error correction memory, have It was found that mistake, correct the function of mistake, generally mostly using with high-grade desktop computer, server or graphics workstation, this will make Entire computer system more tends to safety and stability at work.
The system architecture adapted to below the embodiment of the present application is introduced:
There are mainly of two types for flash memory (flash memory): NOR (no or) type and NAND (no and) type.Although NOR Type may be implemented to read while write so have faster random performance, but since the latter has faster duration performance, more Erasable number, higher storage density, therefore NAND type becomes most-often used flash memory in low cost storage.
The application of this reality apply the method proposed in example be based on nand flash memory, as shown in Figure 1, NAND memory body substantially by Referred to as two class formations of page (page) and block (block) form.Every page most common be 4/2KB (can be other sizes, but This is most common), it represents one and reads and writees unit.The block of multiple pages of composition 32/128KB or 128/512KB. NAND read operation and write operation are performed in the rank of page.And the erasing operation of NAND is the quilt on block level It executes.Nand flash memory array is divided into the block of 128kB a series of, these blocks are the smallest erasable realities in NAND memory body Body.The smallest programming entity is byte (byte).Usually one block of erasing, which refers to, is set as " 1 " all positions (bit).In reality In the application of border, logic unit (logical unit number, LUN) is the basic unit for receiving and executing nand flash memory order. As shown in Figure 1, LUN0 and LUN1 can receive and execute different orders simultaneously.But it in a LUN, can only once execute One order, so while write operation cannot being carried out to some page therein, and to other pages of progress read operations.One LUN It is divided into several memory planes (plane), generally 1,2 or 4 again.Each plane has oneself independent caching Register (cache register) or page register (page register), under normal circumstances, in two register Appearance is the same, and size is equal to the size of a page.Applied host machine (host) is when reading some page, its first handle The data of this page read page register from NAND array, are then transmitted to host on demand again.
In the present embodiment, used flash memory reading manner will lead to similar in same block over time Page content changing, i.e. reading interference.If continuously carrying out a large amount of read operations from page, the data in this page may not be by Damage, still, the data being next read in the page of surrounding will be damaged.To avoid the problem that reading interference, processing unit The total degree from the block read operation after last time erasing move, i.e. reading times (read count) would generally be calculated.When the reading When number being taken to be more than set target value threshold, the data in impacted block can be moved to a new block, so It will be discharged into block recovery area after the erasing of former block afterwards, then, former block becomes a new block after erasing move, this It is garbage reclamation processing.If processing unit does not intervene immediately, reading interference mistake will occur, if mistake is too many And can not ECC mechanism repair when will be along with possible loss of data.
In the present embodiment, it should be noted that the processing unit in the embodiment of the present application can be SSD master controller, It can be flash controller, can also be other devices with the above two identical functions, specifically herein without limitation.In this reality It applies in example and subsequent embodiment, is only illustrated by taking SSD master controller as an example.
Simple introduction has been done to the principle of flash memory structure involved in this embodiment and reading interference above, below it is right The detailed process of the processing method of data manipulation provided in this embodiment is introduced, as shown in Fig. 2, being provided in this embodiment The processing method of data manipulation, the SSD master controller in this method execute following steps, comprising:
201, the generation value of random number generator is obtained;
Before carrying out read operation, processing unit configures random number generator, which can carry out one with every Secondary read operation just generates a random number or multiple random numbers, for characterizing the probability of read operation event generation.It is being read During operation, the generation value of the available random number generator of processing unit, the random number generator can pass through setting Algorithm generates at least one random number in a certain range, which can be different and different according to the algorithm of setting, specifically Herein without limitation.
202, judge whether the generation value is equal to preset value, if the generation value is equal to the preset value, then follow the steps 203;
After the generation value for obtaining random number generator, processing unit may determine that this was generated by random number generator Whether generation value is equal to preset value, the preset value be by setting algorithm set or user it is customized, specifically herein not It limits.When the generation value is equal to preset value, processing unit will execute step 203.
203, the reading times of block are obtained;
If the result judged as the generation value be equal to the preset value, the reading times of the available block of processing unit, The reading times refer to the summation of the number of the read operation of all pages in a block, the reading times be the processing unit from It is obtained in DDR.
204, garbage reclamation processing is carried out to the data in the block according to the reading times of the block.
Processing unit, can be according to the reading times of the block in the block after obtaining the reading times of block Data carry out garbage reclamation processing, garbage reclamation processing refers to and arranges the data in block, to obtain more storages The process in space.
In the embodiment of the present application, then processing unit judges the generation value by the generation value of acquisition random number generator Whether it is equal to preset value, illustrates that the read operation meets the condition that triggering obtains reading times if the generation value is equal to preset value. When the read operation, which meets triggering, obtains the condition of reading times, processing unit just obtains reading times and according to the reading times Garbage reclamation processing is carried out, a processing unit read operation of every progress is avoided and all obtains a reading times, therefore, the application The reading times that page is obtained in embodiment reduce processing unit compared with the existing technology and obtain the time spent by reading times, To improve the efficiency of data manipulation.
The processing method of the data manipulation in the present embodiment is described above, below to the data in the present embodiment Another embodiment of the processing method of operation is introduced, as shown in figure 3, the processing method of the data manipulation in the present embodiment Another embodiment includes:
For flash memory device, most of data manipulations are all read operations, and only only a few data manipulation is write operation.This reality The nand flash memory in example is applied, can be SLC nand flash memory (single-level cell NAND flash memory), it can also To be MLC nand flash memory (multi-level cell NAND flash memory), specifically herein without limitation.The application In embodiment, for macroscopically, if continuously carrying out a large amount of read operations to page, the data in this page may not be by Damage, still, the data being next read in the page of surrounding will be damaged, to cause reading interference;For microcosmic go up, During a read operation, the wordline (wordline) being chosen to is applied one can be with the threshold voltage of read operation, and not The wordline being chosen to is applied a high voltage, then just forms bias condition, in this case, the storage selected The state of unit (cell) can be sent to sensing amplifier, will lead to the storage unit quilt of other unselected wordline controls arrived Slowly programming (electric leakage).If this read operation bias condition is repeated quickly and easily as many times as required, finally, the storage inside non-selected wordline Unit will slowly rise to programmed state, then, will lead to sensing mistake, in turn results in reading interference.
Typical reading interference often occurs under high temperature environment, because high temperature can accelerate the fortune of charge inside storage unit It is dynamic, but the present embodiment puts aside the factor of temperature, is not specifically limited to the operating temperature of nand flash memory.If cannot be correct Reading interference mistake is handled, will finally be formed cannot repair ECC error and lead to equipment damage.In practice, there are three types of Common mode can improve the case where reading interference:
1) wear leveling technology (wear leveling algorithm): this mode can be homogenized the use of flash memory, allow Use scope is evenly distributed in the available space of monolith memory, it is ensured that data can fifty-fifty be read and write.
2) preventative to move away from (early move): this mode can be detected and correct potential error in data.If in block Mistake close to the upper limit, data will be moved into another block, while former block will be wiped free of.
3) it repeats to read (read retry): reference voltage (read when this mode can allow flash memory adjustment to be read Reference voltage), prevent read error.
The present embodiment is proposed from preventative move away from this mode, and the SSD master controller in the present embodiment executes Following steps, comprising:
301, the generation value of random number generator is obtained;
When the page in block carries out read operation, SSD master controller will obtain generating random number by random number generator The generation value of device, the random number generator can be one section of program with special algorithm, be also possible to have in SSD master controller There is a functional unit for generating random number function, specifically herein without limitation.The generation value is that have a certain range of, the model Enclose and can be the range just determined when configuring the random number generator, be also possible to be configured with the random number generator it Afterwards, staff is set according to the actual situation, specifically herein without limitation.It should be noted that the present embodiment in Machine number generator can be equiprobability random number generator, is also possible to non-equal random number generator, does not do herein specifically It limits.In the present embodiment and subsequent embodiment, only it is illustrated by taking equiprobability random number generator as an example.The equiprobability with Machine number generator refers to that the probability for generating each generation value in a certain range is equal.It should also be noted that the generation Value can be Arabic numerals, be also possible to English alphabet, can also be other characters, as long as guaranteeing that each generation value exists The probability occurred in the range of the generation value that the equiprobability random number generator can generate is identical, specifically herein without limitation. In the present embodiment and subsequent embodiment, only it is illustrated so that the generation value is Arabic numerals as an example.For ease of understanding, it lifts Example once configures an equiprobability random number generator, which can be generated appointing in 1 to 100 It anticipates a number, then, 1 to 100 within the scope of this, which generates appointing in this 100 numbers One digital probability of meaning is 1%.
302, judge whether the generation value is equal to preset value, if the generation value is equal to preset value, then follow the steps 303, if The generation value is not equal to preset value, thens follow the steps 306;
In the present embodiment, SSD master controller may determine that whether the generation value is equal to preset value, which is above-mentioned Any one number in 1 to 100, for ease of understanding, the present embodiment is introduced so that the preset value is 50 as an example, works as random number When the value that generator generates is 50,303 are thened follow the steps, then, the probability for executing the step is 1%, otherwise, is not executed.It needs It should be noted that the probability can be 1%, it is also possible to 2%, can also be other values, as long as guarantees formula according to formula 1- (1-P)(b-a)→ 1, wherein P is the probability that the equiprobability random number generator generates the preset value, and b-a is default model The siding-to-siding block length enclosed.To make the probability 2%, then two different numbers are selected from 1 value 100 when preset value is arranged, As long as generation value is equal to any one in two selected different numbers, other probability are once analogized, herein It repeats no more.
303, the reading times of the block are obtained;
In the present embodiment, when SSD master controller determines that the generation value is equal to preset value, SSD master controller will acquire this The reading times of block, the block refer to equiprobability random number generator that carrying out read operation and the block arrangement Generation value be equal to preset value.As shown in Figure 1, the equiprobability random number generator in the present embodiment at least needs to obtain logic list The serial number of member, the serial number of the serial number of memory plane and block just can determine that the address of the block.For example, address: logic unit 0, Memory plane 1, block 0.It should be noted that needing to obtain before the reading times that the SSD master controller obtains the block again The address of block, and counted by reading times of the memAdd function to the address, to know the reading of the page in the block The case where operation.The memAdd function refers to that the memAdd function is increased by a meter whenever the page in the block is read once Number unit.It should be noted that the reading times of the address refer to that all pages in the block carry out the total of the number of read operation With.The reading times that the memAdd function is calculated are stored in memory DDR by the SSD master controller, when the SSD main control Device judges just obtain from DDR when whether the generation value is equal to preset value, thus, it can be understood that, to a certain extent, reduce The number of SSD master controller access DDR, reduces the workload of SSD master controller.
304, judge that whether within a preset range the reading times, if the reading times are within a preset range, execute step Rapid 305, if the reading times not within a preset range, then follow the steps 306;
In the present embodiment, after SSD master controller obtains reading times, which may determine that the reading Whether within a preset range to take number.The preset range refers to the reading of the page when reading times are fallen in the range, in the block Operation is likely to that reading interference occurs.In practical applications, when the reading times reach 20000 or more, in the block Reading interference occurs for the read operation of page.Then, in the present embodiment, take the preset range be 19000 times to 20000 times for into Row is introduced.But preset range in practical applications can be deviated because of the load of data processing difference, specifically herein Without limitation.If the reading times are within a preset range, 305 are thened follow the steps, if the reading times are not within a preset range, Execute step 306;
305, the valid data in the block are moved to target block, and wipe the invalid data in the block;
In the present embodiment, when SSD master controller determines the reading times within a preset range, show in the case such as Continue a large amount of read operation, then will will lead to reading interference.It, should in order to alleviate reading interference or even avoid reading interference SSD master controller can carry out garbage reclamation processing to the data in the block, can be mobile by the valid data in the block To target block, and wipe the invalid data in the block.For convenience of understanding, lifts following example and be introduced.
It is the one provided in this embodiment block for having valid data and invalid data, for convenient for retouching as shown in Fig. 4-1 It states, which is denoted as A block.There are 9 pages in the block, wherein in page a, the page b and page c of the first row in the A block Record is valid data;What is recorded on the page with shade of second row in the A block is invalid data;In the A block The blank page representative of third row does not record data.By taking Fig. 4-1 as an example, SSD master controller is in page a, page b or the page to first row During c carries out read operation, causes the corrupted data in the page of second row and become invalid data.It should be noted that this The invalid data in page in embodiment can be the corrupted data in the adjacent page as caused by reading interference as invalid number According to, be also possible to be written into page but after not will use and the data that need to delete, specifically herein without limitation.In this reality It applies in example and subsequent embodiment, is only illustrated for the former.
As shown in the Fig. 4-2, it is the one provided in this embodiment blank block that data are not written, for ease of description, will The block is denoted as B block.In the treatment process of garbage reclamation, SSD master controller can be by page a, page b and the page c in A block In data be moved in B block, then, the state of B block is as shown in Fig. 4-4, for ease of description, the block is denoted as B1Area Block, the B1Only have in block and contain data in first page 3, latter page 6 are still blank page.At this point, the state of A block such as Fig. 4-3 institute Show, for ease of description, the block is denoted as A1Block, the A1All become invalid data for first page 6 in block.SSD master controller will Valid data in the A block are moved to after B block, and SSD master controller will wipe A1Invalid data in block, herein it Afterwards, A1The state of block as illustrated in figures 4-5, for ease of description, the block is denoted as A2Block, the A2Block becomes a blank Block.It should be noted A2Although block and B block content are all blank, A2Block is different with the address of B block, It is not a block.
It should also be noted that the example of the garbage reclamation in the present embodiment is only one of numerous garbage reclamation processing, In practical applications, the difference by the way of which kind of garbage reclamation as the case may be will likely difference, specifically herein Without limitation.
306, other operations are executed.
In the present embodiment, when SSD master controller judges the generation value not equal to preset value, SSD master controller can be held Row other operation, such as between judge whether the generation value is equal to preset value again at regular intervals, can also be spaced certain Time obtains the generation value again, specifically herein without limitation.It can be arranged according to the actual situation at regular intervals between being somebody's turn to do, have Body is herein without limitation.
In the present embodiment, when SSD master controller judges the reading times not within a preset range, if the reading times are big In the upper limit of preset range, 306 are thened follow the steps, if the reading times are less than the lower limit of preset range, other can be executed Operation, for example, between whether within a preset range judge the reading times again at regular intervals, specifically herein without limitation.It should Between can be arranged according to the actual situation at regular intervals, specifically herein without limitation.
In the embodiment of the present application, then SSD master controller judges the generation by the generation value of acquisition random number generator Whether value is equal to preset value, illustrates that the read operation meets the item that triggering obtains reading times if the generation value is equal to preset value Part.When the read operation, which meets triggering, obtains the condition of reading times, SSD master controller just obtains reading times and judges to be somebody's turn to do Reading times whether within a preset range, if the reading times within a preset range SSD master controller just according to the reading times Garbage reclamation processing is carried out, the method that the present embodiment proposes avoids read operation of each pair of page of SSD master controller progress and all obtains A reading times are taken, therefore, the method that the embodiment of the present application proposes reduces the acquisition of SSD master controller compared with the existing technology Time spent by reading times, to improve the efficiency of data manipulation.
The processing method of the data manipulation in the present embodiment is described above, below to the processing in the present embodiment Device 500 is introduced, as shown in figure 5, processing unit 500 executes following steps in the present embodiment, comprising:
First acquisition unit 501, for obtaining the generation value of random number generator;
Judging unit 502, for judging whether the generation value is equal to preset value;
Second acquisition unit 503, for obtaining the reading times of block when the generation value is equal to the preset value;
Recovery unit 504, for carrying out garbage reclamation processing to the data in the block according to the reading times of the block.
The recovery unit 504 includes:
Judgment sub-unit 5041, for judging the reading times whether within a preset range;
Mobile subelement 5042, is used for when the reading times are in the preset range, by the valid data in the block It is moved to target block.
Subelement 5043 is wiped, for the valid data in the block to be moved to target block when mobile subelement 5042 Later, the invalid data in the block is wiped.
The processing unit 500 further include:
Third acquiring unit 505, for obtaining the address of the block;
Computing unit 506, for being counted by reading times of the memAdd function to the address.
In the embodiment of the present application, first acquisition unit 501 is by the generation value of acquisition random number generator, and then judgement is single Member 502 judges whether the generation value is equal to preset value, illustrates that the read operation meets triggering and obtains if the generation value is equal to preset value Take the condition of reading times.When the read operation, which meets triggering, obtains the condition of reading times, second acquisition unit 503 is just obtained Reading times simultaneously carry out garbage reclamation processing according to the reading times, avoid that the page in processing unit 500 is every once to be read Operation all obtains a reading times, and therefore, the reading times that page is obtained in the embodiment of the present application are reduced compared with the existing technology Processing unit 500 obtains the time spent by reading times, to improve the efficiency of data manipulation.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit is drawn Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can To combine or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or beg for The mutual coupling, direct-coupling or communication connection of opinion can be through some interfaces, the INDIRECT COUPLING of device or unit Or communication connection, it can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member for this, show as unit Component may or may not be physical unit, it can it is in one place, or may be distributed over multiple nets On network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can store in a computer readable storage medium.Based on this understanding, the technical solution of the application substantially or Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products Reveal and, which is stored in a storage medium, including some instructions are with so that a computer is set Standby (can be personal computer, server or the network equipment etc.) execute each embodiment this method of the application whole or Part steps.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (read-only memory, ROM), Random access memory (random access memory, RAM), magnetic or disk etc. be various to can store program code Medium.
Above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although with reference to the foregoing embodiments The application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each implementation Technical solution documented by example is modified or equivalent replacement of some of the technical features;And these modification or Replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution.

Claims (10)

1. a kind of processing method of data manipulation characterized by comprising
Obtain the generation value of random number generator;
Judge whether the generation value is equal to preset value;
If the generation value is equal to the preset value, the reading times of block are obtained;
Garbage reclamation processing is carried out to the data in the block according to the reading times of the block.
2. the method according to claim 1, wherein the reading times according to the block are to the block In data carry out garbage reclamation GC processing include:
Judge the reading times whether within a preset range;
If the reading times are moved to target block in the preset range, by the valid data in the block, and Wipe the invalid data in the block.
3. according to the method described in claim 2, it is characterized in that, the preset range is (a, b), the random number generator The probability P for generating the preset value meets following condition:
1-(1-P)(b-a)→1。
4. according to the method in any one of claims 1 to 3, which is characterized in that the random number generator is equiprobability Random number generator.
5. the method according to claim 1, wherein it is described obtain block reading times before, the method Further include:
Obtain the address of the block;
It is counted by reading times of the memAdd function to the address.
6. a kind of processing unit characterized by comprising
First acquisition unit, for obtaining the generation value of random number generator;
Judging unit, for judging whether the generation value is equal to preset value;
Second acquisition unit, for obtaining the reading times of block when the generation value is equal to the preset value;
Recovery unit, for carrying out garbage reclamation processing to the data in the block according to the reading times of the block.
7. processing unit according to claim 6, which is characterized in that the recovery unit includes:
Judgment sub-unit, for judging the reading times whether within a preset range;
Mobile subelement, for when the reading times are in the preset range, the valid data in the block to be moved It moves to target block;
Subelement is wiped, for wiping after the valid data in the block are moved to target block by mobile subelement Invalid data in the block.
8. the method according to the description of claim 7 is characterized in that the preset range is (a, b), in the processing unit The probability P that random number generator generates the preset value meets following condition:
1-(1-P)(b-a)→1。
9. processing unit according to claim 6, which is characterized in that the processing unit further include:
Third acquiring unit, for obtaining the address of the block;
Computing unit, for being counted by reading times of the memAdd function to the address.
10. a kind of computer program product, which is characterized in that when the computer program product is run on computers, make Obtain method of the computer execution as described in any one of claims 1 to 5.
CN201810829407.3A 2018-07-25 2018-07-25 Data operation processing method and related device Active CN108984131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810829407.3A CN108984131B (en) 2018-07-25 2018-07-25 Data operation processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810829407.3A CN108984131B (en) 2018-07-25 2018-07-25 Data operation processing method and related device

Publications (2)

Publication Number Publication Date
CN108984131A true CN108984131A (en) 2018-12-11
CN108984131B CN108984131B (en) 2021-07-16

Family

ID=64550869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810829407.3A Active CN108984131B (en) 2018-07-25 2018-07-25 Data operation processing method and related device

Country Status (1)

Country Link
CN (1) CN108984131B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111025068A (en) * 2019-12-24 2020-04-17 宁波三星医疗电气股份有限公司 Method and device for reading load curve data of electric meter and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231617A (en) * 2008-01-21 2008-07-30 中兴通讯股份有限公司 Method for processing data of flash memory equipment
CN101494085A (en) * 2008-01-22 2009-07-29 群联电子股份有限公司 Method and controller for preventing nonvolatile semiconductor memory from occurring read interference
CN101640069A (en) * 2008-08-01 2010-02-03 群联电子股份有限公司 Average wear method, storage system and controller used for flash memory
CN102707904A (en) * 2012-05-29 2012-10-03 北京大学 Data management method and system in mixed storage structure of flash disk
CN106776095A (en) * 2016-12-22 2017-05-31 湖南国科微电子股份有限公司 SSD solid state hard disc data reliability intelligent detecting methods and detection means
CN107018185A (en) * 2017-03-28 2017-08-04 清华大学 The synchronous method and device of cloud storage system
US20180059942A1 (en) * 2016-06-21 2018-03-01 International Business Machines Corporation Reducing concurrency of garbage collection operations

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231617A (en) * 2008-01-21 2008-07-30 中兴通讯股份有限公司 Method for processing data of flash memory equipment
CN101494085A (en) * 2008-01-22 2009-07-29 群联电子股份有限公司 Method and controller for preventing nonvolatile semiconductor memory from occurring read interference
CN101640069A (en) * 2008-08-01 2010-02-03 群联电子股份有限公司 Average wear method, storage system and controller used for flash memory
CN102707904A (en) * 2012-05-29 2012-10-03 北京大学 Data management method and system in mixed storage structure of flash disk
US20180059942A1 (en) * 2016-06-21 2018-03-01 International Business Machines Corporation Reducing concurrency of garbage collection operations
CN106776095A (en) * 2016-12-22 2017-05-31 湖南国科微电子股份有限公司 SSD solid state hard disc data reliability intelligent detecting methods and detection means
CN107018185A (en) * 2017-03-28 2017-08-04 清华大学 The synchronous method and device of cloud storage system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MENG WANG ETAL.: "An Efficient NAND Flash Garbage Collection Algorithm Based on Area and Block Operation", 《2012 SECOND INTERNATIONAL CONFERENCE ON INTELLIGENT SYSTEM DESIGN AND ENGINEERING APPLICATION》 *
邢春波: "闪存磨损均衡算法研究", 《中国优秀硕士学位论文全文数据库(电子期刊)》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111025068A (en) * 2019-12-24 2020-04-17 宁波三星医疗电气股份有限公司 Method and device for reading load curve data of electric meter and electronic equipment

Also Published As

Publication number Publication date
CN108984131B (en) 2021-07-16

Similar Documents

Publication Publication Date Title
US10275162B2 (en) Methods and systems for managing data migration in solid state non-volatile memory
US10296231B2 (en) Data-storage device and data maintenance method thereof
US10062442B2 (en) Method for managing data blocks and method of data management for data storage device
US9507711B1 (en) Hierarchical FTL mapping optimized for workload
CN106257594B (en) Read disturb reclaim policy
US10552063B2 (en) Background mitigation reads in a non-volatile memory system
US10372382B2 (en) Methods and apparatus for read disturb detection based on logical domain
US20100287217A1 (en) Host control of background garbage collection in a data storage device
US10956317B2 (en) Garbage collection in non-volatile memory that fully programs dependent layers in a target block
US10628081B2 (en) Managing internal command queues in solid state storage drives
CN105718213B (en) The method for improving the random performance of mixing in low queue depth's workload
TWI633428B (en) Data storage device and methods for processing data in the data storage device
US20170168716A1 (en) Paired Metablocks in Non-Volatile Storage Device
TWI608350B (en) Memory device and control unit thereof, and data movement method for memory device
US12013762B2 (en) Meta data protection against unexpected power loss in a memory system
CN104794063A (en) Method for controlling solid state drive with resistive random-access memory
TW201730892A (en) Method and apparatus for logically removing defective pages in non-volatile memory storage device
KR20160074025A (en) Operating method for data storage device
KR20160011939A (en) Data storage device and operating method thereof
CN110825655A (en) Memory device, method of accessing data, and method of managing data
CN108628545A (en) Data storage device and its operating method
CN108984131A (en) Data operation processing method and related device
KR20210157544A (en) Memory system, memory controller, and operating method of memory system
US10642509B2 (en) Method for designating specific world-lines of data storage device as reserved word-lines, and selecting a writing mode accordingly
CN110968473A (en) Memory controller and memory device including the same

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
GR01 Patent grant
GR01 Patent grant