A storage device data transmission acceleration method, device and system

By dynamically adjusting the mapping relationship between the IO queue and the processing engine in the NVMe device, the problem of low data transmission performance of the NVMe device is solved, load balancing and reliability improvement are achieved, and the continuity of data transmission is ensured in the event of hardware failure.

CN116521375BActive Publication Date: 2026-11-24SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310624406.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-11-24
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

In existing technologies, NVMe devices lack a load balancing mechanism during data transmission, resulting in low IO queue polling efficiency and an inability to dynamically allocate hardware or software processing engine resources, leading to poor data transmission performance.

Method used

By obtaining the priority and actual bandwidth of the host I/O queue, the mapping relationship between the I/O queue and the software processing engine and the hardware processing engine is dynamically adjusted to achieve load balancing. This includes reconfiguring the mapping between the I/O queue polling thread and the module, and switching to the software processing engine to continue processing requests in the event of hardware failure.

Benefits of technology

It improves the data transmission performance and speed of NVMe devices, achieves load balancing, enhances data transmission reliability, and ensures that business software does not run normally in the event of hardware failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521375B_ABST
    Figure CN116521375B_ABST
Patent Text Reader

Abstract

This invention proposes a method for accelerating data transmission in storage devices, operating in a storage device including a hardware processing engine and a software processing engine. The method includes: obtaining the priority and actual bandwidth of the host I / O queue; dynamically adjusting the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine based on the priority and actual bandwidth of the host I / O queue, to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine. This invention also proposes a storage device data transmission acceleration apparatus and system, effectively improving the data transmission performance and speed of NVMe devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of storage devices, and in particular to a method, apparatus and system for accelerating data transmission in storage devices. Background Technology

[0002] Backup technology is a method that restores erroneous data to its original form by using data copies or data checksums, thereby ensuring data integrity. It is commonly used in computer systems. Common backup technologies include data copy or data checksum storage based on algorithms such as compression / decompression, erasure coding / decoding, and redundant disk arrays. Data copies or checksums are used to restore data that has been lost due to data errors during transmission or storage media failure to its original form.

[0003] With the development of information technologies such as big data, cloud computing, and the Internet of Things, the volume of various types of data is growing explosively, placing increasingly higher demands on the data transmission and storage performance of data center servers. To improve data transmission and storage performance, many companies have developed high-speed data storage devices such as NVMe SSDs (Solid State Disks or Solid State Drives) and NVMe network cards based on the NVMe protocol. These devices define a set of management and IO request / response queue interfaces that enable the host to submit IO request commands and process IO responses to devices in a high-concurrency, asynchronous manner.

[0004] The typical method for accelerating NVMe devices is to implement an NVMe protocol acceleration engine in hardware. By leveraging the hardware pipeline execution characteristics, various commands and data transmission details of the NVMe protocol are implemented in hardware circuits. Under the control of clock signals, the various processing stages of the NVMe protocol are executed in parallel by hardware digital logic circuits. Compared with the traditional NVMe protocol based on pure software implementation, this can significantly improve the protocol execution speed, thereby improving the data transmission performance of devices based on the NVMe protocol.

[0005] This approach can effectively improve the data transfer performance of NVMe devices, but the following problems still exist:

[0006] The system lacks a load balancing mechanism. Because the NVMe protocol requires devices to poll multiple host IO queues to obtain IO commands, when an NVMe device contains multiple NVMe protocol hardware processing engines or software processing engines, the NVMe device cannot dynamically allocate the corresponding number of NVMe protocol hardware processing engine resources or software processing engine resources to the host IO queues based on the actual bandwidth differences of the host IO queues. This results in low polling efficiency of the host IO queues, low data transmission performance of the NVMe device, and slow data transmission speed of the NVMe device. Summary of the Invention

[0007] In order to solve the problems existing in the prior art, this invention innovatively proposes a method, device and system for accelerating data transmission of storage devices, which effectively solves the problem of low data transmission performance of NVMe devices caused by the prior art, effectively improves the data transmission performance of NVMe devices and increases the data transmission speed of NVMe devices.

[0008] The first aspect of this invention provides a method for accelerating data transfer in a storage device, operating in a storage device including a hardware processing engine and a software processing engine, comprising:

[0009] Obtain the priority and actual bandwidth of the host I / O queue;

[0010] Based on the priority of the host I / O queue and the actual bandwidth, the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine is dynamically adjusted to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine.

[0011] Optionally, the step of dynamically adjusting the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine based on the priority of the host I / O queue and the actual bandwidth, in order to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine, specifically includes:

[0012] Based on the priority of the host IO queue and the actual bandwidth, reconfigure the mapping relationship between multiple IO queue polling threads in the software processing engine and / or between multiple IO queue polling modules in the hardware processing engine;

[0013] The newly received host I / O queue information is configured to be used by a specific I / O queue polling thread in the software processing engine or a specific I / O queue polling module in the hardware processing engine. The configured I / O queue polling thread in the software processing engine or the I / O queue polling module in the hardware processing engine then processes the newly received host I / O queue.

[0014] Optionally, the reconfiguration of the mapping relationship between multiple IO queue polling threads in the software processing engine and / or between multiple IO queue polling modules in the hardware processing engine based on the priority of the host IO queue and the actual bandwidth specifically includes:

[0015] Sort all host I / O queues from highest to lowest priority, and sort host I / O queues with the same priority from highest to lowest average bandwidth.

[0016] Time slices are allocated to each I / O queue based on the actual bandwidth of the host I / O queue and the total number of time slices; each time slice consists of several clock cycles.

[0017] When the time slice allocated to a host I / O queue spans one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to valid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread require locking. When the time slice allocated to a host I / O queue does not span one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to invalid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread do not require locking.

[0018] Furthermore, before sorting all host I / O queues according to priority from high to low, the process also includes:

[0019] Initialize the software processing engine and the hardware processing engine.

[0020] Furthermore, the initialization of the software processing engine and the hardware processing engine specifically includes:

[0021] Distribute all host I / O queues evenly among all I / O queue polling threads and all I / O queue polling modules;

[0022] Invalidate the atomic locks of all host I / O queues, and distribute the defined total number of time slices equally among all I / O queue polling threads and all I / O queue polling modules;

[0023] The number of clock cycles is monitored. When the cumulative number of clock cycles meets the first preset time interval, the number of monitored clock cycles is reset to zero, monitoring is stopped, and the average bandwidth and priority information of each host IO queue are obtained.

[0024] Furthermore, it also includes:

[0025] When the cumulative clock cycle meets the second preset time interval, the number of monitored clock cycles is cleared to zero, monitoring is stopped, and the host IO queue corresponding to the current time slice is obtained.

[0026] If the atomic lock of the host I / O queue is valid, access the host I / O queue with the lock; if the atomic lock of the host I / O queue is invalid, access the host I / O queue without the lock.

[0027] Calculate and update the average bandwidth of the host I / O queue corresponding to the current time slice.

[0028] Optionally, allocating time slices to each IO queue according to the actual bandwidth of the host IO queue and the total number of time slices specifically involves:

[0029] The number of time slices to be allocated to each host I / O queue is the actual bandwidth of that host I / O queue / the total bandwidth of all host I / O queues * the total number of time slices.

[0030] Optionally, before allocating time slices to each IO queue according to the actual bandwidth of the host IO queue and the total number of time slices, wait for all IO queue polling modules and / or IO queue polling threads to stop running; when the time slices of the IO queue polling module or IO queue polling thread corresponding to a certain host IO queue have been allocated, start the IO queue polling module or IO queue polling thread corresponding to that host IO queue; when the time slices of the IO queue polling modules and / or IO queue polling threads corresponding to all host IO queues have been allocated, re-monitor the number of clock cycles.

[0031] Optionally, it also includes:

[0032] In the event of a hardware processing engine failure, a processing engine switch is performed, and the software processing engine continues to handle host I / O queue requests.

[0033] Optionally, it also includes:

[0034] In the event of a hardware processing engine failure, a processing engine switch is performed, and the software processing engine continues to handle host I / O queue requests.

[0035] A second aspect of the present invention provides a data transfer acceleration device for a storage device, operating in a storage device including a hardware processing engine and a software processing engine, comprising:

[0036] The acquisition unit retrieves the priority and actual bandwidth of the host I / O queue.

[0037] The adjustment unit dynamically adjusts the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine, based on the priority of the host I / O queue and the actual bandwidth, in order to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine.

[0038] A third aspect of the present invention provides a data transmission acceleration system for a storage device, characterized in that it includes a storage device and a host, the host being used to create a host I / O queue and a management queue, the storage device including a hardware processing engine, a software processing engine, and a software management command processing module, the software management command processing module being used to obtain the priority and actual bandwidth of the host I / O queue, and to manage the host I / O queue through the management queue; based on the priority and actual bandwidth of the host I / O queue, dynamically adjusting the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine, so as to achieve load balancing of the host I / O queue relative to the multiple I / O queue polling threads in the software processing engine and / or the multiple I / O queue polling modules in the hardware processing engine.

[0039] Optionally, the storage device further includes a register module, which includes several registers, one register corresponding to each host I / O queue, for use with the I / O queue address corresponding to the host I / O command.

[0040] Furthermore, the software management command processing module also includes an initialization module and a management queue polling thread module. The initialization module is used to initialize the hardware processing engine and the software processing engine. The management queue polling thread module is used to dynamically adjust the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and multiple IO queue polling modules in the hardware processing engine according to the priority and actual bandwidth of the host IO queue, so as to achieve load balancing between the host IO queue and the multiple IO queue polling threads and modules in the software processing engine.

[0041] Furthermore, the hardware processing engine includes several IO queue polling modules and a hardware load balancing module. The IO queue polling modules are used to poll several host IO queues. The hardware load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling modules in the hardware processing engine according to the priority of the host IO queues and the actual bandwidth, so as to achieve load balancing between the host IO queues and the multiple IO queue polling modules in the hardware processing engine.

[0042] Optionally, the software processing engine includes several IO queue polling threads and a software load balancing module. The IO queue polling threads are used to poll several host IO queues. The software load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling threads in the software processing engine according to the priority and actual bandwidth of the host IO queues, so as to achieve load balancing between the host IO queues and the multiple IO queue polling threads in the software processing engine.

[0043] Optionally, the hardware processing engine further includes a first timer module, which is used to monitor the number of polling clock cycles corresponding to the IO queue polling module; the software processing engine further includes a second timer module, which is used to monitor the number of polling clock cycles corresponding to the IO queue polling thread.

[0044] Optionally, the hardware processing engine further includes a module status register, which stores the abnormal status of the IO queue polling module in the hardware processing engine and the IO queue parameters processed by the IO queue polling module.

[0045] Furthermore, the software processing engine also includes a backup thread allocation module, which is used to allocate backup threads from the idle thread pool to replace the hardware processing engine that has encountered an exception. The number of IO queue polling backup threads is the same as the number of IO queue polling modules in the hardware processing engine, and the IO queue polling backup threads continue to execute the unfinished and subsequent host IO queues.

[0046] Furthermore, the software management command processing module also includes a module status monitoring module. The module status monitoring module is used to read the module status register after the interrupt signal is triggered, obtain the status register information of the abnormal IO queue polling module in the hardware processing engine, notify the backup thread allocation module to allocate the IO queue polling backup thread, and let the IO queue polling backup thread continue to execute the incomplete abnormal IO queue polling module and subsequent host IO queues.

[0047] Furthermore, the module status monitoring module in the software management command processing module reads the module status register. When it finds that all IO queue polling modules in the hardware processing engine are in an abnormal state, it notifies the software management command processing module to switch the processing engine so that the software processing engine can continue to process all host IO queue requests.

[0048] The technical solution adopted in this invention has the following technical effects:

[0049] 1. In the technical solution of this invention, the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine is dynamically adjusted according to the priority of the host IO queue and the actual bandwidth. This is used to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine. This effectively solves the problem of low data transmission performance of NVMe devices caused by existing technologies, effectively improves the data transmission performance of NVMe devices, and increases the data transmission speed of NVMe devices.

[0050] 2. The technical solution of this invention can not only achieve load balancing between the host IO queue and the multiple IO queue polling threads in the software processing engine or between the host IO queue and the multiple IO queue polling modules in the hardware processing engine, but also achieve load balancing between the host IO queue and the IO queue polling threads in the software processing engine and between the IO queue polling modules in the hardware processing engine, thereby further improving the data transmission performance of NVMe devices.

[0051] 3. In the technical solution of this invention, since the NVMe protocol is implemented by both hardware and software and can be backed up to each other, when the NVMe protocol hardware processing engine is abnormal, the processing engine is switched and the software processing engine continues to process the host IO queue requests. The entire NVMe data transmission will not be interrupted and will not affect all business software related to NVMe data transmission, thereby improving the data transmission reliability of NVMe devices.

[0052] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1This is a flowchart illustrating the method of Embodiment 1 in the present invention;

[0055] Figure 2 This is a flowchart illustrating step S2 in the method of Embodiment 1 of the present invention;

[0056] Figure 3 This is a schematic diagram of the time slice, IO queue, and IO queue polling module / IO queue polling thread (load balancing algorithm principle) in the method of Embodiment 1 of the present invention.

[0057] Figure 4 This is a flowchart illustrating step S21 in the method of Embodiment 1 of the present invention;

[0058] Figure 5 This is another flowchart illustrating step S21 in the method of Embodiment 1 of the present invention;

[0059] Figure 6 This is a flowchart illustrating step S210 in the method of Embodiment 1 of the present invention;

[0060] Figure 7 This is a schematic diagram of the execution flow of the load balancing algorithm in Embodiment 1 of the present invention;

[0061] Figure 8 This is another flowchart illustrating step S210 in the method of Embodiment 1 of the present invention;

[0062] Figure 9 This is another flowchart illustrating the method of Embodiment 1 in the present invention;

[0063] Figure 10 This is a schematic diagram of the device in Embodiment 2 of the present invention;

[0064] Figure 11 This is a schematic diagram of the system structure in Embodiment 3 of the present invention. Detailed Implementation

[0065] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.

[0066] Example 1

[0067] like Figure 1 As shown, the present invention provides a method for accelerating data transfer in a storage device, which operates in a storage device including a hardware processing engine and a software processing engine, and includes:

[0068] S1, obtain the priority and actual bandwidth of the host IO queue;

[0069] S2 dynamically adjusts the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine, based on the priority of the host IO queue and the actual bandwidth, in order to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine.

[0070] Among them, such as Figure 2 As shown, in step S2, the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine is dynamically adjusted according to the priority of the host I / O queue and the actual bandwidth. This is used to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine and / or multiple I / O queue polling modules in the hardware processing engine. Specifically, this includes:

[0071] S21, based on the priority of the host IO queue and the actual bandwidth, reconfigure the mapping relationship between multiple IO queue polling threads in the software processing engine and / or between multiple IO queue polling modules in the hardware processing engine;

[0072] S22, the newly received host IO queue information is configured to a certain IO queue polling thread in the software processing engine or a certain IO queue polling module in the hardware processing engine, and the newly received host IO queue is processed by the configured IO queue polling thread in the software processing engine or the IO queue polling module in the hardware processing engine.

[0073] like Figures 3-4 As shown, step S21 specifically includes:

[0074] S211, sort all host I / O queues according to priority from high to low ( Figure 3 (S002) Sort host I / O queues of the same priority from highest to lowest according to average bandwidth. Figure 3 (S003);

[0075] S212, allocate time slices to each IO queue according to the actual bandwidth of the host IO queue and the total number of time slices; whereby each time slice includes several clock cycles ( Figure 3 (S004);

[0076] S213. Determine whether the time slice allocated to a host IO queue spans one IO queue polling module and one IO queue polling thread, or two IO queue polling modules, or two IO queue polling threads. If the determination result is yes, proceed to step S214; if the determination result is no, proceed to step S215.

[0077] S214, set the atomic lock of the host IO queue to be valid. When the IO queue polling module or IO queue polling thread accesses the host IO queue, the lock must be acquired.

[0078] S215, invalidate the atomic lock on the host I / O queue. Subsequent I / O queue polling modules or threads accessing the host I / O queue will not require locking. Figure 3 S005 corresponds to Figure 4 (S213-S215).

[0079] like Figure 5 As shown, before step S211, the procedure further includes:

[0080] S210 initializes both the software processing engine and the hardware processing engine.

[0081] like Figure 6 As shown, step S210 specifically includes:

[0082] S2101 distributes all host IO queues equally to all IO queue polling threads and all IO queue polling modules;

[0083] S2102, invalidate the atomic locks of all host IO queues, and distribute the defined total number of time slices equally among all IO queue polling threads and all IO queue polling modules;

[0084] S2103 monitors the number of clock cycles. When the cumulative clock cycles meet the first preset time interval, the number of monitored clock cycles is cleared to zero, monitoring is stopped, and the average bandwidth and priority information of each host IO queue are obtained.

[0085] In step S2102, the atomic locks of all host I / O queues are set to invalid. Then, the total number of I / O queue polling modules in the hardware processing engine and I / O queue polling threads in the software processing engine is defined as m. The size of each time slice is defined as P clock cycles. A total of n time slices are defined, and the total number of time slices is evenly distributed to all I / O queue polling threads and all I / O queue polling modules. That is, each I / O queue polling module or I / O queue polling thread will rotate in an average of n / m time slices. A time slice identifier array is constructed using n time slice identifiers.

[0086] By configuring the enable register / flag in the timer module of the hardware processing engine or the timer module of the software processing engine to 1, the timer module in the hardware processing engine or the timer module of the software processing engine is started. Then, by configuring the enable register / flag in all IO queue polling modules and IO queue polling threads to 1, the IO queue polling modules and IO queue polling threads (i.e., IO queue polling modules and / or IO queue polling threads) are started.

[0087] like Figure 3 As shown, based on the time-slice round-robin algorithm, the IO queue polling module or IO queue polling thread is configured to rotate in units of several time slices. Each time slice consists of several clock cycles, and one rotation processes several IO queues. Figure 3 (S001).

[0088] like Figure 7 As shown, before step S211, after starting, the IO queue polling module or IO queue polling thread determines whether the clock signal is valid and whether the enable register / flag of the IO queue polling module and IO queue polling thread is 1. If the clock signal is valid and the enable register / flag of the IO queue polling module and IO queue polling thread is 1, the clock cycle count is incremented by 1. Then, it is determined whether the cumulative clock cycle count has reached the preset time slice size (i.e., the cumulative clock cycle count is not less than the number of clock cycles included in the preset time slice). If the cumulative clock cycle count has reached the preset time slice size, the current clock cycle count is cleared to zero, and the process switches to the next time slice. Otherwise, do not switch the current time slice; obtain the host I / O queue corresponding to the current time slice, and determine whether the atomic lock of the host I / O queue corresponding to the current time slice is valid. If the atomic lock is valid, acquire the lock and access the host I / O queue. If the lock cannot be acquired, spin idle, and calculate and update the average bandwidth of the host I / O queue. If the atomic lock is invalid, access the host I / O queue without the lock, and calculate and update the average bandwidth of the host I / O queue. Until the clock signal is invalid, or the enable register / flag of the I / O queue polling module and the I / O queue polling thread is not 1, the status register indicates that the I / O queue polling module and the I / O queue polling thread have stopped running.

[0089] After the IO queue polling module and IO queue polling thread stop running, the timer module (which can be a timer module in the hardware processing engine or a timer module in the software processing engine, with corresponding execution steps) checks whether the clock signal is valid and sets the timer module's enable register / flag to 1 after starting. If the clock signal is valid and the timer module's enable register / flag is 1, it increments the clock cycle count by 1 and checks whether the accumulated clock count has reached the preset algorithm time interval (i.e., triggering load balancing adjustment, dynamically adjusting the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine). If the algorithm time interval has been reached, it clears the clock cycle count to zero and stops running by configuring the timer module's enable register / flag to 0.

[0090] After the timer module stops running, the priority and average bandwidth information of each host IO queue are queried, and step S211 is executed. After step S211, the operation of all IO queue polling modules and / or all IO queue polling threads is stopped by configuring the enable register / flag of all IO queue polling modules and / or all IO queue polling threads to 0. After all IO queue polling modules and / or all IO queue polling threads have stopped running, step S212 is executed. Specifically, it is determined whether all host IO queues have been allocated all time slices. If there are host IO queues that have not been allocated time slices, the process switches to the next host IO queue to be allocated time slices. Time slices are allocated to the IO queues to be allocated time slices according to the actual bandwidth of the host IO queues and the total number of time slices. When a host IO queue to be allocated time slices has been allocated all time slices, the IO queue polling module or IO queue polling thread corresponding to that host IO queue is started. This continues until all host IO queues have been allocated time slices. The timer module is restarted by configuring the enable register / flag of the timer module to 1.

[0091] In step S211, all host I / O queues are evenly distributed among all I / O queue polling threads and all I / O queue polling modules; such as Figure 3 As shown, the I / O queues that are further to the right along the X-axis represent lower I / O queue priorities; then, host I / O queues with the same priority are sorted from highest to lowest according to average bandwidth, as follows: Figure 3 The wider the IO queue along the X direction, the greater the average data transfer bandwidth of the queue.

[0092] Furthermore, such as Figure 8 As shown, step S210 further includes:

[0093] S2104: When the accumulated clock cycle meets the second preset time interval, the number of monitored clock cycles is cleared to zero, monitoring is stopped, and the host IO queue corresponding to the current time slice is obtained.

[0094] S2105, Determine whether the atomic lock of the host IO queue is valid. If the result is yes, proceed to step S2106. If the result is no, proceed to step S2107.

[0095] S2106, Lock access to the host's I / O queue;

[0096] S2107, Lock-free access to the host's I / O queue;

[0097] S2108: Calculate and update the average bandwidth of the host IO queue corresponding to the current time slice.

[0098] Specifically, in step S212, allocating time slices to each IO queue according to the actual bandwidth of the host IO queue and the total number of time slices is as follows:

[0099] The number of time slices to be allocated to each host I / O queue is the actual bandwidth of that host I / O queue / the total bandwidth of all host I / O queues * the total number of time slices.

[0100] Based on a greedy algorithm, time slices are allocated to each I / O queue according to the actual bandwidth of the host I / O queue and the total number of time slices; each time slice consists of several clock cycles. Figure 3 (S004).

[0101] Specifically, calculate the number of time slots to be allocated for the current host IO queue based on the current host IO queue bandwidth / total bandwidth of all IO queues * total number of time slots n. Starting from the position (number of allocated time slots + 1) in the time slot identifier array, allocate c time slots to the current host IO queue and increase the number of allocated time slots by c.

[0102] Furthermore, before allocating time slices to each IO queue according to the actual bandwidth of the host IO queue and the total number of time slices, wait for all IO queue polling modules and / or IO queue polling threads to stop running; when the time slices of the IO queue polling module or IO queue polling thread corresponding to a certain host IO queue have been allocated, start the IO queue polling module or IO queue polling thread corresponding to that host IO queue; when the time slices of the IO queue polling modules and / or IO queue polling threads corresponding to all host IO queues have been allocated, re-monitor the number of clock cycles.

[0103] The system obtains the average data transfer bandwidth and priority information for each IO command request queue. After waiting for all IO queue polling modules or IO queue polling threads to stop working, it executes a load balancing algorithm based on the priority and bandwidth information of all IO queues. It then recalculates the mapping relationship between IO queues and IO queue polling modules or IO queue polling threads, configures the new IO queue information to the IO queue polling modules or IO queue polling threads, and finally enables the IO queue polling modules or IO queue polling threads to process subsequent IO commands according to the new mapping relationship.

[0104] like Figure 9 As shown, the present invention also provides a method for accelerating data transmission in a storage device, which further includes:

[0105] S3 switches the processing engine when the hardware processing engine malfunctions, allowing the software processing engine to continue processing host I / O queue requests.

[0106] In step S3, when a hardware engine malfunctions due to hardware design issues or circuit losses (e.g., detecting IO commands in the host IO queue but being unable to process or handle them), the NVMe storage device executes the following process:

[0107] Add the abnormal hardware engine identifier to the list of abnormal modules;

[0108] The system retrieves parameters such as the configured IO queue priority, host memory address, and currently processed IO commands corresponding to the abnormal hardware engine, updates them to the module status register, and then notifies the storage device software using an interrupt signal.

[0109] The storage device software, acting as an interrupt handler, reads the module status register and obtains the status register information of the abnormal hardware engine after being triggered by an interrupt signal.

[0110] The backup thread allocation module is notified to allocate one software I / O queue polling thread to replace the hardware I / O queue polling module that encountered an exception.

[0111] The backup thread allocation module allocates one thread from the idle thread pool and configures the module status register information, such as the configured IO queue priority, host memory address, and currently processed IO commands, into the new thread. The new thread then continues to execute unfinished commands and commands subsequently written to the IO queue.

[0112] The technical solution of this invention dynamically adjusts the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine based on the priority of the host IO queue and the actual bandwidth. This is used to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine. This effectively solves the problem of low data transmission performance of NVMe devices caused by existing technologies, effectively improves the data transmission performance of NVMe devices, and increases the data transmission speed of NVMe devices.

[0113] The technical solution of this invention can not only achieve load balancing between the host IO queue and the multiple IO queue polling threads in the software processing engine or between the host IO queue and the multiple IO queue polling modules in the hardware processing engine, but also achieve load balancing between the host IO queue and the IO queue polling threads in the software processing engine and between the IO queue polling modules in the hardware processing engine, thereby further improving the data transmission performance of NVMe devices.

[0114] In the technical solution of this invention, since the NVMe protocol is implemented by both hardware and software and can be backed up to each other, when the NVMe protocol hardware processing engine is abnormal, the processing engine is switched and the software processing engine continues to process the host IO queue requests. The entire NVMe data transmission will not be interrupted and will not affect all business software related to NVMe data transmission, thereby improving the data transmission reliability of NVMe devices.

[0115] Example 2

[0116] like Figure 10 As shown, the present invention also provides a data transmission acceleration device for storage devices, which operates in a storage device including a hardware processing engine and a software processing engine, comprising:

[0117] Unit 101 retrieves the priority and actual bandwidth of the host I / O queue;

[0118] Adjustment unit 102 dynamically adjusts the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine, based on the priority of the host IO queue and the actual bandwidth, in order to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine.

[0119] The storage device data transmission acceleration device in the technical solution of this invention corresponds one-to-one with a method in the embodiment, which will not be described in detail here.

[0120] The technical solution of this invention dynamically adjusts the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine based on the priority of the host IO queue and the actual bandwidth. This is used to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine. This effectively solves the problem of low data transmission performance of NVMe devices caused by existing technologies, effectively improves the data transmission performance of NVMe devices, and increases the data transmission speed of NVMe devices.

[0121] The technical solution of this invention can not only achieve load balancing between the host IO queue and the multiple IO queue polling threads in the software processing engine or between the host IO queue and the multiple IO queue polling modules in the hardware processing engine, but also achieve load balancing between the host IO queue and the IO queue polling threads in the software processing engine and between the IO queue polling modules in the hardware processing engine, thereby further improving the data transmission performance of NVMe devices.

[0122] In the technical solution of this invention, since the NVMe protocol is implemented by both hardware and software and can be backed up to each other, when the NVMe protocol hardware processing engine is abnormal, the processing engine is switched and the software processing engine continues to process the host IO queue requests. The entire NVMe data transmission will not be interrupted and will not affect all business software related to NVMe data transmission, thereby improving the data transmission reliability of NVMe devices.

[0123] Example 3

[0124] like Figure 11 As shown, the present invention also provides a storage device data transmission acceleration system, including a storage device (NVMe device, S05) and a host (i.e., host NVMe driver, S01). The host is used to create a host IO queue (S02 / S04) and a management queue (S03). The storage device includes a hardware processing engine (S09), a software processing engine (S014), and a software management command processing module (S011). The software management command processing module is used to obtain the priority and actual bandwidth of the host IO queue, and to manage the host IO queue through the management queue. According to the priority and actual bandwidth of the host IO queue, the mapping relationship between the host IO queue and multiple IO queue polling threads (S015) in the software processing engine and / or multiple IO queue polling modules (S010) in the hardware processing engine is dynamically adjusted to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine.

[0125] in, Figure 11 In this diagram, S01 is the host-side driver for adapting to the NVMe device, i.e., the host NVMe driver; S02 is the set of host IO command request / response queues polled and processed by the NVMe device's internal hardware processing engine (hardware IO command processing engine); S03 is the set of host management command request / response queues processed by the NVMe device's internal software; S04 is the set of host IO command request / response queues polled and processed by the NVMe device's internal software processing engine (software IO command processing engine); S05 is the NVMe storage device externally connected to the host and running the NVMe device-side protocol; S09 is the hardware processing engine inside the NVMe device that processes host IO commands, containing several IO queue polling modules S010.

[0126] S010 is a hardware module that polls several host I / O command request / response queues, and includes the following sub-modules:

[0127] a) Module enable, used to start the module running;

[0128] b) Several queue configuration interfaces for configuring the host memory addresses of several IO queues;

[0129] c) Command reading, used to read IO commands from the host IO command request queue;

[0130] d) Command parsing, used to parse command types;

[0131] e) Command execution, used to perform specific processing based on the command type;

[0132] f) Data read / write, used to read and write data between the host and Flash memory when the command data pointer is not null;

[0133] g) Response generation, used to generate IO command request result information;

[0134] h) Response writing, used to write IO command response information to the host IO command response queue;

[0135] i) Performance monitoring, used to calculate average bandwidth based on the data length information of commands within the IO queue;

[0136] j) Module reset, used to reset the module registers and state machine to the default state.

[0137] S011 is a software module inside the NVMe device that processes host management commands.

[0138] S014 is the software processing engine for handling host I / O commands inside the NVMe device, and it contains several I / O queue polling modules S015.

[0139] S015 is a software module that polls several host I / O command request / response queues, and includes the following sub-modules:

[0140] a) Thread enabling, used to start thread execution;

[0141] b) Several queue configuration interfaces for configuring the host memory addresses of several IO queues;

[0142] c) Command reading, used to read IO commands from the host IO command request queue;

[0143] d) Command parsing, used to parse command types;

[0144] e) Command execution, used to perform specific processing based on the command type;

[0145] f) Data read / write, used to read and write data between the host and Flash memory when the command data pointer is not null;

[0146] g) Response generation, used to generate IO command request result information;

[0147] h) Response writing, used to write IO command response information to the host IO command response queue;

[0148] i) Performance monitoring, used to calculate average bandwidth based on the data length information of commands within the IO queue;

[0149] j) Thread reset, used to reset the thread registers and state machine to the default state.

[0150] The software management command processing module also includes a register module, which comprises several registers, one register corresponding to each host I / O queue, used for the I / O queue address of the host I / O command. The registers include a request queue element position register, a response queue element position register, and a request / management queue host memory address register.

[0151] Specifically, S06 indicates that the software management command processing module has written the DellBell register (a method in which software notifies hardware of the queue read / write position when software and hardware interact through queues; by updating the hardware's queue DellBell register, the software can notify the hardware of the currently written / read queue element position) to the IO / management command request queue element position. Each IO / management command request queue contains one DellBell register of this type. S07 indicates that the software has read the DellBell register of the IO / management command response queue element position. Each IO / management command response queue contains one DellBell register of this type. S08 indicates the register of the host memory address of the management command request / response queue. According to the NVMe standard, only the host memory address of the management command request / response queue needs to be configured into the device register by the host software. The host memory address of the IO command request / response queue needs to be submitted to the management command request queue by the host software with an "IO queue creation" command. Then, the DellBell register of the management command request queue is configured to inform the device to read the command. The storage device extracts the IO queue address from the command and saves the queue address to the internal storage space.

[0152] Preferably, the software management command processing module further includes an initialization module (S012) and a management queue polling thread module (S013). The initialization module is used to initialize the hardware processing engine and the software processing engine. The management queue polling thread module is used to poll the host management command request / response IO queue. Based on the priority of the host IO queue and the actual bandwidth, the mapping relationship between the host IO queue and the multiple IO queue polling threads in the software processing engine and the multiple IO queue polling modules in the hardware processing engine is dynamically adjusted to achieve load balancing between the host IO queue and the multiple IO queue polling threads in the software processing engine and the multiple IO queue polling modules in the hardware processing engine.

[0153] The hardware processing engine includes several IO queue polling modules and a hardware load balancing module. The IO queue polling modules are used to poll several host IO queues. The hardware load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling modules in the hardware processing engine according to the priority of the host IO queues and the actual bandwidth, so as to achieve load balancing between the host IO queues and the multiple IO queue polling modules in the hardware processing engine.

[0154] The software processing engine includes several IO queue polling threads and a software load balancing module. The IO queue polling threads are used to poll several host IO queues. The software load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling threads in the software processing engine according to the priority and actual bandwidth of the host IO queues, so as to achieve load balancing between the host IO queues and the multiple IO queue polling threads in the software processing engine.

[0155] The hardware processing engine also includes a first timer module (i.e. Figure 11 In section 5)a), the first timer module is used to monitor the number of polling clock cycles corresponding to the IO queue polling module; the software processing engine also includes a second timer module (i.e. Figure 11 In section 6)a), the second timer module is used to monitor the number of polling clock cycles corresponding to the IO queue polling thread.

[0156] The hardware processing engine also includes a module status register, which stores the abnormal status of the IO queue polling module in the hardware processing engine as well as the IO queue parameters processed by the IO queue polling module.

[0157] The software processing engine also includes a backup thread allocation module, which is used to allocate backup threads from the idle thread pool to replace the hardware processing engine that has encountered an exception. The number of IO queue polling backup threads is the same as the number of IO queue polling modules in the hardware processing engine. The IO queue polling backup threads continue to execute unfinished and subsequent host IO queues.

[0158] Correspondingly, the software management command processing module also includes a module status monitoring module. The module status monitoring module is used to read the module status register after the interrupt signal is triggered, obtain the status register information of the abnormal IO queue polling module in the hardware processing engine, notify the backup thread allocation module to allocate the IO queue polling backup thread, and let the IO queue polling backup thread continue to execute the incomplete abnormal IO queue polling module and subsequent host IO queues.

[0159] Specifically, the module status monitoring module in the software management command processing module reads the module status register. When it finds that all IO queue polling modules in the hardware processing engine are in an abnormal state, it notifies the software management command processing module to switch the processing engine, and the software processing engine continues to process all host IO queue requests.

[0160] Furthermore, the storage device also includes flash memory (S016) for storing host data stored inside the NVMe device.

[0161] The interaction flow between modules in the system is as follows:

[0162] (1) Initialization

[0163] The host NVMe driver executes the NVMe protocol host initialization process, including obtaining the parameter configuration information of the NVMe device and configuring the management request / response queue address to the storage device's internal register module;

[0164] The software management command processing module in the storage device reads the management request / response queue address from the register module, creates a management queue polling thread, and the management queue polling thread continuously executes the following process:

[0165] i. Command reading: Retrieves command content from the host management command request queue via DMA (a hardware data transfer method where the software configures the hardware DMA register interface, configuring the source address, destination address, data length, and transfer direction of data transfer, so that data transfer operations can be performed without CPU involvement).

[0166] ii. Command parsing: Extracting information such as transmission direction, command type, command data address, check data address, starting sector number, and number of sectors from the command content;

[0167] iii. Command execution: Execute the corresponding command based on the command type;

[0168] iv. Data read / write: If the command data address is not empty, then according to the transmission direction, data is transmitted between the host address corresponding to the data address and the NAND flash address corresponding to the starting sector number, in the order of number of sectors * device sector size.

[0169] v, Response generation, generates command response information corresponding to the command request, such as whether the execution was successful;

[0170] vi, Response Write, writes command response information to the host management command response queue via DMA;

[0171] The main thread of the queue polling module in the storage device initializes the hardware processing engine, including resetting the registers of all IO queue polling modules to their default values ​​and configuring the load balancing algorithm strategy to evenly distribute the host IO queues to all queue polling modules;

[0172] The main thread of the queue polling thread module in the storage device initializes the software processing engine, including allocating several threads from the idle thread pool as host IO queue polling threads, resetting the management data of all IO queue polling threads to the default value, and configuring the load balancing algorithm strategy to evenly distribute the host IO queue to all queue polling threads;

[0173] The host NVMe driver creates several IO command request / response queues in memory, and then submits several "IO queue creation" commands to the management command request queue. The commands include information such as IO queue address and IO queue priority. Then, by configuring the device DellBell register corresponding to the management command request queue, the device hardware interrupt signal is triggered to notify the device software of the management commands to be processed.

[0174] In the storage device, the management queue polling thread of the management queue polling module retrieves all commands from the host management command request queue. When the command type is determined to be an IO queue creation command, the IO queue address field is extracted. Based on the FIFO (a hardware queue implementation method, generally with a specific depth indicating the maximum number of queue elements that can be cached) depth of the IO queue polling module, as much IO queue information as possible (including IO queue priority, queue host memory address, etc.) is configured to the IO queue polling module in the hardware processing engine, and the remaining IO queue information is configured to the IO queue polling thread in the software processing engine.

[0175] (2) Hardware data transmission process

[0176] The host writes the "read / write" command to the hardware I / O command request queue managed by the hardware processing engine. All hardware I / O queues in the hardware processing engine poll the modules and execute the same command read and response write process as the management queue polling thread, based on the I / O queue address configured in the module queue configuration FIFO.

[0177] (3) Software data transmission process

[0178] The host writes the "read / write" command to the software IO command request queue managed by the device software processing engine. All software IO queue polling threads in the software processing engine execute the same command read and response write process as the management queue polling thread, based on the IO queue address configured by the thread through the "queue configuration" interface.

[0179] (4) Engine switching process

[0180] When a hardware processing engine failure causes an IO queue polling module to malfunction (e.g., it detects IO commands in the host IO queue but is unable to move or process them), the following process is executed:

[0181] a) The performance monitoring module in the hardware processing engine adds the identifier of the IO queue polling module in the hardware processing engine to the list of abnormal modules;

[0182] b) The hardware processing engine updates the status of the IO queue polling module, including the configured IO queue priority, host memory address, and currently processed IO commands, to the module status register. Then, it uses an interrupt (a notification method for software and hardware interaction, in which the hardware triggers the system interrupt controller driver to call the pre-bound interrupt handling function through a specific interrupt signal line level change, thereby notifying the software to execute specific interrupt handling) signal to notify the software management command processing module.

[0183] c) The module status monitoring module in the software management command processing module acts as an interrupt handler. After being triggered by an interrupt signal, it reads the module status register and obtains the status register information of the IO queue polling module in the hardware engine.

[0184] d) The module status monitoring module notifies the backup thread allocation module to allocate one software IO queue polling thread to replace the hardware IO queue polling module that has encountered an exception;

[0185] e) The backup thread allocation module allocates one thread from the idle thread pool and configures the module status register information, such as the configured IO queue priority, host memory address, and currently processed IO commands, into the new thread, so that the new thread can continue to execute the unfinished commands and the commands subsequently written to the IO queue.

[0186] f) When all IO queue polling modules in the hardware processing engine are in an abnormal state, notify the software management command processing module to switch the processing engine, and let the software processing engine continue to process all host IO queue requests.

[0187] (5) Hardware load balancing process

[0188] The hardware first timer module periodically polls the performance monitoring module of the IO queue module to obtain the average data transmission bandwidth of each IO command request queue processed by the module;

[0189] The "performance monitoring" module of all hardware IO queue polling modules writes the priority and average data transmission bandwidth information of the IO command request queues being processed by the module into the hardware load balancing module.

[0190] The hardware load balancing module is configured and waits for all IO queue polling modules to stop working. Then, based on the priority and bandwidth information of all IO queues, it executes the load balancing algorithm, recalculates the mapping relationship between IO queues and IO queue polling modules, configures the new IO queue information into the IO queue polling module register, and finally enables the IO queue polling module to process subsequent IO commands according to the new mapping relationship.

[0191] (5) Hardware load balancing process (hardware load balancing module)

[0192] The hardware first timer module periodically polls the performance monitoring module of the IO queue module to obtain the average data transmission bandwidth of each IO command request queue processed by the module;

[0193] The "performance monitoring" module of all hardware IO queue polling modules writes the priority and average data transmission bandwidth information of the IO command request queues being processed by the module into the hardware load balancing module.

[0194] The hardware load balancing module is configured and waits for all IO queue polling modules to stop working. Then, based on the priority and bandwidth information of all IO queues, it executes the load balancing algorithm, recalculates the mapping relationship between IO queues and IO queue polling modules, configures the new IO queue information into the IO queue polling module register, and finally enables the IO queue polling module to process subsequent IO commands according to the new mapping relationship.

[0195] (6) Software load balancing process (software load balancing module)

[0196] The second timer module in the software processing engine periodically obtains the average data transmission bandwidth of each IO command request queue processed by the IO queue polling thread from the performance monitoring thread in the IO queue polling thread;

[0197] The performance monitoring thread writes the priority and average data transfer bandwidth information of the IO command request queue being processed by the IO queue polling thread into the software load balancing module.

[0198] The software load balancing module configures and waits for all IO queue polling threads to stop working. Then, based on the priority and bandwidth information of all IO queues, it executes the load balancing algorithm, recalculates the mapping relationship between IO queues and IO queue polling threads, configures the new IO queue information into the IO queue polling thread register, and finally enables the IO queue polling thread to process subsequent IO commands according to the new mapping relationship.

[0199] It should be noted that, for the sake of convenience, the above process only describes the serial execution steps of the hardware module. In actual implementation, the execution steps of the algorithm can be run simultaneously under the control of the clock signal by reasonably designing the pipeline.

[0200] The technical solution of this invention dynamically adjusts the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine based on the priority of the host IO queue and the actual bandwidth. This is used to achieve load balancing between the host IO queue and multiple IO queue polling threads in the software processing engine and / or multiple IO queue polling modules in the hardware processing engine. This effectively solves the problem of low data transmission performance of NVMe devices caused by existing technologies, effectively improves the data transmission performance of NVMe devices, and increases the data transmission speed of NVMe devices.

[0201] The technical solution of this invention can not only achieve load balancing between the host IO queue and the multiple IO queue polling threads in the software processing engine or between the host IO queue and the multiple IO queue polling modules in the hardware processing engine, but also achieve load balancing between the host IO queue and the IO queue polling threads in the software processing engine and between the IO queue polling modules in the hardware processing engine, thereby further improving the data transmission performance of NVMe devices.

[0202] In the technical solution of this invention, since the NVMe protocol is implemented by both hardware and software and can be backed up to each other, when the NVMe protocol hardware processing engine is abnormal, the processing engine is switched and the software processing engine continues to process the host IO queue requests. The entire NVMe data transmission will not be interrupted and will not affect all business software related to NVMe data transmission, thereby improving the data transmission reliability of NVMe devices.

[0203] The system in this invention has high reliability. Since the NVMe protocol is implemented by both hardware and software, they can be backed up to each other. When the NVMe protocol hardware engine fails, the entire NVMe data transmission will not be interrupted and will not affect any business software related to NVMe data transmission.

[0204] The system development and debugging of the present invention is easy. Since the NVMe protocol is relatively complex and difficult to implement through digital logic circuits, the development cycle of the NVMe protocol hardware engine is usually long. When the system consists of many software and hardware modules, and many modules rely on the NVMe protocol hardware engine to work, the NVMe protocol hardware engine will not become a bottleneck for the development and debugging of other modules.

[0205] The system in this invention has good scalability. Since the NVMe protocol is entirely implemented in hardware, when the NVMe protocol hardware engine resources cannot meet the data transmission performance requirements, such as when the queue configuration FIFO is full, the system can effectively utilize the device's idle CPU resources to improve performance.

[0206] The system in this invention has a load balancing mechanism. Since the NVMe protocol requires the device to poll multiple IO queues on the host to obtain IO commands, when the device contains multiple NVMe protocol hardware engines, the device can dynamically allocate the corresponding number of NVMe protocol hardware engine resources to the host IO queues according to the actual bandwidth difference of the host IO queues. Therefore, the polling performance of the host IO queues is higher.

[0207] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for accelerating data transfer of a storage device, characterized by, Running on including hard The storage devices for the component processing engine and the software processing engine include: Obtain the priority and actual bandwidth of the host I / O queue; Dynamically adjust the host I / O queue based on its priority and actual bandwidth. The mapping relationship between multiple I / O queue polling threads in the software processing engine and between the host I / O queue and multiple I / O queue polling modules in the hardware processing engine is used to achieve load balancing between the host I / O queue and the multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and the multiple I / O queue polling modules in the hardware processing engine. Specifically, dynamically adjusting the mapping relationship between the host I / O queue and the multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and the multiple I / O queue polling modules in the hardware processing engine, based on the priority and actual bandwidth of the host I / O queue includes: Sort all host I / O queues from highest to lowest priority, and sort host I / O queues with the same priority from highest to lowest average bandwidth. Time slices are allocated to each I / O queue based on the actual bandwidth of the host I / O queue and the total number of time slices; each time slice consists of several clock cycles. When the time slice allocated to a host I / O queue spans one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to valid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread require locking. When the time slice allocated to a host I / O queue does not span one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to invalid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread do not require locking.

2. The method of claim 1, wherein the step of transmitting the data comprises the step of: The step of dynamically adjusting the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and multiple I / O queue polling modules in the hardware processing engine, based on the priority and actual bandwidth of the host I / O queue, specifically includes: ​ Based on the priority of the host I / O queue and the actual bandwidth, reconfigure the mapping relationship between multiple I / O queue polling threads in the software processing engine and between multiple I / O queue polling modules in the hardware processing engine; The newly received host I / O queue information is configured to be used by a specific I / O queue polling thread in the software processing engine or a specific I / O queue polling module in the hardware processing engine. The configured I / O queue polling thread in the software processing engine or the I / O queue polling module in the hardware processing engine then processes the newly received host I / O queue.

3. The method for accelerating data transmission in a storage device according to claim 1, characterized in that, Before sorting all host I / O queues by priority from high to low, the process also includes: Initialize the software processing engine and the hardware processing engine.

4. The method of claim 3, wherein the step of transmitting the data comprises the step of: transmitting the data at a rate of at least 100 Mbps. The initialization of the software processing engine and the hardware processing engine specifically includes: Distribute all host I / O queues evenly among all I / O queue polling threads and all I / O queue polling modules; Invalidate the atomic locks of all host I / O queues, and distribute the defined total number of time slices equally among all I / O queue polling threads and all I / O queue polling modules; The number of clock cycles is monitored. When the cumulative number of clock cycles meets the first preset time interval, the number of monitored clock cycles is cleared to zero, monitoring is stopped, and the average bandwidth and priority information of each host IO queue are obtained.

5. The method of claim 4, further comprising: include: When the cumulative clock cycle meets the second preset time interval, the number of monitored clock cycles is cleared to zero, monitoring is stopped, and the host IO queue corresponding to the current time slice is obtained. If the atomic lock on the host I / O queue is valid, acquire the lock to access the host I / O queue; If the atomic lock on the host I / O queue is invalid, access the host I / O queue without locking. Calculate and update the average bandwidth of the host I / O queue corresponding to the current time slice.

6. The method of claim 1, wherein the step of transmitting data from the storage device comprises the step of: The specific method for allocating time slices to each I / O queue based on the actual bandwidth of the host I / O queue and the total number of time slices is as follows: ​ The number of time slices to be allocated for each host IO queue is the actual bandwidth of the host IO queue / the total bandwidth of all host IO queues Total number of time slices.

7. The method of claim 4, wherein the step of transmitting the data comprises the step of: transmitting the data at a rate of at least 100 Mbps. Before allocating time slices to each IO queue according to the actual bandwidth and total number of time slices of the host IO queue, wait for all IO queue polling modules and IO queue polling threads to stop running; when the time slices of the IO queue polling module or IO queue polling thread corresponding to a certain host IO queue have been allocated, start the IO queue polling module or IO queue polling thread corresponding to that host IO queue; when the time slices of the IO queue polling modules and IO queue polling threads corresponding to all host IO queues have been allocated, re-monitor the number of clock cycles. ​ 8. The method of claim 1-7, further comprising include: In the event of a hardware processing engine failure, a processing engine switch is performed, and the software processing engine continues to handle host I / O queue requests.

9. A storage device data transfer acceleration apparatus, characterized by, Running on a storage device that includes both hardware and software processing engines, including: The acquisition unit retrieves the priority and actual bandwidth of the host I / O queue. The adjustment unit dynamically adjusts the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and multiple I / O queue polling modules in the hardware processing engine, based on the priority and actual bandwidth of the host I / O queue. This is used to achieve load balancing between the host I / O queue and multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and multiple I / O queue polling modules in the hardware processing engine. Specifically, the dynamic adjustment of the mapping relationship between the host I / O queue and multiple I / O queue polling threads in the software processing engine, and between the host I / O queue and multiple I / O queue polling modules in the hardware processing engine, based on the priority and actual bandwidth of the host I / O queue includes: Sort all host I / O queues from highest to lowest priority, and sort host I / O queues with the same priority from highest to lowest average bandwidth. Time slices are allocated to each I / O queue based on the actual bandwidth of the host I / O queue and the total number of time slices; each time slice consists of several clock cycles. When the time slice allocated to a host I / O queue spans one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to valid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread require locking. When the time slice allocated to a host I / O queue does not span one I / O queue polling module and one I / O queue polling thread, or two I / O queue polling modules, or two I / O queue polling threads, the atomic lock of the host I / O queue is set to invalid. Subsequent accesses to the host I / O queue by either the I / O queue polling module or the I / O queue polling thread do not require locking.

10. A storage device data transfer acceleration system, characterized by, The system includes a storage device and a host. The host is used to create host I / O queues and management queues. The storage device includes a hardware processing engine, a software processing engine, and a software management command processing module. The software management command processing module is used to obtain the priority and actual bandwidth of the host I / O queues and manage the host I / O queues through the management queues. Based on the priority and actual bandwidth of the host I / O queues, the system dynamically adjusts the mapping relationship between the host I / O queues and multiple I / O queue polling threads in the software processing engine, as well as between the host I / O queues and multiple I / O queue polling modules in the hardware processing engine, to achieve load balancing between the host I / O queues and multiple I / O queue polling threads in the software processing engine, and between the host I / O queues and multiple I / O queue polling modules in the hardware processing engine.

11. The system of claim 10, wherein the system is further configured to: The storage device also includes a register module, which includes several registers, one register corresponding to each host I / O queue, and is used for the I / O queue address corresponding to the host I / O command.

12. A data transfer acceleration system for a storage device according to claim 11, characterized in that, The software management command processing module further includes an initialization module and a management queue polling thread module. The initialization module is used to initialize the hardware processing engine and the software processing engine. The management queue polling thread module is used to dynamically adjust the mapping relationship between the host IO queue and multiple IO queue polling threads in the software processing engine and multiple IO queue polling modules in the hardware processing engine according to the priority and actual bandwidth of the host IO queue, so as to achieve load balancing between the host IO queue and the multiple IO queue polling threads and modules in the software processing engine.

13. A data transmission acceleration system for a storage device according to claim 12, characterized in that, The hardware processing engine includes several IO queue polling modules and a hardware load balancing module. The IO queue polling modules are used to poll several host IO queues. The hardware load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling modules in the hardware processing engine according to the priority of the host IO queues and the actual bandwidth, so as to achieve load balancing between the host IO queues and the multiple IO queue polling modules in the hardware processing engine.

14. A data transfer acceleration system for a storage device according to claim 12, characterized in that, The software processing engine includes several IO queue polling threads and a software load balancing module. The IO queue polling threads are used to poll several host IO queues. The software load balancing module is used to dynamically adjust the mapping relationship between the host IO queues and the multiple IO queue polling threads in the software processing engine according to the priority and actual bandwidth of the host IO queues, so as to achieve load balancing between the host IO queues and the multiple IO queue polling threads in the software processing engine.

15. A data transmission acceleration system for a storage device according to claim 12, characterized in that, The hardware processing engine further includes a first timer module, which is used to monitor the number of polling clock cycles corresponding to the IO queue polling module; the software processing engine further includes a second timer module, which is used to monitor the number of polling clock cycles corresponding to the IO queue polling thread.

16. A data transmission acceleration system for a storage device according to claim 12, characterized in that, The hardware processing engine also includes a module status register, which stores the abnormal status of the IO queue polling module in the hardware processing engine and the IO queue parameters processed by the IO queue polling module.

17. A data transmission acceleration system for a storage device according to claim 16, characterized in that, The software processing engine also includes a backup thread allocation module, which is used to allocate backup threads from the idle thread pool to replace the hardware processing engine that has encountered an exception. The number of IO queue polling backup threads is the same as the number of IO queue polling modules in the hardware processing engine. The IO queue polling backup threads continue to execute unfinished and subsequent host IO queues.

18. A data transfer acceleration system for a storage device according to claim 17, characterized in that, The software management command processing module also includes a module status monitoring module. The module status monitoring module is used to read the module status register after the interrupt signal is triggered, obtain the status register information of the abnormal IO queue polling module in the hardware processing engine, notify the backup thread allocation module to allocate the IO queue polling backup thread, and let the IO queue polling backup thread continue to execute the abnormal IO queue polling module that has not been completed and the subsequent host IO queue.

19. A data transmission acceleration system for a storage device according to claim 18, characterized in that, The module status monitoring module in the software management command processing module reads the module status register. When it finds that all IO queue polling modules in the hardware processing engine are in an abnormal state, it notifies the software management command processing module to switch the processing engine so that the software processing engine can continue to process all host IO queue requests.

Citation Information

Patent Citations

  • Providing quality of service in solid state drive

    CN107870820A