Solid state disk open block processing method, device and equipment

文档序号:1888626 发布日期:2021-11-26 浏览:2次 中文

阅读说明:本技术 一种固态硬盘open block处理方法、装置及设备 (Solid state disk open block processing method, device and equipment ) 是由 刘哲 王鑫 张乾坤 赵金 于 2021-08-20 设计创作,主要内容包括:本申请公开了一种固态硬盘open block处理方法,在处理openblock时,该方法不向open block填写垃圾数据,而是对其进行垃圾回收,由于不填写垃圾数据,所以不会占用带宽,因此不会影响用户读写性能,也不需要增加处理流程,实现简化open block处理流程,降低软件复杂度,提高固态硬盘的可靠性。此外,本申请还提供了一种固态硬盘open block处理装置及设备,其技术效果与上述方法的技术效果相对应。(The application discloses a solid state disk open block processing method, when open block is processed, garbage data are not filled in the open block, but are recycled, and the garbage data are not filled in, so that bandwidth is not occupied, the read-write performance of a user is not influenced, a processing flow is not required to be increased, the open block processing flow is simplified, the software complexity is reduced, and the reliability of the solid state disk is improved. In addition, the application also provides a solid-state hard disk open block processing device and equipment, and the technical effect of the device corresponds to that of the method.)

1. A solid state disk open block processing method is characterized by comprising the following steps:

recording the time of first writing data into a block in a solid state disk;

judging whether the block is full of data within a time threshold value taking the time of writing data for the first time as a starting point;

if not, judging that the block is the open block to be processed, and performing garbage recovery on the open block to be processed.

2. The method of claim 1, wherein before the determining whether the block is full of data within a time threshold starting at the time of the first write of data, further comprising:

and determining a time threshold according to the Nand open block characteristic.

3. The method of claim 2, wherein determining a time threshold from the Nand open block characteristic comprises:

writing part data into any block of the solid state disk to ensure that the block is not fully written, and recording the writing time;

and periodically reading the data on the block at the working temperature, determining the data error rate until the data error rate exceeds the ECC (error correction code) error correction capability, and determining the difference between the current time and the writing time to be used as a time threshold.

4. The method of claim 1, wherein the garbage recycling the open block to be processed comprises:

and reusing a garbage recycling process, and recycling the open block to be processed.

5. The method of claim 4, wherein the garbage recycling process for recycling garbage from the open block to be processed comprises:

taking the open block to be processed as a source block, and selecting a target block;

identifying valid data of the source block and reading the valid data;

moving the valid data to the target block;

and after the moving is finished, erasing the valid data on the source block.

6. The method of claim 1, wherein the determining whether the block is full of data within a time threshold starting from the time of the first write of data comprises:

and recording a time threshold value taking the time of writing data for the first time as a starting point through a timer, and judging whether the block is full of data or not when the timer expires.

7. The method of any one of claims 2 to 6, wherein after determining the time threshold from the Nand open block characteristic, further comprising:

and taking the time threshold as a reference time threshold, and respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number.

8. The method of claim 7, wherein the determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number respectively comprises:

according to a target formula, respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number, wherein the target formula is as follows:

time=open_block_retention_time-block_num%10;

wherein, time is a time threshold of block, open _ block _ latency _ time is a reference time threshold, and block _ num is a block number.

9. A solid state disk open block processing device is characterized by comprising:

the time recording module is used for recording the time of the block for writing data for the first time in the solid state disk;

the judging module is used for judging whether the block is fully written with data within a time threshold value taking the time of writing data for the first time as a starting point;

and the garbage recycling module is used for judging that the block is an open block to be processed when the block is not fully written with data, and performing garbage recycling on the open block to be processed.

10. A solid state disk open block processing device is characterized by comprising:

a memory: for storing a computer program;

a processor: the computer program is used for executing the computer program to realize the solid-state hard disk open block processing method according to any one of claims 1 to 8.

Technical Field

The application relates to the technical field of computers, in particular to a method, a device and equipment for processing an open block of a solid state disk.

Background

The solid state disk needs to process an open block, namely, an unfilled block, the previous processing mode is to fill junk data in the open block, and the filling of the junk data refers to writing invalid data in Nand, so that the Nand bandwidth is occupied, the writing performance of a user is possibly influenced, the data writing of the user is slow, and a processing flow is added in the implementation and is complex.

Therefore, how to provide an open block processing scheme to avoid influencing the read-write performance of a user and increasing the processing flow is a problem to be solved by technical personnel in the field urgently.

Disclosure of Invention

The application aims to provide a solid-state hard disk open block processing method, device and equipment, and aims to solve the problems that the current open block processing scheme influences the read-write performance of a user and introduces a processing flow, so that the process is complicated. The specific scheme is as follows:

in a first aspect, the present application provides a method for processing an open block of a solid state disk, including:

recording the time of first writing data into a block in a solid state disk;

judging whether the block is full of data within a time threshold value taking the time of writing data for the first time as a starting point;

if not, judging that the block is the open block to be processed, and performing garbage recovery on the open block to be processed.

Optionally, before the judging whether the block is full of data within a time threshold starting from the time of writing data for the first time, the method further includes:

and determining a time threshold according to the Nand open block characteristic.

Optionally, the determining a time threshold according to the Nand open block characteristic includes:

writing part data into any block of the solid state disk to ensure that the block is not fully written, and recording the writing time;

and periodically reading the data on the block at the working temperature, determining the data error rate until the data error rate exceeds the ECC (error correction code) error correction capability, and determining the difference between the current time and the writing time to be used as a time threshold.

Optionally, the garbage recycling of the open block to be processed includes:

and reusing a garbage recycling process, and recycling the open block to be processed.

Optionally, the reusable garbage recycling process performs garbage recycling on the open block to be processed, and includes:

taking the open block to be processed as a source block, and selecting a target block;

identifying valid data of the source block and reading the valid data;

moving the valid data to the target block;

and after the moving is finished, erasing the valid data on the source block.

Optionally, the determining whether the block is full of data within a time threshold starting from the time of writing data for the first time includes:

and recording a time threshold value taking the time of writing data for the first time as a starting point through a timer, and judging whether the block is full of data or not when the timer expires.

Optionally, after determining the time threshold according to the Nand open block characteristic, the method further includes:

and taking the time threshold as a reference time threshold, and respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number.

Optionally, the determining, according to the reference time threshold and the block number, the time threshold of each block in the solid state disk respectively includes:

according to a target formula, respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number, wherein the target formula is as follows:

time=open_block_retention_time-block_num%10;

wherein, time is a time threshold of block, open _ block _ latency _ time is a reference time threshold, and block _ num is a block number.

In a second aspect, the present application provides a solid state disk open block processing apparatus, including:

the time recording module is used for recording the time of the block for writing data for the first time in the solid state disk;

the judging module is used for judging whether the block is fully written with data within a time threshold value taking the time of writing data for the first time as a starting point;

and the garbage recycling module is used for judging that the block is an open block to be processed when the block is not fully written with data, and performing garbage recycling on the open block to be processed.

In a third aspect, the present application provides a solid state disk open block processing apparatus, including:

a memory: for storing a computer program;

a processor: the computer program is used for executing the computer program to realize the solid state disk open block processing method.

The application provides a solid state disk open block processing method, which comprises the following steps: recording the time of first writing data into a block in a solid state disk; judging whether the block is full of data or not within a time threshold value taking the time of writing data for the first time as a starting point; if not, judging that the block is the open block to be processed, and performing garbage recovery on the open block to be processed. Therefore, the method does not fill the open block with garbage data, but performs garbage recovery on the open block, and does not occupy bandwidth due to the fact that the garbage data is not filled, so that the read-write performance of a user is not influenced, a processing flow is not required to be increased, the open block processing flow is simplified, the software complexity is reduced, and the reliability of the solid state disk is improved.

In addition, the application also provides a solid-state hard disk open block processing device and equipment, and the technical effect of the device corresponds to that of the method, and the details are not repeated here.

Drawings

For a clearer explanation of the embodiments or technical solutions of the prior art of the present application, the drawings needed for the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

Fig. 1 is a flowchart of a first embodiment of a solid state disk open block processing method provided in the present application;

fig. 2 is a flowchart of a second embodiment of a solid state disk open block processing method provided in the present application;

fig. 3 is a schematic diagram of an embodiment of a solid state disk open block processing apparatus provided in the present application;

fig. 4 is a schematic diagram of an embodiment of a solid-state disk open block processing device provided in the present application.

Detailed Description

In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The core of the application is to provide a method, a device and equipment for processing an open block which is not filled with user data, so that the error rate is reduced, specifically, when the open block is processed, a method for filling garbage data is not used, but a method for regularly recovering garbage is adopted, so that the processing flow of the open block is simplified, and the influence on the read-write performance of a user is avoided.

Referring to fig. 1, a first embodiment of a method for processing an open block of a solid state disk provided in the present application is described below, where the first embodiment includes the following steps:

s11, recording the time of the block for writing data for the first time in the solid state disk;

s12, judging whether the block is full of data within a time threshold value taking the time of writing data for the first time as a starting point; if yes, no processing is carried out, otherwise, S13 is entered;

and S13, judging the block to be an open block to be processed, and performing garbage recovery on the open block to be processed.

A Solid State Disk (SSD), which is a computer storage device mainly using Flash memory (Nand Flash) as a permanent memory. Nand, refers to a Non-volatile Memory Device (Non-volatile Memory Device). In the solid state disk, an open block refers to a block in which a part of user data is written, and the block is not full, so that the data cannot be kept stable for a long time, and the open block needs to be processed to ensure the reliability of the solid state disk.

The current processing method for the open block is to fill the open block with garbage data (Dummy), which is only for realizing the filling effect and is not user data. The processing method introduces a new processing flow, namely a flow for filling in the junk data, so that the processing process of the open block is more complicated, and the bandwidth occupied when filling in the junk data influences the read-write performance of a user.

Aiming at the problems, when the open block is processed, a method for filling garbage data is not used, and a method for timing garbage recovery is adopted. The specific process is as follows: when the block writes data for the first time, for example, when the block writes the 1 st page, recording the time for writing the data for the first time; monitoring whether the block is full of data within a time threshold value which takes the time of writing data for the first time as a starting point; if the block is full, the block is not processed, otherwise, the block is regarded as the open block to be processed, and garbage recovery is carried out on the open block to be processed.

As a specific implementation manner, a time threshold value with a time when data is written first as a starting point may be recorded by a timer, and when the timer expires, the step of determining whether the block is full of data is triggered. If the block is full, closing the timer, otherwise, judging the block as an open block to be processed, and performing garbage recovery on the open block to be processed.

As a specific implementation manner, the normal garbage collection process can be reused to realize garbage collection of the open block to be processed. Specifically, the existing garbage recycling process is called, and the valid data is moved from the current block to the target block.

In a specific embodiment, the time threshold may be set according to the Nand open block characteristic. The Nand open block property is an aspect of the Nand property and relates to the data retention time of a block that is not full of data, beyond which time data on the block may be lost.

The solid state disk open block processing method provided by the embodiment includes: recording the time of first writing data into a block in a solid state disk; judging whether the block is full of data or not within a time threshold value taking the time of writing data for the first time as a starting point; if not, judging that the block is the open block to be processed, and performing garbage recovery on the open block to be processed. Therefore, the method does not fill the open block with garbage data, but performs garbage recovery on the open block, and does not occupy bandwidth due to the fact that the garbage data is not filled, so that the read-write performance of a user is not influenced, a processing flow is not required to be increased, the open block processing flow is simplified, the software complexity is reduced, and the reliability of the solid state disk is improved.

The second embodiment of the solid-state disk open block processing method provided by the present application is described in detail below. The second embodiment is realized based on the first embodiment and is expanded to a certain extent on the basis of the first embodiment, on one hand, the second embodiment provides a specific calculation process of the time threshold, and on the other hand, in order to avoid centralized triggering of garbage collection, the second embodiment distinguishes the time thresholds of different blocks to realize discretized garbage collection.

Referring to fig. 2, the second embodiment specifically includes the following steps:

and S21, writing part of data into any block of the solid state disk to ensure that the block is not full, and recording the writing time.

And S22, periodically reading the data on the block at the working temperature, determining the data error rate until the data error rate exceeds the ECC error correction capability, and determining the difference between the current time and the writing time as a time threshold.

And S23, taking the time threshold as a reference time threshold, and respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number.

Specifically, according to a target formula, the time threshold of each block in the solid state disk is respectively determined according to the reference time threshold and the block number, wherein the target formula is as follows:

time=open_block_retention_time-block_num%10;

wherein, time is a time threshold of block, open _ block _ latency _ time is a reference time threshold, and block _ num is a block number.

It can be understood that the above target formula is provided only as a feasible discrete manner, and in practical applications, other discrete manners may be selected, such as the above 10 may also be selected as well, as long as it is ensured that the time thresholds of different blocks are different, and garbage collection is avoided in a centralized manner.

S24, recording the time of the target block writing data for the first time in the solid state disk;

s25, judging whether the target block is fully written with data within the time threshold of the target block by taking the time of writing data for the first time as a starting point; if so, no processing is performed, and if not, the process proceeds to S26.

In a specific embodiment, a timer records a time threshold starting from the time when data is first written, and when the timer expires, it is determined whether the target block is full of data.

And S26, judging that the target block is the open block to be processed, multiplexing a garbage recovery flow, and performing garbage recovery on the open block to be processed.

The garbage recycling process specifically comprises the following steps: taking an open block to be processed as a source block, and selecting a target block; identifying valid data of the source block and reading the valid data; moving the valid data to a target block; and after the moving is finished, erasing the valid data on the source block.

Based on the above embodiments, the open block processing procedure is described below by taking practical applications as an example.

First, testing the data retention time of the Nand open block

For blocks with different numbers in Nand, open block characteristics of the blocks need to be tested, and the specific flow is as follows:

(1) writing 1page data aiming at the selected block;

(2) reading once in 1 minute at the working temperature, and measuring the data error rate; recording corresponding time until the data error rate exceeds the ECC capability, and further obtaining a time threshold;

(3) and erasing the block, rewriting data of more pages, and repeating the steps until all the open block page ranges are traversed.

After the test is completed, the data holding time of the open block, namely the reference time threshold value, can be obtained.

Second, Open block garbage recycling process

(1) Determining an open block to be processed as a source block;

(2) identifying valid data of the source block, and reading the valid data;

(3) selecting a target block as a data write block;

(4) writing the effective data read by the source block into the target block;

(5) and if the data are completely moved, erasing the source block.

Third, open block processing flow

(1) When the block writes the 1 st page, starting a timer for 1 hour, wherein the specific time is determined according to the Nand open block characteristic;

(2) closing the timer if the block has been filled within the timer time;

(3) and if the block is not filled in the timer, directly initiating garbage recovery to the block, and reusing the normal garbage recovery process.

Fourthly, prevent the move centralized trigger caused by open block

Data migration can cause data reading and data writing of background to occur, performance perceived by a user is affected, and if multiple open blocks need to be migrated, the user is affected greatly. In this embodiment, the timer of the open block is subjected to discrete processing to prevent the occurrence of this problem, specifically, the discrete processing is performed according to the following formula:

time=open_block_retention_time-block_num%10;

the units of the above formula are minutes.

Therefore, the timer time of different blocks is different, and open block data movement centralized triggering can be prevented.

Therefore, according to the solid state disk open block processing method provided by the embodiment, garbage data is not filled in the open block, but is recycled, so that the read-write performance of a user is not influenced, the open block processing flow is simplified, the software complexity is reduced, and the reliability of the solid state disk is improved.

The solid-state disk open block processing apparatus provided in the embodiment of the present application is introduced below, and the solid-state disk open block processing apparatus described below and the solid-state disk open block processing method described above may be referred to correspondingly.

As shown in fig. 3, the solid state disk open block processing apparatus of this embodiment includes:

the time recording module 31 is configured to record, in the solid state disk, a time when the block writes data for the first time;

the judging module 32 is configured to judge whether the block is full of data within a time threshold starting from a time when the data is written for the first time;

and the garbage recycling module 33 is configured to determine that the block is an open block to be processed when the block is not full of data, and recycle garbage from the open block to be processed.

In some specific embodiments, the method further comprises:

and the time threshold value determining module is used for determining the time threshold value according to the Nand open block characteristic.

In some specific embodiments, the time threshold determination module comprises:

the data writing unit is used for writing part of data into any block of the solid state disk so as to ensure that the block is not fully written, and recording the writing time;

and the error rate determining unit is used for periodically reading the data on the block at the working temperature, determining the data error rate until the data error rate exceeds the ECC (error correction code) correction capability, and determining the difference value between the current time and the writing time to be used as a time threshold.

In some specific embodiments, the garbage collection module is specifically configured to:

and reusing the garbage recovery process, and recovering the garbage from the open block to be processed.

In some specific embodiments, the garbage collection module includes:

the selecting unit is used for taking the open block to be processed as a source block and selecting a target block;

the valid data reading unit is used for identifying valid data of the source block and reading the valid data;

the data moving unit is used for moving the effective data to the target block;

and the data erasing unit is used for erasing the effective data on the source block after the moving is finished.

In some specific embodiments, the determining module is specifically configured to:

and recording a time threshold value taking the time of writing data for the first time as a starting point through a timer, and judging whether the block is full of data or not when the timer expires.

In some specific embodiments, the method further comprises:

and the time threshold updating module is used for taking the time threshold as a reference time threshold, and respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number.

In some specific embodiments, the time threshold updating module is specifically configured to:

according to a target formula, respectively determining the time threshold of each block in the solid state disk according to the reference time threshold and the block number, wherein the target formula is as follows:

time=open_block_retention_time-block_num%10;

wherein, time is a time threshold of block, open _ block _ latency _ time is a reference time threshold, and block _ num is a block number.

The solid state disk open block processing apparatus of this embodiment is used to implement the solid state disk open block processing method, so the specific implementation of the apparatus can be found in the foregoing embodiment of the solid state disk open block processing method, and details are not described here.

In addition, the present application further provides a solid state disk open block processing device, as shown in fig. 4, including:

the memory 100: for storing a computer program;

the processor 200: for executing the computer program to implement the solid state disk open block processing method as described above.

The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The above detailed descriptions of the solutions provided in the present application, and the specific examples applied herein are set forth to explain the principles and implementations of the present application, and the above descriptions of the examples are only used to help understand the method and its core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种存储桶索引重分裂的方法、装置、设备和介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类