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

Data operation processing method and related device Download PDF

Info

Publication number
CN108984131B
CN108984131B CN201810829407.3A CN201810829407A CN108984131B CN 108984131 B CN108984131 B CN 108984131B CN 201810829407 A CN201810829407 A CN 201810829407A CN 108984131 B CN108984131 B CN 108984131B
Authority
CN
China
Prior art keywords
block
data
reading
random number
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810829407.3A
Other languages
Chinese (zh)
Other versions
CN108984131A (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

Images

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

Data operation processing method and related device
Technical Field
The embodiment of the application relates to the field of data storage, in particular to a data operation processing method and a related device.
Background
A Solid State Drive (SSD), which refers to a hard disk made of a solid state electronic memory chip array, is composed of a control unit and a storage unit. A flash memory chip (flash memory) in a solid state disk includes a plurality of blocks (blocks), and each block includes a plurality of pages (pages). When data operation is performed on a page for multiple times, data operation on other pages in the same block may be interfered, and errors in reading data may be caused. It is then necessary to move the valid data in the page containing invalid data and valid data to a new block to make room for the invalid data for use by the valid data, a process known as garbage collection.
In the prior art, after reading data from a page once, an SSD host controller obtains a read time from a Double Data Rate (DDR), and when the read time of the page reaches a preset value, garbage collection is triggered. In the prior art, each time a user performs a read operation, the SSD main controller obtains a sum of times of reading pages in the block, and when the sum of the accumulated times of reading pages in a certain block reaches a preset value, a garbage collection process is triggered.
In the above scheme, the sum of the number of times that the pages in the block are read is stored in the memory, so the SSD host controller needs to access the DDR once every time the user performs a read operation. In practical applications, the garbage collection process is triggered when the sum of the number of times that the page in the block is read reaches a large value, and therefore, before triggering the garbage collection process, the SSD main controller needs to read the DDR many times, which takes a long time and greatly reduces the efficiency of data operation.
Disclosure of Invention
The embodiment of the application provides a data operation processing method and a related device, which are used for triggering garbage collection operation when a block in a solid state disk generates reading interference in reading operation, so that the efficiency of data operation is ensured.
In a first aspect, an embodiment of the present application provides a method for processing a data operation, including:
when the phenomenon of reading interference occurs in the reading operation of the page in the flash memory, in order to avoid the reading interference from reducing the efficiency of the data operation, the processing device obtains a generation value of a random number generator, the random number generator can generate at least one random number within a certain range through a set algorithm, and the generation value can be different according to the set algorithm.
After acquiring the generated value of the random number generator, the processing device may determine whether the generated value generated by the random number generator is equal to a preset value, which is set by a setting algorithm.
If the result of the determination is that the generated value is equal to the preset value, the processing device may obtain the number of times of reading the block, where the number of times of reading refers to the sum of the number of times of reading all pages in one block.
After acquiring the number of times of reading the block, the processing device may perform garbage collection processing on the data in the block according to the number of times of reading the block, where the garbage collection processing may sort the data in the block, thereby obtaining more storage space.
In the embodiment of the application, the processing device acquires the generated value of the random number generator, then determines whether the generated value is equal to a preset value, and if the generated value is equal to the preset value, it indicates that the read operation meets the condition of triggering acquisition of the read times. When the reading operation meets the condition of triggering the acquisition of the reading times, the processing device acquires the reading times and performs garbage recycling according to the reading times, so that the situation that the processing device acquires the reading times every time of reading operation is avoided, and therefore, compared with the prior art, the reading times of the acquisition page in the embodiment of the application reduces the time consumed by the processing device for acquiring the reading times, and the efficiency of data operation is improved.
According to the first aspect, in a second implementation manner of the first aspect of the embodiment of the present application, the performing, according to the number of times of reading the block, garbage collection GC processing on the data in the block includes:
judging whether the reading times are within a preset range;
if the reading times are within the preset range, the valid data in the block are moved to a target block, and the invalid data in the block are erased.
In the embodiment of the present application, a processing manner of performing garbage collection according to the read times of the block is defined, and it may be determined whether the read times are within a preset range, and if the read times are within the preset range, the valid data in the block is moved to the target block, and the invalid data in the block is erased, so that the feasibility of the scheme may be improved.
According to the second implementation manner of the first aspect, in the third implementation manner of the first aspect of the embodiments of the present application, the generated value is generated by a random number generator, the preset range is (a, b), and a probability P that the random number generator generates the preset value satisfies the following condition:
1-(1-P)(b-a)→1。
in the embodiment of the application, the probability P of the random number generator generating the preset value is provided, and a detailed calculation formula is provided, so that the feasibility of the scheme can be improved.
According to a third implementation form of the first aspect, in a fourth implementation form of the first aspect of the examples of the present application, the random number generator is an equiprobable random number generator.
In the embodiment of the application, the random number generator is determined to be the equal probability random number generator, so that the feasibility of the scheme can be improved.
According to the first aspect, in a fifth implementation manner of the first aspect of the embodiments of the present application, before the obtaining the number of times of reading the block, the method further includes:
acquiring the address of the block;
the number of reads of this address is counted by the memAdd function.
In the embodiment of the application, a step before acquiring the number of times of reading the block is added, and before acquiring the number of times of reading the block, the processing device should acquire the address of the block first and then count the number of times of reading the address through the memAdd function according to the address, so that the feasibility of the scheme can be improved.
In a second aspect, an embodiment of the present application provides a processing apparatus, including:
a first acquisition unit configured to acquire a generation value of the random number generator;
a judging unit for judging whether the generated value is equal to a preset value;
a second obtaining unit, configured to obtain the number of times of reading the block when the generated value is equal to the preset value;
and the recovery unit is used for performing garbage recovery processing on the data in the block according to the reading times of the block.
In the embodiment of the application, the first obtaining unit obtains a generated value of the random number generator, and then the determining unit determines whether the generated value is equal to a preset value, and if the generated value is equal to the preset value, it indicates that the read operation meets a condition for triggering obtaining of the number of read times. When the reading operation meets the condition of triggering the acquisition of the reading times, the second acquisition unit acquires the reading times and performs garbage recycling according to the reading times, so that the situation that the processing device acquires the reading times every time of reading operation is avoided, and therefore, compared with the prior art, the time consumed by the processing device for acquiring the reading times is reduced, and the efficiency of data operation is improved.
According to a second aspect, in a first implementation form of the second aspect of the embodiments herein, the recovery unit comprises:
a judging subunit, configured to judge whether the reading frequency is within a preset range;
a moving subunit, configured to move the valid data in the block to a target block when the read frequency is within the preset range;
and the erasing subunit is used for erasing the invalid data in the block after the moving subunit moves the valid data in the block to the target block.
In the embodiment of the present application, a processing manner of performing garbage collection according to the read times of the block is defined, the determining subunit may first determine whether the read times is within a preset range, if the read times is within the preset range, the moving subunit moves the valid data in the block to the target block, and the erasing subunit erases the invalid data in the block, so that feasibility of the scheme can be improved.
According to a second aspect, in a second implementation manner of the second aspect of this embodiment of the present application, the processing apparatus further includes:
a third obtaining unit, configured to obtain an address of the block;
and the calculating unit is used for counting the reading times of the address through the memAdd function.
In the embodiment of the application, a step before the reading times of the block are acquired is added, before the reading times of the block are acquired, the third acquisition unit acquires the address of the block, and then the calculation unit counts the reading times of the address through the memAdd function according to the address, so that the feasibility of the scheme can be improved.
According to the second aspect, or any one of the first implementation manner of the second aspect to the second implementation manner of the second aspect, in a third implementation manner of the second aspect of the embodiment of the present application, the generated value is generated by a random number generator, the preset range is (a, b), and a probability P of the random number generator generating the preset value satisfies the following condition:
1-(1-P)(b-a)→1。
in the embodiment of the application, the probability P of the random number generator generating the preset value is provided, and a detailed calculation formula is provided, so that the feasibility of the scheme can be improved.
According to the second aspect and any one of the first implementation manner of the second aspect to the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect of the examples of the present application, the random number generator is an equiprobable random number generator.
In the embodiment of the application, the random number generator is determined to be the equal probability random number generator, so that the feasibility of the scheme can be improved.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method according to the first aspect.
In a fifth aspect, the present application provides a chip system, where the chip system includes a processor, and is configured to support a network device to implement the functions recited in the foregoing aspects, such as sending or processing data and/or information recited in the foregoing methods. In one possible design, the system-on-chip further includes a memory for storing program instructions and data necessary for the network device. The chip system may be formed by a chip, or may include a chip and other discrete devices.
According to the technical scheme, the embodiment of the application has the following advantages:
in the embodiment of the application, the processing device acquires the generated value of the random number generator, then determines whether the generated value is equal to a preset value, and if the generated value is equal to the preset value, it indicates that the read operation meets the condition of triggering acquisition of the read times. When the reading operation meets the condition of triggering the acquisition of the reading times, the processing device acquires the reading times and performs garbage recycling according to the reading times, so that the situation that the processing device acquires the reading times for one time when performing one-time reading operation is avoided, and therefore, compared with the prior art, the reading times of the acquisition page in the embodiment of the application reduce the time consumed by the processing device for acquiring the reading times, and the efficiency of data operation is improved.
Drawings
Fig. 1 is a schematic diagram of a network architecture of a processing method for data operations according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for processing data operations in an embodiment of the present application;
FIG. 3 is another flow chart of a method for processing data operations in an embodiment of the present application;
FIG. 4-1 is a schematic diagram of an embodiment of a processing method for data operations in the embodiment of the present application;
4-2 is a schematic diagram of another embodiment of the processing method of the data operation in the embodiment of the present application;
4-3 are diagrams of another embodiment of a processing method of data operation in the embodiment of the present application;
4-4 are schematic diagrams of another embodiment of a processing method of data operation in the embodiment of the present application;
4-5 are schematic diagrams of another embodiment of a processing method of data operation in the embodiment of the present application;
fig. 5 is a schematic diagram of an embodiment of a processing device in the embodiment of the present application.
Detailed Description
The embodiment of the application provides a data operation processing method and a related device, which are used for triggering garbage collection operation when a block in a solid state disk generates reading interference in reading operation, so that the efficiency of data operation is ensured.
Some terms referred to in the embodiments of the present application are described below:
NAND flash memory (NAND flash memory): NAND flash memory is a non-volatile storage technology that retains data after power is removed. The development of NAND flash memory aims to reduce the cost per bit of storage and to increase the storage capacity.
Read disturb (read disturb): read disturb is a less frequent problem, but it still occurs: flash memory is read many times, which results in the content of memory cells in the same block being changed (into a write operation). This is called read disturb.
Garbage Collection (GC): the method moves invalid data in a block to another block, and then erases an original block into a blank block so that the blank block can be written with data again, and the whole process is called garbage collection.
Error Correction Code (ECC): the ECC memory is an error correction memory, has the functions of finding and correcting errors, is generally applied to high-grade desktop computers, servers or graphic workstations, and enables the whole computer system to be safer and more stable during operation.
The following introduces a system architecture to which the embodiments of the present application are applicable:
flash memories (flash memories) are mainly of two types: nor (no or) type and nand (no and) type. Although the NOR type has faster random performance because it can realize simultaneous reading and writing, the NAND type is the most commonly used flash memory for low-cost storage because the latter has faster endurance, more erasable times, and higher storage density.
The method proposed in the present embodiment is based on a NAND flash memory, which is substantially composed of two types of structures called page (page) and block (block) as shown in fig. 1. Each page is most commonly 4/2KB (which may be of other sizes, but this is most common), representing a unit of reading and writing. Multiple pages make up blocks of 32/128KB or 128/512 KB. NAND read and write operations are performed at the page level. While the erase operation of the NAND is performed at the block level. The NAND flash memory array is divided into a series of 128kB blocks, which are the smallest erasable entities in NAND memory. The smallest programming entity is a byte. Erasing a block generally refers to setting all bits (bits) to "1". In practical applications, a Logical Unit Number (LUN) is a basic unit that receives and executes NAND flash commands. As shown in FIG. 1, LUN0 and LUN1 may receive and execute different commands simultaneously. However, in one LUN, only one command can be executed at a time, and thus, it is impossible to perform a write operation on one page and a read operation on another page. A LUN is further divided into several storage planes (planes), typically 1, 2 or 4. Each plane has its own independent cache register (cache register) or page register (page register), and in general, the contents of both registers are the same, and the size of the registers is equal to that of one page. When the application host (host) reads a certain page, it reads the data of the page from the NAND array to the page register and then transmits the data to the host as required.
In this embodiment, the flash memory reading method used may cause the content of the pages in the same block to change over time, i.e., read disturb. If a large number of read operations are performed from one page in succession, the data in that page may not be corrupted, but the data in the surrounding pages that are subsequently read will be corrupted. To avoid the read disturb problem, the processing device usually calculates the total number of block read operations since the last erase operation, i.e. the read count. When the number of times of reading exceeds the set target value threshold, the data in the affected block is moved to a new block, and the original block is released to the block reclamation area after being erased, so that the original block becomes a new block after the erasing operation, which is garbage reclamation processing. Read disturb errors occur if the processing device does not have immediate access, with possible data loss if the errors are too many to be repaired by the ECC mechanism.
In this embodiment, it should be noted that the processing device in this embodiment may be an SSD main controller, a flash memory controller, or another device having the same function as the SSD main controller or the flash memory controller, and is not limited herein. In this embodiment and the following embodiments, the SSD host controller is taken as an example for explanation.
In the above, the flash memory structure and the read disturb principle related in this embodiment are briefly introduced, and a specific flow of the data operation processing method provided in this embodiment is described below, as shown in fig. 2, which is the data operation processing method provided in this embodiment, the SSD main controller in this method executes the following steps, including:
201. acquiring a generation value of a random number generator;
before a read operation is performed, the processing device configures a random number generator that can generate a random number or a plurality of random numbers for each read operation, and the random number or the random numbers are used for representing the probability of occurrence of a read operation event. In the process of performing the reading operation, the processing device may obtain a generation value of a random number generator, where the random number generator may generate at least one random number within a certain range through a setting algorithm, and the generation value may be different according to the setting algorithm, and is not limited herein.
202. Judging whether the generated value is equal to a preset value, if so, executing step 203;
after obtaining the generated value of the random number generator, the processing device may determine whether the generated value generated by the random number generator is equal to a preset value, which is set by a setting algorithm or is user-defined, and is not limited herein. When the generated value is equal to the preset value, the processing means will execute step 203.
203. Acquiring the reading times of the block;
if the generated value is equal to the predetermined value, the processing device may obtain a read count of the block, where the read count refers to a sum of the read count of all pages in a block, and the read count is obtained from the DDR by the processing device.
204. And performing garbage collection processing on the data in the block according to the reading times of the block.
After acquiring the number of times of reading the block, the processing device may perform garbage collection processing on the data in the block according to the number of times of reading the block, where the garbage collection processing refers to a process of sorting the data in the block to obtain more storage space.
In the embodiment of the application, the processing device acquires the generated value of the random number generator, then determines whether the generated value is equal to a preset value, and if the generated value is equal to the preset value, it indicates that the read operation meets the condition of triggering acquisition of the read times. When the reading operation meets the condition of triggering the acquisition of the reading times, the processing device acquires the reading times and performs garbage recycling according to the reading times, so that the situation that the processing device acquires the reading times every time of reading operation is avoided, and therefore, compared with the prior art, the reading times of the acquisition page in the embodiment of the application reduces the time consumed by the processing device for acquiring the reading times, and the efficiency of data operation is improved.
While the data operation processing method in the present embodiment is described above, another embodiment of the data operation processing method in the present embodiment is described below, and as shown in fig. 3, another embodiment of the data operation processing method in the present embodiment includes:
for flash memory devices, most data operations are read operations, and only a very few data operations are write operations. The NAND flash memory in this embodiment may be an SLC NAND flash memory (single-level cell NAND flash memory) or an MLC NAND flash memory (multi-level cell NAND flash memory), and is not limited herein. In the embodiment of the present application, macroscopically, if a large number of read operations are continuously performed on a page, data in the page may not be damaged, but data in the next read surrounding page may be damaged, thereby causing read interference; microscopically, during a read operation, a threshold voltage that can be read is applied to the selected word line (word line) while a high voltage is applied to the unselected word lines, thus creating a bias condition, in which case the state of the selected cell is transferred to the sense amplifier, which causes the other unselected word line controlled cells to be slowly programmed (leaky). If this read bias condition is repeated multiple times, eventually, the memory cells in the unselected word lines will slowly rise to a programmed state, which will cause sensing errors and thus read disturb.
Typical read disturb often occurs in a high temperature environment, because the high temperature accelerates the movement of the charge in the memory cell, but the present embodiment does not consider the temperature factor at all, and the operating temperature of the NAND flash memory is not particularly limited. If the read disturb error is not handled correctly, the ECC error will eventually be irreparable, resulting in device damage. In practical applications, there are three common ways to improve the read disturb condition:
1) wear leveling technique (wear leveling algorithm): the method can homogenize the use of the flash memory, so that the use range is evenly distributed in the available space of the whole internal memory, and the data can be ensured to be read and written evenly.
2) Preventive move (early move): this approach can detect and correct potential data errors. If the error in a block is near the upper limit, the data is moved to another block while the original block is erased.
3) Repeat read (read try): this allows the flash memory to adjust the read reference voltage (reference voltage) during reading, thereby preventing a read error.
The present embodiment is proposed from the manner of preventive removal, and the SSD host controller in the present embodiment executes the following steps, including:
301. acquiring a generation value of a random number generator;
when a page in a block is read, the SSD host controller obtains a generated value of a random number generator through the random number generator, where the random number generator may be a program with a specific algorithm, or may be a functional unit with a function of generating a random number in the SSD host controller, and the specific details are not limited herein. The generated value has a range, which may be a range determined when the random number generator is configured, or may be set by a worker according to an actual situation after the random number generator is configured, and the range is not limited herein. It should be noted that the random number generator in this embodiment may be an equal probability random number generator, or may be a non-equal probability random number generator, and is not limited herein. In this embodiment and the following embodiments, only the equal probability random number generator is taken as an example for explanation. The probabilistic random number generators mean that the probability of generating each generated value is equal within a certain range. It should be noted that the generated values may be arabic numbers, english alphabets, or other characters, as long as it is ensured that each generated value has the same probability of appearing within the range of the generated values that the probabilistic random number generator can generate, and the specific description is not limited herein. In this embodiment and the following embodiments, only the generated value is taken as an arabic numeral for explanation. To facilitate understanding, for example, an equiprobable random number generator is provided that can generate any one of numbers 1 to 100, and thus, in the range of 1 to 100, the probability of the equiprobable random number generator generating any one of the 100 numbers is 1%.
302. Judging whether the generated value is equal to a preset value, if so, executing step 303, and if not, executing step 306;
in this embodiment, the SSD main controller may determine whether the generated value is equal to a preset value, where the preset value is any one of the numbers 1 to 100, for convenience of understanding, the present embodiment is described by taking the preset value as 50 as an example, when the value generated by the random number generator is 50, step 303 is executed, and then, the probability of executing the step is 1%, otherwise, the step is not executed. It should be noted that the probability can be 1%, 2% or other values as long as the formula is guaranteed to be according to formula 1- (1-P)(b-a)→ 1, where P is the probability of the equiprobable random number generator generating the preset value, and b-a is the interval length of the preset range. If the probability is 2%, two different numbers are selected from the 1 value 100 when the preset value is set, as long as the generated value is equal to any one of the two selected different numbers, and the other probabilities are analogized once, and the description is omitted here.
303. Acquiring the reading times of the block;
in this embodiment, when the SSD master controller determines that the generated value is equal to the preset value, the SSD master controller obtains the read times of the block, where the generated value of the equiprobable random number generator of the block is equal to the preset value. As shown in fig. 1, the equiprobable random number generator in this embodiment at least needs to obtain the sequence number of the logical unit, the sequence number of the storage plane, and the sequence number of the block to determine the address of the block. For example, the address: logical unit 0, memory plane 1, block 0. It should be noted that, before the SSD host controller obtains the read times of the block again, it needs to obtain the address of the block, and count the read times of the address through the memAdd function, so as to know the condition of the read operation of the page in the block. The memAdd function indicates that the memAdd function is incremented by one count unit each time a page in the block is read. It should be noted that the reading number of the address refers to the sum of the reading times of all the pages in the block. The SSD main controller stores the read times calculated by the memAdd function in the memory DDR, and obtains the read times from the DDR when the SSD main controller determines whether the generated value is equal to the preset value, so that it can be understood that the number of times the SSD main controller accesses the DDR is reduced to a certain extent, and the workload of the SSD main controller is reduced.
304. Determining whether the reading frequency is within a predetermined range, if so, performing step 305, and if not, performing step 306;
in this embodiment, after the SSD host controller obtains the read count, the SSD host controller may determine whether the read count is within a preset range. The predetermined range indicates that read disturb may occur when the number of reads falls within the range. In practical applications, when the number of reading times reaches 20000 or more, read disturb occurs in the page read operation in the block. Therefore, in the present embodiment, the preset range is 19000 times to 20000 times as an example for description. However, the preset range in practical application may be deviated due to different loads of data processing, and is not limited herein. If the read count is within the predetermined range, go to step 305, and if the read count is not within the predetermined range, go to step 306;
305. moving the valid data in the block to a target block, and erasing the invalid data in the block;
in this embodiment, when the SSD host controller determines that the number of reads is within the preset range, it indicates that if a large number of reads are continued in this case, read disturb will be caused. To mitigate and even avoid read disturb, the SSD host controller may garbage-collect data in the block, may move valid data in the block to a target block, and erase invalid data in the block. For ease of understanding, the following examples are presented.
As shown in fig. 4-1, the block with valid data and invalid data provided in this embodiment is referred to as an a block for convenience of description. There are 9 pages in the block, wherein valid data is recorded in page a, page b and page c of the first row in the a block; invalid data is recorded on the shaded pages of the second row in the A block; the blank page of the third row in the a block represents unrecorded data. Taking fig. 4-1 as an example, during a read operation on page a, page b, or page c of the first row, the SSD host controller causes data in the page of the second row to be damaged and become invalid data. It should be noted that the invalid data in the page in the present embodiment may be data in an adjacent page damaged and become invalid data due to read interference, or may be data that is written into the page but is not used later and needs to be deleted, and is not limited herein. In this embodiment and the following embodiments, only the former embodiment is taken as an example for description.
As shown in fig. 4-2, the present embodiment provides a blank block without data written therein, and for convenience of description, the block is denoted as a B block. During the process of garbage collection, the SSD host controller may move the data in page a, page B, and page c of the a-block into the B-block, and the state of the B-block is then as shown in fig. 4-4, and for convenience of description, the block is denoted as B1Block of B1Only the first 3 pages of the block contain data, and the last 6 pages remain blank. At this time, the state of the block A is shown in FIGS. 4-3, and for convenience of description, the block is denoted as A1Block of A1The first 6 pages in the block are all invalid data. SSD host controller will be the area AAfter the valid data in the block is moved to the B block, the SSD host will erase A1Invalid data in the block, after which, A1The state of the block is shown in FIGS. 4-5, and for convenience of description, the block is denoted as A2Block of A2The block becomes a blank block. It should be noted that A2Although the contents of the block and the B block are both blank, A is2The addresses of the block and the B block are different and not one block.
It should also be noted that the garbage collection in this embodiment is only one of many garbage collection processes, and in practical applications, the manner of garbage collection may be different according to different situations, and is not limited herein.
306. Other operations are performed.
In this embodiment, when the SSD host controller determines that the generated value is not equal to the preset value, the SSD host controller may perform other operations, for example, determine again at a certain interval whether the generated value is equal to the preset value, or obtain again at a certain interval, which is not limited herein. The certain time interval can be set according to actual conditions, and is not limited herein.
In this embodiment, when the SSD main controller determines that the read count is not within the preset range, if the read count is greater than the upper limit of the preset range, step 306 is executed, and if the read count is less than the lower limit of the preset range, other operations may be executed, for example, determining again at certain intervals whether the read count is within the preset range, which is not limited herein. The certain time interval can be set according to actual conditions, and is not limited herein.
In the embodiment of the application, the SSD main controller obtains a generated value of the random number generator, and then determines whether the generated value is equal to a preset value, and if the generated value is equal to the preset value, it indicates that the read operation satisfies a condition for triggering to obtain the read times. When the read operation meets the condition of triggering the acquisition of the read times, the SSD master controller acquires the read times and judges whether the read times are within a preset range, and if the read times are within the preset range, the SSD master controller performs garbage recycling according to the read times.
Having described the processing method of data manipulation in the present embodiment, the following describes the processing apparatus 500 in the present embodiment, and as shown in fig. 5, the processing apparatus 500 in the present embodiment performs the following steps, including:
a first acquisition unit 501 for acquiring a generated value of the random number generator;
a judging unit 502, configured to judge whether the generated value is equal to a preset value;
a second obtaining unit 503, configured to obtain the number of times of reading the block when the generated value is equal to the preset value;
the recycling unit 504 is configured to perform garbage collection processing on the data in the block according to the number of times of reading the block.
The recovery unit 504 includes:
a determining subunit 5041, configured to determine whether the read count is within a preset range;
a moving subunit 5042, configured to move the valid data in the block to a target block when the number of reads is within the predetermined range.
An erase subunit 5043, configured to erase invalid data in the block after the move subunit 5042 moves valid data in the block to the target block.
The processing device 500 further comprises:
a third obtaining unit 505, configured to obtain an address of the block;
a calculating unit 506, configured to count the number of reads of the address through the memAdd function.
In this embodiment of the application, the first obtaining unit 501 obtains a generated value of the random number generator, and then the determining unit 502 determines whether the generated value is equal to a preset value, where if the generated value is equal to the preset value, it indicates that the read operation meets a condition for triggering obtaining of the number of reads. When the read operation satisfies the condition of triggering the acquisition of the read times, the second acquisition unit 503 acquires the read times and performs garbage collection processing according to the read times, so as to avoid that the page in the processing device 500 acquires the read times every time the page is read, and therefore, compared with the prior art, the read times of the acquisition page in the embodiment of the present application reduces the time consumed by the processing device 500 for acquiring the read times, thereby improving the efficiency of data operation.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the unit is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for processing data operation is characterized by comprising 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.
2. The method of claim 1, wherein the performing GC garbage collection processing on the data in the block according to the number of reads of the block comprises:
judging whether the reading times are within a preset range or not;
and if the reading times are within the preset range, moving the valid data in the block to a target block, and erasing the invalid data in the block.
3. The method according to claim 2, wherein the preset range is (a, b), and the probability P that the random number generator generates the preset value satisfies the following condition:
1-(1-P)(b-a)→1。
4. a method according to any one of claims 1 to 3, wherein the random number generator is an equiprobable random number generator.
5. The method of claim 1, wherein before obtaining the number of reads of the block, the method further comprises:
acquiring the address of the block;
the number of reads of the address is counted by the memAdd function.
6. A processing apparatus, comprising:
a first acquisition unit configured to acquire a generation value of the random number generator;
a judging unit for judging whether the generated value is equal to a preset value;
a second obtaining unit, configured to obtain the number of times of reading the block when the generated value is equal to the preset value;
and the recovery unit is used for performing garbage recovery processing on the data in the block according to the reading times of the block.
7. The processing apparatus according to claim 6, wherein the recovery unit comprises:
a judging subunit, configured to judge whether the reading frequency is within a preset range;
the moving subunit is used for moving the effective data in the block to a target block when the reading times are within the preset range;
and the erasing subunit is used for erasing the invalid data in the block after the moving subunit moves the valid data in the block to the target block.
8. The processing apparatus according to claim 7, wherein the preset range is (a, b), and the probability P that the random number generator in the processing apparatus generates the preset value satisfies the following condition:
1-(1-P)(b-a)→1。
9. the processing apparatus according to claim 6, characterized in that the processing apparatus further comprises:
a third obtaining unit, configured to obtain an address of the block;
and the calculating unit is used for counting the reading times of the address through a memAdd function.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1-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 CN108984131A (en) 2018-12-11
CN108984131B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111025068B (en) * 2019-12-24 2022-05-20 宁波三星医疗电气股份有限公司 Ammeter load curve data reading method and device 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
An Efficient NAND Flash Garbage Collection Algorithm Based on Area and Block Operation;Meng Wang etal.;《2012 Second International Conference on Intelligent System Design and Engineering Application》;20121231;第1192-1195页 *
闪存磨损均衡算法研究;邢春波;《中国优秀硕士学位论文全文数据库(电子期刊)》;20090630;全文 *

Also Published As

Publication number Publication date
CN108984131A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
US11593259B2 (en) Directed sanitization of memory
US10062442B2 (en) Method for managing data blocks and method of data management for data storage device
US10372382B2 (en) Methods and apparatus for read disturb detection based on logical domain
US20160118132A1 (en) Low Impact Read Disturb Handling
CN106257594B (en) Read disturb reclaim policy
TWI566252B (en) Method of performing wear management in non-volatile memory devices
TW201545161A (en) Method for read disturbance management in non-volatile memory devices
KR20190027388A (en) Proactive corrective action in memory based on probabilistic data structures
CN111142784A (en) Memory element configuration handling and operation adjustment
CN103995784A (en) Flash memory controller, storage device and flash memory control method
CN111007983A (en) Memory device using buffer memory in read reclamation operation
CN112513823B (en) Logical to physical table segments
CN112053733A (en) Selective accelerated sampling of fault sensitive memory pages
CN112740331A (en) Refreshing data stored at a memory component based on a memory component characteristic component
US20240289039A1 (en) Memory system and method of performing background operation
KR20210099784A (en) Data Storage Apparatus and Operation Method Thereof
CN114270304B (en) Data compression in the same plane of memory components
CN108984131B (en) Data operation processing method and related device
US11366751B2 (en) Storage device and storage control method
US10248594B2 (en) Programming interruption management
CN112086121B (en) Memory proximity interference management
CN114144756A (en) Selecting read voltages using write transaction data
US20240028198A1 (en) Method and apparatus for performing data retention management of memory device with aid of pre-shutdown control
US11520507B1 (en) System and method for test precondition generation based on factory-formatted state of memory device
US20240036741A1 (en) Memory system, memory controller and method for operating memory system, capable of determining target meta memory block on the basis of detected target state

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