CN115934579A - Solid state disk garbage recycling method, accelerating device, equipment and computer medium - Google Patents

Solid state disk garbage recycling method, accelerating device, equipment and computer medium Download PDF

Info

Publication number
CN115934579A
CN115934579A CN202211666319.9A CN202211666319A CN115934579A CN 115934579 A CN115934579 A CN 115934579A CN 202211666319 A CN202211666319 A CN 202211666319A CN 115934579 A CN115934579 A CN 115934579A
Authority
CN
China
Prior art keywords
target
command
ssd
solid state
host controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211666319.9A
Other languages
Chinese (zh)
Inventor
夏城
孟鹏涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dapu Microelectronics Co Ltd
Original Assignee
Shenzhen Dapu Microelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Dapu Microelectronics Co Ltd filed Critical Shenzhen Dapu Microelectronics Co Ltd
Priority to CN202211666319.9A priority Critical patent/CN115934579A/en
Priority to PCT/CN2023/086117 priority patent/WO2024130890A1/en
Publication of CN115934579A publication Critical patent/CN115934579A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a solid state disk garbage recovery method, an accelerating device, equipment and a computer medium, which are applied to the solid state disk garbage recovery accelerating device and used for receiving a target GC command sent by GC management software of a target solid state disk; generating a target read command corresponding to the SSD master controller of the target solid state disk based on the target GC command; transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command. According to the method and the device, the GC management software can complete GC operation only by performing software and hardware interaction once with the SSD main controller, so that the software and hardware interaction latency is reduced, and the garbage recovery efficiency of the solid state disk is improved.

Description

Solid state disk garbage recycling method, accelerating device, equipment and computer medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an acceleration apparatus, a device, and a computer medium for solid state disk garbage collection.
Background
The GC (Garbage Collection) is a basic technology of a Solid State Drive (SSD), and has direct influence on the performance and the service life of the SSD, the GC function of the SSD controller can be roughly understood as a defragmentation function of a common hard disk, effective data in an SSD flash memory block is sequentially read into an external data cache, when the total length of the read data reaches an SSD page size, the effective data in the external cache is written into a new flash memory block, and then the old flash memory block is erased to obtain a new flash memory block.
In order to implement GC control on the solid state disk, GC operation may be performed on the solid state disk by means of software; in the process, software needs to search for a NAND flash memory storage location of valid data through an FTL (flash translation layer), allocate a new NAND write-in location, manage a data cache space according to an operation command, for example, allocate a space when a read command is issued, release the space after the write command is executed, construct a SSD master read-write command and issue the SSD master read-write command to the SSD master, and recover a command completion returned by the SSD master. Therefore, in a single GC process, often along with a plurality of read commands and one write command, software must ensure that all the completions of all GC read commands are received before issuing the write command to the SSD master controller, and the data cache space can be released after receiving the completions of the write commands, so that in the whole GC process, software and hardware (SSD master controller) interaction is frequent, and soft and hard interaction latency is introduced in each soft and hard interaction, which causes the interval from allocation to release of the cache space to be longer, thereby causing the interest rate efficiency of the whole data cache space to be lower, and affecting the GC efficiency of the solid state disk.
In summary, how to improve the garbage collection efficiency of the solid state disk is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a solid state disk garbage recycling method which can solve the technical problem of how to improve garbage recycling efficiency of a solid state disk to a certain extent. The application also provides a solid state disk garbage recycling accelerating device, electronic equipment and a computer readable storage medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
a solid state disk garbage recovery method is applied to a solid state disk garbage recovery accelerating device and comprises the following steps:
receiving a target GC command sent by GC management software of a target solid state disk;
generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command;
transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from a first flash memory block based on the target read command;
generating a target write command corresponding to the SSD host controller based on the target GC command;
and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into a second flash memory block based on the target write command.
Preferably, the generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command includes:
obtaining a pre-stored command template of the SSD master controller, wherein the command template comprises a fixed field and a parameter field;
extracting a read command parameter field in the target GC command;
and replacing the parameter field in the command template with the read command parameter field to obtain the target read command.
Preferably, after transmitting the target read command to the SSD host controller, the method further includes:
determining the storage address of the target read command in a data cache space;
and acquiring the target data read by the SSD main controller, and caching the target data into the data caching space according to the storage address.
Preferably, the determining a storage address of the target read command in the data cache space includes:
determining a buffer area number corresponding to the target reading command;
determining the product value of the buffer number and the buffer size as the storage address;
and the buffer area comprises a storage space obtained by equally dividing the data cache space.
Preferably, after transmitting the target read command to the SSD host controller, the method further includes:
and recording the target read command and the target data.
Preferably, after transmitting the target write command to the SSD host controller, the method further includes:
and releasing the corresponding storage space of the storage address in the data cache space.
Preferably, after transmitting the target write command to the SSD host controller, the method further includes:
and generating a target GC response instruction corresponding to the target GC command, and transmitting the target GC response instruction to the GC management software.
The utility model provides a solid state hard drives rubbish recovery accelerating device, includes:
the receiving port is used for receiving a target GC command sent by GC management software of the target solid state disk;
the command builder is used for generating a target read command corresponding to the SSD main controller of the target solid state disk based on the target GC command; transmitting the target read command to the SSD master controller so that the SSD master controller reads corresponding target data from a first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into a second flash memory block based on the target write command.
An electronic device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of any solid state disk garbage collection method when the computer program is executed.
A computer readable storage medium, having a computer program stored therein, where the computer program, when executed by a processor, implements the steps of the garbage collection method for solid state disks as described in any one of the above.
The solid state disk garbage recovery accelerating device is applied to the solid state disk garbage recovery accelerating device and receives a target GC command sent by GC management software of a target solid state disk; generating a target read command corresponding to the SSD master controller of the target solid state disk based on the target GC command; transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command. In the application, after receiving a target GC command sent by GC management software, the solid state disk garbage collection accelerating device can generate a corresponding target read command and send the target read command to the SSD main controller for processing, and can generate a corresponding target write command based on the target GC command and send the target write command to the SSD main controller for processing, so that GC management software can complete GC operation only by performing software and hardware interaction once with the SSD main controller, software and hardware interaction latency introduced by the software and hardware interaction is reduced, and the garbage collection efficiency of the solid state disk is improved. The solid state disk garbage recycling accelerating device, the electronic equipment and the computer readable storage medium provided by the application also solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic diagram of data reading during GC operations;
FIG. 2 is a schematic diagram of data writing during GC operation;
FIG. 3 is a schematic diagram of data erasure during GC operation;
FIG. 4 is a schematic diagram illustrating the execution of a GC read command on a solid state drive by software;
FIG. 5 is a schematic diagram illustrating the execution of a GC write command on a solid state drive by software;
FIG. 6 is a schematic time composition diagram of a prior art GC overall;
fig. 7 is a first flowchart of a garbage collection method for a solid state disk according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of GC time composition in the solid-state disk garbage recycling method provided in the present application;
fig. 9 is a second flowchart of a solid state disk garbage collection method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a solid state disk garbage recycling system according to an embodiment of the present application;
fig. 11 is a diagram illustrating an interaction process between the solid-state disk garbage collection accelerating device, the GC management software, and the SSD main controller;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 13 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The GC (Garbage Collection) is a basic technology of a Solid State Drive (SSD), and has a direct influence on the performance and the life of the SSD, the GC function of the SSD controller can be roughly understood as a defragmentation function of a normal hard disk, and sequentially reads valid data in a flash memory block of the SSD to an external data cache, the process is shown in fig. 1, when the total length of data to be read reaches SSD page size, the valid data in the external cache is written into a new flash memory block, the process is shown in fig. 2, and then the old flash memory block is erased, and the process is shown in fig. 3, so as to obtain a new flash memory block.
In order to realize GC management and control of the solid state disk, the solid state disk can be subjected to GC operation by means of software; as shown in fig. 4 and 5, in the process, software needs to search for a NAND (NAND flash memory) storage location of valid data through an FTL (flash translation layer), allocate a new NAND write location, and manage a data cache space according to an operation command, for example, space needs to be allocated when a read command is issued, the space is released after the write command is executed, a read/write command of an SSD master controller needs to be constructed and issued to the SSD master controller, and a command completion returned by the SSD master controller needs to be recovered. Therefore, in a single GC process, often along with a plurality of read commands and one write command, software must ensure that all the completions of all GC read commands are received before issuing the write command to the SSD master controller, and the data cache space can be released after receiving the completions of the write commands, so that in the whole GC process, the interaction of software and hardware (SSD master controller) is frequent, the soft and hard interaction latency is introduced in each soft and hard interaction, the time composition of the whole GC is as shown in fig. 6, which causes the interval from the allocation to the release of the cache space to be longer, and further causes the interest rate efficiency of the whole data cache space to be lower, and affects the GC efficiency of the solid state disk. The solid state disk garbage recycling scheme can improve the garbage recycling efficiency of the solid state disk.
Referring to fig. 7, fig. 7 is a first flowchart of a garbage collection method for a solid state disk according to an embodiment of the present application.
The solid state disk garbage recycling method provided by the embodiment of the application is applied to a solid state disk garbage recycling accelerating device and can comprise the following steps:
step S101: and receiving a target GC command sent by GC management software of the target solid state disk.
In practical application, the solid state disk garbage collection accelerating device may receive a target GC command sent by GC management software of a target solid state disk, and the content of the target GC command may be determined according to a specific GC operation requirement, which is not specifically limited herein.
Step S102: and generating a target read command corresponding to the SSD main controller of the target solid state disk based on the target GC command.
In practical application, in the GC operation process, valid data in the target solid state disk needs to be read out first, so that after receiving a target GC command sent by GC management software of the target solid state disk, the solid state disk garbage collection accelerating device can generate a target read command corresponding to the SSD main controller of the target solid state disk based on the target GC command, so as to control the SSD main controller to perform corresponding data reading operation based on the target read command subsequently.
Step S103: and transmitting the target read command to the SSD host controller so that the SSD host controller reads the corresponding target data from the first flash memory block based on the target read command.
In practical application, after generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command, the solid state disk garbage collection acceleration device may transmit the target read command to the SSD host controller, so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command, that is, reads valid data to be reserved from the first flash memory block to serve as the target data.
Step S104: based on the target GC command, a target write command corresponding to the SSD host controller is generated.
In practical application, during the GC operation, the data read before is written into the solid state disk, so the solid state disk garbage collection acceleration device transmits the target read command to the SSD host controller, so that after the SSD host controller reads the corresponding target data from the first flash memory block based on the target read command, the solid state disk garbage collection acceleration device further generates the target write command corresponding to the SSD host controller based on the target GC command, so as to control the SSD host controller to write the target data into the solid state disk again by means of the target write command.
Step S105: and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command.
In practical application, the solid state disk garbage collection accelerating device generates a target write command corresponding to the SSD main controller based on the target GC command, and can transmit the target write command to the SSD main controller, so that the SSD main controller writes the target data into the second flash memory block based on the target write command.
In a specific application scenario, after transmitting the target read command to the SSD host controller, the solid state disk garbage collection acceleration device may further generate a target GC response instruction corresponding to the target GC command and transmit the target GC response instruction to the GC management software, in order to inform the GC management software of completing the GC operation in time.
The solid state disk garbage recovery accelerating device is applied to the solid state disk garbage recovery accelerating device and receives a target GC command sent by GC management software of a target solid state disk; generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command; transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command. In the application, after receiving a target GC command sent by GC management software, the solid state disk garbage collection accelerating device can generate a corresponding target read command and send the target read command to the SSD main controller for processing, and can generate a corresponding target write command based on the target GC command and send the target write command to the SSD main controller for processing, so that GC management software can complete GC operation only by performing software and hardware interaction once with the SSD main controller, software and hardware interaction latency introduced by the software and hardware interaction is reduced, and the garbage collection efficiency of the solid state disk is improved. To facilitate understanding of the efficiency of the solid state disk garbage recycling method provided by the present application, please refer to fig. 8, fig. 8 is a schematic diagram of GC time composition in the solid state disk garbage recycling method provided by the present application, and as can be seen from comparing fig. 8 and fig. 6, software and hardware interact at most twice in one GC process, and at least one software and hardware interaction is performed less than in the prior art, that is, the present application can reduce the software and hardware interaction latency introduced by the software and hardware interaction, and improve the garbage recycling efficiency of the solid state disk.
Referring to fig. 9, fig. 9 is a second flowchart of a garbage collection method for a solid state disk according to an embodiment of the present application.
The solid state disk garbage recycling method provided by the embodiment of the application is applied to a solid state disk garbage recycling accelerating device and can comprise the following steps:
step S201: and receiving a target GC command sent by GC management software of the target solid state disk.
Step S202: and acquiring a pre-stored command template of the SSD master controller, wherein the command template comprises a fixed field and a parameter field.
Step S203: the read command parameter field in the target GC command is extracted.
Step S204: and replacing the parameter field in the command template with the read command parameter field to obtain the target read command.
In practical application, in the process that the solid state disk garbage collection accelerating device generates a target read command corresponding to the SSD main controller of the target solid state disk based on the target GC command, in order to quickly generate the read command corresponding to the SSD main controller in consideration of different read-write command formats of different SSD main controllers, the solid state disk garbage collection accelerating device may obtain a pre-stored command template of the SSD main controller, where the command template includes a fixed field and a parameter field, and the format of the command template may be as shown in table 1; extracting a read command parameter field in a target GC command; and replacing the parameter field in the command template with the read command parameter field to obtain a target read command compatible with different SSD host controllers.
TABLE 1 Command template schematic Table
Figure BDA0004014778330000081
For convenience of understanding, in a specific application scenario, assuming that a read command template of the SSD host controller is shown in table 2, in a process of generating a target read command, the solid state disk garbage collection acceleration device may first read the command template and the opcode, where the opcode is used to describe that parameter fields in the read command template are replaced by gc sq fields, such as bits 0 to 3 and bits 4 to 8 \8230, and respectively replace the fields in the gc sq sequentially to generate the target read command, and correspondingly, after receiving the target read command, the SSD host may parse the target read command according to its own parsing manner to perform a response, and so on. As shown in table 2, the read command field includes fields of ch, fq, cmd _ type, cmd _ sub _ type, lc, 2mtc, bitmap, etc., wherein the fields of cmd _ type, cmd _ sub _ type, lc, 2mtc, gc are fixed fields because the contents of these fields are the same for each read command; the remaining fields are called parameter fields, and the contents of these fields are not the same for each read command and need to be replaced with the parameters in gc sq.
TABLE 2 read Command template schematic Table for SSD host controller
Figure BDA0004014778330000082
Step S205: and transmitting the target read command to the SSD host controller so that the SSD host controller reads the corresponding target data from the first flash memory block based on the target read command.
Step S206: based on the target GC command, a target write command corresponding to the SSD host controller is generated.
In practical application, in the process of generating a target write command corresponding to the SSD host controller based on the target GC command, the solid state disk garbage collection accelerating device may obtain a pre-stored command template of the SSD host controller, where the command template includes a fixed field and a parameter field; extracting a write command parameter field in a target GC command; and replacing the parameter field in the command template with the write command parameter field to obtain a target write command and the like.
Step S207: and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command.
In practical application, after the solid state disk garbage collection accelerating device transmits the target read command to the SSD main controller, the solid state disk garbage collection accelerating device can also determine the storage address of the target read command in the data cache space; and acquiring the target data read by the SSD main controller, and caching the target data into a data cache space according to the storage address so as to store the target data by means of the data cache space.
In a specific application scenario, in the process of determining a storage address of a target read command in a data cache space, the solid state disk garbage collection accelerating device can determine a buffer area number corresponding to the target read command; determining the product value of the buffer area number and the buffer area size as a storage address so as to quickly determine the storage address; the buffer area comprises a storage space obtained by equally dividing the data cache space. For convenience of understanding, assuming that the data cache space is divided into bufs with the same size, and each buf is assigned with a unique buf _ id, that is, a buffer number, the corresponding storage address = buf _ id × size can be quickly calculated through buf _ id.
In a specific application scenario, after the solid state disk garbage collection accelerating device transmits the target read command to the SSD main controller, the solid state disk garbage collection accelerating device may further record the target read command and the target data, so as to determine whether all the target data are completely read based on the record information.
In a specific application scenario, in order to improve the working capacity of the data cache space, after the solid state disk garbage collection accelerating device transmits the target write command to the SSD main controller, the solid state disk garbage collection accelerating device may further release the corresponding storage space of the storage address in the data cache space, so that the data cache space is ready for the next data storage.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a solid state disk garbage recycling system according to an embodiment of the present application.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application can comprise:
a receiving port 101, configured to receive a target GC command sent by GC management software of a target solid-state disk;
a command builder 102, configured to generate a target read command corresponding to an SSD host controller of a target solid state disk based on the target GC command; transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command.
The solid state disk garbage collection accelerating device provided by the embodiment of the application has the advantages that the command builder can comprise:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a prestored command template of the SSD master controller, and the command template comprises a fixed field and a parameter field;
the first extraction module is used for extracting a read command parameter field in a target GC command;
and the first replacing module is used for replacing the parameter field in the command template with the parameter field of the read command to obtain the target read command.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application can further comprise:
the first determining module is used for determining the storage address of the target read command in the data cache space after the command builder transmits the target read command to the SSD main controller;
and the second acquisition module is used for acquiring the target data read by the SSD main controller and caching the target data into the data cache space according to the storage address.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application has the advantages that the first determining module can be specifically used for: determining a buffer area number corresponding to a target reading command; determining the product value of the buffer area number and the buffer area size as a storage address; the buffer area comprises a storage space obtained by equally dividing the data cache space.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application can further comprise:
the first recording module is used for recording the target read command and the target data after the command builder transmits the target read command to the SSD main controller.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application can further comprise:
the first releasing module is used for releasing the corresponding storage space of the storage address in the data cache space after the command builder transmits the target write command to the SSD main controller.
The solid state disk garbage recycling accelerating device provided by the embodiment of the application can further comprise:
and the first generation module is used for generating a target GC response instruction corresponding to the target GC command after the command builder transmits the target write command to the SSD main controller, and transmitting the target GC response instruction to the GC management software.
It should be noted that, in the present application, a specific structure of the solid state disk garbage collection accelerating device may be determined flexibly according to actual needs, for example, in an embodiment, an interaction process between the solid state disk garbage collection accelerating device and the GC management software, and between the solid state disk garbage collection accelerating device and the SSD main controller may be as shown in fig. 11, and includes the following steps:
the command construction module receives GC _ sq sent by GC management software;
the command construction module applies buf id from the data cache management module;
the command building module informs the applied buf id to the read command state recording module, and the read command state recording module records the buf id;
the command construction module reads the command and the opcode from the command template, constructs a read command and sends the read command to the SSD master controller;
the SSD master controller analyzes the command, and reads the effective data from nand to transmit to the garbage recycling accelerating device of the universal solid state disk;
after receiving the read command data, the read command state recording module writes the data into a data cache address corresponding to the buf _ id;
the read command state recording module judges whether the read command data is completely written into the data cache or not, and if the read command data is completely written into the data cache, the drive command construction module generates an SSD controller write command;
the command construction module reads the write command template and the opcode from the command template, constructs a write command and sends the write command to the SSD master vacancy device;
the SSD master analyzes the command and requests data from the general GC acceleration module;
the read command state recording module receives the data request, reads data from the cache address corresponding to the buf _ id to the SSD, and releases the buf _ id to the data cache management module;
after the SSD master receives the data and writes in a nand new position, the SSD master informs the general GC acceleration module that the execution of the write command is finished;
the solid state disk garbage collection accelerating device returns software GC _ cq and informs the GC management software GC of completing the command.
The application also provides an electronic device and a computer readable storage medium, which have corresponding effects of the electronic method provided by the embodiment of the application. Referring to fig. 12, fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program:
receiving a target GC command sent by GC management software of a target solid state disk;
generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command;
transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command;
generating a target write command corresponding to the SSD host controller based on the target GC command;
and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: the method comprises the steps of obtaining a pre-stored command template of the SSD main controller, wherein the command template comprises a fixed field and a parameter field; extracting a read command parameter field in a target GC command; and replacing the parameter field in the command template with the read command parameter field to obtain the target read command.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: after the target read command is transmitted to the SSD main controller, the storage address of the target read command in the data cache space is determined; and acquiring the target data read by the SSD main controller, and caching the target data into a data cache space according to the storage address.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: determining a buffer area number corresponding to a target reading command; determining the product value of the buffer area number and the buffer area size as a storage address; the buffer area comprises a storage space obtained by equally dividing the data cache space.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: and after transmitting the target read command to the SSD host controller, recording the target read command and the target data.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: and after the target write command is transmitted to the SSD main controller, releasing the corresponding storage space of the storage address in the data cache space.
An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the following steps when executing the computer program: and after transmitting the target write command to the SSD host controller, generating a target GC response instruction corresponding to the target GC command, and transmitting the target GC response instruction to the GC management software.
Referring to fig. 13, another electronic device provided in the embodiment of the present application may further include: an input port 203 connected to the processor 202, for transmitting externally input commands to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing the communication between the electronic equipment and the outside world. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high definition link technology (HML), universal Serial Bus (USB), high Definition Multimedia Interface (HDMI), and wireless connection: wireless fidelity technology (WiFi), bluetooth communication technology, bluetooth low energy communication technology, ieee802.11s based communication technology.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving a target GC command sent by GC management software of a target solid state disk;
generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command;
transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from the first flash memory block based on the target read command;
generating a target write command corresponding to the SSD host controller based on the target GC command;
and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into the second flash memory block based on the target write command.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: the method comprises the steps of obtaining a pre-stored command template of the SSD main controller, wherein the command template comprises a fixed field and a parameter field; extracting a read command parameter field in a target GC command; and replacing the parameter field in the command template with the read command parameter field to obtain the target read command.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: after the target read command is transmitted to the SSD main controller, determining a storage address of the target read command in a data cache space; and acquiring the target data read by the SSD main controller, and caching the target data into a data cache space according to the storage address.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: determining a buffer area number corresponding to a target reading command; determining the product value of the buffer area number and the buffer area size as a storage address; the buffer area comprises a storage space obtained by equally dividing the data cache space.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: and after transmitting the target read command to the SSD host controller, recording the target read command and the target data.
A computer-readable storage medium provided in an embodiment of the present application stores a computer program, and when executed by a processor, the computer program implements the following steps: and after the target write command is transmitted to the SSD main controller, releasing the corresponding storage space of the storage address in the data cache space.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: and after transmitting the target write command to the SSD host controller, generating a target GC response instruction corresponding to the target GC command, and transmitting the target GC response instruction to the GC management software.
The computer-readable storage media to which this application relates include Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
For descriptions of relevant parts in the solid state disk garbage recycling device, the electronic device, and the computer readable storage medium provided in the embodiment of the present application, reference is made to detailed descriptions of corresponding parts in the solid state disk garbage recycling method provided in the embodiment of the present application, and details are not repeated here. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A solid state disk garbage recovery method is characterized by being applied to a solid state disk garbage recovery accelerating device and comprising the following steps:
receiving a target GC command sent by GC management software of a target solid state disk;
generating a target read command corresponding to the SSD host controller of the target solid state disk based on the target GC command;
transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from a first flash memory block based on the target read command;
generating a target write command corresponding to the SSD host controller based on the target GC command;
and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into a second flash memory block based on the target write command.
2. The method of claim 1, wherein generating, based on the target GC command, a target read command corresponding to an SSD host controller of the target solid state disk comprises:
obtaining a pre-stored command template of the SSD master controller, wherein the command template comprises a fixed field and a parameter field;
extracting a read command parameter field in the target GC command;
and replacing the parameter field in the command template with the read command parameter field to obtain the target read command.
3. The method of claim 1, wherein after transmitting the target read command to the SSD host controller, further comprising:
determining the storage address of the target read command in a data cache space;
and acquiring the target data read by the SSD main controller, and caching the target data into the data caching space according to the storage address.
4. The method of claim 3, wherein the determining a storage address of the target read command in a data cache space comprises:
determining a buffer area number corresponding to the target reading command;
determining the product value of the buffer area number and the buffer area size as the storage address;
and the buffer area comprises a storage space obtained by equally dividing the data cache space.
5. The method of claim 3, wherein after transmitting the target read command to the SSD host controller, further comprising:
and recording the target read command and the target data.
6. The method of claim 3, wherein after transmitting the target write command to the SSD host controller, further comprising:
and releasing the corresponding storage space of the storage address in the data cache space.
7. The method of any of claims 1 to 6, wherein after transmitting the target write command to the SSD host controller, further comprising:
and generating a target GC response instruction corresponding to the target GC command, and transmitting the target GC response instruction to the GC management software.
8. The utility model provides a solid state hard drives rubbish recovery accelerating device which characterized in that includes:
the receiving port is used for receiving a target GC command sent by GC management software of the target solid state disk;
the command builder is used for generating a target read command corresponding to the SSD main controller of the target solid state disk based on the target GC command; transmitting the target read command to the SSD host controller so that the SSD host controller reads corresponding target data from a first flash memory block based on the target read command; generating a target write command corresponding to the SSD host controller based on the target GC command; and transmitting the target write command to the SSD host controller so that the SSD host controller writes the target data into a second flash memory block based on the target write command.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor, configured to implement the steps of the method for garbage collection of a solid state disk according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of the solid state disk garbage collection method according to any one of claims 1 to 7.
CN202211666319.9A 2022-12-23 2022-12-23 Solid state disk garbage recycling method, accelerating device, equipment and computer medium Pending CN115934579A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211666319.9A CN115934579A (en) 2022-12-23 2022-12-23 Solid state disk garbage recycling method, accelerating device, equipment and computer medium
PCT/CN2023/086117 WO2024130890A1 (en) 2022-12-23 2023-04-04 Solid state drive garbage collection method, solid state drive garbage collection acceleration apparatus, and device and computer medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211666319.9A CN115934579A (en) 2022-12-23 2022-12-23 Solid state disk garbage recycling method, accelerating device, equipment and computer medium

Publications (1)

Publication Number Publication Date
CN115934579A true CN115934579A (en) 2023-04-07

Family

ID=86553871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211666319.9A Pending CN115934579A (en) 2022-12-23 2022-12-23 Solid state disk garbage recycling method, accelerating device, equipment and computer medium

Country Status (2)

Country Link
CN (1) CN115934579A (en)
WO (1) WO2024130890A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775507A (en) * 2023-08-23 2023-09-19 四川云海芯科微电子科技有限公司 Hardware acceleration block selection method and device in garbage collection of solid state disk controller

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10261897B2 (en) * 2017-01-20 2019-04-16 Samsung Electronics Co., Ltd. Tail latency aware foreground garbage collection algorithm
US10838859B2 (en) * 2018-09-25 2020-11-17 Western Digital Technologies, Inc. Recency based victim block selection for garbage collection in a solid state device (SSD)
CN113377278A (en) * 2020-03-10 2021-09-10 阿里巴巴集团控股有限公司 Solid state disk, garbage recycling and controlling method, equipment, system and storage medium
CN113971137A (en) * 2020-07-22 2022-01-25 华为技术有限公司 Garbage recovery method and device
CN114741327B (en) * 2022-04-22 2024-04-19 中科驭数(北京)科技有限公司 Garbage recycling method and device
CN115391237A (en) * 2022-09-06 2022-11-25 山东华芯半导体有限公司 Garbage recovery system and method applied to flash memory storage controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775507A (en) * 2023-08-23 2023-09-19 四川云海芯科微电子科技有限公司 Hardware acceleration block selection method and device in garbage collection of solid state disk controller
CN116775507B (en) * 2023-08-23 2023-10-20 四川云海芯科微电子科技有限公司 Hardware acceleration block selection method and device in garbage collection of solid state disk controller

Also Published As

Publication number Publication date
WO2024130890A1 (en) 2024-06-27

Similar Documents

Publication Publication Date Title
US8521949B2 (en) Data deleting method and apparatus
TWI467372B (en) Command executing method, memory controller and memory storage apparatus
US11354236B2 (en) Garbage collection method for data storage device
US8762627B2 (en) Memory logical defragmentation during garbage collection
CN107481762B (en) Trim processing method and device of solid state disk
TWI569139B (en) Valid data merging method, memory controller and memory storage apparatus
CN104866428B (en) Data access method and data access device
TW201118877A (en) Flash memory device, data storage system, and operation method of a data storage system
CN111108488B (en) Memory block recovery method and device
US8521947B2 (en) Method for writing data into flash memory
CN101297276A (en) A mass storage device having both xip function and storage function
EP3346387B1 (en) Storage system and system garbage collection method
CN109491606B (en) Full flash memory space management method, system, equipment and computer medium
CN111007985B (en) Compatible processing method, system and equipment for space recovery of storage system
CN110309077B (en) Method and device for constructing flash translation layer of cooperative work of host and equipment
CN115934579A (en) Solid state disk garbage recycling method, accelerating device, equipment and computer medium
CN107506311B (en) Method and device for flashing FTL (flash translation layer) table of solid state disk
CN112035065B (en) Data writing method, device and equipment and computer readable storage medium
CN109815157B (en) Programming command processing method and device
US9152348B2 (en) Data transmitting method, memory controller and data transmitting system
CN113641597A (en) Method and apparatus for managing data storage and computer readable storage medium
US11436105B2 (en) Data processing method and memory controller utilizing the same
CN104424124A (en) Memory device, electronic equipment and method for controlling memory device
CN113778317A (en) Computer readable storage medium, method and device for scheduling host commands
CN113448487A (en) Computer readable storage medium, method and device for writing flash memory management table

Legal Events

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