Host command parsing method and device, solid state hard disk controller, solid state hard disk

By detecting and allocating command processing modules and parsing host commands in the SSD controller, the problem of low command parsing efficiency in the existing technology is solved, more efficient and flexible command processing is achieved, and data transmission efficiency is improved.

CN113835756BActive Publication Date: 2024-09-10DAPUSTOR CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111143686.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-28
Publication Date
2024-09-10
Estimated Expiration
2041-09-28

AI Technical Summary

Technical Problem

In the existing technology, when the solid-state disk controller processes host commands, the command parsing efficiency is low and cannot meet the performance requirements.

Method used

By receiving the pending command sent by the host, detecting its type, and assigning it to the corresponding command processing module for parsing according to the command operation code, including transmitting the published protocol command to the hardware automatic parsing module and transmitting the new read and write commands to The microcode controller and the new management commands are transmitted to the microcontroller for analysis.

Benefits of technology

It improves the parsing efficiency and flexibility of host commands, and improves the data transmission efficiency between the solid state drive and the host.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113835756B
    Figure CN113835756B
Patent Text Reader

Abstract

The present invention relates to the field of storage technology, and in particular to a host command parsing method and device, a solid-state hard disk controller, and a solid-state hard disk. The host command parsing method provided by the present invention receives a pending command sent by a host, detects the type of the pending command, and the type includes a published protocol command, a newly added read-write command, and a newly added management command. According to the type of the pending command, the pending command is sent to a command processing module corresponding to the type, so that the pending command is parsed by the command processing module to obtain the parsing result of the pending command. The present invention divides the pending commands into types, and parses the commands in the corresponding command processing module according to the types of the pending commands, thereby not only improving the command parsing efficiency, but also improving the flexibility of command parsing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a host command parsing method and device, a solid state drive controller, and a solid state drive. Background Art

[0002] At present, when the solid-state drive controller processes commands sent by the host, the NVMe (Non-Volatile Memory express, non-volatile memory host controller interface specification) controller usually obtains the command from the host and then submits it to the processor in the solid-state drive controller. The processor parses the command and feeds back a storage space to the NVMe controller according to the command. The NVMe controller then takes data from the host and writes it to the storage space. When the data transmission is completed, the NVMe controller sends a command to the flash memory controller through the processor. The flash memory controller moves the transmitted data from the above storage space to the flash memory according to the received command, and finally the processor releases the storage space.

[0003] The inventors discovered during the process of implementing the embodiments of the present invention that the related art submits all host commands to the processor for parsing, which results in low command parsing efficiency and cannot meet performance requirements. Summary of the invention

[0004] The main technical problem solved by the embodiments of the present invention is how to improve the parsing efficiency of host commands.

[0005] In order to solve the above technical problems, a technical solution adopted by the embodiment of the present invention is: to provide a host command parsing method, the method comprising:

[0006] Receive pending commands sent by the host;

[0007] Detecting the type of the command to be processed, the type including published protocol commands, newly added read / write commands, and newly added management commands;

[0008] According to the type of the command to be processed, the command to be processed is sent to a command processing module corresponding to the type, so that the command to be processed is parsed according to the command processing module to obtain the parsing result of the command to be processed.

[0009] Optionally, the detecting the type of the command to be processed includes:

[0010] Parsing the command operation code of the command to be processed;

[0011] The type of the command to be processed is determined according to the command operation code.

[0012] Optionally, when the type of the command to be processed is the published protocol command, parsing the command to be processed according to the command processing module to obtain the parsing result of the command to be processed includes:

[0013] When the type of the command to be processed is the issued protocol command, transmitting the command to be processed to the hardware automatic parsing module;

[0014] The hardware automatic parsing module parses the command to be processed according to the command operation code to obtain the type of the command to be processed, the data length required to be transmitted by the command, the physical memory page size and command error indication information.

[0015] Optionally, when the type of the command to be processed is a newly added read / write command, parsing the command to be processed according to the command processing module to obtain the parsing result of the command to be processed includes:

[0016] When the type of the command to be processed is a newly added read-write command, transmitting the command to be processed to a microcode controller;

[0017] Acquiring, by the microcode controller, a microcode matching the command to be processed according to the command operation code;

[0018] The to-be-processed command is parsed according to the microcode.

[0019] Optionally, the acquiring, by the microcode controller, a microcode matching the command to be processed according to the command operation code comprises:

[0020] Comparing the command operation code corresponding to the microcode with the command operation code corresponding to the command to be processed by the microcode controller;

[0021] When the two command operation codes are the same, the microcode corresponding to the command operation code is obtained.

[0022] Optionally, parsing the to-be-processed command according to the microcode specifically includes:

[0023] The format of the microcode is obtained, and the to-be-processed command is parsed according to the format of the microcode.

[0024] Optionally, when the type of the command to be processed is a new management command, parsing the command to be processed according to the command processing module to obtain the parsing result of the command to be processed includes:

[0025] When the type of the command to be processed is a new management command, transmitting the command to be processed to the microcontroller;

[0026] The microcontroller obtains a preset instruction from a memory, and parses the to-be-processed command according to the preset instruction.

[0027] In order to solve the above technical problems, another technical solution adopted by the embodiment of the present invention is: to provide a host command parsing device, comprising:

[0028] A command receiving module, used for receiving commands to be processed sent by the host;

[0029] A type detection module, used to detect the type of the command to be processed, the type including the issued protocol command, the newly added read / write command and the newly added management command;

[0030] The command parsing module is used to send the command to be processed to the command processing module corresponding to the type according to the type of the command to be processed, so as to parse the command to be processed according to the command processing module and obtain the parsing result of the command to be processed.

[0031] To solve the above technical problems, another technical solution adopted in the embodiment of the present invention is: providing a solid state drive controller, comprising: one or more processors, and a memory; a program is stored in the memory, and when the program is executed by the one or more processors, the program enables the solid state drive controller to execute the above-mentioned host command parsing method.

[0032] To solve the above technical problems, another technical solution adopted in the embodiment of the present invention is: to provide a solid state hard disk, including: the solid state hard disk controller mentioned above, and a hardware automatic parsing module, a microcode controller and a microcontroller respectively connected to the solid state hard disk controller.

[0033] Different from the related art, the host command parsing method and device, solid state drive controller, and solid state drive provided in the embodiment of the present invention receive the pending command, detect the type of the pending command according to the command operation code of the pending command, and assign the corresponding command processing module according to the type of the command, and parse the pending command in the command processing module to obtain the parsing result of the pending command. If it is detected that the pending command is a published protocol command, the pending command is transmitted to the hardware automatic parsing module for parsing; if it is detected that the pending command is a newly added read-write command, the pending command is transmitted to the microcode controller, and the newly added read-write command is efficiently parsed by introducing the microcode controller to improve the data transmission efficiency between the solid state drive and the host; if it is detected that the type of the pending command is a newly added management command, the pending command is transmitted to the microcontroller for parsing. In summary, the host command parsing method and device, solid state drive controller, and solid state drive provided in the embodiment of the present invention can determine the type of the pending command, and parse the command in the corresponding command processing module according to the type of the pending command, which not only improves the command parsing efficiency, but also improves the flexibility of command parsing. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0035] Figure 1 is a structural schematic diagram of a solid state hard disk provided by an embodiment of the present invention;

[0036] Figure 2 is a structural schematic diagram of a solid state hard disk controller provided by an embodiment of the present invention;

[0037] Figure 3 It is a flowchart of a host command parsing method provided by an embodiment of the present invention;

[0038] Figure 4 yes Figure 3 The specific process diagram of S12;

[0039] Figure 5 yes Figure 3 The parsing flow chart of the issued protocol commands;

[0040] Figure 6 yes Figure 3 The analysis flow chart of the newly added read and write commands;

[0041] Figure 7 yes Figure 3 The parsing flow chart of the newly added management commands;

[0042] Figure 8 is an example diagram of an instruction set provided by an embodiment of the present invention;

[0043] Fig. 9 is an example diagram of the correspondence between command operation codes and command types provided by an embodiment of the present invention;

[0044] Fig.10 It is a structural diagram of a host command parsing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. The described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0046] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device schematic diagram or the order in the flow chart. Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by technicians in the technical field of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not used to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more related listed items.

[0047] The host command parsing method provided by the embodiment of the present invention, when receiving a pending command, first detects the type of the pending command according to the command operation code of the pending command, and allocates a corresponding command processing module according to the type of the command, and parses the pending command in the command processing module to obtain the parsing result of the pending command. If it is detected that the pending command is a published protocol command, the pending command is transmitted to the hardware automatic parsing module for parsing; if it is detected that the pending command is a newly added read-write command, the pending command is transmitted to the microcode controller, and the newly added read-write command is efficiently parsed by introducing the microcode controller to improve the data transmission efficiency between the solid-state drive and the host; if it is detected that the type of the pending command is a newly added management command, the pending command is transmitted to the microcontroller for parsing. In general, the embodiment of the present invention can determine the type of the pending command, and parse the command in the corresponding command processing module according to the type of the pending command, which not only meets the efficiency of parsing the command, but also improves the flexibility of parsing the command.

[0048] The host command parsing method provided in the embodiment of the present invention can be applied to solid-state drives, and in particular can be applied to the parsing of host commands of NVMe solid-state drives, thereby improving the efficiency of solid-state drive command parsing and improving the flexibility of parsing commands.

[0049] See also Figure 1 , is a schematic diagram of the structure of a solid state drive provided by an embodiment of the present invention. Figure 1 As shown, the solid state drive 20 includes a solid state drive controller 21, and a microcode controller 22, a hardware automatic parsing module 23 and a microcontroller 24 respectively connected to the solid state drive controller 21. The solid state drive 20 can be connected to the host 10 in a wired or wireless manner to achieve data interaction.

[0050] The solid state drive controller 21 is used as a control computing unit to manage the internal system of the solid state drive 20. In this embodiment, the solid state drive controller 21 is responsible for the process control of parsing the host command, and is specifically used to decide the module for parsing the current host command from the microcode controller 22, the hardware automatic parsing module 23 and the microcontroller 24.

[0051] In one embodiment, see Figure 2 , the solid-state hard disk controller 21 includes one or more processors 211 and a memory 212. The processor 211 is connected to the memory 212, and may be connected via a bus or other means. The processor 211 is used to run non-volatile software programs, instructions, and modules stored in the memory 212, so as to implement any method embodiment of the present invention. For example: the processor 211 is used to receive a pending command sent by a host; detect the type of the pending command, which includes a published protocol command, a newly added read and write command, and a newly added management command; according to the type of the pending command, send the pending command to the command processing module corresponding to the type, so as to parse the pending command according to the command processing module and obtain the parsing result of the pending command.

[0052] The memory 212 is mainly used to cache the read / write instructions sent by the host 10 and the read data or write data obtained from the flash memory medium according to the read / write instructions sent by the host 10. The memory 212, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 212 may include a storage program area, and the storage program area may store an operating system and at least one application required for a function. In addition, the memory 212 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 212 may optionally include a memory remotely arranged relative to the processor 211. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The memory 212 may be a static random access memory (Static Random Access Memory, SRAM) or a tightly coupled memory (Tightly Coupled Memory, TCM) or a double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDRSRAM).

[0053] Among them, the microcode controller 22, the hardware automatic parsing module 23 and the microcontroller 24 can be integrated on the solid-state drive 20 in the form of an integrated circuit, and the solid-state drive 20 can specifically be an NVMe solid-state drive. The microcode controller 22 and the microcontroller 24 are used to parse the newly added host commands, that is, the commands in the future new version of the protocol, including the newly added read and write commands and the newly added management commands, and the hardware automatic parsing module 23 is used to parse the commands in the latest released protocol.

[0054] Specifically, the microcode controller 22 parses the host command through the microcode, and the microcode refers to the execution instruction of the microcode controller 22. The detailed process of parsing the host command through the microcode can be referred to the following method embodiment. The hardware automatic parsing module 23 is used to automatically parse the commands in the current version of the protocol. The microcontroller 24 processes the newly added management command in an online programmable manner and parses the newly added management command.

[0055] The solid-state hard disk 20 also includes at least one flash memory medium, which serves as the storage medium of the solid-state hard disk 20 and is also called flash memory, Flash, Flash memory or Flash particles. It is a type of storage device and a non-volatile memory that can store data for a long time even without current supply. Its storage characteristics are equivalent to those of a hard disk, making flash memory media the basis of storage media for various portable digital devices.

[0056] Among them, the flash memory medium can be Nand FLASH. Nand FLASH uses a single transistor as a storage unit for binary signals. Its structure is very similar to that of ordinary semiconductor transistors. The difference is that the single transistor of Nand FLASH adds a floating gate and a control gate. The floating gate is used to store electrons. The surface is covered by a layer of silicon oxide insulator and is coupled to the control gate through a capacitor. When negative electrons are injected into the floating gate under the action of the control gate, the storage state of the single crystal of Nand FLASH changes from "1" to "0", and when the negative electrons are removed from the floating gate, the storage state changes from "0" to "1". The insulator coated on the surface of the floating gate is used to trap the negative electrons in the floating gate to achieve data storage. That is, the storage unit of Nand FLASH is a floating gate transistor, which uses the floating gate transistor to store data in the form of charge. The amount of stored charge is related to the magnitude of the voltage applied to the floating gate transistor.

[0057] A Nand FLASH includes at least one Chip chip, each Chip chip consists of several Block physical blocks, and each Block physical block includes several Page pages. Among them, the Block physical block is the smallest unit for Nand FLASH to perform erase operations, and the Page page is the smallest unit for Nand FLASH to perform read and write operations. The capacity of a Nand FLASH is equal to the number of its Block physical blocks * the number of Page pages contained in a Block physical block * the capacity of a Page page. Specifically, flash memory media can be divided into SLC, MLC, TLC and QLC according to the different levels of the voltage of the storage unit.

[0058] The solid state drive provided by the embodiment of the present invention detects the type of the command to be processed, and according to the type of the command to be processed, sends the command to be processed to the command processing module corresponding to the type, parses the command to be processed according to the command processing module, and obtains the parsing result of the command to be processed. Compared with the prior art, the solid state drive provided by the embodiment of the present invention can not only improve the efficiency of command parsing, but also improve the flexibility of command parsing.

[0059] See also Figure 3, is a flow chart of a host command parsing method provided by an embodiment of the present invention. The method can be applied to the above-mentioned solid state drive 20, and specifically can be applied to the above-mentioned solid state drive controller 21. The method includes:

[0060] S11. Receive the pending command sent by the host.

[0061] The solid-state drive can receive pending commands sent by the host through the bus. Usually, the host issues commands based on the NVMe protocol (Non-Volatile Memory Express, a new transmission protocol designed specifically for solid-state storage), including published protocol commands, newly added read and write commands, and newly added management commands, among which, the published protocol commands refer to the commands in the current version of the protocol, such as the commands in the current 2.0 version of the NVMe protocol; newly added read and write commands refer to the newly added read and write commands (I / O commands) in the future new version of the protocol; newly added management commands refer to the newly added management commands (Admin commands) in the future new version of the protocol. Usually, management commands are mainly used in the case where the host manages and controls the solid-state drive. Because the management commands are used less frequently, the efficiency of parsing the management commands is generally not high, while read and write commands are usually used for data transmission between the host and the solid-state drive, especially the Write / Read / Zone Append commands are used very frequently, so the parsing efficiency of the read and write commands is generally required to be high.

[0062] S12. Detect the type of the command to be processed, which includes published protocol commands, newly added read and write commands, and newly added management commands. Taking the write command as an example, the write command format specified in the NVMe protocol is as follows:

[0063] Byte[0]: Opcode (command operation code) is 8'h01

[0064] Byte[3:2]: Command identifier (command identifier)

[0065] Byte[7:4]: Namespace identifier (command space identifier)

[0066] Byte[39:24]:Data pointer

[0067] Byte[47:40]: Starting logical block address (logical starting address of data block)

[0068] Byte[49:48]: Number of logical block (the number of data blocks, usually in units of 512B or 4KB)

[0069] The command opcode of the pending command usually includes the command type. When detecting the type of the pending command, the type of the pending command can be determined by parsing the command opcode of the pending command. Generally speaking, the command formats of read and write commands (such as Write / Read / Zone Append) are basically the same, as shown in the above write command format example; but the format of management commands is not uniform, for example, Byte[43:40] of Direct Receive (opcode is 8'h1A) is the length of the command data in Dword units, while Byte[47:44] of Security Receive (opcode is 8'h82) is the length of the command data in Byte units, and their formats are not the same.

[0070] See also Figure 4 , the detecting the type of the command to be processed comprises:

[0071] S121, parsing the command operation code of the command to be processed, so that the information such as whether the command has data transmission, the type of the command (read / write), the size of the command data transmission and the number of PRPs (Physical Region Pages) required can be subsequently parsed according to the command operation code.

[0072] S122. Determine the type of the command to be processed according to the command operation code.

[0073] For example, see Fig. 9 , is the correspondence between the command operation code and the command type. By parsing the command operation code of the pending command, the type of the pending command can be obtained. The type specifically includes the published protocol command, the newly added read / write command and the newly added management command. For example, if the command operation code of the pending command is identified as 01h or 02h, then the type of the pending command is a newly added read / write command.

[0074] S13. According to the type of the command to be processed, send the command to be processed to a command processing module corresponding to the type, so as to parse the command to be processed according to the command processing module and obtain a parsing result of the command to be processed.

[0075] Compared with the method in the prior art of submitting all host commands to the processor for parsing, this solution will identify the types of pending commands issued by the host by identifying command opcodes, and divide them into published protocol commands, new read and write commands, and new management commands. Different types of pending commands will be assigned to different command processing modules to process the pending commands, which can not only meet the efficiency of parsing commands, but also ensure the flexibility of parsing commands.

[0076] For details, please refer to Figure 5 When the type of the command to be processed is the published protocol command, parsing the command to be processed according to the command processing module and obtaining the parsing result of the command to be processed includes:

[0077] S1311: When the type of the pending command is the published protocol command, transmit the pending command to the hardware automatic parsing module. The published protocol command refers to a command in the current protocol, such as a command in the current 1.4 version of the NVMe protocol.

[0078] S1312. Parse the pending command according to the command operation code through the hardware automatic parsing module to obtain the type of the pending command, the data length required to be transmitted by the command, the physical memory page size, and command error indication information.

[0079] The hardware automatic parsing module will parse the type of the pending command according to the command opcode in the pending command, automatically check whether each area is legal, and then determine whether the direction of the command is read or write, and determine the size of the command, determine the length of data that the command needs to transmit, the number of PRPs required for storage, and whether there are errors in the command, and then apply for data storage space to store data. Take the write command (opcode is 8'h01) as an example, if the command opcode of the received pending command is 8'h01, it is parsed as a write command and there is data transmission. For example, [49:48] in the pending command is the length of the data transmission / number of data blocks and other information. According to the format of each command in the protocol, all commands in the current protocol can be parsed.

[0080] See also Figure 6 When the type of the command to be processed is a newly added read / write command, parsing the command to be processed according to the command processing module and obtaining the parsing result of the command to be processed includes:

[0081] S1321. When the type of the pending command is a newly added read / write command, the pending command is transmitted to the microcode controller. The newly added read / write command refers to a newly added read / write command based on the current protocol, such as a newly added read / write command after the NVMe protocol version is updated. Since the newly added read / write command is a newly added command, the command opcode of the newly added read / write command cannot be predicted. This embodiment introduces a programmable microcode controller and combines the microcode to parse the newly added read / write command. Please refer to the above-mentioned write command format. The command format of the newly added read / write command is basically the same.

[0082] S1322, obtain the microcode that matches the command to be processed according to the command opcode through the microcode controller. The microcode is a series of relatively simple instructions decomposed when running some complex instructions. In the initialization stage of the microcode controller, the microcode needs to be written into the register (SRAM, Static Random-Access Memory) inside the microcode controller. At this time, the microcode is stored in the memory, and the microcode can be updated each time the software is started. Because in general, there are not many new read and write commands added when the protocol version is updated, for example, the NVMe protocol adds a read and write command from version 1.3 to version 1.4. In this embodiment, 8 microcodes can be selected to be written, which can usually meet the use requirements and can also ensure that the command parsing is completed in 1-8 clock cycles.

[0083] This embodiment separates machine instructions from related circuits by introducing microcode and microcode controller, so that machine instructions can be designed and modified more freely without considering the actual circuit architecture.

[0084] The microcode controller acquires the microcode matching the command to be processed according to the command operation code, including:

[0085] S13221, comparing, by the microcode controller, the command operation code corresponding to the microcode with the command operation code corresponding to the command to be processed;

[0086] S13222. When the two command operation codes are the same, obtain the microcode corresponding to the command operation code.

[0087] The microcode controller will obtain the microcode from the register in turn, and compare the corresponding command opcode in the microcode with the command opcode corresponding to the command to be processed. When the comparison results corresponding to the microcode are the same, the microcode is selected to parse the command to be processed. If the comparison results are different, the next microcode is obtained for comparison.

[0088] S1323, parsing the pending command according to the microcode, including:

[0089] S13231. Obtain the format of the microcode, and parse the to-be-processed command according to the format of the microcode.

[0090] In this embodiment, the format of the microcode may be:

[0091] bit[7:0]:opcode (command operation code)

[0092] bit[13:8]: The command size is 64 bytes (used to determine which byte is parsed into the length of the data)

[0093] bit[15:14]: specifies the unit of data length (2'b00 is Byte, 2'b01 is Dword, 2'b10 is 512Byte, 2'b11 is 4K byte)

[0094] bit

[16] : specifies the type of command (1'b0 is write direction, 1'b1 is read direction)

[0095] bit

[17] : specifies the base value of the data length (1'b0 is the value of base 0, 1'b1 is the value of base 1)

[0096] bit[19:18]: specifies the priority of the command

[0097] After the microcode controller receives the pending command, it first compares the command opcode in the microcode with the command opcode in the pending command. If they are the same, it parses the length of the pending command through bit [13:8] and bit [15:16] of the microcode, and then determines the transmission direction of the pending command through bit

[16] of the microcode, and then determines the priority of the pending command through bit [19:18]. After that, it determines a storage space for the pending command and submits the pending command to the processor of the solid-state drive controller.

[0098] In this embodiment, the microcode controller may include a microcode register, a microcode control unit, a microcode comparison unit, an arithmetic logic unit, and a result output unit. The microcode is stored in the microcode register, the microcode control module obtains the microcode from the microcode register, the microcode comparison unit compares the command operation code of the command to be processed with the command operation code of the microcode, the arithmetic logic unit can perform logical operations, such as addition, subtraction, and shift operations, etc., the microcode control module also includes program address self-increment processing and program end processing, and after the analysis is completed, the analysis result of the command to be processed is output through the result output unit, including information such as command type, command length, and error status.

[0099] See also Figure 7When the type of the command to be processed is a new management command, parsing the command to be processed according to the command processing module and obtaining the parsing result of the command to be processed includes:

[0100] S1331, when the type of the command to be processed is a new management command, transmitting the command to be processed to the microcontroller;

[0101] S1332, obtaining a preset instruction from a memory through the microcontroller, and parsing the to-be-processed command according to the preset instruction.

[0102] The newly added management command refers to the management command newly added on the basis of the current protocol, such as the management command newly added after the NVMe protocol version is updated. Since the newly added management command is a newly added command, the command opcode of the newly added management command cannot be predicted, and compared with the newly added read and write commands in the above embodiments, the command format of the newly added management command is not uniform. In this embodiment, the microcontroller parses the newly added management command in an online programmable manner. During the initialization phase of the chip corresponding to the microcontroller, the software can write the instruction to the internal register online. Then, the microcontroller will take out the instructions from the register in turn for execution to parse the host command. Among them, the microcontroller can be designed for the commands specified in the NVMe protocol so that it can support 5-level pipelines and conflict detection. For example, using a 32-bit instruction set, arithmetic operations can be provided to calculate the length of the command to be processed, jump instructions can be provided to compare the command opcodes, and temporary data when executing the command and the status after executing the command are stored in general registers. An example of the instruction set is as follows: Figure 8 As shown, examples of general purpose registers are as follows:

[0103] General registers

[0104] 0~7: $t0~$t7 (32-bit temporary register)

[0105] 8: $zero

[0106] 9: $opcode (command opcode register)

[0107] 10~15:$cmd_entry (content of command Dword[15:10])

[0108] 16: $bc (command total byte count register)

[0109] 17: $cmd_type (command type, the highest bit indicates whether data is transmitted)

[0110] 18: $error (the highest bit indicates whether there is an error)

[0111] In this embodiment, the microcontroller may include a command register, a command acquisition unit, a command parsing unit, an arithmetic logic unit and a register stack. The commands executed by the software are stored in the command register, the command acquisition unit can fetch commands from the command register, and also includes program address self-increment processing and address jump processing. The command parsing unit can parse the command according to the command opcode of the command, for example, it can be a jump command or an arithmetic logic command. The arithmetic logic unit can perform logical operations, for example, including addition, subtraction and shift operations, etc. The register stack includes 8 32-bit temporary registers, an opcode register and an error status register, etc., which cooperate with the command parsing unit to parse the command.

[0112] In some embodiments, when a pending command is received from a host, it is first determined whether the pending command belongs to a published protocol command based on the command operation code of the pending command. If so, the pending command is directly transmitted to the hardware automatic parsing module for parsing; if not, it is further determined whether the pending command belongs to a new read-write command or a new management command. If it is a new read-write command, the pending command is transmitted to the microcode controller for parsing; if it is a new management command, the pending command is transmitted to the microcontroller for parsing.

[0113] The embodiment of the present invention provides a host command parsing method, which receives a pending command sent by a host, then detects the type of the pending command, and sends the pending command to a command processing module corresponding to the type according to the type of the pending command, so as to parse the pending command according to the command processing module and obtain the parsing result of the pending command. Wherein, the types of pending commands include published protocol commands, newly added read-write commands and newly added management commands. If it is detected that the pending command is a published protocol command, the pending command is transmitted to the hardware automatic parsing module for parsing; if it is detected that the pending command is a newly added read-write command, the pending command is transmitted to the microcode controller, and the newly added read-write command is efficiently parsed by introducing the microcode controller to improve the data transmission efficiency between the solid state drive and the host; if it is detected that the type of the pending command is a newly added management command, the pending command is transmitted to the microcontroller for parsing. Compared with the solution in the prior art that all host commands are submitted to the processor for parsing, this method not only meets the efficiency of parsing commands, but also improves the flexibility of parsing commands.

[0114] See also Fig.10 , Fig.103 is a schematic diagram of the structure of a host command parsing device provided by an embodiment of the present invention. The host command parsing device 30 includes a command receiving module 31, a type detection module 32 and a command parsing module 33.

[0115] The command receiving module 31 is used to receive the to-be-processed command sent by the host;

[0116] A type detection module 32, used to detect the type of the command to be processed, the type including the issued protocol command, the newly added read / write command and the newly added management command;

[0117] The command parsing module 33 is used to send the command to be processed to a command processing module corresponding to the type according to the type of the command to be processed, so as to parse the command to be processed according to the command processing module and obtain the parsing result of the command to be processed.

[0118] It should be noted that the host command parsing device can execute the host command parsing method provided in the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the host command parsing device embodiment, please refer to the host command parsing method provided in the embodiment of the present invention.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A host command parsing method, It is characterized in that include: Receive pending commands sent by the host; Detecting the type of the command to be processed, the type including the issued protocol command, the newly added read / write command and the newly added management command, wherein the newly added read / write command refers to the newly added read / write command based on the current protocol, and the newly added management command refers to the newly added management command based on the current protocol; According to the type of the command to be processed, the command to be processed is sent to a command processing module corresponding to the type, so that the command to be processed is parsed according to the command processing module to obtain a parsing result of the command to be processed; Wherein, when the type of the command to be processed is a new management command, parsing the command to be processed according to the command processing module and obtaining the parsing result of the command to be processed includes: The to-be-processed command is transmitted to the microcontroller; a preset instruction is obtained from a memory by the microcontroller, and the to-be-processed command is parsed according to the preset instruction.

2. The method according to claim 1, It is characterized in that The detecting the type of the command to be processed comprises: Parsing the command operation code of the command to be processed; The type of the command to be processed is determined according to the command operation code.

3. The method according to claim 2, It is characterized in that When the type of the command to be processed is the published protocol command, parsing the command to be processed according to the command processing module and obtaining the parsing result of the command to be processed includes: When the type of the command to be processed is the issued protocol command, transmitting the command to be processed to the hardware automatic parsing module; The hardware automatic parsing module parses the command to be processed according to the command operation code to obtain the type of the command to be processed, the data length required to be transmitted by the command, the physical memory page size and command error indication information.

4. The method according to any one of claims 1 to 3, It is characterized in that When the type of the command to be processed is a newly added read / write command, parsing the command to be processed according to the command processing module to obtain the parsing result of the command to be processed includes: When the type of the command to be processed is a newly added read-write command, transmitting the command to be processed to the microcode controller; Acquiring, by the microcode controller, a microcode matching the command to be processed according to the command operation code; The to-be-processed command is parsed according to the microcode.

5. The method according to claim 4, It is characterized in that The obtaining, by the microcode controller according to the command operation code, a microcode matching the command to be processed comprises: Comparing the command operation code corresponding to the microcode with the command operation code corresponding to the command to be processed by the microcode controller; When the two command operation codes are the same, the microcode corresponding to the command operation code is obtained.

6. The method according to claim 4, It is characterized in that The parsing of the to-be-processed command according to the microcode specifically includes: The format of the microcode is obtained, and the to-be-processed command is parsed according to the format of the microcode.

7. A host command parsing device, It is characterized in that include: A command receiving module, used for receiving commands to be processed sent by the host; A type detection module, used to detect the type of the command to be processed, the type including the issued protocol command, the newly added read / write command and the newly added management command, wherein the newly added read / write command refers to the read / write command newly added on the basis of the current protocol, and the newly added management command refers to the management command newly added on the basis of the current protocol; A command parsing module, used for sending the command to be processed to a command processing module corresponding to the type of the command to be processed, so as to parse the command to be processed according to the command processing module and obtain the parsing result of the command to be processed; Wherein, when the type of the command to be processed is a new management command, the command parsing module is specifically used for: The to-be-processed command is transmitted to the microcontroller; a preset instruction is obtained from a memory by the microcontroller, and the to-be-processed command is parsed according to the preset instruction.

8. A solid state hard disk controller, It is characterized in that include: one or more processors, and memory; A program is stored in the memory, and when the program is executed by the one or more processors, the program enables the solid state drive controller to execute the host command parsing method according to any one of claims 1 to 6.

9. A solid state hard disk, It is characterized in that include: The solid-state hard disk controller of claim 8, and a hardware automatic parsing module, a microcode controller and a microcontroller respectively connected to the solid-state hard disk controller.