[go: up one dir, main page]

CN118642849A - A data processing method, device and equipment based on dual-port solid state hard disk - Google Patents

A data processing method, device and equipment based on dual-port solid state hard disk Download PDF

Info

Publication number
CN118642849A
CN118642849A CN202410805650.7A CN202410805650A CN118642849A CN 118642849 A CN118642849 A CN 118642849A CN 202410805650 A CN202410805650 A CN 202410805650A CN 118642849 A CN118642849 A CN 118642849A
Authority
CN
China
Prior art keywords
command
queue
data management
management processor
cache 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.)
Pending
Application number
CN202410805650.7A
Other languages
Chinese (zh)
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.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202410805650.7A priority Critical patent/CN118642849A/en
Publication of CN118642849A publication Critical patent/CN118642849A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

According to the data processing method based on the dual-port solid state disk, the multi-core central processing unit receives the command, if the command is a name space command, the command is forwarded to the data management processor, the data management processor determines the behavior type corresponding to the command, the command is stored in different cache queues according to the behavior type corresponding to the command, the data management processor calculates the load index of each cache queue according to a preset load balancing algorithm, determines the queue priority of each cache queue according to the load index, and the data management processor selects a target cache queue from the cache queues according to the queue priority to process the target command in the target cache queue.

Description

一种基于双端口固态硬盘的数据处理方法、装置及设备A data processing method, device and equipment based on dual-port solid state hard disk

技术领域Technical Field

本发明涉及计算机技术领域,特别涉及一种基于双端口固态硬盘的数据处理方法、装置及设备。The present invention relates to the field of computer technology, and in particular to a data processing method, device and equipment based on a dual-port solid state hard disk.

背景技术Background Art

双端口NVMe SSD(Non-Volatile Memory Express Solid State Drive,非易失性内存快速固态硬盘)是一种高性能、高可靠性的固态硬盘技术,具有双通道数据传输的特点。随着数据中心、云计算和高性能计算等领域对存储性能和数据保护需求的不断提高,双端口NVMe SSD作为一种创新的存储解决方案,正逐渐受到关注和应用。Dual-port NVMe SSD (Non-Volatile Memory Express Solid State Drive) is a high-performance, high-reliability solid-state drive technology with dual-channel data transmission. With the increasing demand for storage performance and data protection in data centers, cloud computing, and high-performance computing, dual-port NVMe SSD, as an innovative storage solution, is gradually gaining attention and application.

当前服务器的使用场景大多为多用户使用,当NVMe SSD在服务器环境下运行时,需要将一个物理设备划分成多个逻辑上的namespace(命名空间),每个namespace可以视作独立的存储空间,这种划分可以实现不同数据的隔离存储,避免数据之间的干扰,提高系统的灵活性和可管理性。不同的控制器可以管理不同的namespace,实现更细粒度的数据管理和更高效的数据处理。Currently, servers are mostly used by multiple users. When NVMe SSD runs in a server environment, a physical device needs to be divided into multiple logical namespaces. Each namespace can be regarded as an independent storage space. This division can achieve isolated storage of different data, avoid interference between data, and improve the flexibility and manageability of the system. Different controllers can manage different namespaces, achieving more fine-grained data management and more efficient data processing.

但是NVMe SSD设备通常情况下为多核系统,在多核的处理过程中,固件系统中的核间并发情况会频繁出现,很大程度上会影响NVMe SSD设备的工作效率。However, NVMe SSD devices are usually multi-core systems. During the multi-core processing, inter-core concurrency in the firmware system will frequently occur, which will greatly affect the working efficiency of the NVMe SSD device.

发明内容Summary of the invention

本发明实施例的目的在于提供一种基于双端口固态硬盘的数据处理方法、装置及设备,实现在双端口固态硬盘中设置数据管理器来专门处理针对命名空间的命令,并通过负载指数保证各个命令缓存队列的有序处理,解放固态硬盘多核中央处理器的部分算力,具体技术方案如下:The purpose of the embodiments of the present invention is to provide a data processing method, device and apparatus based on a dual-port solid-state drive, so as to realize setting a data manager in the dual-port solid-state drive to specifically process commands for the namespace, and to ensure the orderly processing of each command cache queue through the load index, thereby releasing part of the computing power of the multi-core central processing unit of the solid-state drive. The specific technical solution is as follows:

在本发明实施的第一方面,首先提供了一种基于双端口固态硬盘的数据处理方法,其特征在于,所述双端口固态硬盘设置有多核中央处理器和数据管理处理器,所述方法包括:In a first aspect of the present invention, a data processing method based on a dual-port solid-state hard disk is provided, wherein the dual-port solid-state hard disk is provided with a multi-core central processing unit and a data management processor, and the method comprises:

通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器;receiving a command through the multi-core central processing unit, and if the command is a namespace command, forwarding the command to the data management processor;

通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列;Determining, by the data management processor, a behavior type corresponding to the command, and storing the command in different cache queues according to the behavior type corresponding to the command;

通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级;Calculating the load index of each cache queue according to a preset load balancing algorithm by the data management processor, and determining the queue priority of each cache queue according to the load index;

通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。The data management processor selects a target cache queue from the cache queue according to the queue priority, and processes the target command in the target cache queue.

可选的,所述通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级,包括:Optionally, calculating the load index of each cache queue according to a preset load balancing algorithm by the data management processor, and determining the queue priority of each cache queue according to the load index, includes:

获取每个所述缓存队列对应的队列负载信息,所述队列负载信息至少包括:队列权重、命令响应时间和当前负载量;Obtaining queue load information corresponding to each cache queue, wherein the queue load information includes at least: queue weight, command response time, and current load;

依据每个所述缓存队列的当前负载量,计算所述缓存队列的队列总负载量,并根据所述队列总负载量确定所述缓存队列的平均负载量;Calculating the total queue load of the cache queue according to the current load of each cache queue, and determining the average load of the cache queue according to the total queue load;

根据预设的负载均衡算法计算每个所述缓存队列的负载指数;Calculating the load index of each cache queue according to a preset load balancing algorithm;

依据所述负载指数确定每个所述缓存队列的队列优先级;Determining a queue priority of each of the cache queues according to the load index;

其中,所述预设的负载均衡算法对应的公式为:The formula corresponding to the preset load balancing algorithm is:

i为所述缓存队列的总数量,e为常数,LI_i为第i个所述缓存队列的负载指数,CI_i为第i个所述缓存队列的当前负载量,w_i为第i个所述缓存队列对应的队列权重,w_avg为所述缓存队列的平均负载量,RT_i为第i个所述缓存队列对应的命令响应时间,α和β为调整参数,所述α和β用于平衡负载量和响应时间。i is the total number of the cache queues, e is a constant, LI_i is the load index of the i-th cache queue, CI_i is the current load of the i-th cache queue, w_i is the queue weight corresponding to the i-th cache queue, w_avg is the average load of the cache queue, RT_i is the command response time corresponding to the i-th cache queue, α and β are adjustment parameters, and α and β are used to balance the load and response time.

可选的,所述命名空间命令包括:创建命令、删除命令、写入命令、读取命令,所述通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器,包括:Optionally, the namespace command includes: a create command, a delete command, a write command, and a read command, and the receiving of the command by the multi-core central processor and forwarding the command to the data management processor if the command is a namespace command includes:

通过所述多核中央处理器接收命令,且所述命令为所述命名空间命令中的其中一种,则对所述命令进行校验,得到校验结果;Receiving a command through the multi-core central processing unit, and if the command is one of the namespace commands, verifying the command to obtain a verification result;

若所述校验结果为校验未通过,则拦截所述命令;If the verification result is that the verification fails, intercepting the command;

若所述校验结果为校验通过,则将所述命令转发至所述数据管理处理器。If the verification result is that the verification passes, the command is forwarded to the data management processor.

可选的,所述通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器,包括:Optionally, receiving a command through the multi-core central processing unit and forwarding the command to the data management processor if the command is a namespace command includes:

通过多核中央处理器中运行的命令处理模块接收所述命令,并将所述命令发送至所述多核中央处理器中运行的固态硬盘控制模块;The command is received by a command processing module running in a multi-core central processing unit, and the command is sent to a solid state drive control module running in the multi-core central processing unit;

通过所述固态硬盘控制模块申请缓冲区,并将所述命令转存至所述缓冲区;Applying for a buffer through the solid state drive control module, and transferring the command to the buffer;

若所述命令为命名空间命令,通过所述固态硬盘控制模块将所述命令转发至所述数据管理处理器。If the command is a namespace command, the command is forwarded to the data management processor through the solid state drive control module.

可选的,对所述目标缓存队列中的目标命令进行处理,包括:Optionally, processing the target command in the target cache queue includes:

若所述目标命令为创建命令,获取所述目标命令中携带的创建信息;If the target command is a creation command, obtaining creation information carried in the target command;

依据所述创建信息,对所述双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与所述创建信息对应的目标存储空间;其中,所述命名空间信息至少包括:存储容量和起始逻辑地址;According to the creation information, the storage space in the namespace resource pool in the dual-port solid-state hard disk is allocated to obtain a target storage space corresponding to the creation information; wherein the namespace information at least includes: storage capacity and a starting logical address;

将与所述目标存储空间对应的创建结果信息发送至所述多核中央处理器中运行的固态硬盘控制模块,其中,所述创建结果信息包括目标空间唯一标识、创建成功标识。Sending creation result information corresponding to the target storage space to the solid-state hard disk control module running in the multi-core central processing unit, wherein the creation result information includes a unique identifier of the target space and a creation success identifier.

可选的,所述将与所述目标存储空间对应的目标存储空间信息发送至所述多核中央处理器中运行的固态硬盘控制模块之后,包括:Optionally, after sending the target storage space information corresponding to the target storage space to the solid state drive control module running in the multi-core central processor, the method further includes:

通过多核中央处理器中运行的所述固态硬盘控制模块,从所述缓冲区获取与所述创建结果信息匹配的命令数据,输出针对所述命令数据的所述目标空间唯一标识、创建成功标识。The solid state drive control module running in the multi-core central processing unit obtains command data matching the creation result information from the buffer, and outputs the target space unique identifier and the creation success identifier for the command data.

可选的,所述方法还包括:Optionally, the method further includes:

通过所述多核中央处理器接收下电命令,并将所述下电命令发送至所述数据管理处理器;Receiving a power-off command through the multi-core central processing unit, and sending the power-off command to the data management processor;

通过所述数据管理处理器在接收到所述下电命令后,停止接收新命令,并将所述数据管理处理器中管理的数据存储至所述双端口固态硬盘的闪存中。After receiving the power-off command, the data management processor stops receiving new commands and stores the data managed by the data management processor in the flash memory of the dual-port solid state drive.

在本发明实施的第二方面,还提供了一种基于双端口固态硬盘的数据处理装置,其特征在于,所述双端口固态硬盘设置有多核中央处理器和数据管理处理器,包括:In a second aspect of the present invention, a data processing device based on a dual-port solid-state hard disk is provided, wherein the dual-port solid-state hard disk is provided with a multi-core central processor and a data management processor, including:

命令获取模块,用于通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器;A command acquisition module, configured to receive a command through the multi-core central processing unit, and if the command is a namespace command, forward the command to the data management processor;

命令分配模块,用于通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列;A command allocation module, used to determine the behavior type corresponding to the command through the data management processor, and store the command in different cache queues according to the behavior type corresponding to the command;

负载均衡模块,用于通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级;A load balancing module, configured to calculate a load index of each cache queue according to a preset load balancing algorithm through the data management processor, and determine a queue priority of each cache queue according to the load index;

命令处理模块,通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。The command processing module selects a target cache queue from the cache queue according to the queue priority through the data management processor, and processes the target command in the target cache queue.

在本发明实施的第三方面,还提供了一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上述任一项所述的基于双端口固态硬盘的数据处理方法。In the third aspect of the implementation of the present invention, there is also provided an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data processing method based on the dual-port solid-state hard drive as described in any one of the above items is implemented.

在本发明实施的第四方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如上述任一项所述的基于双端口固态硬盘的数据处理方法。In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method based on a dual-port solid-state hard drive as described in any one of the above items is implemented.

本发明实施例提供的基于双端口固态硬盘的数据处理方法,通过多核中央处理器接收命令,若命令为命名空间命令,则将命令转发至数据管理处理器,通过数据管理处理器确定命令对应的行为类型,依据命令对应的行为类型将命令存储至不同的缓存队列,通过数据管理处理器根据预设的负载均衡算法计算每个缓存队列的负载指数,并依据负载指数确定每个缓存队列的队列优先级,通过数据管理处理器按照队列优先级从缓存队列中选取目标缓存队列,对目标缓存队列中的目标命令进行处理,本发明实施例通过在双端口固态硬盘中设置数据管理器来专门处理针对命名空间的命令,并通过负载指数保证各个命令缓存队列的有序处理,解放了固态硬盘多核中央处理器的部分算力。The data processing method based on the dual-port solid-state hard disk provided by the embodiment of the present invention receives commands through a multi-core central processing unit. If the command is a namespace command, the command is forwarded to a data management processor, and the behavior type corresponding to the command is determined by the data management processor. The command is stored in different cache queues according to the behavior type corresponding to the command. The load index of each cache queue is calculated by the data management processor according to a preset load balancing algorithm, and the queue priority of each cache queue is determined according to the load index. The target cache queue is selected from the cache queue according to the queue priority by the data management processor, and the target command in the target cache queue is processed. The embodiment of the present invention sets a data manager in the dual-port solid-state hard disk to specifically process commands for the namespace, and ensures the orderly processing of each command cache queue through the load index, thereby freeing up part of the computing power of the multi-core central processing unit of the solid-state hard disk.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

图1为本发明一些实施例提供的一种基于双端口固态硬盘的数据处理方法的步骤流程图;FIG1 is a flowchart of a data processing method based on a dual-port solid state drive provided by some embodiments of the present invention;

图2为本发明一些实施例提供的另一种基于双端口固态硬盘的数据处理方法的步骤流程图;FIG2 is a flowchart of another data processing method based on a dual-port solid state drive provided by some embodiments of the present invention;

图3是本发明一些实施例提供的双端口逻辑框架图;FIG3 is a dual-port logic framework diagram provided by some embodiments of the present invention;

图4是本发明一些实施例提供的命令交互概要图;FIG4 is a command interaction summary diagram provided by some embodiments of the present invention;

图5是本发明一些实施例提供的并发情况下数据管理处理器的处理命令概图;5 is an overview diagram of processing commands of a data management processor under concurrent conditions provided by some embodiments of the present invention;

图6是本发明一些实施例提供的创建命名空间的命令处理流程图;6 is a flowchart of a command process for creating a namespace provided by some embodiments of the present invention;

图7是本发明一些实施例提供的一种基于双端口固态硬盘的数据处理装置的结构示意图。FIG. 7 is a schematic diagram of the structure of a data processing device based on a dual-port solid state drive provided by some embodiments of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本发明的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

参照图1,示出了本发明一些实施例提供的基于双端口固态硬盘的数据处理方法的步骤流程图,双端口固态硬盘设置有多核中央处理器和数据管理处理器,所述方法可以包括:1 , a flowchart of a data processing method based on a dual-port solid-state hard disk provided by some embodiments of the present invention is shown. The dual-port solid-state hard disk is provided with a multi-core central processor and a data management processor. The method may include:

步骤101,通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器。Step 101: Receive a command through the multi-core central processing unit, and if the command is a namespace command, forward the command to the data management processor.

双端口固态硬盘是一种具有两个独立数据传输端口的固态硬盘,主要用于需要高可靠性和冗余性的企业级存储解决方案中。双端口固态硬盘可以连接到两个不同的控制器或主机。在固态硬盘中,命名空间(namespace)是一个逻辑存储单元,它是双端口固态硬盘管理数据存储和数据访问的一种方式,命名空间功能通常是企业级固态硬盘或特定型号的NVMe SSD才具备的特性,通过创建多个命名空间,双端口固态硬盘可以为不同的主机或控制器提供不同大小的存储空间,这有助于优化存储资源的分配;不同的命名空间可以提供性能隔离,确保一个命名空间中的活动不会影响其他命名空间的性能;命名空间还可以实现数据隔离,提高数据安全性,防止未授权访问。A dual-port SSD is a SSD with two independent data transmission ports, mainly used in enterprise-level storage solutions that require high reliability and redundancy. A dual-port SSD can be connected to two different controllers or hosts. In an SSD, a namespace is a logical storage unit, which is a way for a dual-port SSD to manage data storage and data access. The namespace function is usually a feature of enterprise-level SSDs or specific models of NVMe SSDs. By creating multiple namespaces, a dual-port SSD can provide storage spaces of different sizes for different hosts or controllers, which helps optimize the allocation of storage resources; different namespaces can provide performance isolation to ensure that activities in one namespace do not affect the performance of other namespaces; namespaces can also achieve data isolation, improve data security, and prevent unauthorized access.

在固态硬盘中,多核中央处理器是固态硬盘的大脑,负责管理数据的读取、写入、擦除以及与主机系统的通信。多核中央处理器是指控制器内部集成了多个处理核心,这些核心可以并行处理任务,从而提高固态硬盘的性能和效率。In a solid-state drive, a multi-core CPU is the brain of the solid-state drive, responsible for managing the reading, writing, erasing of data and communication with the host system. A multi-core CPU means that multiple processing cores are integrated inside the controller, which can process tasks in parallel, thereby improving the performance and efficiency of the solid-state drive.

在双端口固态硬盘中使用命名空间虽然可以提供性能隔离和数据隔离,但会增加存储管理的复杂性,需要相应的管理工具和知识来有效地管理这些逻辑存储单元,并且可能影响双端口固态硬盘的整体性能,特别是在创建多个小的命名空间时。此外,由于双端口固态硬盘配备的大多是多核中央处理器,因此,在多个主机和多核的处理过程中,固件系统中的核间并发情况会频繁出现,很大程度影响设备的工作效率。Although using namespaces in dual-port SSDs can provide performance isolation and data isolation, it increases the complexity of storage management and requires corresponding management tools and knowledge to effectively manage these logical storage units. It may also affect the overall performance of the dual-port SSD, especially when creating multiple small namespaces. In addition, since dual-port SSDs are mostly equipped with multi-core CPUs, inter-core concurrency in the firmware system will frequently occur during the processing of multiple hosts and multiple cores, greatly affecting the working efficiency of the device.

在本发明一些实施例中,双端口固态硬盘中设置有多核中央处理器和数据管理处理器,通过多核中央处理器接收命令,若命令为命名空间命令,则将该命令转发至所述数据管理处理器,交由数据管理处理器来单独处理命名空间命令,本发明实施例中数据管理处理器是一个硬件模块单元,独立于多核中央处理器,通过数据管理处理器来对命名空间数据进行管理,此时多核中央处理器就可以继续用在其他模块和进程的处理中。In some embodiments of the present invention, a multi-core central processing unit and a data management processor are provided in a dual-port solid-state hard disk. A command is received by the multi-core central processing unit. If the command is a namespace command, the command is forwarded to the data management processor, and the namespace command is processed separately by the data management processor. In the embodiment of the present invention, the data management processor is a hardware module unit, which is independent of the multi-core central processing unit. The namespace data is managed by the data management processor, and the multi-core central processing unit can continue to be used in the processing of other modules and processes.

在本发明一些实施例中,命名空间命令包括:创建命令、删除命令、写入命令、读取命令,步骤101还可以包括如下子步骤:In some embodiments of the present invention, the namespace command includes: a create command, a delete command, a write command, and a read command. Step 101 may also include the following sub-steps:

子步骤11:通过所述多核中央处理器接收命令,则对所述命令进行校验,得到校验结果。Sub-step 11: receiving a command through the multi-core central processing unit, verifying the command and obtaining a verification result.

对于接收到的命令,系统首先进行校验,校验包括检查命令的格式、参数的有效性、权限验证等,校验的目的是确保命令的正确性和安全性。本发明实施例中,通过多核中央处理器对命令进行校验并得到校验结果。For the received command, the system first performs verification, which includes checking the format of the command, the validity of the parameters, and the authority verification, etc. The purpose of the verification is to ensure the correctness and security of the command. In the embodiment of the present invention, the command is verified by a multi-core central processing unit and the verification result is obtained.

子步骤12:若所述校验结果为校验未通过,则拦截所述命令。Sub-step 12: If the verification result is that the verification fails, intercept the command.

如果校验结果显示命令未通过校验,系统将拦截该命令,防止其被执行。校验未通过的原因可能包括命令格式错误、缺少必要参数或用户没有足够的权限。If the verification result shows that the command fails the verification, the system will intercept the command and prevent it from being executed. The reasons for the failure of the verification may include incorrect command format, missing required parameters, or insufficient user permissions.

子步骤13:若所述校验结果为校验通过,且所述命令为所述命名空间命令中的其中一种,则将所述命令转发至所述数据管理处理器。Sub-step 13: If the verification result is verification passed and the command is one of the namespace commands, forward the command to the data management processor.

如果校验结果显示命令通过校验,系统将继续处理该命令,对于通过校验的命令,若命令为创建命令、删除命令、写入命令、读取命令中的其中一种,系统将其转发给数据管理处理器,数据管理处理器接收到命令后,执行相应的操作。例如,创建命令将导致新的命名空间被创建,删除命令将导致命名空间被移除,写入命令将数据写入指定的命名空间,读取命令将从命名空间读取数据。If the verification result shows that the command has passed the verification, the system will continue to process the command. For commands that have passed the verification, if the command is one of the create command, delete command, write command, and read command, the system will forward it to the data management processor. After receiving the command, the data management processor will perform the corresponding operation. For example, the create command will cause a new namespace to be created, the delete command will cause the namespace to be removed, the write command will write data to the specified namespace, and the read command will read data from the namespace.

在本发明一些实施例中,步骤101还可以包括如下子步骤:In some embodiments of the present invention, step 101 may further include the following sub-steps:

子步骤21:通过多核中央处理器中运行的命令处理模块接收所述命令,并将所述命令发送至所述多核中央处理器中运行的固态硬盘控制模块。Sub-step 21: receiving the command through a command processing module running in the multi-core central processing unit, and sending the command to a solid state drive control module running in the multi-core central processing unit.

双端口固态硬盘中的多核中央处理器相当于固态硬盘的大脑,其中运行的有不同的模块,用于处理不同类型的命令。命令处理模块在多核中央处理器上运行,负责接收来自用户、应用程序或其他系统组件的命令,接收到的命令首先需要被解析,以确定其类型和所需执行的操作,解析后的命令根据其类型和操作被分发到相应的处理模块。The multi-core CPU in the dual-port SSD is equivalent to the brain of the SSD, in which different modules are running to process different types of commands. The command processing module runs on the multi-core CPU and is responsible for receiving commands from users, applications or other system components. The received commands first need to be parsed to determine their type and the operations to be performed. The parsed commands are distributed to the corresponding processing modules according to their type and operation.

在本发明实施例中,多核中央处理器上运行有命令处理模块和固态硬盘控制模块,通过多核中央处理器中运行的命令处理模块接收命令,与固态硬盘相关的命令将被发送至固态硬盘控制模块。具体的,固态硬盘控制模块可以指NVMe模块。NVMe模块指的是实现NVMe协议的软件组件,它允许操作系统与NVMe设备进行通信,NVMe模块的主要功能包括设备识别、命令处理等;在本发明中,NVMe模块处理来自操作系统或应用程序的命令,并将这些命令转换为NVMe协议规定的格式。In an embodiment of the present invention, a command processing module and a solid-state drive control module are running on a multi-core central processing unit, and commands related to the solid-state drive will be sent to the solid-state drive control module through the command processing module running in the multi-core central processing unit. Specifically, the solid-state drive control module may refer to an NVMe module. The NVMe module refers to a software component that implements the NVMe protocol, which allows the operating system to communicate with the NVMe device. The main functions of the NVMe module include device identification, command processing, etc.; in the present invention, the NVMe module processes commands from the operating system or application program, and converts these commands into the format specified by the NVMe protocol.

子步骤22:通过所述固态硬盘控制模块申请缓冲区,并将所述命令转存至所述缓冲区。Sub-step 22: applying for a buffer through the solid state drive control module, and transferring the command to the buffer.

在存储系统中,当操作系统或应用程序需要向固态硬盘设备发送命令时,通常会通过固态硬盘控制模块来申请缓冲区,并将命令及其相关数据转存至该缓冲区。In a storage system, when an operating system or an application needs to send a command to a solid-state drive device, a buffer is usually requested through a solid-state drive control module, and the command and its related data are transferred to the buffer.

在本发明一些实施例中,通过以下步骤来申请缓冲区,命令准备:应用程序或操作系统内核准备好需要发送给NVMe设备的命令,这些命令可能包括读取、写入、擦除等操作;NVMe模块在接收到命令后会申请缓冲区,系统会分配一块内存作为缓冲区,这个缓冲区用于临时存储命令及其相关数据,如读写操作的数据块;NVMe模块将准备好的命令及其数据转存到分配的缓冲区中,命令和数据就可以被NVMe驱动程序访问和处理。在本发明一些实施例中,NVMe模块在接收到命令后会申请上下文和缓冲区,上下文通常包括命令的状态、执行进度、错误信息等,有助于模块跟踪命令的执行情况,并在必要时进行错误处理,命令执行完成后,NVMe模块会更新上下文中的状态信息,并向发起命令的主机反馈执行结果。In some embodiments of the present invention, the buffer is applied for and the command is prepared by the following steps: the application or operating system kernel prepares the commands to be sent to the NVMe device, which may include operations such as reading, writing, and erasing; the NVMe module will apply for a buffer after receiving the command, and the system will allocate a piece of memory as a buffer, which is used to temporarily store commands and related data, such as data blocks for read and write operations; the NVMe module transfers the prepared commands and their data to the allocated buffer, and the commands and data can be accessed and processed by the NVMe driver. In some embodiments of the present invention, the NVMe module will apply for a context and a buffer after receiving the command. The context usually includes the status of the command, the execution progress, the error information, etc., which helps the module to track the execution of the command and perform error handling when necessary. After the command is executed, the NVMe module will update the status information in the context and feedback the execution result to the host that initiated the command.

子步骤23:若所述命令为命名空间命令,通过所述固态硬盘控制模块将所述命令转发至所述数据管理处理器。Sub-step 23: If the command is a namespace command, forward the command to the data management processor through the solid state drive control module.

在存储系统中,命名空间是指一组逻辑块地址的集合,它们映射到物理闪存或其他存储介质上。命名空间命令通常涉及对这些逻辑块的管理,如创建、删除、查询状态等。当NVMe模块接收到命名空间命令时,它需要将这些命令转发给数据管理处理器,以便进行相应的处理。In a storage system, a namespace refers to a set of logical block addresses that are mapped to physical flash memory or other storage media. Namespace commands usually involve the management of these logical blocks, such as creation, deletion, query status, etc. When the NVMe module receives namespace commands, it needs to forward these commands to the data management processor for corresponding processing.

在相关技术中,NVMe模块接收来自命令处理模块的命令之后,NVMe模块还需要将缓冲区中的命令提交到NVMe设备的I/O队列中,之后NVMe设备从I/O队列中取出命令并执行,而固态硬盘设备多为多核系统,在多个主机和多核系统的处理过程中,固件系统中的核间并发情况会频繁出现,很大程度影响设备的工作效率。本发明一些实施例中,NVMe模块将命令转发至数据管理处理器,通过数据管理器来单独处理针对命名空间的命令,因此,多核中央处理器中运行的模块也无需再考虑命名数据的处理、多核之间命名空间数据同步的问题。In the related art, after the NVMe module receives the command from the command processing module, the NVMe module also needs to submit the command in the buffer to the I/O queue of the NVMe device, and then the NVMe device takes out the command from the I/O queue and executes it. However, most solid-state hard disk devices are multi-core systems. In the processing of multiple hosts and multi-core systems, inter-core concurrency in the firmware system will frequently occur, which greatly affects the working efficiency of the device. In some embodiments of the present invention, the NVMe module forwards the command to the data management processor, and the data manager processes the command for the namespace separately. Therefore, the module running in the multi-core central processor no longer needs to consider the processing of named data and the synchronization of namespace data between multiple cores.

步骤102:通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列。Step 102: Determine the behavior type corresponding to the command by the data management processor, and store the command into different cache queues according to the behavior type corresponding to the command.

其中,命令用于执行特定的操作或任务,命令的行为类型指的是命令对应的任务类型。缓存队列是一种在计算机系统中用于提高数据访问速度的技术,结合了缓存和队列的概念,队列遵循先进先出策略来决定哪些数据应该保留在缓存中。Among them, commands are used to perform specific operations or tasks, and the behavior type of commands refers to the task type corresponding to the command. Cache queue is a technology used in computer systems to improve data access speed. It combines the concepts of cache and queue. The queue follows the first-in-first-out strategy to decide which data should be kept in the cache.

在本发明一些实施例中,缓存队列用于管理针对命名空间的相关命令,确保它们按照正确的顺序和时间执行。在获取到多核中央处理器转发来的命令后,对命令对应的类型进行识别判断,通过数据管理处理器确定所述命令对应的行为类型,依据命令对应的行为类型将命令存储至不同的缓存队列。In some embodiments of the present invention, the cache queue is used to manage the relevant commands for the namespace to ensure that they are executed in the correct order and time. After obtaining the command forwarded by the multi-core central processor, the type corresponding to the command is identified and judged, and the behavior type corresponding to the command is determined by the data management processor, and the command is stored in different cache queues according to the behavior type corresponding to the command.

在具体实现中,命令对应的行为类型可以包括针对命名空间的所有命令类型,例如读命令、写命令、创建namespace命令、删除namespace命令等等,在收到多条命令后会将命令存储到缓存队列,根据命令的参数将不同的行为分配到不同的缓存队列中,例如,将创建namespace和删除namespace等管理命令放在优先级较高的缓存队列中,而读、写命令放在次优先级的缓存队列中。In a specific implementation, the behavior type corresponding to the command may include all command types for the namespace, such as read commands, write commands, create namespace commands, delete namespace commands, etc. After receiving multiple commands, the commands will be stored in the cache queue, and different behaviors will be assigned to different cache queues according to the command parameters. For example, management commands such as create namespace and delete namespace are placed in a cache queue with a higher priority, while read and write commands are placed in a cache queue with a lower priority.

步骤103,通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级。Step 103: The data management processor calculates the load index of each cache queue according to a preset load balancing algorithm, and determines the queue priority of each cache queue according to the load index.

其中,负载均衡算法指的是一种用于在多个计算资源之间分配工作负载的均衡算法,以优化资源使用、最大化吞吐量、降低响应时间,并避免任何单一资源的过载。Among them, load balancing algorithm refers to a balancing algorithm used to distribute workload among multiple computing resources to optimize resource usage, maximize throughput, reduce response time, and avoid overloading of any single resource.

数据管理处理器在收到多条命令后会将命令存储到不同的缓存队列,例如创建命名空间和删除命名空间等管理命令放在优先级较高的缓存队列中,而读、写命令放在次优先级的缓存队列中,可以保证对高优先级的命令处理效率。但是如果一直处理优先级较高的缓存独立的命令,则会造成其他优先级缓存队列中的命令无法处理。After receiving multiple commands, the data management processor will store the commands in different cache queues. For example, management commands such as creating and deleting namespaces are placed in a cache queue with a higher priority, while read and write commands are placed in a cache queue with a lower priority, which can ensure the processing efficiency of high-priority commands. However, if the cache-independent commands with higher priority are always processed, the commands in other priority cache queues cannot be processed.

在本发明一些实施例中,通过数据管理处理器根据预设的负载均衡算法计算每个缓存队列的负载指数,并依据负载指数确定每个所述缓存队列的队列优先级。在本发明的具体实现中,负载均衡算法可以考虑每个缓存队列的权重、处理效率和负载情况。因此,通过负载均衡算法确保高优先级的命令先处理,同时较低优先级的命令有序处理,避免某些缓存队列中命令长时间未处理导致超时而其他缓存队列中已空闲。In some embodiments of the present invention, the load index of each cache queue is calculated by a data management processor according to a preset load balancing algorithm, and the queue priority of each cache queue is determined according to the load index. In a specific implementation of the present invention, the load balancing algorithm can take into account the weight, processing efficiency and load of each cache queue. Therefore, the load balancing algorithm ensures that high-priority commands are processed first, while lower-priority commands are processed in order, so as to avoid timeouts caused by commands in some cache queues not being processed for a long time while other cache queues are idle.

在本发明一些实施例中,步骤103包括如下子步骤:In some embodiments of the present invention, step 103 includes the following sub-steps:

子步骤31:获取每个所述缓存队列对应的队列负载信息,所述队列负载信息至少包括:队列权重、命令响应时间和当前负载量。Sub-step 31: Obtain queue load information corresponding to each cache queue, wherein the queue load information at least includes: queue weight, command response time and current load.

其中,队列权重是一个预设的值,用于表示队列的重要性或优先级,在负载均衡算法中,权重可以用来决定分配给每个队列的工作量;命令响应时间是指从命令进入队列到命令执行完成并返回结果所花费的时间,一些高级的队列管理系统可能提供查询接口来查询实时或历史的响应时间数据;当前负载量是指队列中当前等待处理的命令数量,或者队列正在处理的命令数量。Among them, the queue weight is a preset value used to indicate the importance or priority of the queue. In the load balancing algorithm, the weight can be used to determine the workload assigned to each queue; the command response time refers to the time it takes from the command entering the queue to the command execution completion and returning the result. Some advanced queue management systems may provide a query interface to query real-time or historical response time data; the current load refers to the number of commands currently waiting to be processed in the queue, or the number of commands being processed by the queue.

在本发明一些实施例中,获取每个缓存队列对应的队列负载信息,队列负载信息至少包括:队列权重、命令响应时间和当前负载量,在具体实现中,命名空间命令对应的各个队列的权重可以在系统配置中设置,不同类型的命名空间命令对应的队列的权重可以相同,也可以不同,本发明对此不作限制。命令响应时间指的是命名空间命令进入到对应的队列到该命名空间命令执行完成并返回执行结果花费的总时间;例如,创建命名空间这个命令从进入到队列到命名空间创建完成并返回命名空间创建完成结果花费的总时间。在本发明一些实施例中,当前负载量是命名空间命令对应的各个队列中当前等待处理的命令数量,也可以是命名空间命令对应的各个队列中正在处理的命令数量;例如,当前负载量为命名空间命令对应的队列中当前等待处理的命令数量时,若某一缓存队列中当前等待处理的命令数量为10,则确定该队列当前负载量为10;或者,当前负载量为队列中正在处理的命令数量时,若某一缓存队列中正在处理的命名空间命令数量为2,则确定该队列当前负载量为2。In some embodiments of the present invention, the queue load information corresponding to each cache queue is obtained, and the queue load information at least includes: queue weight, command response time and current load. In a specific implementation, the weight of each queue corresponding to the namespace command can be set in the system configuration. The weights of the queues corresponding to different types of namespace commands can be the same or different, and the present invention does not limit this. Command response time refers to the total time taken for the namespace command to enter the corresponding queue to complete the execution of the namespace command and return the execution result; for example, the total time taken for the command to create a namespace from entering the queue to completing the namespace creation and returning the namespace creation completion result. In some embodiments of the present invention, the current load is the number of commands currently waiting to be processed in each queue corresponding to the namespace command, and it can also be the number of commands being processed in each queue corresponding to the namespace command; for example, when the current load is the number of commands currently waiting to be processed in the queue corresponding to the namespace command, if the number of commands currently waiting to be processed in a cache queue is 10, then the current load of the queue is determined to be 10; or, when the current load is the number of commands being processed in the queue, if the number of namespace commands being processed in a cache queue is 2, then the current load of the queue is determined to be 2.

子步骤32:依据每个所述缓存队列的当前负载量,计算所述缓存队列的队列总负载量,并根据所述队列总负载量确定所述缓存队列的平均负载量。Sub-step 32: Calculate the total queue load of the cache queue according to the current load of each cache queue, and determine the average load of the cache queue according to the total queue load.

在确定了每个缓存队列的当前负载量之后,可以依据每个缓存队列的当前负载量,计算缓存队列的队列总负载量,并根据队列总负载量确定缓存队列的平均负载量。After the current load of each cache queue is determined, the total queue load of the cache queue may be calculated according to the current load of each cache queue, and the average load of the cache queue may be determined according to the total queue load.

在具体实现中,可以对每个缓存的当前负载量进行求和得到缓存队列的队列总负载量,进而根据队列总负载量与队列的总数量通过平均值算法来确定缓存队列的平均负载量。In a specific implementation, the current load of each cache may be summed to obtain the total queue load of the cache queue, and then the average load of the cache queue may be determined by an average value algorithm according to the total queue load and the total number of queues.

子步骤33:根据预设的负载均衡算法计算每个所述缓存队列的负载指数。Sub-step 33: Calculate the load index of each cache queue according to a preset load balancing algorithm.

其中,预设的负载均衡算法考虑了每个缓存队列的权重、处理效率和负载情况。在具体实现中,处理效率参考了命令响应时间,负载情况参考了每个缓存队列的当前负载量和所有缓存队列的平均负载量。The preset load balancing algorithm takes into account the weight, processing efficiency and load of each cache queue. In the specific implementation, the processing efficiency refers to the command response time, and the load refers to the current load of each cache queue and the average load of all cache queues.

子步骤34:依据所述负载指数确定每个所述缓存队列的队列优先级。Sub-step 34: Determine the queue priority of each cache queue according to the load index.

通过预设的负载均衡算法可以为每个缓存队列计算一个负载指数,然后根据这个指数来分配处理的优先级。A load index can be calculated for each cache queue through a preset load balancing algorithm, and then the processing priority is assigned based on this index.

其中,所述预设的负载均衡算法对应的公式为:The formula corresponding to the preset load balancing algorithm is:

i为所述缓存队列的总数量,e为常数,LI_i为第i个所述缓存队列的负载指数,CI_i为第i个所述缓存队列的当前负载量,w_i为第i个所述缓存队列对应的队列权重,w_avg为所述缓存队列的平均负载量,RT_i为第i个所述缓存队列对应的命令响应时间,α和β为调整参数,所述α和β用于平衡负载量和响应时间。i is the total number of the cache queues, e is a constant, LI_i is the load index of the i-th cache queue, CI_i is the current load of the i-th cache queue, w_i is the queue weight corresponding to the i-th cache queue, w_avg is the average load of the cache queue, RT_i is the command response time corresponding to the i-th cache queue, α and β are adjustment parameters, and α and β are used to balance the load and response time.

步骤104,通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。Step 104 : Selecting a target cache queue from the cache queues according to the queue priority by the data management processor, and processing the target command in the target cache queue.

本发明实施例通过负载均衡算法为每个缓存队列计算一个负载指数,根据该负载指数来分配处理的优先级,因此,在确定了队列优先级之后,按照队列优先级从缓存队列中选取出目标缓存队列,对目标缓存队列中的目标命令进行处理。The embodiment of the present invention calculates a load index for each cache queue through a load balancing algorithm and allocates processing priority according to the load index. Therefore, after the queue priority is determined, the target cache queue is selected from the cache queue according to the queue priority, and the target command in the target cache queue is processed.

在本发明一些实施例中,步骤104还可以包括如下子步骤:In some embodiments of the present invention, step 104 may further include the following sub-steps:

子步骤41:若所述目标命令为创建命令,获取所述目标命令中携带的创建信息。Sub-step 41: If the target command is a creation command, obtain creation information carried in the target command.

为保证在数据上的独立,主机需要为当前的控制器创建新的命名空间,不同的命名空间之间数据、容量、属性都可以各不相同。首先主机下发创建命名空间命令,两个端口的主机可以各自下发此命令,具体的,可以通过双端口固态硬盘的PCIe(PerIP2403000heral Component Interconnect Express,高速串行计算机扩展总线标准)端口下发到NVMe模块,NVMe模块收到命令后,根据命令的参数识别到此命令是创建命名空间命令,NVMe模块会申请上下文和buffer,同时将命令进行转存,并将命令发送给数据管理处理器。数据管理器在接收到该命令后,首先将该创建命名空间命令存储至缓存队列,在执行到该命令时,数据管理处理器从缓存队列中取出此创建命名空间命令作为目标命令,并获取目标命令中携带的创建信息,为创建命名空间做准备。To ensure data independence, the host needs to create a new namespace for the current controller. The data, capacity, and attributes between different namespaces can be different. First, the host sends a create namespace command. The hosts of the two ports can each send this command. Specifically, it can be sent to the NVMe module through the PCIe (PerIP2403000heral Component Interconnect Express, a high-speed serial computer expansion bus standard) port of the dual-port solid-state drive. After receiving the command, the NVMe module recognizes that this command is a create namespace command based on the command parameters. The NVMe module will apply for context and buffer, transfer the command at the same time, and send the command to the data management processor. After receiving the command, the data manager first stores the create namespace command in the cache queue. When executing the command, the data management processor takes out the create namespace command from the cache queue as the target command, and obtains the creation information carried in the target command to prepare for the creation of the namespace.

子步骤42:依据所述创建信息,对所述双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与所述创建信息对应的目标存储空间;其中,所述命名空间信息至少包括:存储容量和起始逻辑地址。Sub-step 42: Allocate storage space in the namespace resource pool in the dual-port solid-state hard disk according to the creation information to obtain a target storage space corresponding to the creation information; wherein the namespace information includes at least: storage capacity and a starting logical address.

存储容量指的是需要分配的存储空间的大小,起始逻辑地址指的是存储空间分配的起始点,即从哪个逻辑地址开始分配存储空间。Storage capacity refers to the size of the storage space that needs to be allocated, and the starting logical address refers to the starting point of the storage space allocation, that is, from which logical address the storage space is allocated.

在本发明一些实施例中,在分配之前,确认资源池中是否有足够的未分配空间来满足所需的存储容量,检查资源池中的起始逻辑地址是否与请求的起始逻辑地址相匹配。在确定存储容量和逻辑地址都符合要求时,依据创建信息,对双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与创建信息对应的目标存储空间。In some embodiments of the present invention, before allocation, it is confirmed whether there is enough unallocated space in the resource pool to meet the required storage capacity, and it is checked whether the starting logical address in the resource pool matches the requested starting logical address. When it is determined that both the storage capacity and the logical address meet the requirements, the storage space in the namespace resource pool in the dual-port solid-state drive is allocated according to the creation information to obtain the target storage space corresponding to the creation information.

子步骤43:将与所述目标存储空间对应的创建结果信息发送至所述多核中央处理器中运行的固态硬盘控制模块,其中,所述创建结果信息包括目标空间唯一标识、创建成功标识。Sub-step 43: Sending the creation result information corresponding to the target storage space to the solid-state hard disk control module running in the multi-core central processor, wherein the creation result information includes a unique identifier of the target space and a creation success identifier.

无论创建命名空间的操作成功与否,都需要返回分配结果,将与目标存储空间对应的创建结果信息发送至多核中央处理器中运行的固态硬盘控制模块。Regardless of whether the operation of creating the namespace is successful or not, the allocation result needs to be returned, and the creation result information corresponding to the target storage space is sent to the solid-state drive control module running in the multi-core central processing unit.

在本发明一些实施例中,对所述目标缓存队列中的目标命令进行处理还包括:对目标命令进行合法性判断,当命令合法时,数据管理处理器将目标命令发送到后续模块进行处理。当命令非法时,数据管理处理器会将命令以及非法状态发送给固态硬盘控制模块,由固态硬盘控制模块进行后续处理。具体的,数据管理处理器通过硬件实现,是负责管理固态硬盘设备上命名空间和存储资源的组件,数据管理处理器接收到命令后,执行针对命名空间的操作,命令执行完成后,数据管理处理器将目标命令发送到后续模块进行处理,并将结果返回给NVMe模块。In some embodiments of the present invention, processing the target command in the target cache queue also includes: judging the legality of the target command, and when the command is legal, the data management processor sends the target command to the subsequent module for processing. When the command is illegal, the data management processor will send the command and the illegal status to the solid-state drive control module, and the solid-state drive control module will perform subsequent processing. Specifically, the data management processor is implemented through hardware and is a component responsible for managing the namespace and storage resources on the solid-state drive device. After receiving the command, the data management processor performs operations on the namespace. After the command is executed, the data management processor sends the target command to the subsequent module for processing, and returns the result to the NVMe module.

在本发明一些实施例中,可以对命名空间进行配额与限制,通过引入新的配额系统,允许管理员为每个命名空间设置存储使用上限,防止某个命名空间过度消耗存储资源。在本发明另一些实施例中,通过快照机制或克隆机制,允许管理员快速创建命名空间的只读或可写副本,这些副本可以用于数据备份、测试或开发环境,而不会影响原始命名空间的性能或稳定性。In some embodiments of the present invention, quotas and restrictions can be imposed on namespaces. By introducing a new quota system, administrators are allowed to set a storage usage cap for each namespace to prevent a certain namespace from over-consuming storage resources. In other embodiments of the present invention, through a snapshot mechanism or a cloning mechanism, administrators are allowed to quickly create read-only or writable copies of a namespace. These copies can be used for data backup, testing, or development environments without affecting the performance or stability of the original namespace.

在本发明一些实施例中,子步骤43后,还包括如下子步骤:In some embodiments of the present invention, after sub-step 43, the following sub-steps are further included:

子步骤51:通过多核中央处理器中运行的所述固态硬盘控制模块,从所述缓冲区获取与所述创建结果信息匹配的命令数据,输出针对所述命令数据的所述目标空间唯一标识、创建成功标识。Sub-step 51: obtaining command data matching the creation result information from the buffer through the solid-state hard disk control module running in the multi-core central processing unit, and outputting the target space unique identifier and the creation success identifier for the command data.

由前述子步骤22可知,NVMe模块在获取命令时会申请缓冲区,具体的,在申请缓冲区时也会申请相应的上下文,将命令及相关数据转存至缓冲区,上下文包括命令的状态、执行进度、错误信息。因此,数据管理处理器将创建结果信息发送至NVMe模块,NVMe模块收到消息后,会根据上下文找到这条命令,从缓冲区中获取到子步骤12中转存的具体命令数据,然后NVMe模块将完成的消息和分配的命名空间唯一标识返回给主机。As can be seen from the above sub-step 22, the NVMe module will apply for a buffer when obtaining a command. Specifically, when applying for a buffer, it will also apply for a corresponding context, and transfer the command and related data to the buffer. The context includes the status, execution progress, and error information of the command. Therefore, the data management processor sends the creation result information to the NVMe module. After receiving the message, the NVMe module will find the command according to the context, obtain the specific command data transferred in sub-step 12 from the buffer, and then the NVMe module returns the completed message and the allocated namespace unique identifier to the host.

在本发明一些实施例中,还包括:In some embodiments of the present invention, it also includes:

通过所述多核中央处理器接收下电命令,并将所述下电命令发送至所述数据管理处理器;Receiving a power-off command through the multi-core central processing unit, and sending the power-off command to the data management processor;

通过所述数据管理处理器在接收到所述下电命令后,停止接收新命令,并将所述数据管理处理器中管理的数据存储至所述双端口固态硬盘的闪存中。After receiving the power-off command, the data management processor stops receiving new commands and stores the data managed by the data management processor in the flash memory of the dual-port solid state drive.

其中,下电指令是一种控制信号或命令,用于指示电子设备或系统准备关闭电源。在存储系统中,下电指令通常用于安全地关闭固态硬盘或其他存储设备,以确保数据的完整性和防止数据丢失。存储设备或其控制器接收到可能来自操作系统、硬件管理接口或其他系统组件的下电指令,并且设备会停止接收新的读写请求,以防止在关闭过程中发生数据不一致。Among them, the power-off instruction is a control signal or command used to instruct an electronic device or system to prepare to turn off the power. In a storage system, the power-off instruction is usually used to safely shut down a solid-state drive or other storage device to ensure data integrity and prevent data loss. The storage device or its controller receives a power-off instruction that may come from an operating system, hardware management interface, or other system component, and the device stops receiving new read and write requests to prevent data inconsistencies during the shutdown process.

在本发明一些实施例中,当设备遇到下电场景,通过多核中央处理器接收下电命令,具体的,NVMe模块会将下电消息发送到数据管理处理器,数据管理处理器收到下电消息后,不再接收处理新的命令消息,并会将其管理的且并未落盘的数据发送到nfc(nandflash controller,闪存控制)模块。此外,NVMe模块同时会将下电消息发送给日志管理模块,算法模块等其他模块,这些模块在收到下电消息后各自进入下电流程处理,然后发送数据给nfc模块,由nfc模块将数据持久化到固态硬盘的闪存中,将所有未写入的数据写入到闪存,确保数据的持久性,通过针对下电命令的处理步骤,防止数据在突然断电时丢失,确保数据的安全存储和系统的正常关闭。In some embodiments of the present invention, when the device encounters a power-off scenario, a power-off command is received through a multi-core central processor. Specifically, the NVMe module will send a power-off message to the data management processor. After receiving the power-off message, the data management processor will no longer receive and process new command messages, and will send the data that it manages and has not been written to the disk to the NFC (NandFlash Controller, Flash Memory Control) module. In addition, the NVMe module will also send the power-off message to the log management module, algorithm module and other modules. These modules will each enter the power-off process after receiving the power-off message, and then send the data to the NFC module. The NFC module will persist the data in the flash memory of the solid-state drive, write all unwritten data to the flash memory, ensure the persistence of the data, and prevent data from being lost in the event of a sudden power outage through the processing steps for the power-off command, thereby ensuring the safe storage of data and the normal shutdown of the system.

本发明实施例提供的基于双端口固态硬盘的数据处理方法,通过多核中央处理器接收命令,若命令为命名空间命令,则将命令转发至数据管理处理器,通过数据管理处理器确定命令对应的行为类型,依据命令对应的行为类型将命令存储至不同的缓存队列,通过数据管理处理器根据预设的负载均衡算法计算每个缓存队列的负载指数,并依据负载指数确定每个缓存队列的队列优先级,通过数据管理处理器按照队列优先级从缓存队列中选取目标缓存队列,对目标缓存队列中的目标命令进行处理,本发明实施例通过在双端口固态硬盘中设置数据管理器来专门处理针对命名空间的命令,并通过负载指数保证各个命令缓存队列的有序处理,解放了固态硬盘多核中央处理器的部分算力。The data processing method based on the dual-port solid-state hard disk provided by the embodiment of the present invention receives commands through a multi-core central processing unit. If the command is a namespace command, the command is forwarded to a data management processor, and the behavior type corresponding to the command is determined by the data management processor. The command is stored in different cache queues according to the behavior type corresponding to the command. The load index of each cache queue is calculated by the data management processor according to a preset load balancing algorithm, and the queue priority of each cache queue is determined according to the load index. The target cache queue is selected from the cache queue according to the queue priority by the data management processor, and the target command in the target cache queue is processed. The embodiment of the present invention sets a data manager in the dual-port solid-state hard disk to specifically process commands for the namespace, and ensures the orderly processing of each command cache queue through the load index, thereby freeing up part of the computing power of the multi-core central processing unit of the solid-state hard disk.

参照图2,示出了本发明实施例提供的基于双端口固态硬盘的数据处理方法的步骤流程图之二,具体包括:2, a second flow chart of the data processing method based on a dual-port solid state drive according to an embodiment of the present invention is shown, which specifically includes:

步骤201,通过多核中央处理器中运行的命令处理模块接收所述命令,并将所述命令发送至所述多核中央处理器中运行的固态硬盘控制模块。Step 201: receiving the command through a command processing module running in a multi-core central processing unit, and sending the command to a solid state drive control module running in the multi-core central processing unit.

在本发明一些实施例中,双端口固态硬盘指的是NVMe SSD设备,且NVMe SSD设备中采用多核系统,主要在服务器环境下运行,服务器支持创建多控制器和多命名空间,服务器为双端口服务器,适配了NVMe SSD设备。具体的,在服务器开机时,NVMe SSD设备同时启动,因为是在双端口环境下运行,NVMe SSD设备可以支持2个PCIe端口并各自实例化成单独的NVMe subsystem(NVMe子系统),2个端口各自对应独立的主机。在每个主机中各自至少包含有一个控制器和一个命名空间。如图3所示,是本发明一些实施例提供的双端口逻辑框架图,两个端口对应各自的主机,每个端口对应了多个控制器和多个命名空间。如图4所示,是本发明一些实施例提供的命令交互概要图,通过多核中央处理器中运行的命令处理模块接收命令,并将命令发送至多核中央处理器中运行的固态硬盘控制模块。In some embodiments of the present invention, a dual-port solid-state drive refers to an NVMe SSD device, and a multi-core system is used in the NVMe SSD device, which mainly runs in a server environment. The server supports the creation of multiple controllers and multiple namespaces. The server is a dual-port server and is adapted to the NVMe SSD device. Specifically, when the server is turned on, the NVMe SSD device starts at the same time. Because it runs in a dual-port environment, the NVMe SSD device can support 2 PCIe ports and each is instantiated into a separate NVMe subsystem (NVMe subsystem), and the 2 ports each correspond to an independent host. Each host includes at least one controller and one namespace. As shown in Figure 3, it is a dual-port logical framework diagram provided by some embodiments of the present invention, and the two ports correspond to their respective hosts, and each port corresponds to multiple controllers and multiple namespaces. As shown in Figure 4, it is a command interaction summary diagram provided by some embodiments of the present invention, which receives commands through a command processing module running in a multi-core central processor, and sends commands to a solid-state drive control module running in a multi-core central processor.

步骤202,通过所述固态硬盘控制模块申请缓冲区,并将所述命令转存至所述缓冲区。Step 202: Apply for a buffer through the solid state drive control module, and transfer the command to the buffer.

在存储系统中,当接收到命令(如读取、写入、擦除等)时,通常需要将这些命令暂时存储在缓冲区中,以便进行进一步的处理。在本发明一些实施例中,通过NVMe模块向系统内存管理单元申请一个或多个缓冲区,这些缓冲区可以是内部的快速存储器,用于临时存储数据和命令,NVMe模块将接收到的命令转存至申请到的缓冲区中,将命令数据、地址信息、命令类型等存储在缓冲区的指定位置,如果系统中有多个命令等待处理,NVMe模块会将这些命令按照一定的优先级或顺序排队,确保命令按照正确的顺序执行,避免数据不一致或冲突。In a storage system, when a command (such as read, write, erase, etc.) is received, it is usually necessary to temporarily store these commands in a buffer for further processing. In some embodiments of the present invention, the NVMe module applies to the system memory management unit for one or more buffers, which can be internal fast memories for temporary storage of data and commands. The NVMe module transfers the received command to the applied buffer, and stores the command data, address information, command type, etc. in the specified location of the buffer. If there are multiple commands waiting to be processed in the system, the NVMe module will queue these commands according to a certain priority or order to ensure that the commands are executed in the correct order to avoid data inconsistency or conflict.

步骤203,若所述命令为命名空间命令,通过所述固态硬盘控制模块将所述命令转发至所述数据管理处理器;Step 203: if the command is a namespace command, forward the command to the data management processor through the solid state drive control module;

相关技术中,如果是针对命名空间的命令,需要在多核中央处理器进行命令的处理,例如创建命名空间、删除命名空间、读写命名空间等。在本发明一些实施例中,若判断命令是命名空间命令时,NVMe模块会将命令转发到数据管理处理器,交由数据管理处理器来进行处理,那么多核中央处理器可以不再处理相关命令,解放了多核中央处理器的部分算力。In the related art, if the command is for a namespace, it is necessary to process the command in the multi-core CPU, such as creating a namespace, deleting a namespace, reading and writing a namespace, etc. In some embodiments of the present invention, if the command is determined to be a namespace command, the NVMe module will forward the command to the data management processor for processing, and then the multi-core CPU can no longer process the related commands, freeing up part of the computing power of the multi-core CPU.

步骤204,通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列。Step 204: Determine the behavior type corresponding to the command by the data management processor, and store the command in different cache queues according to the behavior type corresponding to the command.

步骤205,通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级。Step 205: The data management processor calculates the load index of each cache queue according to a preset load balancing algorithm, and determines the queue priority of each cache queue according to the load index.

上述204-205参照前序论述步骤102、103的内容,本发明在此不再赘述。The above 204-205 refer to the contents of steps 102 and 103 discussed in the previous section, and the present invention will not repeat them here.

步骤206,通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理,若所述目标命令为创建命令,获取所述目标命令中携带的创建信息。Step 206: The data management processor selects a target cache queue from the cache queues according to the queue priority, processes the target command in the target cache queue, and if the target command is a create command, obtains the create information carried in the target command.

数据管理处理器从缓存队列中选取目标缓存队列并对目标缓存队列中的目标命令进行处理,若目标命令为创建命令,则需要获取目标命令中携带的创建信息。本发明中双端口固态硬盘中的中央处理器为多个cortex cpu核(处理器核心),NVMe模块运行在多个cortex cpu核上,NVMe模块在处理完命令后,将命令转存并发送给数据管理处理器,多个cortex cpu核同时下发给数据管理处理器,对数据管理处理器来说会存在高并发情况,如图5,是本发明实施例提供的并发情况下数据管理处理器的处理命令概图,数据管理处理器接受命令、检查命令,如果是创建、删除命令将其存储至优先级高的缓存队列中,如果是读写命令将其存储至优先级较低的缓存队列中,提高整体性能和响应速度,同时确保关键操作的优先处理。根据预设的负载均衡算法从缓存队列中取出命令并进行相应处理,将处理结果返回给各个中央处理器核心上运行的模块。The data management processor selects the target cache queue from the cache queue and processes the target command in the target cache queue. If the target command is a create command, it is necessary to obtain the creation information carried in the target command. In the present invention, the central processing unit in the dual-port solid-state hard disk is a plurality of cortex cpu cores (processor cores), and the NVMe module runs on a plurality of cortex cpu cores. After processing the command, the NVMe module transfers the command and sends it to the data management processor. The plurality of cortex cpu cores are simultaneously sent to the data management processor. For the data management processor, there will be a high concurrency situation. As shown in FIG5, it is a general diagram of the processing commands of the data management processor under the concurrency provided by the embodiment of the present invention. The data management processor accepts commands and checks commands. If it is a create or delete command, it is stored in a cache queue with a high priority. If it is a read-write command, it is stored in a cache queue with a lower priority, thereby improving the overall performance and response speed, and ensuring the priority processing of key operations at the same time. According to the preset load balancing algorithm, the command is taken out from the cache queue and processed accordingly, and the processing result is returned to the modules running on each central processing unit core.

步骤207:依据所述创建信息,对所述双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与所述创建信息对应的目标存储空间;其中,所述命名空间信息至少包括:存储容量和起始逻辑地址。Step 207: Allocate storage space in the namespace resource pool in the dual-port solid state drive according to the creation information to obtain a target storage space corresponding to the creation information; wherein the namespace information includes at least: storage capacity and a starting logical address.

具体的,命令携带的创建信息中包括size(存储容量)和start lba(起始逻辑地址)等参数,从start lba开始,分配size大小的存储空间给新命名空间,确保分配的空间是连续的,并且不与资源池中已分配的空间冲突,为新命名空间分配一个唯一的空间标识,确保该标识在系统中是唯一的,不与现有的命名空间标识冲突。在资源池的元数据中记录新命名空间的分配信息,包括标识、起始逻辑地址和分配的容量,此外还要更新资源池的可用空间信息,标记已分配的区域。Specifically, the creation information carried by the command includes parameters such as size (storage capacity) and start lba (starting logical address). Starting from start lba, a storage space of size is allocated to the new namespace, ensuring that the allocated space is continuous and does not conflict with the allocated space in the resource pool. A unique space identifier is allocated to the new namespace, ensuring that the identifier is unique in the system and does not conflict with the existing namespace identifier. The allocation information of the new namespace, including the identifier, the starting logical address, and the allocated capacity, is recorded in the metadata of the resource pool. In addition, the available space information of the resource pool is updated to mark the allocated area.

步骤208:将与所述目标存储空间对应的创建结果信息发送至所述多核中央处理器中运行的固态硬盘控制模块,其中,所述创建结果信息包括目标空间唯一标识、创建成功标识。Step 208: Send the creation result information corresponding to the target storage space to the solid-state hard disk control module running in the multi-core central processor, wherein the creation result information includes a unique identifier of the target space and a creation success identifier.

步骤209:通过多核中央处理器中运行的所述固态硬盘控制模块,从所述缓冲区获取与所述创建结果信息匹配的命令数据,输出针对所述命令数据的所述目标空间唯一标识、创建成功标识。Step 209: The solid state drive control module running in the multi-core central processing unit obtains command data matching the creation result information from the buffer, and outputs the target space unique identifier and the creation success identifier for the command data.

在本发明一些实施例中,无论创建命名空间的操作成功与否,都将对应的创建结果信息发送至多核中央处理器中运行的NVMe模块。如图6,是本发明一些实施例提供的创建命名空间的命令处理流程图,主机下发创建指令,命名处理模块收到命令,对命令进行检查,若命令不合法和返回操作码并结束该命令,命令合法,则将命令发送至NVMe模块,NVMe模块会判断命令类型,如果是其他命令,则交由其他模块处理,本发明在此不作说明,如果是命名空间命令,则需要将命令发送至数据管理处理器,在发送之前N VMe模块需要申请上下文和缓冲区并将命令转存至缓冲区,完成转存之后N VMe模块将命令发送至数据管理处理器,数据管理处理器判断是命名空间创建命令,则从命名空间资源池中分配资源给新的命名空间,并将创建结果返回给NVMe模块;如果是读写命令,则会进入相应的读写流程,并将结果返回给NVMe模块。NVMe模块从数据管理处理器得到处理结果后,会从此前申请的上下文和缓冲区中找到这条命令,向主机端发送针对该命令的完成消息。具体的,如果命名空间创建成功,则将新命名空间的详细信息(包括标识、起始逻辑地址和分配的容量)返回给NVMe模块,如果命名空间创建失败(例如,资源池空间不足或起始lba无效),则向NVMe模块返回错误信息。In some embodiments of the present invention, regardless of whether the operation of creating a namespace is successful or not, the corresponding creation result information is sent to the NVMe module running in the multi-core central processor. As shown in Figure 6, it is a command processing flow chart for creating a namespace provided by some embodiments of the present invention. The host sends a creation instruction, the naming processing module receives the command, checks the command, and if the command is illegal and returns the operation code and ends the command, the command is legal, then the command is sent to the NVMe module, the NVMe module will determine the command type, if it is other commands, it will be handled by other modules, the present invention will not be explained here, if it is a namespace command, then the command needs to be sent to the data management processor, before sending, the N VMe module needs to apply for context and buffer and transfer the command to the buffer, after the transfer is completed, the N VMe module sends the command to the data management processor, the data management processor determines that it is a namespace creation command, then allocates resources from the namespace resource pool to the new namespace, and returns the creation result to the NVMe module; if it is a read-write command, it will enter the corresponding read-write process and return the result to the NVMe module. After the NVMe module gets the processing result from the data management processor, it will find this command from the previously applied context and buffer, and send a completion message for the command to the host. Specifically, if the namespace is created successfully, the detailed information of the new namespace (including the identifier, the starting logical address, and the allocated capacity) will be returned to the NVMe module. If the namespace creation fails (for example, insufficient resource pool space or invalid starting lba), an error message will be returned to the NVMe module.

本发明实施例提供的基于双端口固态硬盘的数据处理方法,通过多核中央处理器接收命令,若命令为命名空间命令,则将命令转发至数据管理处理器,通过数据管理处理器确定命令对应的行为类型,依据命令对应的行为类型将命令存储至不同的缓存队列,通过数据管理处理器根据预设的负载均衡算法计算每个缓存队列的负载指数,并依据负载指数确定每个缓存队列的队列优先级,通过数据管理处理器按照队列优先级从缓存队列中选取目标缓存队列,对目标缓存队列中的目标命令进行处理,本发明实施例通过在双端口固态硬盘中设置数据管理器来专门处理针对命名空间的命令,并通过负载指数保证各个命令缓存队列的有序处理,解放了固态硬盘多核中央处理器的部分算力。The data processing method based on the dual-port solid-state hard disk provided by the embodiment of the present invention receives commands through a multi-core central processing unit. If the command is a namespace command, the command is forwarded to a data management processor, and the behavior type corresponding to the command is determined by the data management processor. The command is stored in different cache queues according to the behavior type corresponding to the command. The load index of each cache queue is calculated by the data management processor according to a preset load balancing algorithm, and the queue priority of each cache queue is determined according to the load index. The target cache queue is selected from the cache queue according to the queue priority by the data management processor, and the target command in the target cache queue is processed. The embodiment of the present invention sets a data manager in the dual-port solid-state hard disk to specifically process commands for the namespace, and ensures the orderly processing of each command cache queue through the load index, thereby freeing up part of the computing power of the multi-core central processing unit of the solid-state hard disk.

参照图7,示出了本发明实施例提供的一种基于双端口固态硬盘的数据处理装置的结构示意图,如图7所示,该装置可以包括:7 , a schematic diagram of the structure of a data processing device based on a dual-port solid-state hard disk provided by an embodiment of the present invention is shown. As shown in FIG7 , the device may include:

命令获取模块701,用于通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器。The command acquisition module 701 is used to receive a command through the multi-core central processing unit, and if the command is a namespace command, forward the command to the data management processor.

命令分配模块702,用于通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列。The command allocation module 702 is used to determine the behavior type corresponding to the command through the data management processor, and store the command in different cache queues according to the behavior type corresponding to the command.

负载均衡模块703,用于通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级。The load balancing module 703 is used to calculate the load index of each cache queue according to a preset load balancing algorithm through the data management processor, and determine the queue priority of each cache queue according to the load index.

命令处理模块704,通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。The command processing module 704 selects a target cache queue from the cache queues according to the queue priority through the data management processor, and processes the target command in the target cache queue.

在本发明的可选实施例中,负载均衡模块703包括:In an optional embodiment of the present invention, the load balancing module 703 includes:

负载信息获取子模块,用于获取每个所述缓存队列对应的队列负载信息,所述队列负载信息至少包括:队列权重、命令响应时间和当前负载量。The load information acquisition submodule is used to obtain queue load information corresponding to each of the cache queues, and the queue load information at least includes: queue weight, command response time and current load amount.

负载均值计算子模块,用于依据每个所述缓存队列的当前负载量,计算所述缓存队列的队列总负载量,并根据所述队列总负载量确定所述缓存队列的平均负载量。The load average calculation submodule is used to calculate the total queue load of the cache queue according to the current load of each cache queue, and determine the average load of the cache queue according to the total queue load.

负载指数计算子模块,用于根据预设的负载均衡算法计算每个所述缓存队列的负载指数。The load index calculation submodule is used to calculate the load index of each cache queue according to a preset load balancing algorithm.

优先级确定子模块,用于依据所述负载指数确定每个所述缓存队列的队列优先级。The priority determination submodule is used to determine the queue priority of each cache queue according to the load index.

其中,所述预设的负载均衡算法对应的公式为:The formula corresponding to the preset load balancing algorithm is:

i为所述缓存队列的总数量,e为常数,LI_i为第i个所述缓存队列的负载指数,CI_i为第i个所述缓存队列的当前负载量,w_i为第i个所述缓存队列对应的队列权重,w_avg为所述缓存队列的平均负载量,RT_i为第i个所述缓存队列对应的命令响应时间,α和β为调整参数,所述α和β用于平衡负载量和响应时间。i is the total number of the cache queues, e is a constant, LI_i is the load index of the i-th cache queue, CI_i is the current load of the i-th cache queue, w_i is the queue weight corresponding to the i-th cache queue, w_avg is the average load of the cache queue, RT_i is the command response time corresponding to the i-th cache queue, α and β are adjustment parameters, and α and β are used to balance the load and response time.

在本发明的可选实施例中,命令获取模块701包括:In an optional embodiment of the present invention, the command acquisition module 701 includes:

第一校验子模块,用于通过所述多核中央处理器接收命令,对所述命令进行校验,得到校验结果;A first check submodule, configured to receive a command through the multi-core central processing unit, check the command, and obtain a check result;

第二校验子模块,用于若所述校验结果为校验未通过,则拦截所述命令;A second verification submodule, configured to intercept the command if the verification result is that the verification fails;

第三校验子模块,用于若所述校验结果为校验通过,且所述命令为所述命名空间命令中的其中一种,则将所述命令转发至所述数据管理处理。The third check submodule is used to forward the command to the data management process if the check result is check passed and the command is one of the namespace commands.

在本发明的可选实施例中,命令获取模块701还包括:In an optional embodiment of the present invention, the command acquisition module 701 further includes:

命令获取子模块,用于通过多核中央处理器中运行的命令处理模块接收所述命令,并将所述命令发送至所述多核中央处理器中运行的固态硬盘控制模块。The command acquisition submodule is used to receive the command through the command processing module running in the multi-core central processing unit, and send the command to the solid state drive control module running in the multi-core central processing unit.

缓冲区申请子模块,用于通过所述固态硬盘控制模块申请缓冲区,并将所述命令转存至所述缓冲区。The buffer application submodule is used to apply for a buffer through the solid state drive control module and transfer the command to the buffer.

命令转发子模块,用于若所述命令为命名空间命令,通过所述固态硬盘控制模块将所述命令转发至所述数据管理处理器。The command forwarding submodule is used to forward the command to the data management processor through the solid state drive control module if the command is a namespace command.

在本发明的可选实施例中,命令处理模块704包括:In an optional embodiment of the present invention, the command processing module 704 includes:

信息获取子模块,用于若所述目标命令为创建命令,获取所述目标命令中携带的创建信息。The information acquisition submodule is used to obtain the creation information carried in the target command if the target command is a creation command.

空间分配子模块,用于依据所述创建信息,对所述双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与所述创建信息对应的目标存储空间;其中,所述命名空间信息至少包括:存储容量和起始逻辑地址。The space allocation submodule is used to allocate the storage space in the namespace resource pool in the dual-port solid-state hard disk according to the creation information to obtain the target storage space corresponding to the creation information; wherein the namespace information at least includes: storage capacity and starting logical address.

结果返回子模块,用于将与所述目标存储空间对应的创建结果信息发送至所述多核中央处理器中运行的固态硬盘控制模块,其中,所述创建结果信息包括目标空间唯一标识、创建成功标识。The result returning submodule is used to send the creation result information corresponding to the target storage space to the solid state hard disk control module running in the multi-core central processing unit, wherein the creation result information includes a unique identifier of the target space and a creation success identifier.

在本发明的可选实施例中,结果返回子模块包括:In an optional embodiment of the present invention, the result returning submodule includes:

结果返回子单元,用于通过多核中央处理器中运行的所述固态硬盘控制模块,从所述缓冲区获取与所述创建结果信息匹配的命令数据,输出针对所述命令数据的所述目标空间唯一标识、创建成功标识。The result returning subunit is used to obtain the command data matching the creation result information from the buffer through the solid state drive control module running in the multi-core central processing unit, and output the target space unique identifier and the creation success identifier for the command data.

在本发明的可选实施例中,基于双端口固态硬盘的数据处理装置还包括:In an optional embodiment of the present invention, the data processing device based on the dual-port solid state hard disk further includes:

第一下电模块,用于通过所述多核中央处理器接收下电命令,并将所述下电命令发送至所述数据管理处理器。The first power-off module is used to receive a power-off command through the multi-core central processing unit and send the power-off command to the data management processor.

第二下电模块,用于通过所述数据管理处理器在接收到所述下电命令后,停止接收新命令,并将所述数据管理处理器中管理的数据存储至所述双端口固态硬盘的闪存中。The second power-off module is used to stop receiving new commands after receiving the power-off command through the data management processor, and store the data managed by the data management processor in the flash memory of the dual-port solid state drive.

本发明实施例提供的基于双端口固态硬盘的数据处理方法,通过多核中央处理器接收命令,若命令为命名空间命令,则将命令转发至数据管理处理器,通过数据管理处理器确定命令对应的行为类型,依据命令对应的行为类型将命令存储至不同的缓存队列,通过数据管理处理器根据预设的负载均衡算法计算每个缓存队列的负载指数,并依据负载指数确定每个缓存队列的队列优先级,通过数据管理处理器按照队列优先级从缓存队列中选取目标缓存队列,对目标缓存队列中的目标命令进行处理,本发明实施例通过在双端口固态硬盘中设置数据管理器来专门处理针对命名空间的命令,并通过负载指数保证各个命令缓存队列的有序处理,解放了固态硬盘多核中央处理器的部分算力。The data processing method based on the dual-port solid-state hard disk provided by the embodiment of the present invention receives commands through a multi-core central processing unit. If the command is a namespace command, the command is forwarded to a data management processor, and the behavior type corresponding to the command is determined by the data management processor. The command is stored in different cache queues according to the behavior type corresponding to the command. The load index of each cache queue is calculated by the data management processor according to a preset load balancing algorithm, and the queue priority of each cache queue is determined according to the load index. The target cache queue is selected from the cache queue according to the queue priority by the data management processor, and the target command in the target cache queue is processed. The embodiment of the present invention sets a data manager in the dual-port solid-state hard disk to specifically process commands for the namespace, and ensures the orderly processing of each command cache queue through the load index, thereby freeing up part of the computing power of the multi-core central processing unit of the solid-state hard disk.

本发明一实施例还提供了一种电子设备,可以包括处理器、存储器及存储在存储器上并能够在处理器上运行的计算机程序,计算机程序被处理器执行时实现如上基于双端口固态硬盘的数据处理方法。An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the data processing method based on the dual-port solid-state hard disk is implemented as described above.

本发明一实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储计算机程序,计算机程序被处理器执行时实现如上基于双端口固态硬盘的数据处理方法。An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data processing method based on a dual-port solid-state hard disk is implemented as described above.

本发明一些实施例还提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现如上基于双端口固态硬盘的数据处理方法。Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above data processing method based on a dual-port solid-state hard disk when executed by a processor.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

在此提供的算法和显示不与任何特定计算机、虚拟装置或者其他设备固有相关。根据上面的描述,构造这类装置所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. According to the above description, it is obvious that the structure required for constructing this type of device is. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is to disclose the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图,或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and/or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明的排序设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所做的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

需要说明的是,本申请实施例中获取各种数据相关过程,都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.

Claims (10)

1.一种基于双端口固态硬盘的数据处理方法,其特征在于,所述双端口固态硬盘设置有多核中央处理器和数据管理处理器,所述方法包括:1. A data processing method based on a dual-port solid-state hard disk, characterized in that the dual-port solid-state hard disk is provided with a multi-core central processing unit and a data management processor, the method comprising: 通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器;receiving a command through the multi-core central processing unit, and forwarding the command to the data management processor if the command is a namespace command; 通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列;Determining, by the data management processor, a behavior type corresponding to the command, and storing the command in different cache queues according to the behavior type corresponding to the command; 通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级;Calculating the load index of each cache queue according to a preset load balancing algorithm by the data management processor, and determining the queue priority of each cache queue according to the load index; 通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。The data management processor selects a target cache queue from the cache queue according to the queue priority, and processes the target command in the target cache queue. 2.根据权利要求1所述的方法,其特征在于,所述通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级,包括:2. The method according to claim 1, characterized in that the data management processor calculates the load index of each cache queue according to a preset load balancing algorithm, and determines the queue priority of each cache queue according to the load index, comprising: 获取每个所述缓存队列对应的队列负载信息,所述队列负载信息至少包括:队列权重、命令响应时间和当前负载量;Obtaining queue load information corresponding to each cache queue, wherein the queue load information includes at least: queue weight, command response time, and current load; 依据每个所述缓存队列的当前负载量,计算所述缓存队列的队列总负载量,并根据所述队列总负载量确定所述缓存队列的平均负载量;Calculating the total queue load of the cache queue according to the current load of each cache queue, and determining the average load of the cache queue according to the total queue load; 根据预设的负载均衡算法计算每个所述缓存队列的负载指数;Calculating the load index of each cache queue according to a preset load balancing algorithm; 依据所述负载指数确定每个所述缓存队列的队列优先级;Determining a queue priority of each of the cache queues according to the load index; 其中,所述预设的负载均衡算法对应的公式为:The formula corresponding to the preset load balancing algorithm is: i为所述缓存队列的总数量,e为常数,LI_i为第i个所述缓存队列的负载指数,CI_i为第i个所述缓存队列的当前负载量,w_i为第i个所述缓存队列对应的队列权重,w_avg为所述缓存队列的平均负载量,RT_i为第i个所述缓存队列对应的命令响应时间,α和β为调整参数,所述α和β用于平衡负载量和响应时间。i is the total number of the cache queues, e is a constant, LI_i is the load index of the i-th cache queue, CI_i is the current load of the i-th cache queue, w_i is the queue weight corresponding to the i-th cache queue, w_avg is the average load of the cache queue, RT_i is the command response time corresponding to the i-th cache queue, α and β are adjustment parameters, and α and β are used to balance the load and response time. 3.根据权利要求1-2任一项所述的方法,其特征在于,所述命名空间命令包括:创建命令、删除命令、写入命令、读取命令,所述通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器,包括:3. The method according to any one of claims 1 to 2, wherein the namespace command includes: a create command, a delete command, a write command, and a read command, and the receiving of the command by the multi-core central processor, if the command is a namespace command, forwarding the command to the data management processor, comprises: 通过所述多核中央处理器接收命令,对所述命令进行校验,得到校验结果;Receiving a command through the multi-core central processing unit, verifying the command, and obtaining a verification result; 若所述校验结果为校验未通过,则拦截所述命令;If the verification result is that the verification fails, intercepting the command; 若所述校验结果为校验通过,且所述命令为所述命名空间命令中的其中一种,则将所述命令转发至所述数据管理处理。If the verification result is verification passed and the command is one of the namespace commands, the command is forwarded to the data management process. 4.根据权利要求1所述的方法,其特征在于,所述通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器,包括:4. The method according to claim 1, wherein the receiving a command through the multi-core central processor and forwarding the command to the data management processor if the command is a namespace command comprises: 通过多核中央处理器中运行的命令处理模块接收所述命令,并将所述命令发送至所述多核中央处理器中运行的固态硬盘控制模块;The command is received by a command processing module running in a multi-core central processing unit, and the command is sent to a solid state drive control module running in the multi-core central processing unit; 通过所述固态硬盘控制模块申请缓冲区,并将所述命令转存至所述缓冲区;Applying for a buffer through the solid state drive control module, and transferring the command to the buffer; 若所述命令为命名空间命令,通过所述固态硬盘控制模块将所述命令转发至所述数据管理处理器。If the command is a namespace command, the command is forwarded to the data management processor through the solid state drive control module. 5.根据权利要求4所述的方法,其特征在于,对所述目标缓存队列中的目标命令进行处理,包括:5. The method according to claim 4, characterized in that processing the target command in the target cache queue comprises: 若所述目标命令为创建命令,获取所述目标命令中携带的创建信息;If the target command is a creation command, obtaining creation information carried in the target command; 依据所述创建信息,对所述双端口固态硬盘中的命名空间资源池中的存储空间进行分配,得到与所述创建信息对应的目标存储空间;其中,所述命名空间信息至少包括:存储容量和起始逻辑地址;According to the creation information, the storage space in the namespace resource pool in the dual-port solid-state hard disk is allocated to obtain a target storage space corresponding to the creation information; wherein the namespace information at least includes: storage capacity and a starting logical address; 将与所述目标存储空间对应的创建结果信息发送至所述多核中央处理器中运行的固态硬盘控制模块,其中,所述创建结果信息包括目标空间唯一标识、创建成功标识。The creation result information corresponding to the target storage space is sent to the solid state hard disk control module running in the multi-core central processing unit, wherein the creation result information includes a unique identifier of the target space and a creation success identifier. 6.根据权利要求5所述的方法,其特征在于,所述将与所述目标存储空间对应的目标存储空间信息发送至所述多核中央处理器中运行的固态硬盘控制模块之后,包括:6. The method according to claim 5, characterized in that after sending the target storage space information corresponding to the target storage space to the solid state drive control module running in the multi-core central processor, it comprises: 通过多核中央处理器中运行的所述固态硬盘控制模块,从所述缓冲区获取与所述创建结果信息匹配的命令数据,输出针对所述命令数据的所述目标空间唯一标识、创建成功标识。The solid state drive control module running in the multi-core central processing unit obtains command data matching the creation result information from the buffer, and outputs the target space unique identifier and the creation success identifier for the command data. 7.根据权利要求1-2任一项所述的方法,其特征在于,所述方法还包括:7. The method according to any one of claims 1 to 2, characterized in that the method further comprises: 通过所述多核中央处理器接收下电命令,并将所述下电命令发送至所述数据管理处理器;Receiving a power-off command through the multi-core central processing unit, and sending the power-off command to the data management processor; 通过所述数据管理处理器在接收到所述下电命令后,停止接收新命令,并将所述数据管理处理器中管理的数据存储至所述双端口固态硬盘的闪存中。After receiving the power-off command, the data management processor stops receiving new commands and stores the data managed by the data management processor in the flash memory of the dual-port solid state drive. 8.一种基于双端口固态硬盘的数据处理装置,其特征在于,所述双端口固态硬盘设置有多核中央处理器和数据管理处理器,包括:8. A data processing device based on a dual-port solid-state hard disk, characterized in that the dual-port solid-state hard disk is provided with a multi-core central processing unit and a data management processor, comprising: 命令获取模块,用于通过所述多核中央处理器接收命令,若所述命令为命名空间命令,则将所述命令转发至所述数据管理处理器;A command acquisition module, configured to receive a command through the multi-core central processing unit, and if the command is a namespace command, forward the command to the data management processor; 命令分配模块,用于通过所述数据管理处理器确定所述命令对应的行为类型,依据所述命令对应的行为类型将所述命令存储至不同的缓存队列;A command allocation module, used to determine the behavior type corresponding to the command through the data management processor, and store the command in different cache queues according to the behavior type corresponding to the command; 负载均衡模块,用于通过所述数据管理处理器根据预设的负载均衡算法计算每个所述缓存队列的负载指数,并依据所述负载指数确定每个所述缓存队列的队列优先级;A load balancing module, configured to calculate a load index of each cache queue according to a preset load balancing algorithm through the data management processor, and determine a queue priority of each cache queue according to the load index; 命令处理模块,通过所述数据管理处理器按照所述队列优先级从所述缓存队列中选取目标缓存队列,对所述目标缓存队列中的目标命令进行处理。The command processing module selects a target cache queue from the cache queues according to the queue priority through the data management processor, and processes the target command in the target cache queue. 9.一种电子设备,其特征在于,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至7中任一项所述的基于双端口固态硬盘的数据处理方法。9. An electronic device, characterized in that it comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data processing method based on a dual-port solid-state hard drive as described in any one of claims 1 to 7 is implemented. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的基于双端口固态硬盘的数据处理方法。10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the data processing method based on a dual-port solid-state hard disk according to any one of claims 1 to 7 is implemented.
CN202410805650.7A 2024-06-20 2024-06-20 A data processing method, device and equipment based on dual-port solid state hard disk Pending CN118642849A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410805650.7A CN118642849A (en) 2024-06-20 2024-06-20 A data processing method, device and equipment based on dual-port solid state hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410805650.7A CN118642849A (en) 2024-06-20 2024-06-20 A data processing method, device and equipment based on dual-port solid state hard disk

Publications (1)

Publication Number Publication Date
CN118642849A true CN118642849A (en) 2024-09-13

Family

ID=92662582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410805650.7A Pending CN118642849A (en) 2024-06-20 2024-06-20 A data processing method, device and equipment based on dual-port solid state hard disk

Country Status (1)

Country Link
CN (1) CN118642849A (en)

Similar Documents

Publication Publication Date Title
CN107967124B (en) Distributed persistent memory storage system and method
US10248322B2 (en) Memory system
US9092426B1 (en) Zero-copy direct memory access (DMA) network-attached storage (NAS) file system block writing
EP3382557B1 (en) Method and apparatus for persistently caching storage data in a page cache
US11922537B2 (en) Resiliency schemes for distributed storage systems
CN110096220B (en) Distributed storage system, data processing method and storage node
TW200846910A (en) Hints model for optimization of storage devices connected to host and write optimization schema for storage devices
CN103678149B (en) Data processing method and device
JP6652647B2 (en) Storage system
CN110457261A (en) Data access method, device and server
US10872036B1 (en) Methods for facilitating efficient storage operations using host-managed solid-state disks and devices thereof
JP5381713B2 (en) Data storage system for virtual machine, data storage method, and data storage program
WO2021174698A1 (en) Virtual machine snapshot creation method and apparatus, and storage medium and computer device
US11789634B2 (en) Systems and methods for processing copy commands
WO2016059715A1 (en) Computer system
CN118642849A (en) A data processing method, device and equipment based on dual-port solid state hard disk
US8234651B2 (en) Information processing method and apparatus using the same
EP4227790B1 (en) Systems, methods, and apparatus for copy destination atomicity in devices
CN114489465A (en) Method, network device and computer system for data processing using network card
CN120045493B (en) A host bus adapter, control method and related equipment
CN116302007B (en) Disk array firmware upgrade method, device, equipment, medium and disk array card
JP7580501B2 (en) Image distribution method, electronic device and storage medium
US11940938B2 (en) Hypervisor bridging of different versions of an IO protocol
CN113568567B (en) Method for seamless migration of simple storage service by index object, main device and storage server
CN112199044B (en) Multi-tenant-oriented FTL setting method, system, computer program and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination