[go: up one dir, main page]

CN104090847B - Address distribution method of solid-state storage device - Google Patents

Address distribution method of solid-state storage device Download PDF

Info

Publication number
CN104090847B
CN104090847B CN201410290432.0A CN201410290432A CN104090847B CN 104090847 B CN104090847 B CN 104090847B CN 201410290432 A CN201410290432 A CN 201410290432A CN 104090847 B CN104090847 B CN 104090847B
Authority
CN
China
Prior art keywords
request
read
write
channel
queue
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
CN201410290432.0A
Other languages
Chinese (zh)
Other versions
CN104090847A (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201410290432.0A priority Critical patent/CN104090847B/en
Publication of CN104090847A publication Critical patent/CN104090847A/en
Application granted granted Critical
Publication of CN104090847B publication Critical patent/CN104090847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Memory System (AREA)

Abstract

本发明公开了一种固态存储设备的地址分配方法,适用于基于闪存的多通道固态存储设备,属于固态存储领域,解决现有的分配策略中存在的读写请求冲突问题。解决在读写请求混合的工作负载中,请求的响应时间变长的问题。本发明方法包括通道权值的分配,物理地址分配以及冲突预测避免机制。本发明为读、写请求以及垃圾回收操作分配不同的权值,权值可以根据用户的需求调整,以适应不同的读写性能要求,充分利用固态存储设备内部的并行性,并根据负载情况,为写请求选择合适的物理地址,减少写后读冲突并降低垃圾回收操作对写请求的阻塞。实现固态存储设备读写响应时间的降低以及固态存储设备性能的提升。

The invention discloses an address allocation method of a solid-state storage device, which is suitable for multi-channel solid-state storage devices based on flash memory, belongs to the field of solid-state storage, and solves the problem of conflict between read and write requests existing in existing allocation strategies. Solve the problem that the response time of requests becomes longer in workloads with mixed read and write requests. The method of the invention includes channel weight distribution, physical address distribution and conflict prediction and avoidance mechanism. The invention allocates different weights for read and write requests and garbage collection operations, and the weights can be adjusted according to user needs to meet different read and write performance requirements, fully utilize the parallelism inside solid-state storage devices, and according to load conditions, Choose an appropriate physical address for write requests, reduce read-after-write conflicts and reduce garbage collection operations blocking write requests. Realize the reduction of the read and write response time of the solid-state storage device and the improvement of the performance of the solid-state storage device.

Description

一种固态存储设备的地址分配方法A method for allocating addresses of solid-state storage devices

技术领域technical field

本发明属于固态存储技术领域,更具体地,涉及一种固态存储设备的地址分配方法。The invention belongs to the technical field of solid-state storage, and more particularly relates to an address allocation method of a solid-state storage device.

背景技术Background technique

固态存储设备是一类有别于机械硬盘的新型计算机存储设备。与传统硬盘相比,基于闪存的固态存储设备具有高密度,低能耗,无噪音,抗震动等特点,同时它具有较低的读写延时以及更高的吞吐率。Solid-state storage devices are a new type of computer storage devices that are different from mechanical hard disks. Compared with traditional hard disks, flash-based solid-state storage devices have the characteristics of high density, low energy consumption, no noise, anti-vibration, etc., and it has lower read and write delays and higher throughput rates.

由于闪存介质的特点,基于闪存的固态存储设备还具有以下缺陷:Due to the characteristics of flash media, flash-based solid-state storage devices also have the following drawbacks:

(1)先擦后写:闪存介质在写入数据时不能就地更新,需要先对目标地址的物理块进行擦除操作,然后再进行数据的更新。擦除操作和读写操作的基本单位不同,擦除操作以物理块为单位,读写操作以物理页为单位,通常一个物理块中包含有64或128个物理页。(1) Erase first and then write: the flash memory medium cannot be updated in situ when writing data, and the physical block of the target address needs to be erased first, and then the data is updated. The basic units of the erase operation and the read and write operations are different. The erase operation takes the physical block as the unit, and the read and write operations take the physical page as the unit. Usually, a physical block contains 64 or 128 physical pages.

(2)读、写和擦除操作的速度差异:在闪存介质中,单次的读操作时间约为15-50μs,写操作时间约为200μs,擦除操作时间约为50ms。读写速度的差异会带来读操作的阻塞问题,当读请求在写请求之后到达时,由于较长的写请求处理时间,会导致读请求等待一个较长的时间。擦除操作耗时长,会导致后续请求长时间等待。(2) Speed difference of read, write and erase operations: in flash media, the time for a single read operation is about 15-50 μs, the time for a write operation is about 200 μs, and the time for an erase operation is about 50 ms. The difference in read and write speed will cause the blocking problem of the read operation. When the read request arrives after the write request, the read request will wait for a long time due to the long write request processing time. The wipe operation takes a long time, causing subsequent requests to wait for a long time.

(3)闪存寿命:闪存颗粒的寿命是按Program/Erase(编程/擦除)次数计算的,MLC(全称,多阶存储单元闪存)的寿命一般在1000-10000次,SLC(全称,单阶存储单元闪存)则在10万次左右。(3) Flash memory life: The life of flash memory particles is calculated according to the number of Program/Erase (programming/erasing). The life of MLC (full name, multi-level storage unit flash memory) is generally 1000-10000 times. Storage unit flash memory) is about 100,000 times.

为了充分利用闪存芯片的速度优势,并解决闪存芯片存在的问题,在固态存储设备中,加入了一个闪存转换层。闪存转换层主要提供地址映射,垃圾回收以及磨损均衡3个功能。地址映射是闪存转换层的核心,它通过一个映射表提供逻辑地址到物理地址的映射。垃圾回收的作用是回收固态存储设备中的失效页,合并整理为干净的物理块,增加设备的可用空间。磨损均衡用来保证固态存储设备中各个物理块之间擦除次数的均衡,保证固态存储设备的寿命以及可靠性。垃圾回收和磨损均衡等功能都依赖地址映射表来实现。In order to make full use of the speed advantages of flash memory chips and solve the problems of flash memory chips, a flash conversion layer is added to solid-state storage devices. The flash translation layer mainly provides three functions of address mapping, garbage collection and wear leveling. Address mapping is the core of the flash translation layer, which provides mapping from logical addresses to physical addresses through a mapping table. The function of garbage collection is to reclaim the invalid pages in the solid-state storage device, merge them into clean physical blocks, and increase the available space of the device. Wear leveling is used to ensure the balance of erasing times between physical blocks in the solid-state storage device, and to ensure the life and reliability of the solid-state storage device. Functions such as garbage collection and wear leveling rely on the address mapping table to achieve.

基于闪存的固态存储通常由多个独立通道组成,每个通道连接多颗闪存芯片,芯片内部又可以分为晶元、分组、块和页。单颗芯片的读写速度,单个通道的传输速度都有限,为了尽可能的提高固态存储设备的性能,就需要充分的利用通道和芯片间的并行性。Flash-based solid-state storage usually consists of multiple independent channels, each channel is connected to multiple flash memory chips, and the chip can be divided into wafers, groups, blocks and pages. The read and write speed of a single chip and the transmission speed of a single channel are limited. In order to improve the performance of solid-state storage devices as much as possible, it is necessary to make full use of the parallelism between channels and chips.

固态存储设备中,地址分配是指为需要写到设备中的逻辑页确定空闲物理页,根据选择物理页的范围主要分为静态分配方式、动态分配方式和混合分配方式。不同的地址分配方式对固态存储设备内部的并行性的利用方式不一样,所以对性能有着不同的影响。在通常情况下,静态分配方式的读性能优于动态分配方式,而写性能比动态分配方式差。In solid-state storage devices, address allocation refers to determining free physical pages for logical pages that need to be written to the device. According to the range of selected physical pages, it is mainly divided into static allocation methods, dynamic allocation methods, and hybrid allocation methods. Different address allocation methods have different utilization methods of parallelism inside the solid-state storage device, so they have different impacts on performance. Under normal circumstances, the read performance of the static allocation method is better than that of the dynamic allocation method, while the write performance is worse than that of the dynamic allocation method.

在静态分配方式中,逻辑页按预先定义好的规则被分配到指定的通道、芯片、晶元、分组中。根据分配规则的不同,可以分为多种不同的静态分配方式,根据<通道,芯片,晶元,分组>不同的排列组合顺序,可以排列成24种不同的静态分配方式。In the static allocation method, logical pages are allocated to specified channels, chips, wafers, and groups according to predefined rules. According to the different allocation rules, it can be divided into many different static allocation methods. According to the different arrangement and combination sequences of <channel, chip, wafer, group>, it can be arranged into 24 different static allocation methods.

在动态分配方式中,逻辑页可以选择设备中所有的空闲物理页。综合考虑通道、芯片、晶元、分组的忙闲,物理块的磨损程度等因素,最终确定分配的具体位置。使用全动态的分配方式,可以有效的提高写性能,让写请求在较短的时间获得响应。In dynamic allocation, logical pages can select all free physical pages in the device. Considering factors such as channels, chips, wafers, grouping busy and idle, and physical block wear and tear, the specific location of allocation is finally determined. Using a fully dynamic allocation method can effectively improve write performance and allow write requests to be responded in a relatively short period of time.

混合分配方式结合静态分配方式以及动态分配方式的特点,通道、芯片、晶元、分组4个层次的分配部分使用静态规则指定,部分由动态规则指定。如静态的分配通道,根据忙闲动态的分配芯片、晶元、分组等。The hybrid allocation method combines the characteristics of the static allocation method and the dynamic allocation method. The allocation of the four levels of channels, chips, wafers, and groups is partially specified by static rules, and some are specified by dynamic rules. For example, static allocation channels, dynamic allocation of chips, wafers, groups, etc. according to busy or idle.

目前,静态地址分配在固态存储设备中广泛应用,静态地址分配可以提供较好的连续读写性能,但随机读写的性能较差。请求分配到固态存储设备内部的具体位置,由请求的逻辑地址计算得到,当请求的逻辑地址随机分布时,会出现大量请求对固态存储设备内部通道等资源的争用,导致某些通道内请求十分密集,而某些通道请求较少甚至没有请求访问。尤其是读请求其访问的数据位置已根据地址确定,写请求占用通道资源时,读请求响应时间不断上升,固态存储设备的性能显著下降。At present, static address allocation is widely used in solid-state storage devices. Static address allocation can provide better continuous read and write performance, but the performance of random read and write is poor. The request is allocated to the specific location inside the solid-state storage device, which is calculated from the logical address of the request. When the logical address of the request is randomly distributed, there will be a large number of requests for contention for resources such as internal channels of the solid-state storage device, resulting in requests in some channels Very intensive, while some channels request little or no access. In particular, the location of the data accessed by the read request has been determined according to the address. When the write request occupies channel resources, the response time of the read request continues to rise, and the performance of the solid-state storage device decreases significantly.

动态地址分配可以提高固态存储设备的写性能,但并不能有效的减少读写请求之间的冲突,读性能较静态地址分配降低。Dynamic address allocation can improve the write performance of solid-state storage devices, but it cannot effectively reduce conflicts between read and write requests, and the read performance is lower than static address allocation.

发明内容Contents of the invention

针对现有技术的以上缺陷或改进需求,本发明提供了一种基于通道权值的地址分配方法,其目的在于在固态盘内部实现读写请求调度,充分利用固态存储设备内部的并行性,由此解决固态存储设备在读写混合的工作环境中读写请求对其内部资源争用而导致的性能下降。In view of the above defects or improvement needs of the prior art, the present invention provides an address allocation method based on channel weights, the purpose of which is to realize the scheduling of read and write requests inside the solid state disk, and make full use of the parallelism inside the solid state storage device. This solves the performance degradation caused by the internal resource contention caused by the read and write requests of the solid state storage device in a mixed read and write environment.

为实现上述目的,本发明提供了一种固态存储设备的地址分配方法,所述方法包括如下步骤:In order to achieve the above object, the present invention provides a method for allocating addresses of solid-state storage devices, said method comprising the following steps:

(1)请求接收步骤:固态存储设备接收到由上层文件系统发送的读写请求,对接收的请求类型进行判断并进行相应的操作,若为写请求,则直接将请求加入到请求队列队尾,等待处理;若为读请求,则根据请求的逻辑地址查找映射表获得其对应的物理地址,根据物理地址可以计算得到请求对应的通道信息,预先处理读请求对应的权值,根据已知的通道信息,给对应的通道加上读操作的权值,并将此请求加入到请求队列队尾,等待处理;(1) Request receiving step: The solid-state storage device receives the read and write request sent by the upper file system, judges the type of the received request and performs corresponding operations, if it is a write request, directly adds the request to the end of the request queue , waiting for processing; if it is a read request, look up the mapping table according to the logical address of the request to obtain its corresponding physical address, and calculate the channel information corresponding to the request according to the physical address, pre-process the corresponding weight of the read request, according to the known Channel information, add the weight of the read operation to the corresponding channel, and add this request to the end of the request queue, waiting for processing;

(2)请求队列处理步骤:固态存储设备对存放在请求队列中未处理的请求采用先进先出的方式进行处理,依次进行地址分配;(2) Request queue processing steps: the solid-state storage device processes unprocessed requests stored in the request queue in a first-in-first-out manner, and sequentially assigns addresses;

(3)读请求分配步骤:若从请求队列取出的请求为读请求,根据请求接收步骤中查找映射表已知的信息,将请求加入到对应通道的通道队列的尾部,等待处理;(3) Read request distribution step: if the request taken out from the request queue is a read request, according to the known information of the mapping table in the request receiving step, the request is added to the tail of the channel queue of the corresponding channel, waiting for processing;

(4)写请求分配步骤:若从请求队列取出的请求为写请求,则根据各个通道的权值大小,比较得到权值最小的通道,并根据芯片忙闲信息选择此写请求对应的芯片、晶元、分组、物理块和物理页,并由此计算出对应的物理地址;将请求加入到对应通道的通道队列的尾部,更改对应通道的权值,等待处理;(4) Write request allocation step: if the request taken out from the request queue is a write request, then according to the weight of each channel, compare the channel with the smallest weight, and select the chip corresponding to the write request according to the chip busy or idle information. Wafer, packet, physical block and physical page, and calculate the corresponding physical address; add the request to the tail of the channel queue of the corresponding channel, change the weight of the corresponding channel, and wait for processing;

(5)通道队列处理步骤:闪存控制器从通道队列中取出请求,并根据由请求接收步骤和请求队列处理步骤中获得的请求物理地址、请求大小、请求类型信息,对闪存芯片进行相应的操作,从闪存中读取相应数据信息或将请求携带的数据写入到其物理地址对应的闪存物理页中;当闪存芯片的读写操作完成后,闪存控制器向固态盘控制器返回完成信息,并根据请求的类型更改对应通道的权值;通道内读操作完成则对应通道的权值减去读操作权值,写操作完成则对应通道的权值减去写操作权值;(5) Channel queue processing step: the flash memory controller takes out the request from the channel queue, and performs corresponding operations on the flash memory chip according to the request physical address, request size, and request type information obtained in the request receiving step and the request queue processing step , read the corresponding data information from the flash memory or write the data carried by the request into the physical page of the flash memory corresponding to its physical address; when the read and write operations of the flash memory chip are completed, the flash memory controller returns the completion information to the solid state disk controller, And change the weight of the corresponding channel according to the type of request; when the read operation in the channel is completed, the weight of the corresponding channel is subtracted from the weight of the read operation, and when the write operation is completed, the weight of the corresponding channel is subtracted from the weight of the write operation;

(6)垃圾回收处理步骤:触发垃圾回收操作时,为进行垃圾回收操作的通道加上垃圾回收操作权值,待垃圾回收操作完成后,对应通道的权值减去垃圾回收操作的权值。(6) Garbage collection processing steps: when a garbage collection operation is triggered, add the weight of the garbage collection operation to the channel performing the garbage collection operation, and after the garbage collection operation is completed, subtract the weight of the garbage collection operation from the weight of the corresponding channel.

在本发明的一个实施例中,所述请求接收步骤具体包括:In one embodiment of the present invention, the request receiving step specifically includes:

(1.1)固态存储设备接收上层文件系统或固态存储设备缓存产生的读写请求,所述读写请求至少包含逻辑页地址、请求大小、读写操作信息,进行子步骤(1.2);(1.1) The solid-state storage device receives the read-write request generated by the upper-level file system or the cache of the solid-state storage device, and the read-write request includes at least a logical page address, a request size, and read-write operation information, and performs substep (1.2);

(1.2)判断请求大小是否大于一个物理页的大小,若大于,转子步骤(1.3);否则转子步骤(1.4);(1.2) Determine whether the request size is greater than the size of a physical page, if greater, the rotor step (1.3); otherwise the rotor step (1.4);

(1.3)计算此请求需要占用的物理页数n,将其划分为n个请求,每个请求对应一个物理页,转子步骤(1.4);(1.3) Calculate the number n of physical pages that this request needs to occupy, divide it into n requests, each request corresponds to a physical page, rotor step (1.4);

(1.4)判断请求的操作类型,若为写请求,转子步骤(1.7);若为读请求,转子步骤(1.5);(1.4) Judging the operation type of the request, if it is a write request, the rotor step (1.7); if it is a read request, the rotor step (1.5);

(1.5)根据读请求的逻辑地址查映射表得到对应的物理地址,由物理地址可知此请求所对应的通道i、芯片,i对应固态存储设备中某一通道号,转子步骤(1.6);(1.5) According to the logical address of read request, look up the mapping table to obtain the corresponding physical address, the corresponding channel i and chip of this request can be known by the physical address, and i corresponds to a certain channel number in the solid-state storage device, rotor step (1.6);

(1.6)计算通道i对应通道权值Wi=Wi+WR,WR为读请求权值,转子步骤(1.7);(1.6) Calculate the channel weight corresponding to channel i W i =W i +W R , W R is the read request weight, rotor step (1.7);

(1.7)将请求按序加入请求队列的尾部。(1.7) Add requests to the tail of the request queue in order.

在本发明的一个实施例中,所述请求队列处理步骤具体包括:In one embodiment of the present invention, the request queue processing step specifically includes:

(2.1)查询请求队列状态,判断请求队列是否为空,是则转子步骤(2.3),否则转子步骤(2.2);(2.1) Query the status of the request queue, and judge whether the request queue is empty, if so, the rotor step (2.3), otherwise the rotor step (2.2);

(2.2)读取请求队列队头请求,根据请求操作信息分类,若为读请求,转步骤(3);若为写请求,转步骤(4)。(2.2) Read the requests at the head of the request queue and classify them according to the request operation information. If it is a read request, go to step (3); if it is a write request, go to step (4).

在本发明的一个实施例中,所述读请求分配步骤具体包括:从请求队列队头取出读请求,由子步骤(1.5)中查得请求对应的通道号i,将此读请求加入通道i队列尾部,转步骤(5)。In one embodiment of the present invention, the read request allocation step specifically includes: taking out the read request from the head of the request queue, finding the channel number i corresponding to the request in substep (1.5), and adding the read request to the channel i queue At the end, turn to step (5).

在本发明的一个实施例中,所述写请求分配步骤具体包括:In one embodiment of the present invention, the write request allocation step specifically includes:

(4.1)从请求队列队头取出写请求,进行子步骤(4.2);(4.1) Take out the write request from the head of the request queue, and carry out the substep (4.2);

(4.2)由闪存先擦后写特性可知,写请求需要空闲物理页进行存储,比较各个通道权值Wi,找到权值最小的通道j,j对应此时固态存储设备中权值最小的通道,转子步骤(4.3);(4.2) According to the characteristics of flash memory after erasing first, it can be seen that the write request requires free physical pages for storage, compare the weights W i of each channel, and find the channel j with the smallest weight, and j corresponds to the channel with the smallest weight in the solid-state storage device at this time , the rotor step (4.3);

(4.3)判断闪存转换层是否支持芯片选择,若支持,转子步骤(4.4);若不支持,将此写请求加入通道j队列尾部,转子步骤(4.5);(4.3) Judging whether the flash memory conversion layer supports chip selection, if it supports, the rotor step (4.4); if not, add this write request to the tail of the channel j queue, and the rotor step (4.5);

(4.4)轮询查找此通道下芯片片选信号R/B,找到空闲芯片k,若所有芯片都不空闲,则选择第一个查询的芯片k,确定请求将要写入的芯片k,将此写请求加入通道j队列尾部,转子步骤(4.5)(4.4) Polling to find the chip selection signal R/B of the chip under this channel, find the idle chip k, if all the chips are not idle, then select the first inquired chip k, determine the chip k to be written into the request, and write this The write request is added to the tail of the channel j queue, the rotor step (4.5)

(4.5)通道j通道权值Wj=Wi+WW,WW为写请求权值,转步骤(5)(4.5) Channel j channel weight W j =W i +W W , W W is the write request weight, go to step (5)

在本发明的一个实施例中,所述通道队列处理步骤具体包括:In one embodiment of the present invention, the channel queue processing step specifically includes:

(5.1)依次查询通道队列,若通道i队列为空,转步骤(6)并继续查询下一通道,若不为空,转子步骤(5.2);(5.1) Query the channel queue in turn, if the channel i queue is empty, go to step (6) and continue to query the next channel, if not empty, the rotor step (5.2);

(5.2)读取通道队列头部请求,获取信息,转子步骤(5.3);(5.2) read channel queue head request, obtain information, rotor step (5.3);

(5.3)处理通道队列队头的请求,若为读请求,转子步骤(5.4);若为写请求,转子步骤(5.5);(5.3) process the request of the head of the channel queue, if it is a read request, the rotor step (5.4); if it is a write request, the rotor step (5.5);

(5.4)根据读请求的物理地址,取出物理地址对应的物理页中的数据,并发送给上层应用,当读操作完成后,更新芯片片选信号R/B,将此请求从通道队列中删除,此时Wi=Wi-WR,转子步骤(5.1);(5.4) According to the physical address of the read request, take out the data in the physical page corresponding to the physical address and send it to the upper application. When the read operation is completed, update the chip selection signal R/B and delete this request from the channel queue , at this time W i =W i -W R , rotor step (5.1);

(5.5)根据已知的写请求通道、芯片信息,将数据写入对应的空闲物理页中,当写操作完成后,更新芯片片选信号R/B,将此请求从通道队列中删除,此时Wi=Wi-WW,转子步骤(5.1)。(5.5) According to the known write request channel and chip information, write the data into the corresponding free physical page. After the write operation is completed, update the chip select signal R/B, and delete this request from the channel queue. When W i =W i -W W , the rotor step (5.1).

在本发明的一个实施例中,所述通道队列处理步骤具体包括:In one embodiment of the present invention, the channel queue processing step specifically includes:

(6.1)根据通道i空闲物理页比例,判断是否需要进行垃圾回收操作,若不需要进行垃圾回收操作,转子步骤(2.1),若需要进行垃圾回收操作,转子步骤(6.2);(6.1) According to the proportion of free physical pages of channel i, determine whether garbage collection operation is required, if garbage collection operation is not required, rotor step (2.1), if garbage collection operation is required, rotor step (6.2);

(6.2)执行通道内垃圾回收操作,通道i通道权值Wi=Wi+WGC,WGC为垃圾回收权值,转子步骤(6.3);(6.2) Execute the garbage collection operation in the channel, channel i channel weight W i =W i +W GC , W GC is the garbage collection weight, rotor step (6.3);

(6.3)垃圾回收操作完成,通道i通道权值Wi=Wi-WGC,转步骤(5)。(6.3) The garbage collection operation is completed, the channel i channel weight W i =W i -W GC , go to step (5).

总体而言,通过本发明所构思的以上技术方案与现有技术相比,具有以下有益效果:Generally speaking, compared with the prior art, the above technical solution conceived by the present invention has the following beneficial effects:

(1)相比传统的静态分配方式与动态分配方式,本发明中加入了通道权值。通道权值能表征通道的忙闲程度,当有写请求到达时,可以根据通道权值的比较,选择合适的通道分配请求,充分利用通道间的并行性。(1) Compared with the traditional static allocation method and dynamic allocation method, the present invention adds channel weights. The channel weight can represent the busyness of the channel. When a write request arrives, an appropriate channel allocation request can be selected according to the comparison of the channel weight, and the parallelism between channels can be fully utilized.

(2)本发明在进行垃圾回收操作时,为对应通道加上垃圾回收操作的权值,写请求处理步骤可以根据通道权值比较,合理的避免垃圾回收操作与写请求操作的冲突,为写请求分配合适的通道,减少写请求响应时间。(2) When the present invention performs the garbage collection operation, the weight of the garbage collection operation is added to the corresponding channel, and the write request processing step can be compared according to the channel weight, so as to reasonably avoid the conflict between the garbage collection operation and the write request operation. Requests to allocate appropriate channels to reduce write request response time.

(3)本发明在读请求进入固态存储设备,而不是读请求加入通道队列时,给请求对应的通道加上了相应的读操作权值WR,通过这一步骤对权值的操作,提高了此读请求的优先性,降低了此读请求被写请求阻塞的可能性,减少了读写操作的冲突,从而可以提高固态存储设备的性能,降低读写请求的响应时间。(3) The present invention adds a corresponding read operation weight W R to the channel corresponding to the request when the read request enters the solid-state storage device instead of the read request being added to the channel queue. Through this step, the operation of the weight value improves the The priority of the read request reduces the possibility of the read request being blocked by the write request and reduces the conflict of read and write operations, thereby improving the performance of the solid-state storage device and reducing the response time of the read and write requests.

(4)本发明通过通道队列的先进先出策略保证读写请求都能在一定时间内被处理,而不会出现读请求或写请求被长时间阻塞,保证了读写请求的公平性。通过权值的设置以及轮询机制,也保证了写请求在各个通道间的均匀分布。使数据平均的分布在各个通道中,保证了读请求的并行性和性能,同时使各个通道内物理块的磨损程度保持均衡。(4) The present invention ensures that read and write requests can be processed within a certain period of time through the first-in-first-out strategy of the channel queue, without long-term blocking of read or write requests, ensuring the fairness of read and write requests. Through the setting of the weight and the polling mechanism, the even distribution of write requests among the various channels is also guaranteed. The data is evenly distributed in each channel, which ensures the parallelism and performance of read requests, and at the same time keeps the wear degree of physical blocks in each channel balanced.

(5)本发明可以合理的根据固态存储设备使用的工作环境自定义读写操作的权值WR、WW,从而控制读写操作的优先级,以适应要求不同读写响应时间的工作环境。WR与WW比值越高,则读请求优先级越高,反之则写请求优先级越高。(5) The present invention can reasonably customize the weights W R and W W of the read and write operations according to the working environment used by the solid-state storage device, thereby controlling the priority of the read and write operations to adapt to the working environment that requires different read and write response times . The higher the ratio of W R to W W , the higher the priority of the read request, otherwise the higher the priority of the write request.

附图说明Description of drawings

图1为本发明固态存储设备的地址分配方法的流程示意图;FIG. 1 is a schematic flow diagram of an address allocation method for a solid-state storage device of the present invention;

图2为本发明一实施例中请求接收步骤的流程示意图;FIG. 2 is a schematic flowchart of a request receiving step in an embodiment of the present invention;

图3为本发明一实施例中请求队列处理步骤的流程示意图;Fig. 3 is a schematic flow chart of request queue processing steps in an embodiment of the present invention;

图4为本发明一实施例中读请求分配步骤的流程示意图;FIG. 4 is a schematic flow diagram of a read request allocation step in an embodiment of the present invention;

图5为本发明一实施例中写请求分配步骤的流程示意图;FIG. 5 is a schematic flow diagram of a write request allocation step in an embodiment of the present invention;

图6为本发明一实施例中通道队列处理步骤的流程示意图;FIG. 6 is a schematic flow chart of channel queue processing steps in an embodiment of the present invention;

图7为本发明一实施例中垃圾回收操作步骤的流程示意图。FIG. 7 is a schematic flowchart of garbage collection operation steps in an embodiment of the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

为了清楚地理解本发明,以下对有关概念加以解释:In order to understand the present invention clearly, relevant concepts are explained below:

NAND闪存芯片:闪存芯片技术在1984年由东芝公司发明,是一种电子式可清除程序化只读存储器,它的特点是结构简洁,单位面积的半导体内能实现相当多的数据存储量。这种结构带来的副作用是擦写时不能以bit为单位,而只能以物理块为单位进行大范围的操作。NAND flash memory chip: The flash memory chip technology was invented by Toshiba in 1984. It is an electronic erasable programmable read-only memory. It is characterized by a simple structure and a considerable amount of data storage in a semiconductor per unit area. The side effect of this structure is that erasing and writing cannot be performed in units of bits, but only in large-scale operations in units of physical blocks.

闪存控制器:管理存储在闪存芯片中的数据,并提供访问接口。Flash memory controller: manages the data stored in the flash memory chip and provides an access interface.

通道:在固态存储设备中连接闪存控制器和闪存芯片,每个通道由多个芯片组成;Channel: Connect the flash memory controller and flash memory chip in the solid-state storage device, and each channel consists of multiple chips;

物理块:闪存芯片的存储区域,每个闪存芯片中包含若干个物理块,每个物理块中包含恒定数量的物理页,物理块也是擦除操作的基本单位;Physical block: the storage area of the flash memory chip. Each flash memory chip contains several physical blocks, and each physical block contains a constant number of physical pages. The physical block is also the basic unit of the erase operation;

物理页:闪存芯片的最小存储单元,物理页是为写请求分配资源的基本单位,根据闪存工艺的不同,不同芯片的物理页大小不同;Physical page: The smallest storage unit of a flash memory chip. The physical page is the basic unit for allocating resources for write requests. Depending on the flash memory technology, the physical page size of different chips is different;

逻辑页地址:描述计算机存储设备上数据所在区块的通用机制,指某个数据区块的地址或某个地址所指向的数据区块,可由闪存转换层转换得到物理地址;Logical page address: the general mechanism for describing the block where the data on the computer storage device is located, refers to the address of a certain data block or the data block pointed to by a certain address, which can be converted by the flash memory conversion layer to obtain the physical address;

空闲物理页:固态存储设备中物理页还没有使用,即其没有数据时,该物理页为空闲物理页,可以用于写请求和垃圾回收操作的分配;Free physical page: the physical page in the solid-state storage device has not been used, that is, when it has no data, the physical page is a free physical page, which can be used for allocation of write requests and garbage collection operations;

映射表:是保存逻辑页地址与物理页地址之间一一对应关系的数据结构。Mapping table: It is a data structure that stores the one-to-one correspondence between logical page addresses and physical page addresses.

垃圾回收:垃圾回收的过程一般是先将选中的物理块中的有效数据转移到其它物理块中,然后对其实施擦除操作。是通过擦除具有较多无效数据的物理块来回收物理页。Garbage collection: The process of garbage collection is generally to transfer the valid data in the selected physical block to other physical blocks, and then perform an erase operation on it. Physical pages are reclaimed by erasing physical blocks with more invalid data.

请求队列:固态存储设备中用来存放待处理请求的队列,此队列为先进先出队列;Request queue: the queue used to store pending requests in the solid-state storage device, this queue is a first-in first-out queue;

通道队列:固态存储设备中用来存放来自请求队列、经过闪存转换层分配给各个通道的请求,此队列为先进先出队列;Channel queue: the solid-state storage device is used to store requests from the request queue and assigned to each channel through the flash conversion layer. This queue is a first-in-first-out queue;

读请求权值WR:根据固态存储设备读取一个物理页数据所需的时间取值,也可用户工作需要自定义;Read request weight W R : According to the time required for the solid-state storage device to read a physical page data, it can also be customized by the user;

写请求权值WW:根据固态存储设备写入一个物理页数据所需的时间取值也可根据用户工作需要自定义。读写权值比值越高,则读请求优先级越高,反之则写请求优先级越高;Write request weight W W : The value of the time required to write a physical page data according to the solid-state storage device can also be customized according to the user's work needs. The higher the read-write weight ratio, the higher the priority of the read request, and vice versa, the higher the priority of the write request;

垃圾回收权值WGC:根据通道内进行垃圾回收操作所需的时间取值,也可根据用户工作需要自定义;Garbage collection weight W GC : The value is taken according to the time required for garbage collection operations in the channel, and can also be customized according to the user's work needs;

通道权值:由通道队列内的读写请求状态,根据读写请求权值计算统计出此时通道i对应的权值Wi,Wi可以表示此时的通道状态并感知未来一段时间内的通道繁忙程度。Channel weight: From the read and write request status in the channel queue, according to the calculation and statistics of the read and write request weight, the weight Wi corresponding to channel i at this time can be calculated. Wi can indicate the channel status at this time and perceive that the channel will be busy for a period of time in the future degree.

本发明所提供的一种固态存储设备的地址分配方法,采用混合分配方式,由权值计算比较动态得到目标通道,通过检测通道连接的各芯片R/B信号忙闲选择芯片。此方式适用于基于闪存的固态存储设备,如图1所示,本发明方法包括请求接收、请求队列处理、读请求分配、写请求分配、通道队列处理和垃圾回收操作的步骤,包括:The address allocation method of a solid-state storage device provided by the present invention adopts a mixed allocation method, calculates and dynamically obtains a target channel through weight calculation, and selects a chip by detecting the R/B signals of each chip connected to the channel. This method is suitable for solid-state storage devices based on flash memory. As shown in Figure 1, the method of the present invention includes the steps of request receiving, request queue processing, read request distribution, write request distribution, channel queue processing and garbage collection operations, including:

(1)请求接收步骤:固态盘存储设备接收到由上层文件系统发送的读写请求,其中包含请求的逻辑地址,请求大小,读写操作等信息,设备对读写请求采用不同的处理策略,对接收的请求类型进行判断并进行相应的操作,若为写请求,则直接将请求加入到请求队列队尾,等待处理,若为读请求,则根据请求的逻辑地址查找映射表获得其对应的物理地址,根据物理地址可以计算得到请求对应的通道信息,预先处理读请求对应的权值,根据已知的通道信息,给对应的通道加上读操作的权值,并将此请求加入到请求队列队尾,等待处理;(1) Request receiving step: The SSD storage device receives the read and write request sent by the upper file system, which includes the requested logical address, request size, read and write operations and other information. The device adopts different processing strategies for the read and write requests, Judge the received request type and perform corresponding operations. If it is a write request, it will directly add the request to the end of the request queue and wait for processing. If it is a read request, it will search the mapping table according to the logical address of the request to obtain its corresponding Physical address, according to the physical address, the channel information corresponding to the request can be calculated, the weight corresponding to the read request can be processed in advance, and the weight of the read operation can be added to the corresponding channel according to the known channel information, and this request can be added to the request The end of the queue, waiting for processing;

(2)请求队列处理步骤:请求队列是固态盘与上层的接口,还未处理的请求都将存放在请求队列中等待处理,请求队列采用先进先出方式设计,队列中的请求依次进行地址分配;(2) Request queue processing steps: The request queue is the interface between the solid-state disk and the upper layer. Unprocessed requests will be stored in the request queue for processing. The request queue is designed in a first-in-first-out manner, and the requests in the queue are assigned addresses sequentially. ;

(3)读请求分配步骤:请求队列采用先进先出队列,固态盘控制器取出请求队列队头的请求,对读写请求采用不同的分配策略;若从请求队列取出的请求,根据请求接收步骤中查找映射表已知的信息,将请求从请求队列队头取出,加入到对应通道的通道队列的尾部,等待处理;(3) Read request distribution steps: the request queue adopts a first-in-first-out queue, and the solid-state disk controller takes out the request at the head of the request queue, and adopts different distribution strategies for read and write requests; if the request is taken out from the request queue, it is received according to the request receiving step Look up the known information in the mapping table, take the request from the head of the request queue, add it to the tail of the channel queue of the corresponding channel, and wait for processing;

(4)写请求分配步骤:若从请求队列取出的请求为写请求,则根据各个通道的权值大小,比较得到权值最小的通道,并根据芯片忙闲等信息选择此写请求对应的芯片、晶元、分组、物理块和物理页,并由此计算出对应的物理地址;将请求从请求队列队头取出,加入到对应通道的通道队列的尾部,更改对应通道的权值,等待处理;(4) Write request allocation step: If the request taken out from the request queue is a write request, then according to the weight of each channel, compare the channel with the smallest weight, and select the chip corresponding to the write request according to the information such as chip busy or idle , wafer, packet, physical block and physical page, and calculate the corresponding physical address; take the request from the head of the request queue, add it to the tail of the channel queue of the corresponding channel, change the weight of the corresponding channel, and wait for processing ;

(5)通道队列处理步骤:闪存控制器从通道队列中取出请求,并根据由请求接收步骤和请求队列处理步骤中获得的请求物理地址、请求大小、请求类型等信息,对闪存芯片进行相应的操作,从闪存中读取相应数据信息或将请求携带的数据写入到其物理地址对应的闪存物理页中;当闪存芯片的读写操作完成后,闪存控制器向固态盘控制器返回完成信息,并根据请求的类型更改对应通道的权值;通道内读操作完成则对应通道的权值减去读操作权值,写操作完成则对应通道的权值减去写操作权值;(5) Channel queue processing step: the flash memory controller takes out the request from the channel queue, and according to the request physical address, request size, request type and other information obtained in the request receiving step and request queue processing step, the flash memory chip is correspondingly processed Operation, read the corresponding data information from the flash memory or write the data carried by the request into the physical page of the flash memory corresponding to its physical address; when the read and write operations of the flash memory chip are completed, the flash memory controller returns the completion information to the SSD controller , and change the weight of the corresponding channel according to the type of request; when the read operation in the channel is completed, the weight of the corresponding channel is subtracted from the weight of the read operation, and when the write operation is completed, the weight of the corresponding channel is subtracted from the weight of the write operation;

(6)垃圾回收处理步骤:触发垃圾回收操作时,为进行垃圾回收操作的通道加上垃圾回收操作权值,垃圾回收操作时间较长,权值设置较大,降低写请求分配至该通道的优先级,待垃圾回收操作完成后,对应通道的权值减去垃圾回收操作的权值。(6) Garbage collection processing steps: when the garbage collection operation is triggered, add the weight of the garbage collection operation to the channel for the garbage collection operation. The garbage collection operation takes a long time and the weight is set to be large, which reduces the allocation of write requests to the channel. Priority, after the garbage collection operation is completed, the weight of the corresponding channel minus the weight of the garbage collection operation.

下面对各步骤的详细操作进行具体描述,The detailed operation of each step is described in detail below,

(1)请求接收步骤,具体如图2所示,包括如下子步骤:(1) The request receiving step, specifically as shown in Figure 2, includes the following sub-steps:

(1.1)固态存储设备接收上层文件系统或固态存储设备缓存产生的读写请求,所述读写请求至少包含逻辑页地址、请求大小、读写操作信息,进行子步骤(1.2);(1.1) The solid-state storage device receives the read-write request generated by the upper-level file system or the cache of the solid-state storage device, and the read-write request includes at least a logical page address, a request size, and read-write operation information, and performs substep (1.2);

(1.2)判断请求大小是否大于一个物理页的大小,若大于,转子步骤(1.3);否则转子步骤(1.4);(1.2) Determine whether the request size is greater than the size of a physical page, if greater, the rotor step (1.3); otherwise the rotor step (1.4);

(1.3)计算此请求需要占用的物理页数n,将其划分为n个请求,每个请求对应一个物理页,转子步骤(1.4);(1.3) Calculate the number n of physical pages that this request needs to occupy, divide it into n requests, each request corresponds to a physical page, rotor step (1.4);

(1.4)判断请求的操作类型,若为写请求,转子步骤(1.7);若为读请求,转子步骤(1.5);(1.4) Judging the operation type of the request, if it is a write request, the rotor step (1.7); if it is a read request, the rotor step (1.5);

(1.5)根据读请求的逻辑地址查映射表得到对应的物理地址,由物理地址可知此请求所对应的通道i(i对应固态存储设备中某一通道号)、芯片,转子步骤(1.6);(1.5) According to the logical address of the read request, the mapping table is checked to obtain the corresponding physical address, and the corresponding channel i (a certain channel number in the i corresponding solid-state storage device), chip, rotor step (1.6) can be known from the physical address;

(1.6)计算通道i对应通道权值Wi=Wi+WR,转子步骤(1.7);(1.6) Calculate channel i corresponding to channel weight W i =W i +W R , rotor step (1.7);

(1.7)将请求按序加入请求队列的尾部,转步骤(2);(1.7) Add the request to the tail of the request queue in order, and turn to step (2);

(2)请求队列处理步骤,具体如图3所示,包括下述子步骤:(2) Request queue processing steps, specifically as shown in Figure 3, including the following sub-steps:

(2.1)查询请求队列状态,判断请求队列是否为空,是则转子步骤(2.3),否则转子步骤(2.2);(2.1) Query the status of the request queue, and judge whether the request queue is empty, if so, the rotor step (2.3), otherwise the rotor step (2.2);

(2.2)读取请求队列队头请求,根据请求操作信息分类,若为读请求,转步骤(3);若为写请求,转步骤(4);(2.2) Read the request at the head of the request queue, classify it according to the request operation information, if it is a read request, go to step (3); if it is a write request, go to step (4);

(2.3)结束;(2.3) end;

(3)读请求分配步骤,具体如图4所示,包括下述子步骤:(3) The read request allocation step, specifically as shown in Figure 4, includes the following sub-steps:

(3.1)从请求队列队头取出读请求,由子步骤(1.5)中查得请求对应的通道号i,将此读请求加入通道i队列尾部,转步骤(5);(3.1) Take out the read request from the head of the request queue, find the channel number i corresponding to the request in substep (1.5), add this read request to the tail of the channel i queue, and turn to step (5);

(4)写请求分配步骤,具体如图5所示,包括下述子步骤:(4) Write request allocation step, specifically as shown in Figure 5, including the following sub-steps:

(4.1)从请求队列队头取出写请求,进行子步骤(4.2);(4.1) Take out the write request from the head of the request queue, and carry out the substep (4.2);

(4.2)由闪存先擦后写特性可知,写请求需要空闲物理页进行存储,比较各个通道权值Wi,找到权值最小的通道j(j对应此时固态存储设备中权值最小的通道),转子步骤(4.3);(4.2) According to the characteristics of first erase and then write of flash memory, the write request needs to be stored in free physical pages, compare the weights W i of each channel, and find the channel j with the smallest weight (j corresponds to the channel with the smallest weight in the solid-state storage device at this time ), the rotor step (4.3);

(4.3)判断闪存转换层是否支持芯片选择,若支持,转子步骤(4.4);若不支持,将此写请求加入通道j队列尾部,转子步骤(4.5);(4.3) Judging whether the flash memory conversion layer supports chip selection, if it supports, the rotor step (4.4); if not, add this write request to the tail of the channel j queue, and the rotor step (4.5);

(4.4)轮询查找此通道下芯片片选信号R/B,找到空闲芯片k,若所有芯片都不空闲,则选择第一个查询的芯片k,确定请求将要写入的芯片k,将此写请求加入通道j队列尾部,转子步骤(4.5)(4.4) Polling to find the chip selection signal R/B of the chip under this channel, find the idle chip k, if all the chips are not idle, then select the first inquired chip k, determine the chip k to be written into the request, and write this The write request is added to the tail of the channel j queue, the rotor step (4.5)

(4.5)通道j通道权值Wj=Wi+WW,转步骤(5);(4.5) channel j channel weight W j =W i +W W , turn to step (5);

(5)通道队列处理步骤,具体如图6所示,其子步骤如下:(5) channel queue processing steps, specifically as shown in Figure 6, its sub-steps are as follows:

(5.1)依次查询通道队列,若通道i队列为空,转步骤(6)并继续查询下一通道,若不为空,转子步骤(5.2);(5.1) Query the channel queue in turn, if the channel i queue is empty, go to step (6) and continue to query the next channel, if not empty, the rotor step (5.2);

(5.2)读取通道队列头部请求,获取信息,转子步骤(5.3);(5.2) read channel queue head request, obtain information, rotor step (5.3);

(5.3)处理通道队列队头的请求,若为读请求,转子步骤(5.4);若为写请求,转子步骤(5.5);(5.3) process the request of the head of the channel queue, if it is a read request, the rotor step (5.4); if it is a write request, the rotor step (5.5);

(5.4)根据读请求的物理地址,取出物理地址对应的物理页中的数据,并发送给上层应用,当读操作完成后,更新芯片片选信号R/B,将此请求从通道队列中删除,此时Wi=Wi-WR,转子步骤(5.1);(5.4) According to the physical address of the read request, take out the data in the physical page corresponding to the physical address and send it to the upper application. When the read operation is completed, update the chip selection signal R/B and delete this request from the channel queue , at this time W i =W i -W R , rotor step (5.1);

(5.5)根据已知的写请求通道、芯片信息,将数据写入对应的空闲物理页中,当写操作完成后,更新芯片片选信号R/B,将此请求从通道队列中删除,此时Wi=Wi-WW,转子步骤(5.1);(5.5) According to the known write request channel and chip information, write the data into the corresponding free physical page. After the write operation is completed, update the chip select signal R/B, and delete this request from the channel queue. When W i =W i -W W , rotor step (5.1);

(6)垃圾回收处理步骤,具体如图7所示,其子步骤如下:(6) Garbage collection processing steps, specifically as shown in Figure 7, its sub-steps are as follows:

(6.1)根据通道i空闲物理页比例,判断是否需要进行垃圾回收操作,若不需要进行垃圾回收操作,转子步骤(2.1),若需要进行垃圾回收操作,转子步骤(6.2);(6.1) According to the proportion of free physical pages of channel i, determine whether garbage collection operation is required, if garbage collection operation is not required, rotor step (2.1), if garbage collection operation is required, rotor step (6.2);

(6.2)执行通道内垃圾回收操作,通道i通道权值Wi=Wi+WGC,转子步骤(6.3);(6.2) Execute the garbage collection operation in the channel, channel i channel weight W i =W i +W GC , rotor step (6.3);

(6.3)垃圾回收操作完成,通道i通道权值Wi=Wi-WGC,转步骤(5);(6.3) The garbage collection operation is completed, the channel i channel weight W i =W i -W GC , go to step (5);

以下结合具体实施例说明本发明的方案,本实施例中的固态存储设备物理容量为512GB,设备内有4个通道,每个通道连接4个32GB闪存芯片。以MT29F256G08CJAAB芯片为例,芯片内物理页大小为8KB,每个物理块内部包含256个物理页,每2048个物理块组成一个分组,两个分组封装为一个晶元,四个晶元组成一个芯片。The solution of the present invention will be described below in conjunction with specific embodiments. The physical capacity of the solid-state storage device in this embodiment is 512GB, and there are 4 channels in the device, and each channel is connected to 4 32GB flash memory chips. Take the MT29F256G08CJAAB chip as an example, the physical page size in the chip is 8KB, and each physical block contains 256 physical pages, and every 2048 physical blocks form a group, two groups are packaged as a wafer, and four wafers form a chip .

连续的写请求:Sequential write requests:

当请求队列中的请求为连续的写请求时,根据写请求分配步骤(4.2)闪存控制器查询比较各通道的权值,此时通道权值按从小到大排列有一个固定的顺序,例如通道1<通道2<通道3<通道0。根据本发明方案,将请求队列中的写请求依次分配到通道1,通道2,通道3,通道0的队列中,增加对应通道的权值并通过片选信号找到空闲的芯片。因每个通道都有写请求加入,各通道的权值比较顺序不会改变,写请求按顺序均匀的分布在通道1、2、3、0中,读请求访问这些连续数据时,能依通道顺序读出,充分利用固态存储设备内部通道间的并行性。When the requests in the request queue are continuous write requests, according to the write request allocation step (4.2), the flash memory controller queries and compares the weights of each channel. At this time, the channel weights are arranged in a fixed order from small to large, such as channel 1<channel 2<channel 3<channel 0. According to the solution of the present invention, the write requests in the request queue are sequentially assigned to the queues of channel 1, channel 2, channel 3 and channel 0, the weight of the corresponding channel is increased and an idle chip is found through the chip selection signal. Because each channel has a write request, the comparison order of the weights of each channel will not change, and the write requests are evenly distributed in the channels 1, 2, 3, and 0 in order. When the read request accesses these continuous data, it can follow the channel Sequential readout makes full use of the parallelism between internal channels of solid-state storage devices.

随机的写请求:Random write requests:

当请求队列中的请求为随机的写请求时,本发明方案处理方式与连续的写请求一样,使随机写性能与连续写性能相当。When the request in the request queue is a random write request, the processing method of the solution of the present invention is the same as that of the continuous write request, so that the random write performance is equivalent to the continuous write performance.

连续的读请求:Sequential read requests:

当请求队列中的请求为连续的读请求时,根据请求接收步骤(1.5),闪存控制器根据读请求逻辑地址(lpn)查映射表得到对应的物理地址。由于读请求的所请求的物理地址已确定,将读请求分配到对应的通道中,等待执行。连续的读请求对应的数据多数为原先已连续写入的数据。根据本发明方案,其数据已均匀的分布在各个通道和芯片中,连续读请求也能充分利用设备的并行性。When the request in the request queue is a continuous read request, according to the request receiving step (1.5), the flash memory controller searches the mapping table according to the read request logical address (lpn) to obtain the corresponding physical address. Since the requested physical address of the read request has been determined, the read request is assigned to a corresponding channel and waits for execution. Most of the data corresponding to the continuous read requests is the data that has been written continuously before. According to the solution of the present invention, the data has been evenly distributed in each channel and chip, and the continuous read request can also make full use of the parallelism of the device.

随机的读请求:Random read requests:

与连续的读请求处理方式类似。若读请求所请求的数据是在一个连续时间段内发送给固态存储设备的,那么根据本方案处理随机写请求的原则,这些数据也能均匀的分布在各个通道与芯片中。若不是,则可能出现随机的读请求所请求的数据分布在一个通道甚至一个芯片内的情况,此时,后续的请求需要等待前面的请求完成,无法利用闪存设备的并行性,设备的整体性能下降。Similar to how sequential read requests are handled. If the data requested by the read request is sent to the solid-state storage device within a continuous period of time, then according to the principle of processing random write requests in this solution, the data can also be evenly distributed in each channel and chip. If not, the data requested by random read requests may be distributed in one channel or even one chip. At this time, the subsequent requests need to wait for the previous requests to complete, which cannot take advantage of the parallelism of the flash memory device and the overall performance of the device. decline.

读写混合的请求:Mixed read and write requests:

写请求较多的情况:When there are many write requests:

当请求队列内出现读写混合请求时,按照本发明专利的步骤。假设此时所有通道都为空闲状态,即通道权值都为0。此时,写请求1、2、3、4、5依次进入请求队列,写请求1、2、3、4被依次分配到通道0、1、2、3中,等待数据写入到对应的闪存芯片中,此时通道权值W0、W1、W2、W3都加上对应的写请求权值WW。此时读请求1、2进入请求队列,根据读请求的逻辑地址,直接查找映射表得到对应的物理地址,由物理地址计算得出请求数据对应通道0和通道1,此时对通道0,通道1权值W1、W2加上对应的读请求权值WR为WW+WR。此时通道队列最前端的请求为写请求5,根据请求判断步骤(2),请求类型为写请求,转步骤(4)。步骤(4.2)轮询比较各通道的权值W,找到此时通道权值最小的通道2,并将此请求分配到通道2的请求队列中。此时通道2的权值W2=WW+WW。继续处理读请求1、2,写请求5被分配到通道2中,读请求1、2可直接分配到通道0、1中等待执行,而不用等待写请求5执行完毕,导致读请求响应时间的增加。When a read-write mixed request appears in the request queue, follow the steps of the patent of the present invention. Assume that all channels are idle at this time, that is, the channel weights are all 0. At this time, write requests 1, 2, 3, 4, and 5 enter the request queue in turn, and write requests 1, 2, 3, and 4 are assigned to channels 0, 1, 2, and 3 in turn, waiting for data to be written to the corresponding flash memory In the chip, the corresponding write request weight W W is added to the channel weights W0, W1, W2, and W3 at this time. At this time, read requests 1 and 2 enter the request queue. According to the logical address of the read request, directly search the mapping table to obtain the corresponding physical address, and calculate the request data from the physical address corresponding to channel 0 and channel 1. At this time, for channel 0, channel 1 Weight W1, W2 plus the corresponding read request weight W R is W W +W R . At this time, the request at the forefront of the channel queue is a write request 5. According to the request judgment step (2), the request type is a write request, and then go to step (4). Step (4.2) Polling and comparing the weight W of each channel, finding the channel 2 with the smallest channel weight at this time, and assigning this request to the request queue of channel 2. At this time, the weight of channel 2 is W2=W W +W W . Continue to process read requests 1 and 2, write request 5 is assigned to channel 2, and read requests 1 and 2 can be directly assigned to channels 0 and 1 to wait for execution without waiting for write request 5 to be executed, resulting in a slowdown in the response time of read requests Increase.

读请求较多的情况:When there are many read requests:

当请求队列内出现读写混合请求时,按照本发明专利的步骤。假设此时通道队列内请求分布如下:读请求1、2、3、4,写请求1,读请求6、7、8,写请求2、读请求9、10、11、12、13、14、15、16。此时,根据多次步骤(1.6)的计算,当写请求1处在请求队列队头,进入步骤(4)时,通道权值W0至W3分别为5*WR、3*WR、1*WR以及8*WR,此时通道2对应权值W2最小为1*WR,根据步骤(4.2),将写请求1分配给通道2,并加入通道队列2,由步骤(4.5)W2=1*WR+WW。此时继续处理后续的读请求6、7、8直到写请求2到达请求队列队头,这时读请求1、2、3、4已完成,通道0到3的权值分别为4*WR、3*WR、Ww以及7*WR,此时根据步骤(4.2),得到此时权值最小的通道1,权值为3*WR。将写请求2分配给通道1,此时通道1权值W1=3*WR+Ww。When a read-write mixed request appears in the request queue, follow the steps of the patent of the present invention. Assume that the distribution of requests in the channel queue is as follows: read requests 1, 2, 3, 4, write requests 1, read requests 6, 7, 8, write requests 2, read requests 9, 10, 11, 12, 13, 14, 15, 16. At this time, according to the calculation of multiple steps (1.6), when the write request 1 is at the head of the request queue and enters step (4), the channel weights W0 to W3 are 5*W R , 3*W R , 1 respectively *W R and 8*W R , at this time the minimum weight W2 corresponding to channel 2 is 1*W R , according to step (4.2), assign write request 1 to channel 2, and join channel queue 2, by step (4.5) W2=1*W R +W W . At this time, continue to process subsequent read requests 6, 7, and 8 until write request 2 reaches the head of the request queue. At this time, read requests 1, 2, 3, and 4 have been completed, and the weights of channels 0 to 3 are 4*W R , 3*W R , Ww and 7*W R , at this time, according to step (4.2), the channel 1 with the smallest weight at this time is obtained, and the weight is 3*W R . Write request 2 is assigned to channel 1, at this time, the weight of channel 1 is W1=3*W R +Ww.

垃圾回收操作:Garbage collection operations:

当检测到通道i内空闲物理页不足,进行垃圾回收操作时,此时通道i权值加上垃圾回收操作的权值WGC。若此时有写请求访问固态存储设备,根据子步骤(4.2),控制器会根据权值进行判断,选择通道权值最小的通道,若有其他通道的权值小于通道i的权值,此写请求将不会分配给通道i,写请求不必等待垃圾回收操作完成,有效降低写请求的响应时间。When it is detected that there are not enough free physical pages in the channel i and the garbage collection operation is performed, the weight value W GC of the garbage collection operation is added to the weight value of the channel i at this time. If there is a write request to access the solid-state storage device at this time, according to the sub-step (4.2), the controller will make a judgment according to the weight, and select the channel with the smallest channel weight. If the weight of other channels is less than the weight of channel i, this The write request will not be assigned to channel i, and the write request does not have to wait for the completion of the garbage collection operation, effectively reducing the response time of the write request.

极端情况:extreme case:

混合请求队列中,读请求连续的读取同一个通道的数据,使此通道的权值保持一个较高的值,此时闪存控制器在分配写请求时,将不会将写请求分配到此通道中,在此通道中避开了读写请求间的阻塞,降低了读写请求的延迟,但减少可供分配给写请求的通道数,减弱了固态存储设备内部通道间的并行性,使固态存储设备的资源得不到充分的利用。同时这也会影响整个固态存储设备的磨损均衡。In the mixed request queue, read requests continuously read the data of the same channel, so that the weight of this channel remains at a high value. At this time, when the flash memory controller allocates write requests, it will not allocate write requests to this channel. In this channel, the blocking between read and write requests is avoided, and the delay of read and write requests is reduced, but the number of channels available for allocation to write requests is reduced, and the parallelism between internal channels of solid-state storage devices is weakened, so that The resources of the solid-state storage device are underutilized. At the same time, this will also affect the wear leveling of the entire solid-state storage device.

与静态分配方式相比,本发明方案可以灵活的选择写请求被分配的通道,并通过权值的设置以及读请求对权值的优先处理保证读请求响应一定的优先程度,并减少各个通道读写请求相互间的干扰,降低读写请求之间的阻塞,减少固态存储设备的读写响应时间。Compared with the static allocation method, the scheme of the present invention can flexibly select the channel to which the write request is allocated, and through the setting of the weight value and the priority processing of the read request to the weight value, a certain priority degree of the read request response is guaranteed, and the read rate of each channel is reduced. Write requests interfere with each other, reduce the blocking between read and write requests, and reduce the read and write response time of solid-state storage devices.

本发明方案中,请求队列与通道队列都为先进先出(FIFO)队列,各通道并行的处理请求,不关心各请求间的顺序,请求队列与通道队列内的请求顺序执行。In the scheme of the present invention, both the request queue and the channel queue are first-in-first-out (FIFO) queues, and each channel processes requests in parallel, regardless of the order among the requests, and the requests in the request queue and the channel queue are executed sequentially.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, All should be included within the protection scope of the present invention.

Claims (7)

1. the address distribution method of a solid storage device, it is characterised in that described method comprises the steps:
(1) request receiving step: solid storage device receives the read-write requests sent by topmost paper system, the request type received is judged and operates accordingly, if write request, then directly request is joined request queue tail of the queue, wait pending;If read request, then search mapping table according to the logical address of request and obtain the physical address of its correspondence, can be calculated, according to physical address, the channel information that request is corresponding, anticipate the weights that read request is corresponding, i.e. read request weights WR, according to known channel information, give corresponding passage plus read request weights WR, and this request is joined request queue tail of the queue, wait pending;Described read request weights WRIt is according to required time value according to solid storage device one number of physical pages of reading, or is needed by user job self-defined;
(2) request queue processes step: solid storage device uses the mode of first in first out to process to leaving untreated request in request queue in, carries out address distribution successively;
(3) read request allocation step: if the request from request queue taking-up is read request, searches channel information known to mapping table according in request receiving step, request is joined the afterbody of the channel queue of respective channel, waits pending;
(4) write request allocation step: if the request from request queue taking-up is write request, then according to the passage weights size of each passage, relatively obtain the passage that weights are minimum, and select corresponding chip, wafer, packet, physical block and the Physical Page of this write request according to chip busy information, and thus calculate the physical address of correspondence;Request is joined the afterbody of the channel queue of respective channel, the passage weights of change respective channel, its Wj=Wi+WW, wait pending;Wherein, described passage weights refer to, by the read-write requests state in channel queue, count now corresponding for passage i weights Wi, Wi according to read-write requests weight computing and can represent channel status now the passage busy extent in perception a period of time in future;WWFor write request weights, refer to that writing a number of physical pages according to solid storage device according to required time value or needs self-defined according to user job;
(5) channel queue processes step: flash controller takes out request from channel queue, and according to being processed request physical address, request size, the request type information obtained in step by request receiving step and request queue, flash chip is operated accordingly, from flash memory, reads corresponding data information maybe the data that request is carried are written in the flash memory Physical Page that its physical address is corresponding;After the read-write operation of flash chip completes, flash controller has returned information, and the passage weights of the Type Change respective channel according to request to solid state disk controller;In passage, read operation completes, and the passage weights of respective channel deduct read request weights, and write operation completes, and the passage weights of respective channel deduct write request weights;
(6) garbage reclamation processes step: according to passage i free physical page ratio, it may be judged whether need to carry out garbage collection operation, when triggering garbage collection operation, for carrying out the passage of garbage collection operation plus garbage reclamation weights WGC, after garbage collection operation completes, the passage weights of respective channel deduct garbage reclamation weights WGC;Described garbage reclamation weights WGCRefer to according to the time value carried out in passage needed for garbage collection operation, or need self-defined according to user job.
2. the method for claim 1, it is characterised in that described request receiving step specifically includes:
(1.1) solid storage device receives topmost paper system or the read-write requests of solid storage device caching generation, and described read-write requests, including at least logical page address, request size, read-write operation information, carries out sub-step (1.2);
(1.2) size asking size whether to be more than a Physical Page, if being more than, rotor step (1.3) are judged;Otherwise rotor step (1.4);
(1.3) calculate number of physical pages n that this request needs to take, be divided into n request, the corresponding Physical Page of each request, rotor step (1.4);
(1.4) action type of request is judged, if write request, rotor step (1.7);If read request, rotor step (1.5);
(1.5) look into mapping table according to the logical address of read request and obtain the physical address of correspondence, physical address understand the passage i corresponding to this request, chip, a certain channel number in i correspondence solid storage device, rotor step (1.6);
(1.6) passage i respective channel weights W is calculatedi=Wi+WR, WRFor read request weights, rotor step (1.7);
(1.7) request is sequentially added the afterbody of request queue.
3. method as claimed in claim 1 or 2, it is characterised in that described request queue processes step and specifically includes:
(2.1) inquiry request quene state, it is judged that whether request queue is empty, is then rotor step (2.3), otherwise rotor step (2.2);
(2.2) read request queue team head request, classifies according to action message, if read request, goes to step (3);If write request, go to step (4).
4. method as claimed in claim 1 or 2, it is characterized in that, described read request allocation step specifically includes: take out read request from request queue team head, the channel number i corresponding by checking in request in sub-step (1.5), this read request is added passage i queue tail, goes to step (5).
5. method as claimed in claim 1 or 2, it is characterised in that described write request allocation step specifically includes:
(4.1) take out write request from request queue team head, carry out sub-step (4.2);
(4.2) write attribute after first being wiped from flash memory, write request needs free physical page to store, and compares each passage weights Wi, the passage of weights minimum, rotor step (4.3) in the corresponding now solid storage device of passage j, j finding weights minimum;
(4.3) judge whether flash translation layer (FTL) supports that chip selects, if supporting, rotor step (4.4);If not supporting, this write request is added passage j queue tail, rotor step (4.5);
(4.4) chip chip selection signal R/B under poll searches this passage, finds free chip die k, if all chips are the most idle, then select the chip k of first inquiry, determine the chip k that request will write, this write request is added passage j queue tail, rotor step (4.5);
(4.5) passage j passage weights Wj=Wi+WW, WWFor write request weights, go to step (5).
6. method as claimed in claim 1 or 2, it is characterised in that described channel queue processes step and specifically includes:
(5.1) inquire about channel queue successively, if passage i queue is empty, goes to step (6) and continue to inquire about next passage, if not empty, rotor step (5.2);
(5.2) read channel queue's head request, obtain information, rotor step (5.3);
(5.3) request for the treatment of channel queue team head, if read request, rotor step (5.4);If write request, rotor step (5.5);
(5.4) according to the physical address of read request, take out the data in the Physical Page that physical address is corresponding, and be sent to upper layer application, after read operation completes, update chip chip selection signal R/B, this request is deleted from channel queue, now Wi=Wi-WR, rotor step (5.1);
(5.5) according to known write request passage, chip information, write data in the free physical page of correspondence, after write operation completes, update chip chip selection signal R/B, this request is deleted from channel queue, now Wi=Wi-WW, rotor step (5.1).
7. method as claimed in claim 1 or 2, it is characterised in that described garbage reclamation processes step and specifically includes:
(6.1) according to passage i free physical page ratio, it may be judged whether need to carry out garbage collection operation, if being made without garbage collection operation, rotor step (2.1), if desired carry out garbage collection operation, rotor step (6.2);
(6.2) garbage collection operation in passage, passage i passage weights W are performedi=Wi+WGC, WGCFor garbage reclamation weights, rotor step (6.3);
(6.3) garbage collection operation completes, passage i passage weights Wi=Wi-WGC, go to step (5).
CN201410290432.0A 2014-06-25 2014-06-25 Address distribution method of solid-state storage device Active CN104090847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410290432.0A CN104090847B (en) 2014-06-25 2014-06-25 Address distribution method of solid-state storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410290432.0A CN104090847B (en) 2014-06-25 2014-06-25 Address distribution method of solid-state storage device

Publications (2)

Publication Number Publication Date
CN104090847A CN104090847A (en) 2014-10-08
CN104090847B true CN104090847B (en) 2017-01-11

Family

ID=51638565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410290432.0A Active CN104090847B (en) 2014-06-25 2014-06-25 Address distribution method of solid-state storage device

Country Status (1)

Country Link
CN (1) CN104090847B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718206B (en) * 2014-12-03 2018-08-03 中国人民解放军国防科学技术大学 The flash translation layer (FTL) and its implementation of RAID can be perceived
US9866647B2 (en) * 2015-03-26 2018-01-09 Alcatel Lucent Hierarchical cost based caching for online media
CN105159836B (en) * 2015-08-03 2019-01-08 北京联想核芯科技有限公司 A kind of information processing method and electronic equipment
CN105975209A (en) * 2016-04-26 2016-09-28 浪潮(北京)电子信息产业有限公司 Multichannel data write-in method and system
CN107515728B (en) * 2016-06-17 2019-12-24 清华大学 Data management method and device for developing internal concurrency characteristics of flash memory device
CN106325994B (en) * 2016-08-24 2018-05-29 广东欧珀移动通信有限公司 A kind of method and terminal device for controlling write request
CN107885456B (en) * 2016-09-29 2022-09-16 北京忆恒创源科技股份有限公司 Reducing conflicts for IO command access to NVM
CN107885667B (en) * 2016-09-29 2022-02-11 北京忆恒创源科技股份有限公司 Method and apparatus for reducing read command processing delay
CN106547703B (en) * 2016-10-08 2019-05-14 华中科技大学 A kind of FTL optimization method based on block group structure
EP3367251B1 (en) * 2016-12-29 2023-06-21 Huawei Technologies Co., Ltd. Storage system and solid state hard disk
TWI653533B (en) * 2017-03-07 2019-03-11 慧榮科技股份有限公司 Data storage device and method of operation thereof
CN107220124B (en) * 2017-05-26 2021-01-12 苏州浪潮智能科技有限公司 Path selection method and device
WO2019071620A1 (en) 2017-10-09 2019-04-18 华为技术有限公司 Garbage data cleaning method and equipment
CN109726137B (en) * 2017-10-27 2021-01-29 华为技术有限公司 Management method of garbage collection task of solid state disk, controller and solid state disk
CN108829346B (en) * 2018-05-28 2020-11-17 华中科技大学 User writing request processing method of solid state disk adapting to flash memory page difference
CN109697032B (en) * 2018-12-19 2022-01-07 中国人民解放军国防科技大学 Physical address aware solid-state disk request scheduling method and device
CN109783398B (en) * 2019-01-18 2020-09-15 上海海事大学 Performance optimization method for FTL (fiber to the Home) solid state disk based on relevant perception page level
CN110515859B (en) * 2019-07-09 2021-07-20 杭州电子科技大学 A method for parallel processing of read and write requests for solid state disks
CN111857601B (en) * 2020-07-30 2023-09-01 暨南大学 Solid-state disk cache management method based on garbage collection and channel parallelism
CN114047712B (en) * 2021-10-12 2023-04-18 中国电子科技集团公司第二十九研究所 Data communication method of semi-physical simulation system based on reflective memory network
CN117055820B (en) * 2023-10-09 2024-02-09 苏州元脑智能科技有限公司 Command processing method of solid state disk, solid state disk and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567257A (en) * 2011-12-26 2012-07-11 华中科技大学 Method for controlling data reading and writing of multi-channel solid-state disc
CN103135945A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Multi-channel dynamic read-write dispatching method used in solid state drive (SSD)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012248110A (en) * 2011-05-30 2012-12-13 Toshiba Corp Memory unit having multiple channels and writing control method including error correction channel determination therein
JP2012248109A (en) * 2011-05-30 2012-12-13 Toshiba Corp Memory unit having multiple channels and read command group generating method for compaction in the memory unit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567257A (en) * 2011-12-26 2012-07-11 华中科技大学 Method for controlling data reading and writing of multi-channel solid-state disc
CN103135945A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Multi-channel dynamic read-write dispatching method used in solid state drive (SSD)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高性能固态盘的多级并行性及算法研究;胡洋;《中国博士学位论文全文数据库 信息科技辑》;20120915;第2012卷(第9期);第2章 *

Also Published As

Publication number Publication date
CN104090847A (en) 2014-10-08

Similar Documents

Publication Publication Date Title
CN104090847B (en) Address distribution method of solid-state storage device
CN107885456B (en) Reducing conflicts for IO command access to NVM
CN113138713B (en) memory system
CN107665146B (en) Memory management device and method
US10049040B2 (en) Just in time garbage collection
US20180150242A1 (en) Controller and storage device for efficient buffer allocation, and operating method of the storage device
US20180165014A1 (en) Array controller, solid state disk, and method for controlling solid state disk to write data
JP7279889B2 (en) MEMORY BLOCK RECLAIM METHOD AND MEMORY BLOCK RECLAIM DEVICE
US20110252215A1 (en) Computer memory with dynamic cell density
IE20150399A1 (en) Resource allocation and deallocation for power management in devices
CN103336744A (en) Garbage recovery method for solid-state storage device and system for garbage recovery method
KR20120127698A (en) Selective data storage in lsb and msb pages
CN105701029B (en) A kind of isomery storage optimization method and device
US20160070647A1 (en) Memory system
US11966635B2 (en) Logical unit number queues and logical unit number queue scheduling for memory devices
US10042773B2 (en) Advance cache allocator
US20130061009A1 (en) High Performance Free Buffer Allocation and Deallocation
KR101549569B1 (en) Method for performing garbage collection and flash memory apparatus using the method
CN107885667B (en) Method and apparatus for reducing read command processing delay
Sun et al. HIPA: A hybrid load balancing method in SSDs for improved parallelism performance
CN102411543B (en) Method and device for processing caching address
TWI696115B (en) Memory storage device and operation method thereof
US11644991B2 (en) Storage device and control method
CN115145493A (en) A resource allocation method based on ZNS SSD system
CN108572924B (en) A request processing method for 3D MLC flash memory device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant