A command decompression method, system and solid state hard disk

By introducing the command decompression method in the solid-state drive, using the template management and decompression module to parse and execute operation instructions, and generating decompression commands, the problem of large command data sent by the solid-state drive processor is solved, and the processing efficiency and hardware filling speed are improved.

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

Patent Information

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

AI Technical Summary

Technical Problem

Existing solid-state drives have a large amount of data when the processor sends commands, resulting in high CPU overhead and affecting performance.

Method used

Provides a command decompression method that reduces the amount of command data sent by the processor by obtaining the compression command sent by the processor, determining its corresponding command template, and generating a decompression command based on the compression command and template. The method includes a template management module, an interface module and a decompression module, and uses a command parsing unit and an execution management unit to parse and execute operation instructions to generate decompression commands.

Benefits of technology

By reducing the amount of command data sent by the processor, the processing efficiency of the solid state drive is improved, the formatting time of the CPU and the waste of memory resources are reduced, and the hardware filling speed is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113093992B
    Figure CN113093992B
Patent Text Reader

Abstract

The embodiment of the present application relates to the application field of solid-state hard disks, and discloses a method, system, and solid-state hard disk for decompressing commands. The method for decompressing commands is applied to solid-state hard disks and includes: obtaining a compressed command sent by a processor; determining a command template corresponding to the compressed command according to the compressed command; and generating a decompression command according to the compressed command and the command template. By determining the command template corresponding to the compressed command and generating a decompression command according to the compressed command and the command template, the present application can reduce the data volume of the command sent by the processor and improve the processing efficiency of the solid-state hard disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of solid-state hard disk applications, and in particular to a command decompression method, system and solid-state hard disk. Background Art

[0002] Solid State Drives (SSD) are hard disks made of solid-state electronic storage chip arrays. SSDs include a control unit and a storage unit (FLASH storage chip or DRAM storage chip). Currently, a considerable portion of SSD systems have dynamic random access memory (DRAM), so SSDs have a large data cache space for caching data.

[0003] NAND Flash is the main storage medium of SSD. The CPU and hardware modules in the SSD system communicate based on the doorbell. The CPU sends commands to the hardware modules through the submission queue (SQ) of the doorbell. After the hardware modules execute the relevant commands, they return the execution results (Response) through the completion queue (CQ) for the CPU to query. Usually, the data volume of a single command sent to the SQ is large, and the number of commands is also large, resulting in a long overall time for the CPU to send commands to the hardware, that is, the CPU overhead is large, which affects the performance.

[0004] Application Contents

[0005] The embodiments of the present application aim to provide a command decompression method, system and solid-state hard disk, which solve the technical problem of large data volume in commands sent by the processor of the existing solid-state hard disk and improve the processing efficiency of the solid-state hard disk.

[0006] To solve the above technical problems, the present application provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a command decompression method, which is applied to a solid state drive, and the method includes:

[0008] Get the compression command sent by the processor;

[0009] Determining, according to the compression command, a command template corresponding to the compression command;

[0010] A decompression command is generated according to the compression command and the command template.

[0011] In some embodiments, before obtaining the compression command sent by the processor, the method further includes:

[0012] A command template group is pre-established, the template group includes a plurality of command templates, and each command template corresponds to a template identification number one by one.

[0013] In some embodiments, the compression command includes a template identification number, and determining the template corresponding to the compression command according to the compression command includes:

[0014] Obtaining the template identification number contained in the compression command;

[0015] According to the template identification number and based on the command template group, a command template corresponding to the compression command is determined.

[0016] In some embodiments, each command template includes a default data area and an operation instruction area, and generating a decompression command according to the compression command and the command template includes:

[0017] According to the operation instruction area, obtaining the operation instruction contained in the operation instruction area, wherein the operation instruction area includes at least one operation instruction;

[0018] Executing the operation instruction contained in the operation instruction area to update the default data area;

[0019] The updated fields of the default data area are used as fields of the decompression command to generate a decompression command.

[0020] In some embodiments, before obtaining the operation instruction contained in the operation instruction area according to the operation instruction area, the method further includes:

[0021] Copies the default data area in the command template to the buffer.

[0022] In some embodiments, executing the operation instruction contained in the operation instruction area includes:

[0023] The operation instructions contained in the operation instruction area are executed sequentially until the currently executed operation instruction is an end instruction.

[0024] In some embodiments, the compression command further includes a bypass flag, the template identification number and the bypass flag are both stored in a specific field of the compression command, and the method further includes:

[0025] According to whether the compression command includes a bypass flag, it is determined whether to index a command template corresponding to the template identification number according to the template identification number.

[0026] In some embodiments, the compression command includes a source data area and a reserved area, wherein the processor does not fill in the reserved area.

[0027] In a second aspect, an embodiment of the present application provides a command optimization system for executing the command decompression method as described in the first aspect, the system comprising:

[0028] A template management module, used for storing a command template group, wherein the command template group includes a plurality of command templates;

[0029] An interface module, used for receiving a compression command sent by a processor;

[0030] A decompression module, connected to the template management module, the decompression module includes:

[0031] A command parsing unit, used for parsing the compressed command sent by the processor to determine the corresponding command template;

[0032] The execution management unit is used to execute the operation instructions in the command template to generate a decompression command.

[0033] In a third aspect, an embodiment of the present application provides a solid state drive, comprising:

[0034] A flash memory medium for storing flash memory data;

[0035] A processor, for sending a compression command;

[0036] A command optimization system as described in the second aspect.

[0037] In a fourth aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a solid-state hard disk to execute the decompression method of the command as described above.

[0038] The beneficial effect of the embodiment of the present application is that, different from the prior art, the embodiment of the present application provides a method for decompressing a command, which is applied to a solid-state hard disk, and the method includes: obtaining a compressed command sent by a processor; determining a command template corresponding to the compressed command according to the compressed command; and generating a decompression command according to the compressed command and the command template. By determining the command template corresponding to the compressed command and generating a decompression command according to the compressed command and the command template, the present application can reduce the amount of data of the command sent by the processor and improve the processing efficiency of the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 1 is a schematic diagram of communication between hardware modules in the prior art;

[0041] Figure 2 is a schematic diagram of the communication of commands in the prior art;

[0042] Figure 3 is a structural schematic diagram of a solid state hard disk provided in an embodiment of the present application;

[0043] Figure 4 is a schematic diagram of a command processing method provided in an embodiment of the present application;

[0044] Figure 5 is a schematic diagram of a command provided in an embodiment of the present application;

[0045] Figure 6 It is a schematic diagram of the CPU processing method of commands in the prior art;

[0046] Figure 7 It is a structural diagram of a command optimization system provided in an embodiment of the present application;

[0047] Figure 8 It is a flowchart of a command decompression method provided in an embodiment of the present application;

[0048] Fig. 9 yes Figure 8 A detailed flowchart of step S20 in FIG.

[0049] Fig.10 is a schematic diagram of a compression command provided in an embodiment of the present application;

[0050] Fig.11 is a schematic diagram of a command template provided in an embodiment of the present application;

[0051] Fig.12 yes Figure 8 A detailed flowchart of step S30 in FIG.

[0052] Fig.13 is a schematic diagram of an operation instruction area provided in an embodiment of the present application;

[0053] Fig.14 This is an overall decompression process provided by an embodiment of the present application;

[0054] Fig.15is a schematic diagram of fields in an update command template provided in an embodiment of the present application;

[0055] Fig.16 is a schematic diagram of another field in an update command template provided in an embodiment of the present application;

[0056] Fig.17 It is a schematic diagram of the overall flow of a command decompression method provided in an embodiment of the present application;

[0057] Fig.18 It is a schematic diagram of an operation instruction area provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0059] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0060] See also Figure 1 , Figure 1 is a schematic diagram of communication between hardware modules in the prior art;

[0061] like Figure 1 As shown, the CPU and various hardware modules, such as the dynamic random access memory controller (DMAC, DDR Controller / PHY), the NVMe controller, the flash controller (FCH, Flash Controller / PHY), and the data processing module (Data Processor), complete the command interaction through the doorbell. The doorbell can be set between the CPU and the hardware module, between the hardware module and the CPU, or between the CPU and the CPU, and supports two-way message interaction, and all use the message queue method for interaction.

[0062] Please refer to Figure 2 , Figure 2 is a schematic diagram of the communication of commands in the prior art;

[0063] like Figure 2As shown, the CPU's commands for operating the hardware are all sent to the hardware module through the DB (DoorBell), and the hardware module's response message (Response) for completing the command is also returned to the CPU through the DB (DoorBell). For example, the CPU and the NVMe module, and the CPU and the flash controller (NAND Flash Controller, FLC) all interact through the DB (DoorBell). When sending a command, the CPU writes the Command to the Submission Queue (SQ) of the DB, and the NVMe module and the flash controller read the Submission Queue (SQ) of the DB to obtain the Command; similarly, when returning a Response, the NVMe module and the flash controller write the Response to the Complete Queue (CQ) of the DB, and the CPU reads the CQ (Complete Queue) of the DoorBell to obtain the Response.

[0064] The SQ / CQ of the doorbell points to a memory buffer (or FIFO). The size of the SQ memory buffer is: total_sq_memory_size = command_size * command_count. Here, Command is generally called SQ Entry. The size of the Memory Buffer depends on the size and number of SQ Entry. The size of the SQ Entry depends on the size of the command to be passed by the CPU operation;

[0065] Therefore, the length of the command will affect the efficiency of the interaction and further affect the performance of the system.

[0066] In view of this, embodiments of the present application provide a command decompression method, system, and solid-state hard disk to improve the processing efficiency of the solid-state hard disk.

[0067] The technical solution of the present application is described below in conjunction with the accompanying drawings.

[0068] See also Figure 3 , Figure 3 is a structural schematic diagram of a solid state hard disk provided in an embodiment of the present application;

[0069] like Figure 3 As shown, the solid state drive 100 includes a flash memory medium 110 and a solid state drive controller 120 connected to the flash memory medium 110. The solid state drive 100 is connected to the host 200 in a wired or wireless manner to achieve data interaction.

[0070] The flash memory medium 110, as the storage medium of the solid state drive 100, 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 the flash memory medium 110 the basis of the storage medium for various portable digital devices.

[0071] Among them, the flash memory medium 110 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.

[0072] A Nand FLASH includes at least one Chip chip, each Chip chip is composed 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, the flash memory medium 110 can be divided into SLC, MLC, TLC and QLC according to the different levels of the voltage of the storage unit.

[0073] The solid state drive controller 120 includes a data converter 121 , a processor 122 , a buffer 123 , a flash memory controller 124 , and an interface 125 .

[0074] The data converter 121 is connected to the processor 122 and the flash controller 124 respectively, and the data converter 121 is used to convert binary data into hexadecimal data, and convert hexadecimal data into binary data. Specifically, when the flash controller 124 writes data to the flash medium 110, the binary data to be written is converted into hexadecimal data by the data converter 121, and then written into the flash medium 110. When the flash controller 124 reads data from the flash medium 110, the hexadecimal data stored in the flash medium 110 is converted into binary data by the data converter 121, and then the converted data is read from the binary data page register. Among them, the data converter 121 may include a binary data register and a hexadecimal data register. The binary data register can be used to store data converted from hexadecimal to binary, and the hexadecimal data register can be used to store data converted from binary to hexadecimal.

[0075] The processor 122 is respectively connected to the data converter 121, the cache 123, the flash memory controller 124 and the interface 125, wherein the processor 122 and the data converter 121, the cache 123, the flash memory controller 124 and the interface 125 can be connected via a bus or other means, and the processor is used to run the non-volatile software programs, instructions and modules stored in the cache 123, so as to implement any method embodiment of the present application.

[0076] The buffer 123 is mainly used to cache the read / write instructions sent by the host 200 and the read data or write data obtained from the flash memory medium 110 according to the read / write instructions sent by the host 200. The buffer 123, 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 buffer 123 may include a program storage area, and the program storage area may store an operating system and an application required by at least one function. In addition, the buffer 123 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 device. In some embodiments, the buffer 123 may optionally include a memory remotely arranged relative to the processor 124. 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 buffer 123 may be a static random access memory (SRAM) or a tightly coupled memory (TCM) or a double data rate synchronous dynamic random access memory (DDR SRAM).

[0077] The flash memory controller 124 is connected to the flash memory medium 110, the data converter 121, the processor 122 and the cache 123, and is used to access the back-end flash memory medium 110 and manage various parameters and data I / O of the flash memory medium 110; or, it is used to provide an access interface and protocol, implement the corresponding SAS / SATA target protocol end or NVMe protocol end, obtain the I / O instructions issued by the host 200, decode and generate internal private data results to wait for execution; or, it is responsible for the core processing of FTL (Flash translation layer).

[0078] The interface 125 connects the host 200 and the data converter 121, the processor 122 and the buffer 123, and is used to receive data sent by the host 200, or receive data sent by the processor 122 to realize data transmission between the host 200 and the processor 122. The interface 125 can be a SATA-2 interface, a SATA-3 interface, a SAS interface, an MSATA interface, a PCI-E interface, a NGFF interface, a CFast interface, an SFF-8639 interface and an M.2NVME / SATA protocol.

[0079] Please refer to Figure 4 , Figure 4 is a schematic diagram of a command processing method provided in an embodiment of the present application;

[0080] in, Figure 4 The left half is the command processing method of the prior art. Figure 4 The right half is the command processing method provided in the embodiment of the present application;

[0081] like Figure 4 As shown, the prior art directly includes all the information required for the operation into one command, so that the size of each command is fixed. The CPU and various hardware complete the interaction of commands through the Doorbell module. The length of the command affects the efficiency of the interaction and further affects the performance of the system. The disadvantage of the prior art is that the length of the command is getting longer and longer, and there is more redundancy.

[0082] However, this application adds a command optimization system so that the command sent by the CPU does not need to contain all the information. By processing the command Command, a decompression command is generated to improve the processing efficiency of the solid-state drive.

[0083] Please refer to Figure 5 , Figure 5 is a schematic diagram of a command provided in an embodiment of the present application;

[0084] like Figure 5 As shown, a command includes multiple fields, for example: command0 includes field 0-field 7, wherein the command (Command) contains redundant information, for example: the light-colored field 2, field 1, field 7, field 5 and field 4 in the figure are redundant information. It can be understood that the redundant information may be the same between different commands (Command), that is, some fields are repeated, and only some fields are specific to the command (Command), for example: the dark-colored field 3, field 0 and field 6 in the figure are specific to the command.

[0085] Please refer to Figure 6 , Figure 6 It is a schematic diagram of the CPU processing method of commands in the prior art;

[0086] It can be seen that the CPU in the prior art processes commands by filling in all fields. Due to the fixed length, some fields are not required for this operation, but still need to be filled in, which not only increases the CPU formatting time, but also wastes precious memory resources.

[0087] The present application can improve the processing efficiency of the solid-state drive by reducing the data volume of the commands sent by the processor.

[0088] For details, please refer to Figure 7 , Figure 7 It is a structural diagram of a command optimization system provided in an embodiment of the present application;

[0089] The command optimization system is applied to the above-mentioned solid-state hard disk, and the command optimization system is connected to the processor described in the above-mentioned embodiment, and is used to receive the compression command sent by the processor, and process the compression command to generate a decompression command;

[0090] like Figure 7 As shown, the command optimization system 70 includes: a decompression module 71, a template management module 72 and an interface module 73, wherein the decompression module 71 includes a command parsing unit 711 and an execution management unit 712;

[0091] Specifically, the command parsing unit 711 is connected to the execution management unit 712, the template management module 72 and the interface module 73, and is used to parse the compressed command sent by the processor to determine the corresponding command template; wherein the compressed command includes a template identification number, and after obtaining the compressed command, the command parsing unit 711 parses the compressed command, obtains the template identification number included in the compressed command, and obtains the corresponding command template from the template management module 72 according to the template identification number. In the embodiment of the present application, the command parsing unit 711 includes a command parser.

[0092] Specifically, the execution management unit 712 is connected to the command parsing unit 711, the template management module 72 and the interface module 73, and is used to obtain the operation instruction area parsed by the command parsing unit 711, and determine the operation instructions contained in the operation instruction area according to the operation instruction area, and execute the operation instructions contained in the operation instruction area to obtain the decompression command. In the embodiment of the present application, the execution management unit includes an execution manager or a microcode parser, which is used to parse the operation instructions in the command template and execute the operation instructions.

[0093] It is understandable that, since there are identical parts in the Command field, the embodiment of the present application separates the parts of the original Command first, and the hardware manages the shared duplicate parts, while the CPU only transmits the special parts, and finally the hardware merges them into a complete Command, which is then sent to the submission queue (SQ) of the destination Doorbell. By using the hardware module to automatically fill in instead of using the CPU to fill in, the CPU overhead can be reduced, and the hardware filling speed is faster, which is conducive to improving the processing efficiency of the solid-state drive.

[0094] Specifically, the template management module 72 is used to pre-establish a command template group and store the command template group, wherein the template group includes a plurality of command templates, and each command template corresponds to a template identification number. It is understandable that the template management module 72 includes a storage unit, which is used to store the command template group. In the embodiment of the present application, the template management module 72 includes a template manager.

[0095] Specifically, the interface module 73 is connected to the command parsing unit 711, the execution management unit 712 and the template management module 72, and is used to receive the compression command sent by the processor and send the compression command to the command parsing unit 711, and to receive the decompression command sent by the execution management unit 712 and send the decompression command to the submission queue (Submission Queue, SQ). In the embodiment of the present application, the interface module 73 includes a hardware interface, and the hardware interface can be an interface such as SATA, PCIe, SAS, etc.

[0096] In an embodiment of the present application, a command optimization system is provided, including: a template management module for storing a command template group, the command template group including multiple command templates; an interface module for receiving a compressed command sent by a processor; a decompression module connected to the template management module, the decompression module including: a command parsing unit for parsing the compressed command sent by the processor to determine the corresponding command template; an execution management unit for executing the operation instructions in the command template to generate a decompression command. By setting the template management module to store the command template group, the command parsing unit parses the compressed command sent by the processor, obtains the corresponding command template in the command template group, and then the execution management unit executes the operation instructions in the command template to generate a decompression command, the present application can reduce the data volume of the command sent by the processor and improve the processing efficiency of the solid-state hard disk.

[0097] Please refer to Figure 8 , Figure 8 It is a flowchart of a command decompression method provided in an embodiment of the present application;

[0098] The command decompression method is applied to the command optimization system provided in the above embodiment. The command decompression method in this application is based on the Doorbell technology and optimizes the SQCommand in the Doorbell technology (compression->decompression expansion).

[0099] like Figure 8 As shown, the decompression method of the command includes:

[0100] Step S10: Obtaining a compression command sent by the processor;

[0101] Specifically, the interface module of the command optimization system receives the compression command sent by the processor, and sends the compression command to the command parsing unit, wherein the compression command includes a source data area and a reserved area, the source data area is used to store specific fields of the compression command, and the reserved area does not fill in fields, that is, the processor does not fill in the reserved area, so that the data filled by the processor is only the specific fields of the compression command, which greatly reduces the formatting time of the processor and can also save memory resources.

[0102] like Figure 5 As shown, in command command_0, only field 3, field 0, and field 6 are characteristic fields of the command.

[0103] Step S20: determining a command template corresponding to the compression command according to the compression command;

[0104] Specifically, the template management module of the command optimization system stores a command template group, which includes multiple command templates. The command parsing unit parses the compressed command, obtains the template identification number contained in the compressed command, and obtains the corresponding command template from the template management module according to the template identification number.

[0105] Specifically, before obtaining the compression command sent by the processor, the method further includes:

[0106] A command template group is pre-established, the template group includes a plurality of command templates, and each command template corresponds to a template identification number one by one.

[0107] Please refer to Fig. 9 , Fig. 9 yes Figure 8 A detailed flowchart of step S20 in FIG.

[0108] like Fig. 9 As shown, step S20: determining a command template corresponding to the compression command according to the compression command includes:

[0109] Step S21: obtaining the template identification number contained in the compression command;

[0110] Specifically, the compression command includes multiple fields. It can be understood that the template identification number is stored in a specific field in the compression command, for example, field 0.

[0111] Please refer to Fig.10 , Fig.10 is a schematic diagram of a compression command provided in an embodiment of the present application;

[0112] like Fig.10As shown, the compressed command (compressedcommand) includes multiple fields, for example: field 0, field 1, field 2, field 3, field 4, ..., field m; wherein the template identification number (TemplateID) is stored in field 0, wherein field 0 is a specific field in the compressed command.

[0113] Step S22: Determine the command template corresponding to the compression command according to the template identification number and based on the command template group.

[0114] Specifically, the command parsing unit obtains the command template corresponding to the template identification number from the command template group stored in the template management module according to the template identification number, and determines it as the command template corresponding to the compression command.

[0115] In an embodiment of the present application, the compression command further includes a bypass flag, the template identification number and the bypass flag are both stored in a specific field of the compression command, and the method further includes:

[0116] According to whether the compression command includes a bypass flag, it is determined whether to index a command template corresponding to the template identification number according to the template identification number.

[0117] Specifically, the bypass flag (Bypass) is used to determine whether it is necessary to start the decompression process. If the field in the compression command does not include the bypass flag (Bypass), it indicates that the compression command is a compressed command. At this time, it is necessary to enable the command template, that is, to perform a decompression operation, including: according to the template identification number contained in the field of the compression command, indexing the command template corresponding to the template identification number from the command template group; if the field in the compression command includes the bypass flag, it indicates that the compression command is the final command, which is equivalent to the decompressed command. At this time, there is no need to enable the template, that is, no decompression operation is required, that is, there is no need to index the command template corresponding to the template identification number according to the template identification number.

[0118] Step S30: Generate a decompression command according to the compression command and the command template.

[0119] Specifically, each command template includes a default data area and an operation instruction area, wherein the default data area is used to store default data (InstructData), and the operation instruction area is used to store operation instructions (DefaultData);

[0120] In the embodiment of the present application, the space occupied by the compression command and the command template may be the same or different, and there is no fixed relationship between them, depending on the specific circumstances.

[0121] It is understandable that in order to facilitate hardware access and prevent data sizes between different compressed commands from being inconsistent, it is still necessary to maintain the space of the complete command size, that is, the space of the decompressed command. Therefore, when using it, the space occupied by the compressed command and the decompressed command is the same size. However, the extra unused space in the compressed command is used as a reserved area, and the processor will not fill in the reserved area, thereby reducing CPU overhead. Moreover, since the content filled in is less, the hardware fills in faster, which is beneficial to improving the processing efficiency of the solid-state drive.

[0122] Please refer to Fig.11 , Fig.11 is a schematic diagram of a command template provided in an embodiment of the present application;

[0123] like Fig.11 As shown, each command template includes an operation instruction area and a default data area. The operation instruction area is used to store operation instructions (Default Data), and the default data area is used to store default data (Instruct Data).

[0124] For details, please refer to Fig.12 , Fig.12 yes Figure 8 A detailed flowchart of step S30 in FIG.

[0125] like Fig.12 As shown, step S30: generating a decompression command according to the compression command and the command template includes:

[0126] Step S31: acquiring the operation instruction contained in the operation instruction area according to the operation instruction area, wherein the operation instruction area includes at least one operation instruction;

[0127] For details, please refer to Fig.13 , Fig.13 is a schematic diagram of an operation instruction area provided in an embodiment of the present application;

[0128] like Fig.13As shown, the operation instruction area includes multiple operation instructions, for example: operation instruction 0, operation instruction 1, ..., operation instruction n; wherein each operation instruction is composed of an operation code (op_code), a target position (dest_pos), a source position (src_pos) and the length (length) of the operation data, wherein the operation code (op_code) is used to define the operation of the instruction, the target position (dest_pos) is used to point to the field position of the decompression command, the source position (src_pos) is used to point to the field position in the compression command written by the processor, and the length (length) of the operation data is used to define the length of the operation data.

[0129] In the embodiment of the present application, the operation code (op_code) can be customized according to the actual application. For example, common operation codes include:

[0130] copy: data copy, used to copy the length of data starting from src_pos of compressedcommand to dest_pos of decompressed command;

[0131] clz: data clearing, used to clear the length data starting from dest_pos of the decompressed command;

[0132] set: data is set to 1, which is used to set the length data starting from dest_pos of the decompressed command to 1;

[0133] or: OR operation, used to perform OR operation on the data of length length starting from compressed commandsrc_pos and the data of length length starting from template dest_pos, and write the operation result to decompressed command's dest_pos;

[0134] and: AND operation, used to perform AND operation on the data of length starting from rc_pos of compressed commands and the data of length starting from dest_pos of decompressed command, and write the operation result to dest_pos of decompressed command;

[0135] inc: self-increment operation, used to add one to the data of length starting from template src_pos and write it to dest_pos of decompressd command;

[0136] dec: decrement operation, used to decrement the length of data starting from template src_pos by one and write it to dest_pos of decompressd command;

[0137] end: end instruction, used to inform the decompression module (decoder) that the decompression operation is finished.

[0138] Step S32: executing the operation instruction contained in the operation instruction area to update the default data area;

[0139] Specifically, the execution management unit executes the operation instruction in the operation instruction area to update the field information in the default data area, which is equivalent to the execution management unit adjusting the field of the default data area in the command template to update the field in the default data area in the command template and generate an updated default data area.

[0140] In the embodiment of the present application, the decompression of the compressed command is completed by defining the operation instruction, and the operation instruction in the operation instruction area can be dynamically adjusted, so it has the characteristics of user-definable and good flexibility, and the decompression is implemented by dedicated hardware (faster than the CPU general instruction decompression), so the processing time can be significantly reduced. At the same time, the CPU can do other things during decompression, which is conducive to improving the system concurrency.

[0141] Step S33: Using the updated fields of the default data area as fields of the decompression command to generate a decompression command.

[0142] Specifically, the fields of the updated default data area are used as the fields of the decompression command, so that the command template is updated to the decompression command.

[0143] In an embodiment of the present application, a method for decompressing a command is provided, which is applied to a solid-state hard disk. The method includes: obtaining a compressed command sent by a processor; determining a command template corresponding to the compressed command according to the compressed command; and generating a decompression command according to the compressed command and the command template. By determining the command template corresponding to the compressed command and generating a decompression command according to the compressed command and the command template, the present application can reduce the data volume of the command sent by the processor and improve the processing efficiency of the solid-state hard disk.

[0144] The following example explains the command optimization process in detail:

[0145] Please refer to Fig.14 , Fig.14 This is an overall decompression process provided by an embodiment of the present application;

[0146] like Fig.14As shown, the template identification number in the compressed command (Compressedcommand) is used to index the command template in the command template group, and the decompressor (decoder) executes the operation instructions in the command template and updates the fields in the default data (Default_data) to generate a decompressed command (Decompressedcommand).

[0147] Please refer to Fig.15 , Fig.15 is a schematic diagram of fields in an update command template provided in an embodiment of the present application;

[0148] like Fig.15 As shown, the processor (CPU) only fills in fields 0, 3, 6, that is, the specific fields in the compressed command are fields 0, 3, 6, and the message data is updated (expanded) through the decompressor (Decoder), and the command template (Template) is obtained. According to the operation instructions and the source data (fields 0, 3, 6 in compressedCommand), expansion, replacement and other operations are performed to update the original fields 0, 3, 6 in the command template, which is equivalent to forming a complete field by merging, thereby generating a decompressed command, wherein the decompressed command includes fields 0-8.

[0149] It is understandable that the corresponding command template can be specified by setting the template ID in the compressed command. If the decompressed command has N fields, the number of fields in the compressed command is much smaller than N. The reason is:

[0150] First, some fields that do not need to be changed can directly use the default values ​​in the template and do not need to be filled in the compressed command. In actual use, many fields do not need to be set and can use the default values;

[0151] Second, some data in the decompressed command is 32-bit or 64-bit. In fact, these data have only a few valid bits. In the compressed command, only a few valid bits of data need to be written, and the length can be extended by the operation instruction. That is, these data can be included one by one through common operation codes.

[0152] Please refer to Fig.16 , Fig.16 is a schematic diagram of another field in an update command template provided in an embodiment of the present application;

[0153] like Fig.16 As shown, by running the operation instruction in the command template, the data in the default data area is updated according to the operation instruction, thereby updating the compression command to generate the decompression command. It can be understood that the default data area in the command template is itself a complete uncompressed command (Command), and the default data area is updated by the operation instruction in the command area, thereby updating the decompression command.

[0154] See also Fig.17 , Fig.17 It is a schematic diagram of the overall flow of a command decompression method provided in an embodiment of the present application;

[0155] like Fig.17 As shown, the decompression method of the command includes:

[0156] start;

[0157] Step S171: parsing the compression command;

[0158] Specifically, a compression command sent by a processor is obtained, the compression command is parsed, and fields included in the compression command are obtained.

[0159] Step S172: whether the compression command includes a bypass flag;

[0160] Specifically, it is determined whether the field in the compression command contains a bypass flag (Bypass). If not, the process proceeds to step S173: obtaining a command template according to the template identification number; if yes, the process ends;

[0161] In an embodiment of the present application, the bypass flag is used to determine whether it is necessary to start the decompression process. If the field in the compression command does not include the bypass flag (Bypass), it indicates that the compression command is a compressed command, and the command template needs to be enabled at this time, that is, a decompression operation is performed; if the field in the compression command includes the bypass flag, it indicates that the compression command is the final command, which is equivalent to the decompressed command. At this time, there is no need to enable the template, that is, no decompression operation is required.

[0162] Step S173: Obtain the command template according to the template identification number;

[0163] Specifically, according to the template identification number, a corresponding command template is obtained from a pre-established command template group.

[0164] Step S174: copy the default data in the command template to the buffer;

[0165] Specifically, the data in the default data area in the command template is copied to the buffer, wherein the buffer is a cache area (decompressmemorybuffer) of the decompressor. Since the data in the default data area is copied to the buffer, the buffer is a cache area, and therefore, the speed of acquiring data can be increased, thereby improving the processing efficiency of the solid state drive.

[0166] Step S175: obtaining the next operation instruction in the operation command area in the command template;

[0167] Specifically, the operation instruction is obtained from the operation command area of ​​the command template;

[0168] Step S176: whether it is an end instruction;

[0169] Specifically, if the operation instruction is an end instruction, then the process ends; if the operation instruction is not an end instruction, then the process proceeds to step S175: obtaining the next operation instruction in the operation command area in the command template;

[0170] Step S177: Execute the operation instruction;

[0171] Specifically, the operation instructions contained in the operation instruction area are executed sequentially until the currently executed operation instruction is an end instruction.

[0172] Please refer to Fig.18 , Fig.18 is a schematic diagram of an operation instruction area provided in an embodiment of the present application;

[0173] like Fig.18 As shown, the operation instruction area includes four operation instructions. The decompressor sequentially executes the operation instructions included in the operation instruction area until the currently executed operation instruction is the end instruction. Specifically, the execution process is as follows:

[0174] The first operation instruction: copy, copy the data starting from the 3rd byte of the compressed command to the 1st byte of the decompress command, with a length of 2 bytes;

[0175] The second operation instruction: set, set the 4 bytes starting from byte 5 of the decompress command to 1;

[0176] The third operation instruction: inc, adds 1 to the 4th byte of the decompress command;

[0177] The fourth operation instruction: end, end instruction, decode decompression is completed;

[0178] Finish;

[0179] In the embodiment of the present application, by compressing the command, the amount of data of the SQ command sent by the processor is reduced, and the same number of commands can be sent out in a shorter time, thereby improving the efficiency of the solid-state drive; and by increasing the command template group, the repeated filling of common information is reduced, and the needs of generating different information are met. At the same time, the compressed command (Compressed-Command) is parsed by the command parser, thereby restoring the compressed command to obtain the decompressed command, which is sent to the doorbell; since it supports instruction operations, that is, the command template contains not only default data but also operation instructions, and has instruction functions such as Copy, XOR, INC (increment), and DEC (decrement), the ability of the template to generate commands is enhanced, and the processing capacity of the solid-state drive is improved.

[0180] An embodiment of the present application also provides a non-volatile computer storage medium, which stores computer executable instructions. The computer executable instructions are executed by one or more processors, so that the one or more processors can execute the command decompression method in any of the above method embodiments, for example, execute the command decompression method in any of the above method embodiments, for example, execute the various steps of the command decompression method described in the above embodiments.

[0181] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application 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 can still be modified, or some of the technical features can be replaced by equivalents. 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 command decompression method, applied to a solid state drive, characterized in that: The method comprises: Get the compression command sent by the processor; Determining, according to the compression command, a command template corresponding to the compression command; Generate a decompression command according to the compression command and the command template, wherein each command template includes a default data area and an operation instruction area; The step of generating a decompression command according to the compression command and the command template includes: According to the operation instruction area, obtaining the operation instruction contained in the operation instruction area, wherein the operation instruction includes at least one of a copy instruction, an XOR instruction, an increment instruction, and a decrement instruction; Executing the operation instruction contained in the operation instruction area to update the fields in the default data area; The fields of the updated default data area are used as the fields of the decompression command to generate a decompression command, wherein the space occupied by the compression command and the decompression command is the same, and the number of fields in the compression command is less than the number of fields in the decompression command.

2. The method according to claim 1, characterized in that Before obtaining the compression command sent by the processor, the method further includes: A command template group is pre-established, the template group comprising a plurality of command templates, each command template corresponding to a template identification number.

3. The method according to claim 2, characterized in that The compression command includes a template identification number, and determining the template corresponding to the compression command according to the compression command includes: Obtaining the template identification number contained in the compression command; According to the template identification number and based on the command template group, a command template corresponding to the compression command is determined.

4. The method according to claim 1, characterized in that: The operation instruction area includes at least one operation instruction.

5. The method according to claim 1, characterized in that Before acquiring the operation instruction contained in the operation instruction area according to the operation instruction area, the method further includes: Copies the default data area in the command template to the buffer.

6. The method according to claim 1, characterized in that The executing operation instructions contained in the operation instruction area includes: The operation instructions contained in the operation instruction area are executed sequentially until the currently executed operation instruction is an end instruction.

7. The method according to claim 1, characterized in that The compression command further includes a bypass flag, and both the template identification number and the bypass flag are stored in a specific field of the compression command. The method further includes: According to whether the compression command includes a bypass flag, it is determined whether to index a command template corresponding to the template identification number according to the template identification number.

8. The method according to any one of claims 1 to 7, characterized in that: The compression command includes a source data area and a reserved area, wherein the processor does not fill in the reserved area.

9. A command optimization system, characterized in that: A decompression method for executing a command according to any one of claims 1 to 8, the system comprising: A template management module, used for storing a command template group, wherein the command template group includes a plurality of command templates; An interface module, used for receiving a compression command sent by a processor; A decompression module, connected to the template management module, the decompression module includes: A command parsing unit, used for parsing the compressed command sent by the processor to determine the corresponding command template; The execution management unit is used to execute the operation instructions in the command template to generate a decompression command.

10. A solid state hard disk, characterized in that: include: A flash memory medium for storing flash memory data; A processor, for sending a compression command; The command optimization system as claimed in claim 9.

Citation Information

Patent Citations

  • Message encoding / decoding using templated parameters

    CN101933297A

  • Method for processing batched management information bases (MIB)

    CN103023702A

  • Solid state disk and control device, system and method thereof

    CN103942005A

  • Stage processing method and system for data in mobile terminal

    CN108897807A

  • XML file processing method, device and storage medium

    CN109241498A