Method for scheduling flash queue and related device
By pre-parsing and storing the coprocessor's message instructions in the solid-state drive, the problem of low message instruction resolution when JOB FIFO space is insufficient is solved, and the data processing performance of the solid-state drive is improved.
Patent Information
- Application Number
- CN202411228806.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-02
AI Technical Summary
The coprocessor's message instruction parsing efficiency in solid-state drives is low, resulting in a degradation in data processing performance. It is mainly because when the JOB FIFO space is insufficient, the coprocessor cannot fully utilize its computing power to parse message instructions.
When the target coprocessor communicates with the hardware processing queue and the flash queue module, the unresolved message instructions in the coprocessor message queue are pre-parsed, and the parsed instructions are stored in the preset position, and the hardware queue space is sufficient. Read and process.
It improves the coprocessor's parsing efficiency of message instructions and the scheduling efficiency of flash queues, and improves the data processing performance of solid-state drives.
Smart Images

Figure CN119045744A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hard disk data processing, and in particular to a method for scheduling a flash queue and a related device. Background Art
[0002] Nand Flash (hereinafter referred to as Nand) is a non-volatile semiconductor storage medium, and its basic storage unit is a double-layer floating gate MOS tube similar to NMOS. A solid-state drive is a storage device with Nand as the medium, and its main components include Nand, controller chip, DRAM, etc. An important function of the controller chip is to perform storage operations as a driver of the Nand chip, and its main operations include erasing, writing, and reading.
[0003] In order to improve the overall writing and reading speed of the solid-state drive, there are usually multiple channels in parallel under the controller, and multiple Die areas are mounted under each channel. Multiple Die areas under the same channel share a set of control buses. When a Die area has sent a command / data, it is in a busy state. This Die area cannot continue to execute other commands, but can continue to send commands / data to other Die areas through the bus; after other Die areas have sent commands, you can query the previously busy Die area to confirm whether it is completed. If completed, you can continue to send subsequent commands to this Die area. In this way, you can make full use of the parallelism of the Die area to improve the bus bandwidth and improve the overall performance.
[0004] In order to improve the overall write / read speed of Nand, the blocks in Nand are usually evenly divided into multiple planes. Currently, mainstream Nands are usually divided into 2, 4, 6 or 8 planes. Taking 4 planes as an example, Block 0 / 4 / 8 / 12... is in Plane0, Block 1 / 5 / 9 / 13... is in Plane1, Block 2 / 6 / 10 / 14... is in Plane2, Block 3 / 7 / 11 / 15... is in Plane3. Nand supports multi-plane parallel operation, for example, Block0, 1, 6, 11 perform erase, write or read operations at the same time.
[0005] For batch / continuous reads, you can usually send multiple planes in parallel to increase the read bandwidth. For random reads, since the time to obtain the read command is random and the plane position is random, it is usually impossible to send multiple planes in parallel. In order to improve the random read bandwidth, more and more Nands support asynchronous plane read parallel operations: for example, when PlaneA sends a Read command and Nand starts the Read operation, Plane A cannot continue to execute other commands, but other Planes can continue to send Read commands, and Read command operations of different Planes can be executed in parallel.
[0006] As Nand's performance becomes higher and higher, its functions become more powerful and complex, and the fixed controller chip is increasingly unable to meet Nand's flexible control requirements. Some controllers have begun to add coprocessor CPUs (S-CPUs for short) to optimize the flexibility of Nand operations through a combination of software and hardware. The controller usually adds several coprocessor S-CPUs, each of which is responsible for command processing of one or more CHs. The upper-level driver sends the command (SQ for short) to the coprocessor S-CPU, which further parses the command into a hardware instruction sequence and sends it to the hardware processing queue (JOB FIFO) for sequential execution.
[0007] For ease of understanding, Figure 1 A schematic diagram of the structure of a solid-state drive including a coprocessor S-CPU is given. Figure 1 In the system, the main processor CPU (referred to as the main CPU) and the coprocessor S-CPU belong to different systems. SQ cannot be directly transmitted and needs to be sent through the hardware module. For easy understanding, Figure 2 The schematic diagram of the process of SQ transmission and parsing between the main processor and the coprocessor is given. In the continuous read scenario, Figure 3 The schematic diagram of the S-CPU's SQ parsing process is given, where: Figure 3 The green in the figure is the time when the hardware processing queue JOB FIFO space is insufficient, and the coprocessor S-CPU performs other operations. Figure 2 As shown in the parsing flowchart, the space of the JOB FIFO cannot meet the requirements, so that the computing power of the S-CPU cannot be fully used to parse the SQ, thereby reducing the data processing performance of the SSD. Summary of the invention
[0008] An embodiment of the present invention provides a method for scheduling a flash queue, which is used in a solid-state hard disk. When the storage space of a hardware processing queue that is connected to a target coprocessor in communication is smaller than the storage space of a flash queue module that is connected to the target processor in communication, the coprocessor pre-parses unparsed message instructions in the coprocessor message queue to obtain a parsed hardware instruction sequence, and stores the parsed message instructions at a preset position, so that the coprocessor can directly read the parsed message instructions from the preset position when the space of a JOB FIFO meets the requirement. Compared with the prior art, this method saves the time for parsing the message instructions in the coprocessor message queue when the space of the JOB FIFO meets the requirement, thereby improving the efficiency of the coprocessor in parsing the message instructions, and correspondingly improving the data processing performance of the solid-state hard disk.
[0009] A first aspect of an embodiment of the present application provides a method for scheduling a flash queue, which is applied to a coprocessor in a solid-state drive, wherein the solid-state drive includes at least one coprocessor, a hardware processing queue and a flash queue module that are communicatively connected to the coprocessor, wherein the flash queue module includes at least one flash queue, a storage space of the hardware processing queue that is communicatively connected to a target coprocessor is smaller than a storage space of the flash queue module that is communicatively connected to the target coprocessor, and the target coprocessor is any one of the at least one coprocessor, and the method includes:
[0010] Acquire a target hardware processing queue and a target flash queue module that are communicatively connected to the target coprocessor;
[0011] If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold, determining whether all the schedulable flash queues in the target flash queue module are in a working state;
[0012] If all schedulable flash queues in the target flash queue module are in working state, determining whether there are unparsed message instructions in the message queue of the target coprocessor;
[0013] If there are unparsed message instructions in the message queue of the target coprocessor, performing a parsing operation on the unparsed message instructions to obtain a parsed message instruction;
[0014] The parsed message instruction is stored in a preset location.
[0015] Preferably, the solid state drive further includes a main processor, and the method further includes:
[0016] If there is an idle flash queue in the target flash queue module, and there is a message instruction sent by the main processor in the idle flash queue, the message instruction is stored in the message queue of the target coprocessor, and the idle flash queue is updated to be in a working state.
[0017] Preferably, the solid state drive further comprises a hardware processing module communicatively connected to the hardware processing queue, and the method further comprises:
[0018] If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, determining whether there is a message instruction of parsing completion at the preset position;
[0019] If there is a parsed message instruction at the preset position, obtaining the parsed message instruction from the preset position;
[0020] The parsed message instruction is sent to a corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
[0021] Preferably, the method further comprises:
[0022] If there is no parsed message instruction at the preset position, determining whether there is an unparsed message instruction in the message queue of the target coprocessor;
[0023] If there are unparsed message instructions in the message queue of the target coprocessor, the unparsed message instructions are parsed to obtain parsed message instructions;
[0024] The parsed message instruction is sent to a corresponding hardware processing queue, so that the hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
[0025] Preferably, the target coprocessor is provided with a plurality of message queues with priorities;
[0026] The determining whether there is an unparsed message instruction in the message queue of the target coprocessor includes:
[0027] According to the priorities of the multiple message queues, determining respectively whether there are unparsed message instructions in the multiple message queues;
[0028] If there is an unparsed message instruction in the message queue of the target coprocessor, performing a parsing operation on the unparsed message instruction to obtain a parsed message instruction includes:
[0029] If there are unparsed message instructions in the multiple message queues of the target coprocessor, parsing operations are performed on the unparsed message instructions respectively according to the priorities of the message queues to obtain parsed message instructions.
[0030] Preferably, the solid-state drive further includes multiple NandFlash, message queue interfaces, and hardware scheduling modules, wherein the hardware scheduling module includes at least one scheduling channel, the main processor is communicatively connected to the scheduling channel through the message queue interface, each scheduling channel is communicatively connected to a flash queue module, one or more flash queue modules are communicatively connected to one of the coprocessors, each of the coprocessors is communicatively connected to one or more hardware processing queues, and one or more of the hardware processing queues are communicatively connected to a hardware processing module;
[0031] The message instruction is used to instruct to perform interactive operations with the multiple NandFlashes, and the interactive operations include at least one of a read operation, a write operation, a delete operation, and a query operation.
[0032] Preferably, the NandFlash includes a plurality of Die areas, each Die area includes a plurality of Plane surfaces, each Plane surface includes a plurality of Block blocks, and each Block block includes one or more Page pages;
[0033] If the NandFlash supports asynchronous Plane read operations, the read operation message instruction sent by the main processor and received by each flash queue corresponds to the read operation instruction in each Plane;
[0034] If the NandFlash does not support asynchronous Plane read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Die area.
[0035] A second aspect of an embodiment of the present application provides a solid state drive, including:
[0036] At least one coprocessor, a hardware processing queue and a flash queue module connected to the coprocessor in communication, wherein the flash queue module includes at least one flash queue, a storage space of the hardware processing queue connected to the target coprocessor in communication is smaller than a storage space of the flash queue module connected to the target coprocessor in communication, the target coprocessor is any one of the at least one coprocessor, and the coprocessor includes:
[0037] An acquisition unit, used for acquiring a target hardware processing queue and a target flash queue module which are communicatively connected to the coprocessor;
[0038] a judging unit, configured to judge whether all schedulable flash queues in the target flash queue module are in a working state when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold;
[0039] The judging unit is further configured to judge whether there is an unparsed message instruction in the message queue of the coprocessor when all the schedulable flash queues in the target flash queue module are in a working state;
[0040] A parsing unit, configured to, when there are unparsed message instructions in the message queue of the coprocessor, perform a parsing operation on the unparsed message instructions to obtain parsed message instructions;
[0041] The storage unit is used to store the parsed message instruction in a preset location.
[0042] Preferably, the solid state hard disk further includes a main processor, and the storage unit is further used for:
[0043] If there is an idle flash queue in the target flash queue module, and there is a message instruction sent by the main processor in the idle flash queue, the message instruction is stored in the message queue of the target coprocessor, and the idle flash queue is updated to be in a working state.
[0044] Preferably, the solid state drive further includes a hardware processing module communicatively connected to the hardware processing queue, and the determination unit is further configured to:
[0045] If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, determining whether there is a message instruction of parsing completion at the preset position;
[0046] The acquisition unit is further used for:
[0047] If there is a parsed message instruction at the preset position, obtaining the parsed message instruction from the preset position;
[0048] The coprocessor also includes:
[0049] The sending unit is used to send the parsed message instruction to the corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0050] Preferably, the judging unit is further used for:
[0051] If there is no parsed message instruction at the preset position, determining whether there is an unparsed message instruction in the message queue of the target coprocessor;
[0052] The parsing unit is further used for:
[0053] If there are unparsed message instructions in the message queue of the target coprocessor, the unparsed message instructions are parsed to obtain parsed message instructions;
[0054] The sending unit is further used for:
[0055] The parsed message instruction is sent to a corresponding hardware processing queue, so that the hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
[0056] Preferably, the target coprocessor is provided with a plurality of message queues with priorities;
[0057] The judging unit is specifically used for:
[0058] According to the priorities of the multiple message queues, determining respectively whether there are unparsed message instructions in the multiple message queues;
[0059] The parsing unit is specifically used for:
[0060] If there are unparsed message instructions in the multiple message queues of the target coprocessor, parsing operations are performed on the unparsed message instructions respectively according to the priorities of the message queues to obtain parsed message instructions.
[0061] Preferably, the solid-state drive further includes multiple NandFlash, message queue interfaces, and hardware scheduling modules, wherein the hardware scheduling module includes at least one scheduling channel, the main processor is communicatively connected to the scheduling channel through the message queue interface, each scheduling channel is communicatively connected to a flash queue module, one or more flash queue modules are communicatively connected to one of the coprocessors, each of the coprocessors is communicatively connected to one or more hardware processing queues, and one or more of the hardware processing queues are communicatively connected to a hardware processing module;
[0062] The message instruction is used to instruct to perform interactive operations with the multiple NandFlashes, and the interactive operations include at least one of a read operation, a write operation, a delete operation, and a query operation.
[0063] Preferably, the NandFlash includes a plurality of Die areas, each Die area includes a plurality of Plane surfaces, each Plane surface includes a plurality of Block blocks, and each Block block includes one or more Page pages;
[0064] If the NandFlash supports asynchronous Plane read operations, the read operation message instruction sent by the main processor and received by each flash queue corresponds to the read operation instruction in each Plane;
[0065] If the NandFlash does not support asynchronous Plane read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Die area.
[0066] A third aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a coprocessor, it is used to implement the method for scheduling a flash queue provided in the first aspect of the embodiment of the present application.
[0067] A fourth aspect of an embodiment of the present application provides a computer program product on which a computer program is stored. When the computer program is executed by a coprocessor, it is used to implement the method for scheduling a flash queue provided in the first aspect of the embodiment of the present application.
[0068] It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
[0069] In an embodiment of the present application, if the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold, and the schedulable flash queues in the target flash queue module are all in working state, it is determined whether there are unparsed message instructions in the message queue of the coprocessor, and when there are unparsed message instructions in the message queue of the coprocessor, the unparsed message instructions are parsed in advance to store the parsed message instructions at a preset location, thereby providing a technical basis for the coprocessor to quickly obtain the parsed message instructions from the preset location.
[0070] Therefore, compared with the prior art, the embodiments of the present application reduce the parsing time of the coprocessor for unparsed message instructions when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, thereby correspondingly improving the coprocessor's parsing efficiency for message instructions and the scheduling efficiency for the flash queue, and also improving the data processing performance of the solid-state drive. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a schematic diagram of the architecture of a solid state drive in an embodiment of the present application;
[0072] Figure 2 A schematic diagram of a process of scheduling a flash queue for a coprocessor in the prior art;
[0073] Figure 3A schematic diagram of time allocation for coprocessor scheduling flash queue in the prior art;
[0074] Figure 4 A schematic diagram of an embodiment of a method for scheduling a flash queue in an embodiment of the present application;
[0075] Figure 5 A schematic diagram of another embodiment of the method for scheduling a flash queue in an embodiment of the present application;
[0076] Figure 6 A schematic diagram of the time allocation for the coprocessor to schedule the flash queue in an embodiment of the present application;
[0077] Figure 7 A schematic diagram of an embodiment of a coprocessor of a solid state drive in an embodiment of the present application. DETAILED DESCRIPTION
[0078] An embodiment of the present invention provides a method for scheduling a flash queue, which is used for obtaining a target hardware queue and a target flash queue module that are communicated with the target coprocessor in a solid-state hard disk when the storage space of a hardware processing queue that is communicated with a target coprocessor is smaller than the storage space of a flash queue module that is communicated with the target processor; when the usage rate of the storage space of any hardware queue in the target hardware queue reaches a preset threshold, and all the flash queues that can be scheduled in the target flash queue module are in a working state, it is determined whether there are unparsed message instructions in the message queue of the coprocessor; and when there are unparsed message instructions in the message instructions of the coprocessor, the message instructions in the message queue of the coprocessor are pre-parsed by using the coprocessor, and the message instructions after the parsing is completed are stored in a preset position, so that when the storage space usage rate in the hardware queue is less than the preset threshold, the pre-parsed message instructions can be directly obtained from the preset position, and the pre-parsed message instructions are sent to the hardware processing module for processing, thereby improving the efficiency of the coprocessor in parsing message instructions in the solid-state hard disk and the efficiency of scheduling the flash queue, and correspondingly improving the data processing performance of the solid-state hard disk.
[0079] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0080] The terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0081] Figure 1 This is a schematic diagram of the structure of a solid state drive including an S-CPU provided in the background technology of this application. Figure 1 In the figure, the main processor CPU sends a message instruction SQ through the message queue interface, and then sends the message instruction SQ to the flash queue module through different message channels CH in the hardware scheduling module, wherein the flash queue module contains multiple flash queues FQ (FQ stands for Flash Queue, which is an independent execution unit queue). In the figure, a message channel CH communicates with a flash queue module, and due to the limitation of hardware resources, the number of flash queues FQ in the same message channel is usually 32.
[0082] exist Figure 1 In the embodiment, one end of the coprocessor S-CPU can be connected to one or more message channels CH, and the other end of the S-CPU can be connected to one or more hardware queues JOB FIFO, and one or more hardware queues JOB FIFO ( Figure 1 The figure shows a JOB FIFO) and the corresponding communication connection is a hardware processing module, wherein the hardware queue JOBFIFO stores the message instruction SQ parsed by the coprocessor S-CPU, and sends the parsed message instruction SQ to the corresponding hardware processing module for processing, wherein the S-CPU parses the message instruction SQ into a hardware instruction sequence when parsing the message instruction SQ, wherein the parsed hardware instructions include START, DELAY, CMD, ADDR, TIME, INFO, CE_SEL, FRDATA, FWDATA, DWDATA, DRDATA, CHK, END, etc. Each SQ parsed hardware instruction sequence starts with a START instruction and ends with an END instruction, and no other SQ hardware instructions can be inserted in between.
[0083] For ease of understanding, the following Figure 1, describes the process of issuing and parsing the message instruction SQ. Generally, the message instruction SQ contains CH and FQ information, so the main processor CPU can route the message instruction SQ to different flash queues FQ in different flash queue modules through different message channels CH. Among them, the software resources of FQ are represented by the status bit to indicate the current running status. When FQ is parsing SQ, FQ is set to busy (working state). When SQ is executed, FQ is set to Idle (idle state), so that the coprocessor S-CPU can schedule the next SQ in the flash queue.
[0084] A message queue is set in the coprocessor S-CPU. When there is a message instruction SQ to be parsed in the flash queue and the flash queue FQ is in an idle state, the coprocessor S-CPU stores the message instruction to be parsed in the message queue and sets the idle FQ to a working state (busy). Then the S-CPU parses the message instruction to be parsed into a hardware instruction sequence and stores it in the hardware queue JOB FIFO. The JOB FIFO further sends the hardware instruction sequence to the hardware processing module for processing.
[0085] Figure 2 A schematic diagram of the process of the coprocessor S-CPU scheduling the flash queue to parse the message instruction SQ provided by the background technology of this application, in Figure 2 In the process of coprocessor S-CPU scheduling flash queue to parse message instruction SQ is as follows:
[0086] Step 1: Determine whether there is an idle flash queue FQ in the flash queue of the flash module;
[0087] Step 2: If there is an idle flash queue FQ in the flash module, and there is a message instruction sent by the main processor in the idle flash queue, the message instruction is stored in the message queue, and then the idle flash queue FQ is updated to a working state;
[0088] Step 3: If there is no idle flash queue FQ in the flash queue, further determine whether there is a message instruction SQ to be executed in the message queue of the coprocessor; if there is no message instruction SQ to be executed in the message queue of the coprocessor, determine whether there is a message instruction in the message queue of the coprocessor that has been executed by the flash queue FQ; if there is a message instruction that has been executed by the flash queue FQ, update the state of the flash queue FQ from the working state to the idle state, and return to step 1; if there is no message instruction in the coprocessor that has been executed by the flash queue FQ, further return to step 1;
[0089] Step 4: If there is a message instruction SQ to be executed in the message queue of the coprocessor, further determine whether the storage space utilization rate of the hardware queue JOB FIFO reaches the preset threshold. If the storage space utilization rate of the JOB FIFO reaches the preset threshold, determine whether there is a message instruction of the flash queue in the message queue that has been executed. If a message instruction has been executed, the status of the flash queue is updated to idle accordingly.
[0090] Step 5: If the storage space usage of the JOB FIFO does not reach the preset threshold, the message instruction SQ in the message queue is parsed into a hardware instruction sequence and put into the hardware processing queue JOB FIFO.
[0091] Step 6: If there is no message instruction in the flash queue in the message queue that has been executed, return to step 1.
[0092] according to Figure 2 The schematic diagram of the SQ parsing process is shown in Figure 1. Figure 3 The schematic diagram of the S-CPU scheduling flash queue in the continuous read scenario is given. Figure 3 In the figure, the time taken to check the FQ status in the flash queue, whether there are message instructions to be executed in the message queue, the usage status of the space in the JOB FIFO, and whether the message instruction SQ in the message queue has been executed is omitted. Among them, the green is the time when the coprocessor S-CPU performs other operations when the JOB FIFO space is insufficient. It can be clearly seen that when the JOB FIFO space is insufficient, the computing power of the S-CPU cannot be fully used to parse the message instruction SQ. It should be noted that Figure 3 The colors in the figure are just a hint of the time taken by each part and are not a limitation.
[0093] Based on the problems described in the background technology, the method for coprocessor scheduling flash queue in the embodiment of the present application is now described. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of a method for co-processing and scheduling flash queues in an embodiment of the present application:
[0094] Specifically, the protocol processor application in the embodiment of the present application is in a solid-state hard disk. The solid-state hard disk in the embodiment of the present application includes at least one coprocessor, and a hardware processing queue and a flash queue module that are communicated with the coprocessor, wherein the flash queue module includes at least one flash queue, and the storage space of the hardware processing queue that is communicated with the target coprocessor in the embodiment of the present application is smaller than the storage space of the flash queue module that is communicated with the target coprocessor, and the target coprocessor is any one of the at least one coprocessor. The difference from the prior art is that when the coprocessor starts to execute a program instruction, the prior art first executes Figure 2Step 1 in (determining whether there is an idle flash queue FQ in the flash queue of the flash module), and the coprocessor in this application is executed according to the following process:
[0095] 401. Acquire a target hardware processing queue and a target flash queue module that are in communication connection with a target coprocessor;
[0096] For ease of understanding, the following Figure 1 Explanation: In Figure 1 In the embodiment, a plurality of coprocessors S-CPU are provided, and the target coprocessor in the present application is any one of the plurality of coprocessors S-CPU. Figure 1 In the example, one S-CPU has one communication channel CH for corresponding communication connection. In actual application scenarios, one S-CPU can have multiple communication channels CH for corresponding communication connection. The corresponding S-CPU can have multiple flash queue modules for communication connection. However, it should be noted that the number of FQs in the same communication channel is usually limited to 32 at most due to hardware limitations.
[0097] Specifically, in the embodiment of the present application, it is assumed that the target protocol processor is Figure 1 The S-CPU0 in the embodiment obtains the target flash queue module and the target hardware processing queue that are communicated with S-CPU0. Because the specific hardware connection relationship is recorded in the software program during the hardware connection process, the coprocessor S-CPU0 in the embodiment of the present application can read the target flash queue module and the target hardware processing queue that are communicated with S-CPU0 from the software program.
[0098] 402. If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches the preset threshold, it is determined whether all the flash queues that can be scheduled in the target flash queue module are in working state. If so, step 403 is executed.
[0099] When the usage rate of the storage space of any hardware queue in the target hardware queue is greater than a preset threshold, it is determined whether all the schedulable flash queues in the target flash queue module are in a working state.
[0100] Corresponding to step 401, when the usage rate of the storage space of the JOB FIFO connected to the communication with S-CPU0 is greater than the preset threshold (assuming it is 80%, of course it can also be other values), it is determined whether all the flash queues connected to the communication with S-CPU0 are in working state.
[0101] Because only when all the schedulable flash queues in the target flash queue modules are in working state, the internal operation parallelism of Nand is the highest at this time, so it can accurately determine whether there are unresolved message instructions in the message queue of the target coprocessor, and when there are unresolved message instructions in the message queue, parse the unresolved message instructions, thereby improving the efficiency of parsing the unresolved message instructions in the message queue, and further improving the data processing performance of the solid-state drive.
[0102] Specifically, when the flash queue FQ in the flash queue module receives the message instruction SQ dispatched by the main CPU, the message instruction SQ is sent to the message queue of the coprocessor S-CPU. Because each message instruction SQ carries the message channel CH and the flash queue FQ identification information, when the message instruction SQ is sent to the message queue of the S-CPU, the state of the FQ identified by the message instruction SQ is changed from idle to working state, and the flash queue FQ can be released only after the FQ corresponding to the message instruction is executed, and the state of the flash queue FQ is updated from working state to idle state. Here, when judging whether the flash queues in the target flash queue module are all in working state, the judgment can be made through the corresponding flash queue state identification bit in the software program.
[0103] 403. If all the schedulable flash queues in the target flash queue module are in working state, it is determined whether there are unparsed message instructions in the message queue of the target coprocessor. If so, execute step 404.
[0104] If all schedulable flash queues in the target flash queue module are in working state, it is further determined whether there are unresolved message instructions in the message queue of the coprocessor.
[0105] Specifically corresponding to steps 401 and 402, when all the schedulable flash queues in the target flash queue module communicating with S-CPU0 are in working state, it is further determined whether there are unresolved message instructions in the message queue of S-CPU0. If there are unresolved message instructions in the message queue of S-CPU0, step 404 is executed.
[0106] 404. If there are unparsed message instructions in the message queue of the target coprocessor, perform a parsing operation on the unparsed message instructions to obtain parsed message instructions;
[0107] If there are unparsed message instructions in the message queue of the target coprocessor, a parsing operation is performed on the unparsed message instructions to obtain parsed message instructions.
[0108] Specifically corresponding to steps 401-403, when there are unparsed message instructions in the message queue of S-CPU0, the unparsed message instructions are parsed to obtain parsed message instructions.
[0109] Generally, when the target coprocessor parses a message instruction, it parses the message instruction SQ into a hardware instruction sequence, wherein the parsed hardware instruction sequence includes START, DELAY, CMD, ADDR, TIME, INFO, CE_SEL, FRDATA, FWDATA, DWDATA, DRDATA, CHK, END, etc. The hardware instruction sequence after each message instruction SQ is parsed starts with a START instruction and ends with an END instruction, and no hardware instructions of other SQs can be inserted in between.
[0110] 405. Store the parsed message instruction to a preset location.
[0111] When the target coprocessor completes parsing of the unparsed message instructions in the message queue, the parsed message instructions are stored in a preset position, so that when the usage rate of the storage space of the JOB FIFO connected to the target coprocessor is less than the preset threshold, the parsed message instructions are directly read from the preset position. Compared with the prior art, this directly saves the time for interpreting the message instructions in the message queue of the target coprocessor when the usage rate of the storage space of the JOB FIFO connected to the target coprocessor is less than the preset threshold, thereby further improving the efficiency of the coprocessor in parsing the message instructions and making full use of the computing power of the coprocessor S-CPU. The preset position in the embodiment of the present application is the memory space of the software program, similar to SRAM, DRAM or set according to the global variable.
[0112] Specifically corresponding to steps 401-404, when S-CPU0 stores the parsed message instructions to the preset position, so that the usage rate of the storage space of the JOB FIFO connected to the communication with S-CPU0 is less than the preset threshold, the coprocessor can directly read the parsed message instructions from the preset position, that is, directly read the parsed hardware instruction sequence from the preset position, and send the read hardware instruction sequence to the JOB FIFO connected to the communication with S-CPU0, so that the JOB FIFO sends the hardware instruction sequence to the hardware processing module for processing.
[0113] In an embodiment of the present application, if the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold, it is determined whether all the schedulable flash queues in the target flash queue module are in a working state. If all the schedulable flash queues in the target flash queue module are in a working state, it is determined whether there are any unparsed message instructions in the message queue of the coprocessor, and the unparsed message instructions are parsed in advance to store the parsed message instructions at a preset location, thereby providing a technical basis for the coprocessor to quickly obtain the parsed message instructions from the preset location.
[0114] Therefore, compared with the prior art, the embodiments of the present application reduce the time it takes for the coprocessor to parse unparsed message instructions when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach a preset threshold, thereby correspondingly improving the coprocessor's efficiency in parsing message instructions and scheduling flash queues, and also improving the data processing performance of the solid-state drive.
[0115] based on Figure 4 The solid state drive in the embodiment is easy to understand that, in addition to the coprocessor, and the hardware processing queue and flash queue module that are in communication with the coprocessor, the solid state drive also includes: multiple NandFlash, a main processor, a message queue interface, a hardware scheduling module and a hardware processing module, wherein the hardware scheduling module includes at least one scheduling channel;
[0116] As a specific connection relationship, the solid-state hard disk in the embodiment of the present application can be a main processor that is connected to the scheduling channel through a message queue interface, and each scheduling channel is connected to a flash queue module, and one or more flash queue modules are connected to a coprocessor (wherein, Figure 1 In the solid-state hard drive shown, a flash queue module is communicated with a coprocessor), each coprocessor is communicated with one or more hardware processing queues, one or more hardware processing queues are communicated with a hardware processing module, and the message instructions in the embodiment of the present application are used to instruct interactive operations with multiple NandFlash, and the interactive operations include at least one of a read operation, a write operation, a delete operation and a query operation.
[0117] For example, when the message instruction is a read operation instruction, it may be an instruction to read the relevant content in page 1 of NandFlash1; when the message instruction is a write operation instruction, it may be an instruction to write the relevant content in page 2 of NandFlash2. There is no specific restriction on the relevant content here.
[0118] Furthermore, the NandFlash in the embodiment of the present application includes a plurality of Die areas, each Die area includes a plurality of Plane surfaces, each Plane surface includes a plurality of Block blocks, and each Block block includes one or more Page pages;
[0119] When the NandFlash supports asynchronous Plane surface read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Plane surface; when the NandFlash does not support asynchronous Plane surface read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Die area.
[0120] The embodiment of the present application describes in detail the structure and connection relationship of the solid-state hard disk, and the NandFlash in the embodiment of the present application includes two modes: supporting asynchronous Plane surface read operations and not supporting asynchronous Plane surface read operations, thereby improving the flexibility of the solid-state hard disk read mode in the embodiment of the present application.
[0121] Based on the solid state drive structure described in the above embodiment, the method for co-processing and scheduling flash queues in the embodiment of the present application is described below. Figure 5 , Figure 5 This is a schematic diagram of an embodiment of a method for co-processing and scheduling flash queues in an embodiment of the present application:
[0122] 501. Acquire a target hardware processing queue and a target flash queue module that are in communication connection with a target coprocessor;
[0123] 502. If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches the preset threshold, it is determined whether all the flash queues that can be scheduled in the target flash queue module are in working state. If so, step 503 is executed. If not, step 506 is executed.
[0124] 503. If all the flash queues that can be scheduled in the target flash queue module are in working state, it is determined whether there are unparsed message instructions in the message queue of the target coprocessor. If so, step 504 is executed. If not, the process returns to step 501.
[0125] 504. If there are unparsed message instructions in the message queue of the coprocessor, perform a parsing operation on the unparsed message instructions to obtain a parsed message instruction;
[0126] 505. Store the parsed message instruction to a preset location.
[0127] It should be noted that steps 501 to 505 are Figure 4The description in the embodiment is similar and will not be repeated here.
[0128] 506. If there is an idle flash queue in the target flash queue module, and there is a message instruction sent by the main processor in the idle flash queue, the received message instruction is stored in the message queue of the target coprocessor, and the idle flash queue is updated to a working state.
[0129] Based on step 502, if the schedulable flash queue in the target flash queue module is in an idle state, and there is a message instruction sent by the main processor in the flash queue in the idle state, the received message instruction is stored in the message queue of the target coprocessor, and the flash queue in the idle state is updated to a working state.
[0130] Corresponding to the example in step 402, when the schedulable flash queue in the target flash queue module that is communicatively connected to the coprocessor S-CPU0 is in an idle state, and when there is a message instruction sent by the main processor in the idle flash queue, the received message instruction is stored in the message queue of S-CPU0, and the idle flash queue is updated to a working state.
[0131] Furthermore, generally, NandFlash is composed of multiple Die areas, the Die area is composed of multiple Plane surfaces, the Plane surface is composed of multiple Block blocks, and the Block block is composed of one or more Page pages.
[0132] In batch / continuous read scenarios, multi-plane parallel read instructions are usually sent to improve the read bandwidth. However, for random reads, since the time and plane positions of the obtained read commands are random, multi-plane parallel read commands cannot be sent.
[0133] For random read scenarios, in order to improve the random read bandwidth, more and more NandFlash supports asynchronous plane read parallel operations. For example, when PlaneA sends a Read command and NandFlash starts the Read operation, PlaneA cannot continue to execute other commands, but other Plane surfaces can continue to send Read commands, and Read command operations on different Plane surfaces can be executed in parallel.
[0134] When NandFlash supports asynchronous Plane read operations, the read operation message instructions sent by the host processor and received by each flash queue correspond to the read operation instructions in each Plane;
[0135] When NandFlash does not support asynchronous Plane read operations, the read operation message instruction sent by the main processor and received by each flash queue corresponds to the read operation instruction in each Die area.
[0136] 507. If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, it is determined whether there is a message instruction that has been parsed at the preset position. If so, step 508 is executed. If not, step 510 is executed.
[0137] If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, it is determined whether there is a message instruction whose parsing is completed at the preset position.
[0138] Specifically, corresponding to Figure 4 For example, when the usage rate of the storage space of the target hardware processing queue JOB FIFO that is connected to the communication with S-CPU0 does not reach the preset threshold, it is determined whether there is a parsed message instruction at the preset position, that is, whether there is a parsed hardware instruction sequence, and when there is a parsed message instruction at the preset position, step 508 is executed.
[0139] 508. If there is a parsed message instruction at the preset position, obtain the parsed message instruction from the preset position;
[0140] Specifically, if there is a message instruction for parsing completed at the preset position, the message instruction for parsing completed is obtained from the preset position, and step 509 is executed.
[0141] 509. Send the parsed message instruction to the corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0142] After the target coprocessor obtains the parsed message instruction, it sends the parsed message instruction to the corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0143] For Figure 4 For example, after S-CPU0 obtains the parsed message instruction, it sends the parsed message instruction to the hardware processing queue JOB FIFO that is connected to S-CPU0 for communication, so that the JOB FIFO sends the parsed message instruction to the corresponding hardware processing module for processing.
[0144] 510. If there is no parsed message instruction at the preset position, determine whether there is an unparsed message instruction in the message queue of the target coprocessor. If so, execute step 511; if not, return to execute step 501.
[0145] If there is no parsed message instruction at the preset position, the target coprocessor further determines whether there is an unparsed message instruction in its own message queue, and executes step 511 if there is an unparsed message instruction in the message queue, and returns to execute step 501 if there is no unparsed message instruction in the message queue.
[0146] 511. If there are unparsed message instructions in the message queue of the target coprocessor, parse the unparsed message instructions to obtain parsed message instructions;
[0147] If there are unparsed message instructions in the message queue of the target coprocessor, the unparsed message instructions are parsed to obtain parsed message instructions.
[0148] correspond Figure 4 For example, if there are unparsed message instructions in the message queue of S-CPU0, the unparsed message instructions are parsed to obtain parsed message instructions.
[0149] 512. Send the parsed message instruction to a corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
[0150] After the target coprocessor obtains the parsed message instruction, it sends the parsed message instruction to the corresponding target hardware processing queue, so that the target hardware processor queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0151] correspond Figure 4 For example, when S-CPU0 obtains the message instruction after the parsing is completed, the parsed message instruction is sent to the hardware processing queue that is communicated with S-CPU0, so that the hardware processing queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0152] In an embodiment of the present application, when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, and there is a parsed message instruction at the preset position, the parsed message instruction can be directly obtained from the preset position, thereby improving the parsing efficiency of the coprocessor for the message instruction, and correspondingly improving the data processing performance of the solid-state drive.
[0153] In order to verify the utilization rate of the coprocessor computing power in the embodiment of the present application, Figure 6 Given according to Figure 5 S-CPU scheduling process of the embodiment, when the storage space of the JOB FIFO hardware resource is smaller than the storage space of the FQ hardware resource, the time allocation diagram of the S-CPU scheduling flash queue is compared with Figure 3 In terms of S-CPU, the computing power resources of S-CPU can be used to process message instructions SQ to the maximum extent, thereby improving the scheduling efficiency of FQ. It should be noted that Figure 6 The colors in the figure are also a hint of the time taken by each part, rather than a limitation.
[0154] Further, based on Figure 4 and Figure 5 In the described embodiment, the message queue in the target coprocessor may be a plurality of message queues with priorities. When the target coprocessor is provided with a plurality of message queues with priorities, when the target coprocessor determines whether there are unresolved message instructions in the message queue of the target coprocessor, the target coprocessor determines whether there are unresolved message instructions in the plurality of message queues respectively according to the priorities of the plurality of message queues. When the target coprocessor has unresolved message instructions in a plurality of message queues, the unresolved message instructions are resolved respectively according to the priorities of the message queues to obtain resolved message instructions.
[0155] That is, when the target coprocessor has a plurality of message queues with priority levels, the target coprocessor judges and parses the message instructions in the message queues of the corresponding levels according to the priority levels of the message queues when executing the judgment instruction and the parsing instruction.
[0156] In an embodiment of the present application, a priority level is set in the message queue of the target coprocessor so that message queues of different levels can store message instructions of different priority levels, thereby meeting the processing of message instructions of different priority levels in different application scenarios and improving the user experience of the solid-state drive.
[0157] It is understandable that, in various embodiments of the present invention, the sequence numbers of the above steps do not mean the order of execution. The order of execution of the steps should be determined by their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0158] The above describes in detail the method for scheduling the flash queue in the embodiment of the present application. Next, the solid state drive in the embodiment of the present application is described. Figure 7 :
[0159] The solid-state hard disk in the embodiment of the present application includes at least one coprocessor, a hardware processing queue and a flash queue module connected to the coprocessor in communication, wherein the flash queue module includes at least one flash queue, the storage space of the hardware processing queue connected to the target coprocessor in communication is smaller than the storage space of the flash queue module connected to the target coprocessor in communication, the target coprocessor is any one of the at least one coprocessor, and the coprocessor includes:
[0160] An acquisition unit 701 is used to acquire a target hardware processing queue and a target flash queue module that are communicatively connected to the coprocessor;
[0161] The judging unit 702 is configured to judge whether all the schedulable flash queues in the target flash queue module are in a working state when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold;
[0162] The determining unit 702 is further configured to determine whether there is an unparsed message instruction in the message queue of the coprocessor when all the schedulable flash queues in the target flash queue module are in a working state;
[0163] The parsing unit 703 is used to perform a parsing operation on the unparsed message instruction when there is an unparsed message instruction in the message queue of the coprocessor to obtain a parsed message instruction;
[0164] The storage unit 704 is used to store the parsed message instruction to a preset location.
[0165] Preferably, the solid state hard disk further includes a main processor, and the storage unit 704 is further used for:
[0166] If there is an idle flash queue in the target flash queue module, and there is a message instruction sent by the main processor in the idle flash queue, the message instruction is stored in the message queue of the target coprocessor, and the idle flash queue is updated to be in a working state.
[0167] Preferably, the solid state drive further includes a hardware processing module that is communicatively connected to the hardware processing queue, and the determination unit 702 is further configured to:
[0168] If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, determining whether there is a message instruction of parsing completion at the preset position;
[0169] The acquisition unit 701 is further used for:
[0170] If there is a parsed message instruction at the preset position, obtaining the parsed message instruction from the preset position;
[0171] The coprocessor also includes:
[0172] The sending unit 705 is used to send the parsed message instruction to the corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to the corresponding hardware processing module for processing.
[0173] Preferably, the judging unit 702 is further used for:
[0174] If there is no parsed message instruction at the preset position, determining whether there is an unparsed message instruction in the message queue of the target coprocessor;
[0175] The parsing unit 703 is further used for:
[0176] If there are unparsed message instructions in the message queue of the target coprocessor, the unparsed message instructions are parsed to obtain parsed message instructions;
[0177] The sending unit 705 is further configured to:
[0178] The parsed message instruction is sent to a corresponding hardware processing queue, so that the hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
[0179] Preferably, the target coprocessor is provided with a plurality of message queues with priorities;
[0180] The determining unit 702 is specifically configured to:
[0181] According to the priorities of the multiple message queues, determining respectively whether there are unparsed message instructions in the multiple message queues;
[0182] The parsing unit 703 is specifically used for:
[0183] If there are unparsed message instructions in the multiple message queues of the target coprocessor, parsing operations are performed on the unparsed message instructions respectively according to the priorities of the message queues to obtain parsed message instructions.
[0184] Preferably, the solid-state drive further includes multiple NandFlash, message queue interfaces, and hardware scheduling modules, wherein the hardware scheduling module includes at least one scheduling channel, the main processor is communicatively connected to the scheduling channel through the message queue interface, each scheduling channel is communicatively connected to a flash queue module, one or more flash queue modules are communicatively connected to one of the coprocessors, each of the coprocessors is communicatively connected to one or more hardware processing queues, and one or more of the hardware processing queues are communicatively connected to a hardware processing module;
[0185] The message instruction is used to instruct to perform interactive operations with the multiple NandFlashes, and the interactive operations include at least one of a read operation, a write operation, a delete operation, and a query operation.
[0186] Preferably, the NandFlash includes a plurality of Die areas, each Die area includes a plurality of Plane surfaces, each Plane surface includes a plurality of Block blocks, and each Block block includes one or more Page pages;
[0187] If the NandFlash supports asynchronous Plane read operations, the read operation message instruction sent by the main processor and received by each flash queue corresponds to the read operation instruction in each Plane;
[0188] If the NandFlash does not support asynchronous Plane read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Die area.
[0189] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of each unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0190] Compared with the prior art, the embodiments of the present application reduce the parsing time of the coprocessor for unparsed message instructions when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach a preset threshold, thereby correspondingly improving the parsing efficiency of the coprocessor for message instructions and the efficiency of the coprocessor scheduling the flash queue, and also improving the data processing performance of the solid-state drive.
[0191] The present application also provides a computer program product having a computer program stored thereon, which is used to implement the following when the computer program is executed by a processor: Figure 4 and Figure 5 The method for scheduling a flash queue described in the method embodiment.
[0192] The present invention also provides another computer-readable storage medium, which is used to implement the function of the coprocessor, and stores a computer program. When the computer program is executed by the processor, the processor can be used to execute Figure 4 and Figure 5 Steps in a method embodiment.
[0193] It is understandable that if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a corresponding computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned corresponding embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0194] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0195] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0196] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0197] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for scheduling a flash queue, characterized in that: A coprocessor applied to a solid state drive, the solid state drive comprising at least one coprocessor, a hardware processing queue and a flash queue module connected to the coprocessor in communication, wherein the flash queue module comprises at least one flash queue, a storage space of the hardware processing queue connected to the target coprocessor in communication is smaller than a storage space of the flash queue module connected to the target coprocessor in communication, the target coprocessor being any one of the at least one coprocessor, the method comprising: Acquire a target hardware processing queue and a target flash queue module that are communicatively connected to a target coprocessor; If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold, determining whether all the schedulable flash queues in the target flash queue module are in a working state; If all schedulable flash queues in the target flash queue module are in working state, determining whether there are unparsed message instructions in the message queue of the target coprocessor; If there are unparsed message instructions in the message queue of the target coprocessor, performing a parsing operation on the unparsed message instructions to obtain a parsed message instruction; The parsed message instruction is stored in a preset location.
2. The method according to claim 1, characterized in that: The solid state drive also includes a main processor, and the method further includes: If there is an idle flash queue in the target flash queue module, and there is a message instruction sent by the main processor in the idle flash queue, the message instruction is stored in the message queue of the target coprocessor, and the idle flash queue is updated to be in a working state.
3. The method according to claim 1, characterized in that The solid state drive also includes a hardware processing module that is communicatively connected to the hardware processing queue, and the method further includes: If the usage rate of the storage space of any hardware processing queue in the target hardware processing queue does not reach the preset threshold, determining whether there is a message instruction of parsing completion at the preset position; If there is a parsed message instruction at the preset position, obtaining the parsed message instruction from the preset position; The parsed message instruction is sent to a corresponding target hardware processing queue, so that the target hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
4. The method according to claim 3, characterized in that: The method further comprises: If there is no parsed message instruction at the preset position, determining whether there is an unparsed message instruction in the message queue of the target coprocessor; If there are unparsed message instructions in the message queue of the target coprocessor, the unparsed message instructions are parsed to obtain parsed message instructions; The parsed message instruction is sent to a corresponding hardware processing queue, so that the hardware processing queue sends the parsed message instruction to a corresponding hardware processing module for processing.
5. The method according to claim 1, characterized in that The target coprocessor is provided with a plurality of message queues with priorities; The determining whether there is an unparsed message instruction in the message queue of the target coprocessor includes: According to the priorities of the multiple message queues, determining respectively whether there are unparsed message instructions in the multiple message queues; If there is an unparsed message instruction in the message queue of the target coprocessor, performing a parsing operation on the unparsed message instruction to obtain a parsed message instruction includes: If there are unparsed message instructions in the multiple message queues of the target coprocessor, parsing operations are performed on the unparsed message instructions respectively according to the priorities of the message queues to obtain parsed message instructions.
6. The method according to claim 1, characterized in that The solid-state hard disk further includes a plurality of NandFlash, a message queue interface, and a hardware scheduling module, wherein the hardware scheduling module includes at least one scheduling channel, the main processor is communicatively connected to the scheduling channel through the message queue interface, each scheduling channel is communicatively connected to a flash queue module, one or more flash queue modules are communicatively connected to one of the coprocessors, each of the coprocessors is communicatively connected to one or more hardware processing queues, and one or more of the hardware processing queues are communicatively connected to a hardware processing module; The message instruction is used to instruct to perform interactive operations with the multiple NandFlashes, and the interactive operations include at least one of a read operation, a write operation, a delete operation, and a query operation.
7. The method according to claim 6, characterized in that The NandFlash includes a plurality of Die areas, each Die area includes a plurality of Plane surfaces, each Plane surface includes a plurality of Block blocks, and each Block block includes one or more Page pages; If the NandFlash supports asynchronous Plane read operations, the read operation message instruction sent by the main processor and received by each flash queue corresponds to the read operation instruction in each Plane; If the NandFlash does not support asynchronous Plane read operations, the read operation message instructions sent by the main processor and received by each flash queue correspond to the read operation instructions in each Die area.
8. A solid state hard disk, characterized in that: At least: At least one coprocessor, a hardware processing queue and a flash queue module connected to the coprocessor in communication, wherein the flash queue module includes at least one flash queue, a storage space of the hardware processing queue connected to the target coprocessor in communication is smaller than a storage space of the flash queue module connected to the target coprocessor in communication, the target coprocessor is any one of the at least one coprocessor, and the coprocessor includes: An acquisition unit, used for acquiring a target hardware processing queue and a target flash queue module which are communicatively connected to the coprocessor; a judging unit, configured to judge whether all schedulable flash queues in the target flash queue module are in a working state when the usage rate of the storage space of any hardware processing queue in the target hardware processing queue reaches a preset threshold; The judging unit is further configured to judge whether there is an unparsed message instruction in the message queue of the coprocessor when all the schedulable flash queues in the target flash queue module are in a working state; A parsing unit, configured to, when there are unparsed message instructions in the message queue of the coprocessor, perform a parsing operation on the unparsed message instructions to obtain parsed message instructions; The storage unit is used to store the parsed message instruction in a preset location.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a coprocessor, it is used to implement the method for scheduling a flash queue according to any one of claims 1 to 6.
10. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a coprocessor, it is used to implement the method for scheduling a flash queue according to any one of claims 1 to 6.
Citation Information
Patent Citations
Command scheduling method, flash memory controller, flash memory device and storage medium
CN116225318A
Command scheduling method, flash memory device and command scheduling system
CN117762342A
Multi-channel high-speed data processor and processing method
CN1889503A
Systems and methods for message queue storage
US20210405926A1
Method and Apparatus for Improving Message Processing Efficiency of Flash Channel Controller
US20240012699A1
