An apparatus and method for implementing hierarchical management of Nand commands
By managing NAND commands in a hierarchical manner, and employing command caching units, hierarchical management units, and processing units, the CPU consumption problem caused by the lack of distinction in the NAND Flash command management hierarchy is solved, thereby improving the read and write performance and efficiency of the SSD.
Patent Information
- Application Number
- CN202411965997.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In existing technologies, NandFlash command management does not differentiate between levels, resulting in excessive CPU computing power consumption and affecting read and write operation time latency.
It employs command caching units, hierarchical management units, and command processing units to classify and process commands according to NAND hierarchy, dividing them into high-priority and low-priority queues, and processing read and write operations in parallel to avoid invalid stacking of the same type of commands.
It improves NAND IO efficiency, enhances SSD read and write performance, and reduces system consumption for software management.
Smart Images

Figure CN119883122B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of storage, in particular to a device and method for implementing hierarchical management of Nand commands. BACKGROUND
[0002] NandFlash has four levels in physical structure: Device, CE, LUN and Plane, wherein Device represents NandFlash packaged into a chip; CE, also known as Target, is an independent Flash memory module with an independent chip selection signal; LUN, also known as Die, is the smallest unit in NandFlash that can execute commands and return the execution status of the commands; there is one or more LUNs in a CE; Plane is a unit composed of multiple Blocks, and there is one or more Planes in a LUN.
[0003] NandFlash has different operations in the four levels, for example, in ODT (On-die Termination) operation, CE is taken as the operation unit; in parallel read and write operation, LUN is taken as the operation unit; in Multi Plane or Single Plane operation, Plane is taken as the operation unit. Therefore, when NandFlash is managed, different NandFlash commands need to be operated in different levels. The existing command management does not make a distinction, and all commands are put into a command buffer for serial or parallel execution; some commands may be preprocessed by software, but this consumes CPU power. SUMMARY
[0004] In view of the defects of the prior art, the present application provides a device and method for implementing hierarchical management of Nand commands, which classifies and processes different NAND commands according to NAND levels, can more efficiently process commands in parallel, and reduces the system consumption caused by software management of NAND commands, which is beneficial to improving the time delay of read and write operations.
[0005] To solve the aforementioned technical problem, the present invention adopts the following technical solution: a device for implementing hierarchical management of NAND commands, comprising a command cache unit, a hierarchical management unit, and a command processing unit. The command cache unit is used to cache NAND operation commands sent from the host to the SSD after being parsed by FTL. The hierarchical management unit is connected to the command cache unit and is used to hierarchically manage the NAND operation commands in the command cache unit according to CE, LUN, and Plane. Each Plane is set up with a cache queue containing multiple command slots, and each Plane queue contains a status queue corresponding to each command slot. The hierarchical management unit stores the commands in the command cache unit according to the Plane number and releases the command slot in the command cache unit. The command processing unit is connected to the hierarchical management unit and is used to process the commands of each Plane in the hierarchical management unit.
[0006] Furthermore, NAND erase, write, and read operation commands are divided into two types: Multi Plane and Single Plane. For multi plane operations, the hierarchical management unit stores the command in the plane0 queue and sets the status of the corresponding LUN and all Planes to Busy. For single plane operations, the hierarchical management unit stores the command in the corresponding Plane queue and sets the status of the corresponding LUN and Plane to Busy.
[0007] Furthermore, for multi-plane operations, the command processing unit determines whether there are any ongoing read operations on multiple planes belonging to the same LUN. A multi-plane command is only executed if all planes on the LUN are in a ready state. If a multi-plane command is being executed, other single-plane commands on the LUN cannot be executed. For single-plane read operations, if no multi-plane read operation is being performed on the LUN and no single-plane read operation is being performed on the same plane, then the single-plane read command is executed. That is, two single-plane read commands cannot be executed simultaneously on the same plane.
[0008] Furthermore, the command cache unit is configured with a high-priority command cache queue and a low-priority command cache queue, with the execution ratio of high-priority and low-priority commands as a setting.
[0009] Furthermore, the high-priority command cache queue is used to store read commands, while the low-priority command cache queue is used to store erase and write commands.
[0010] Further, the command cache unit is consistent with the number of NAND channels in the SSD host.
[0011] The application further discloses a method for implementing Nand command hierarchical management, comprising the following steps:
[0012] S01, system initialization, the hierarchical management unit configures the number of CEs, LUNs and Planes for hardware initialization; if the number of CEs, LUNs and Planes is confirmed, the software operation is to the level;
[0013] S02, receiving the operation command issued by the Host end, applying whether there is a usable command slot in the command cache unit according to the high and low priority of the command, and putting the command into the command cache unit when there is a usable command slot;
[0014] S03, the hierarchical management unit takes out the command from the command cache unit, parses the PBA address of the command, and stores the Single Plane operation command into the corresponding Plane slot, and sets the state of the Plane and the LUN as BUSY;
[0015] S04, the hierarchical management unit continuously acquires the command from the command cache unit, if the command taken is the same as the Plane address in S03, if it is a Single Plane command, it is checked whether the state of the Plane is BUSY, if not, the command is executed, otherwise it is not executed;
[0016] S05, if the command taken in step S04 is a Multi Plane command, it is checked whether the state of the LUN is BUSY, if not, the write command is executed, otherwise it needs to wait until the state of the LUN becomes Ready before execution;
[0017] S06, if the command taken in step S03 is a Multi Plane operation command, the command is stored in the Plane0 slot in the LUN, and the state of the LUN and all Planes under the LUN is set as BUSY;
[0018] S07, the hierarchical management unit continuously acquires the command from the command cache unit, if the command taken is the same as the Plane address in step S06, if it is a Single Plane command, it is checked whether the state of the Plane is BUSY, if not, the command is executed, otherwise it is not executed; if the command taken is a Multi Plane command, it is checked whether the state of the LUN is BUSY, if not, the write command is executed, otherwise it needs to wait until the state of the LUN becomes Ready before execution;
[0019] S08, after the Single Plane execution is completed, the slot corresponding to the Plane is released, and the state of the Plane is set to Ready state, and whether other Planes in the LUN belong to the Plane are in the Busy state is detected, if yes, the LUN is set to the Busy state;
[0020] S09, after the Multi Plane execution is completed, the slot corresponding to the Plane0 is released, and the LUN and all the Planes under the LUN are set to the Ready state.
[0021] The application has the advantages that the application is a SSD hardware unit module for realizing NandFlash command management in a host, according to the characteristics of NANDFlash command execution, Plane and LUN commands are classified and managed, invalid stacking of the same type of command is avoided, NAND IO use efficiency is improved, and SSD read and write performance is improved. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 a principle block diagram of the device described in Embodiment 1;
[0023] Figure 2 a flow chart of the method described in Embodiment 2. DETAILED DESCRIPTION
[0024] The application will be further described below in combination with the drawings and specific embodiments.
[0025] Embodiment 1
[0026] The embodiment discloses a device for realizing Nand command hierarchical management, as shown in the figure, which comprises a command cache unit, a hierarchical management unit and a command processing unit. Figure 1 The main function of the command cache unit is to cache the NAND operation command after FTL analysis of the command issued by the Host to the SSD. The number of the command cache unit is consistent with the number of NAND channels in the SSD host. Here, the channel refers to a parallel channel connecting the NandFlash and the SSD host, which is mainly used to improve the bandwidth and performance of data transmission. The command issued by the Host to the SSD contains LBA (Logical Block Address), and the NAND operation command containing PBA (Physical Block Address) information of the specific NandFlash block address is obtained after analysis, such as erasing, writing and reading.
[0027] The number of command slots in the command cache unit can be configured, such as 64 or 128; in order to optimize the performance of the SSD system, a high-priority command cache queue and a low-priority command cache queue are configured, and the execution ratio of high and low priority commands can be set, such as 2:1, 3:1, etc. From the actual demand, the high-priority queue mainly stores read commands, and the low-priority queue stores erase and write commands.
[0028] The hierarchical management unit is connected with the command cache unit, and functions to manage the commands in the high and low priority cache queues according to CE, LUN and Plane respectively. A separate cache queue is set for each Plane, and each Plane cache queue contains 8 command slots. The CE and LUN of the Plane can be calculated according to the number of Planes. In order to improve the read performance, the read commands are mainly managed by plane.
[0029] The hierarchical management unit stores the commands in the command cache unit according to the Plane number, and releases the command slot in the cache unit. If the Plane queue is full of commands, the command slot in the cache unit is not released. If all the command slots in the cache unit are full of commands, a slot full interrupt is reported to notify the software system to perform corresponding processing. Each Plane queue contains a state queue corresponding to each command slot.
[0030] The NAND read and write operation commands are divided into Multi Plane and Single Plane types. For multiplane operation, the hierarchical management unit stores the type of command in the plane0 queue, and sets the state of the corresponding LUN and all Planes to Busy. For single plane operation, the hierarchical management unit stores it in the corresponding Plane queue, and needs to set the state of the corresponding LUN and Plane to Busy.
[0031] The command processing unit mainly functions to process the commands of each Plane in the hierarchical management unit, and there are different processing methods for multiplane and single plane read operations.
[0032] For multi plane operation, it is necessary to determine whether there is a running read operation on multiple Planes belonging to the same LUN at this time. Only when all the Planes on the LUN are in the ready state, a multi plane command can be executed. If a multi plane command is being executed, other single plane commands on the LUN cannot be executed.
[0033] For single plane read operation, if there is no multi plane read operation in the LUN and no single plane read operation in the same plane, the single plane read command can be executed. That is, two single plane read commands cannot be executed in the same plane at the same time.
[0034] Each command runs to receive the operation state returned by the NAND, and the state is updated to the state queue corresponding to each plane queue. The software system needs to poll the state of each state queue and process the completed command in time. Only when the state queue has a free slot, the hierarchical management unit can take the command from the cache unit.
[0035] Embodiment 2
[0036] The embodiment discloses a method for implementing hierarchical management of Nand commands, as shown in Figure 2 The method comprises the following steps:
[0037] First, the system is initialized, and the hierarchical management unit configures the number of CEs, LUNs and planes for hardware initialization. After confirming the number of CEs, LUNs and planes, the software operates to the hierarchy.
[0038] Second, the software receives the operation command issued by the Host end, and applies for whether there is a usable command slot in the command cache unit according to the high and low priority of the command (for example, reading is high priority, and writing and erasing are low priority). Only when there is a usable command slot, the command is put into the command cache unit, otherwise the software needs to be temporarily cached.
[0039] Third, the hierarchical management unit takes the command from the command cache unit, parses the PBA address of the command, and stores it in the corresponding plane slot if it is a single plane operation command, and sets the state of the plane and the LUN as BUSY.
[0040] Fourth, the command unit continuously obtains the command from the hierarchical cache unit, and if the same command as the plane address in step three is obtained, if it is a single plane command, it is checked whether the state of the plane is BUSY, if not, the command is executed, otherwise it is not executed.
[0041] Fifth, based on step four, if the obtained command is a multi plane command, it is checked whether the state of the LUN is BUSY, if not, the write command is executed, otherwise it needs to wait for the LUN state to become Ready before execution.
[0042] Sixth, based on step three, if the taking-out command is a Multi Plane operation command, the command is stored in the Plane0 slot in the LUN, and the LUN and all Plane states under the LUN are set to the BUSY state.
[0043] Seventh, the hierarchical management unit continues to obtain the command from the command cache unit, and performs the same operation as steps four and five.
[0044] Eighth, after the Single Plane execution is completed, the slot of the corresponding Plane is released, the Plane state is set to the Ready state, and whether the other Plane in the LUN is in the Busy state is detected, if yes, the LUN is set to the Busy state.
[0045] Ninth, after the Multi Plane execution is completed, the slot of the corresponding Plane0 is released, and the LUN and all Plane states under the LUN are set to the Ready state.
[0046] According to the characteristics of the NANDFlash command execution, the application is classified and managed by Plane and LUN commands, invalid stacking of the same type of command is avoided, the NAND IO use efficiency is improved, and the SSD read-write performance is improved.
[0047] The above description is only the basic principle and preferred embodiment of the application, and the improvements and replacements made by the person skilled in the art according to the application belong to the protection scope of the application.
Claims
1. A device for implementing hierarchical management of Nand commands, characterized in that: The command cache unit, the hierarchical management unit and the command processing unit are included. The command cache unit is used for caching the NAND operation command after FTL analysis of the Host end issued to the SSD end. The hierarchical management unit is connected with the command cache unit and is used for hierarchical management of the NAND operation command in the command cache unit according to CE, LUN and Plane. Each Plane sets a cache queue containing multiple command slots. Meanwhile, each Plane queue contains a state queue corresponding to each command slot. The hierarchical management unit stores the command in the command cache unit according to the Plane number and releases the command slot in the command cache unit. The command processing unit is connected with the hierarchical management unit and is used for processing the command of each Plane in the hierarchical management unit. The NAND read operation command is divided into Multi Plane and Single Plane two types. For multi plane operation, the hierarchical management unit stores the command in the plane0 queue and sets the state of the corresponding LUN and all Planes to Busy state. For single plane operation, the hierarchical management unit stores the command in the corresponding Plane queue and sets the state of the corresponding LUN and Plane to Busy state. For Multiplane operation, the command processing unit judges whether there is a running read operation on multiple Planes belonging to the same LUN. Only when all Planes on the LUN are in ready state, a Multi plane command is executed. If a multi plane command is being executed, other single plane commands on the LUN cannot be executed. For single plane read operation, if there is no multi plane read operation in the LUN and no single plane read operation in the same Plane, the single plane read command is executed. That is, two single plane read commands cannot be executed in the same Plane at the same time.
2. The apparatus for implementing hierarchical management of Nand commands according to claim 1, wherein: The command cache unit is configured with a high priority command cache queue and a low priority command cache queue. The high and low priority command execution ratio is set as a setting item.
3. The apparatus for implementing hierarchical management of Nand commands according to claim 2, wherein: The high priority command cache queue is used for storing read commands, and the low priority command cache queue is used for storing erase and write commands.
4. The apparatus for implementing hierarchical management of Nand commands of claim 1, wherein: The command cache unit is consistent with the number of NAND channels in the SSD host.
5. A method for implementing hierarchical management of Nand commands, the method comprising: The following steps are included: S01, system initialization, the hierarchical management unit configures the number of CEs, LUNs and Planes for hardware initialization; if the number of CEs, LUNs and Planes is confirmed, the software operation is to the hierarchy; S02, receiving the operation command issued by the Host end, applying whether there is a available command slot in the command cache unit according to the high and low priority of the command, and putting the command into the command cache unit when there is an available command slot; S03, the hierarchical management unit fetches a command from the command cache unit, parses the PBA address of the command, and if it is a Single Plane operation command, stores it in the corresponding Plane slot and sets the state of the Plane and LUN to BUSY; S04, the hierarchical management unit continuously fetches a command from the command cache unit, and if it is the same command as in S03, if it is a Single Plane command, checks whether the state of the Plane is BUSY, and if not, executes the command, otherwise does not execute it; S05, if the command fetched in step S04 is a Multi Plane command, checks whether the state of the LUN is BUSY, and if not, executes the command, otherwise needs to wait until the state of the LUN becomes Ready before executing it; S06, if the command fetched in step S03 is a Multi Plane operation command, stores it in the Plane0 slot in the LUN, and sets the state of the LUN and all the Planes under the LUN to BUSY; S07, the hierarchical management unit continuously fetches a command from the command cache unit, and if it is the same command as in step S06, if it is a Single Plane command, checks whether the state of the Plane is BUSY, and if not, executes the command, otherwise does not execute it; if the fetched command is a Multi Plane command, checks whether the state of the LUN is BUSY, and if not, executes the command, otherwise needs to wait until the state of the LUN becomes Ready before executing it; S08, after the execution of the Single Plane is completed, the corresponding Plane slot is released, the state of the Plane is set to Ready, and it is checked whether the other Planes in the LUN are in the Busy state, and if so, the LUN is set to the Busy state; S09, after the execution of the Multi Plane is completed, the corresponding Plane0 slot is released, and the state of the LUN and all the Planes under the LUN are set to Ready.
Citation Information
Patent Citations
Method for improving random reading performance of small-capacity ssd
CN115826864A
Software LUN management-based AIPR command implementation data structure and method
CN117420952A