Trim command processing method and device and related equipment
By alternating between read/write requests and the L2P table in the solid-state drive, the latency issue of read/write requests affecting L2P table processing during the process is resolved, ensuring timely data deletion and efficient processing of read/write requests.
Patent Information
- Application Number
- CN202411078892.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-31
AI Technical Summary
In existing technologies, when solid-state drives (SSDs) process Trim commands, the L2P table is processed with lower priority than read and write requests, which makes the processing process prone to interruption and delay, affecting the timeliness of data deletion and the efficiency of read and write requests.
By alternating between processing L2P tables and read/write requests, and setting different alternation conditions based on the type of read/write request, the orderly processing of read/write requests and L2P tables is ensured. This includes setting the unit processing ratio and alternation conditions for different types of read/write requests.
This ensures timely deletion of target data, avoids write amplification, and guarantees the efficiency of SSD read and write request processing.
Smart Images

Figure CN119225634A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of solid-state hard disks, and in particular to a Trim command processing method, device and related equipment. Background Art
[0002] When an SSD (Solid State Drive) is connected to a computer, when target data stored in the SSD needs to be deleted, the computer will send a Trim command to the SSD.
[0003] In actual execution, the process of SSD processing Trim command includes: parsing the Trim command to obtain LBA (Logical Block Address) information, and marking the data page in the physical block storing the target data recorded in the L2P (Logical to Physical) table as invalid according to the LBA information. After the Trim command is processed, the SSD performs garbage collection on the target data in the data page marked invalid in the memory space according to the processed L2P table, and finally deletes the target data; among them, the processing process of the L2P table needs to be processed during the idle time of the SSD.
[0004] In practical applications, although the use of the Trim command helps to improve the write performance of the SSD and can effectively extend the service life of the SSD, the priority of processing the L2P table in the SSD is lower than the priority of processing the read and write requests, which makes the processing of the L2P table easily interrupted and delayed. As a result, the write amplification may increase due to the untimely deletion of the target data, and even affect the processing efficiency of the read and write requests. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a Trim command processing method, device and related equipment to solve the technical problem in the prior art that the processing process for the L2P table is interrupted and delayed by the processing process for the read and write requests, resulting in untimely deletion of the target data.
[0006] In a first aspect, the present application proposes a Trim command processing method, which is applied to a solid state drive, and the method comprises:
[0007] Parse the received Trim command to obtain the logical block address LBA information;
[0008] According to the LBA information, a logical block to physical block L2P table is processed;
[0009] In the process of processing the L2P table, if a read / write request is received, the process of processing the read / write request and the process of processing the L2P table are controlled to be performed alternately according to the read / write request.
[0010] Preferably, the controlling, according to the read / write request, to process the read / write request and the processing of the L2P table alternately comprises:
[0011] Determine the type of the read / write request according to the read / write request;
[0012] The types of read and write requests include: pure write, pure read, and mixed read and write;
[0013] According to the type of the read / write request, determining, from among a plurality of alternating conditions, a current alternating condition that needs to be satisfied when controlling the alternating processing of the read / write request and the processing of the L2P table;
[0014] According to the current alternation condition, the processing process for the read / write request and the processing process for the L2P table are controlled to be performed alternately.
[0015] Preferably, the LBA information indicates location information and data information of a target data page in a target physical block storing target data in the solid state drive, and the target data is data that needs to be deleted in the solid state drive as indicated by the Trim command;
[0016] The processing process for the read / write request includes: M first unit processes corresponding to the M read / write requests one by one;
[0017] The processing process for the L2P table includes: N second unit processes corresponding one-to-one to the N target physical blocks;
[0018] The second unit process includes: marking the target data page in the nth target physical block recorded in the L2P table as invalid according to the location information, and adjusting the number of valid data pages in the nth target physical block recorded in the valid page count VPC table according to the data information, where N≥n≥1;
[0019] The alternating condition indicates that n′ second unit processes are executed every time m′ first unit processes are completed; wherein, M≥m′≥1, N≥n′≥1.
[0020] Preferably, when the type of the read / write request is the pure write, the ratio between m′ and n′ is a first value;
[0021] When the type of the read-write request is the pure read, the ratio between m' and n' is a second value;
[0022] When the type of the read-write request is the read-write mix, the ratio between m' and n' is a third value.
[0023] Preferably, the magnitude relationship among the first value, the second value, and the third value satisfies the following condition:
[0024] The second value > the third value > the first value;
[0025] When the read-write request types are the pure write, the pure read, and the read-write mix respectively, the corresponding n' 纯写 , n' 纯读 and n' 读写混合 The magnitude relationship among them satisfies the following condition:
[0026] n' 纯写 > n' 读写混合 > n' 纯读 .
[0027] Preferably, the number of the Trim commands is P; the method further includes:
[0028] In the i-th process of processing the L2P table during the alternating process, if the N p -th second unit process corresponding to the p-th Trim command is processed and N p < n', continue to process at least one second unit process corresponding to the subsequent p commands until the number of second unit processes processed in the i-th process of processing the L2P table reaches n'; where i ≥ 1;
[0029] Wherein, the subsequent Trim commands indicate at least one Trim command located after the p-th Trim command in the Trim command sorting, and the Trim command sorting indicates the order in which the P Trim commands are transmitted to the solid-state drive, P ≥ p ≥ 1.
[0030] In a second aspect, the present application provides a Trim command processing device applied to a solid-state drive. The device includes: a parsing module, a processing module, and a scheduling module;
[0031] The parsing module is configured to parse the received Trim command to obtain logical block address LBA information;
[0032] The processing module processes the logical block to physical block L2P table according to the LBA information;
[0033] The scheduling module is used for, during the process of processing the L2P table, if a read / write request is received, controlling the processing of the read / write request and the processing of the L2P table to be performed alternately according to the read / write request.
[0034] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store software programs, and the processor runs or executes the software programs stored in the memory so that the electronic device implements the Trim command processing method as described above.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program codes executed by a processor, wherein the program codes include methods for implementing the above-mentioned Trim command processing method.
[0036] In a fifth aspect, the present application provides a computer program product, including a program code, so that when a computer runs the computer program product, the computer executes the above-mentioned Trim command processing method.
[0037] Beneficial effects:
[0038] The present application proposes a Trim command processing method, which is applied to a solid-state hard disk. The method includes: parsing a received Trim command to obtain logical block address LBA information; processing a logical block to physical block L2P table according to the LBA information; in the process of processing the L2P table, if a read / write request is received, controlling the processing process for the read / write request and the processing process for the L2P table to be performed alternately according to the read / write request;
[0039] In summary, the present application schedules the processing process for read and write requests and the processing process for the L2P table, so that the processing process for read and write requests and the processing process for the L2P table can be performed alternately. Therefore, after the technical solution of the present application is implemented, the target data that needs to be deleted in the SSD will be deleted in time, avoiding the increase of write amplification and ensuring the processing quality of the SSD for read and write requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. The following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1A flow chart of a Trim command processing method provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of two processing processes provided in an embodiment of the present application being performed alternately;
[0043] Figure 3 A schematic diagram of the structure of a Trim command processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In the prior art, when an SSD (Solid State Drive) is connected to a computer, if target data stored in the SSD needs to be deleted, the computer will send a Trim command to the SSD.
[0045] In actual execution, the process of SSD processing Trim command usually includes: foreground process and background process; among them, the foreground process is executed immediately after the SSD receives the Trim command, mainly referring to the process of the SSD parsing the Trim command to obtain LBA (Logical Block Address) information, and the LBA information indicates the location information and data information of the logical block corresponding to the physical block that needs to be deleted in the SSD; the background process is executed when the SSD is idle, mainly referring to the SSD marking the data page in the physical block storing the target data recorded in the L2P (Logical to Physical) table as invalid according to the LBA information and modifying the number of valid data pages in the physical block storing the target data recorded in the VPC (Valid Page Count) table accordingly.
[0046] After the Trim command is processed, the SSD performs garbage collection on the target data in the data pages marked invalid in the memory space according to the processed L2P table, and finally deletes the target data; the processing of the L2P table needs to be processed during the idle time of the SSD.
[0047] In practical applications, although the use of the Trim command helps to improve the write performance of the SSD and can effectively extend the service life of the SSD, the priority of processing the L2P table in the SSD is lower than the priority of processing the read and write requests. Therefore, when processing the L2P table, if the SSD receives a read or write request sent by the computer, it will give priority to the processing of the read or write request, resulting in the processing of the L2P table being easily interrupted and delayed. As a result, the write amplification may increase due to the untimely deletion of the target data, and may even affect the processing efficiency of the read and write requests.
[0048] In order to solve the above problems, an embodiment of the present application proposes a Trim command processing solution; in this solution, the embodiment of the present application schedules the processing process for read and write requests and the processing process for the L2P table, so that the processing process for the read and write requests and the processing process for the L2P table can be performed alternately. Therefore, after the technical solution of the embodiment of the present application is implemented, the target data that needs to be deleted in the SSD will be deleted in time, ensuring the processing efficiency of the SSD for read and write requests.
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. 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 the present application.
[0050] First, the present application embodiment proposes a Trim command processing method, which is applied to a solid state drive, such as Figure 1 As shown, Figure 1 The flowchart of the Trim command processing method provided in the embodiment of the present application includes: S110 to S130, and the details are as follows:
[0051] S110: Parse the received Trim command to obtain logical block address LBA information.
[0052] Specifically, when a user deletes target data stored in the SSD by operating a computer, the computer sends a Trim command for deleting the target data stored in the SSD to the SSD.
[0053] After receiving the Trim command, the SSD immediately executes the foreground process and parses the Trim command to obtain the logical block address LBA information.
[0054] The LBA information indicates location information and data information of a physical block of target data in the SSD.
[0055] S120: Processing the logical block to physical block L2P table according to the LBA information.
[0056] Specifically, when the SSD is idle, that is, when no read or write requests are required, the SSD executes a background process and processes the L2P table and the VPC table according to the LBA information, marking the data pages in the physical blocks storing the target data recorded in the L2P table as invalid and modifying the number of valid data pages in the physical blocks storing the target data recorded in the VPC (Valid Page Count) table accordingly.
[0057] S130: During the process of processing the L2P table, if a read / write request is received, the process of processing the read / write request and the process of processing the L2P table are controlled to be performed alternately according to the read / write request.
[0058] Specifically, in the embodiment of the present application, in order to enable the target data to be deleted in a timely manner without hindering the processing of read and write requests, the SSD controls the processing of read and write requests and the processing of the L2P table alternately.
[0059] It should be emphasized that the read and write requests in the embodiments of the present application refer to multiple requests generated by the computer according to the user's read and write operations for requesting corresponding processing of unit data amounts in the SSD; the unit data amount requested by each read and write request can be 4kb, so the number of read and write requests sent is usually large.
[0060] In actual execution, the alternating process ends when any one of the processing process for the read / write request and the processing process for the L2P table is finished, and the SSD will only execute the remaining processing process.
[0061] In actual execution, because both the processing of read and write requests and the processing of the L2P table are started based on the user's operation on the SSD in the computer, there is a situation where read and write requests and Trim commands continue to increase; in this case, it is only necessary to continue the alternating process.
[0062] In one implementation, S130 includes: Step (1) to Step (3), the details of which are as follows:
[0063] Step (1): Determine the type of the read / write request according to the read / write request;
[0064] The types of read and write requests include: pure write, pure read, and mixed read and write.
[0065] Step (2): According to the type of the read / write request, determine the current alternating condition that needs to be satisfied when controlling the alternating processing of the read / write request and the processing of the L2P table from among multiple alternating conditions.
[0066] Specifically, in the embodiment of the present application, the alternation of the processing process for the read / write request and the processing process for the L2P table needs to meet multiple pre-set alternation conditions, so that the alternation of the processing process for the read / write request and the processing process for the L2P table has a certain "rhythm" to ensure that the two processing processes can be carried out in an orderly manner. In actual application, when controlling the alternation of the two processing processes, when the alternation conditions are met, switch from one processing process to the other processing process.
[0067] In actual execution, the resources required by the SSD to process different read and write requests are different, so formulating alternating rules according to the types of read and write requests can ensure the stability of the alternating of the two processing processes.
[0068] When the computer sends a read or write request to the SSD, the request includes information indicating the type of the read or write request. After receiving the read or write request, the SSD can determine the type of the read or write request.
[0069] Step (3): According to the current alternation condition, the processing process for the read / write request and the processing process for the L2P table are controlled to be performed alternately.
[0070] Specifically, in the embodiment of the present application, the alternation condition corresponds to the type of the read / write request. The types of the read / write request include 3 types, and there are also at least 3 alternation conditions.
[0071] In some embodiments, the LBA information indicates location information and data information of a target data page in a target physical block storing target data in the solid state drive, and the target data is data that needs to be deleted in the solid state drive as indicated by the Trim command;
[0072] The processing process for the read and write requests includes: M first unit processes corresponding to the M read and write requests one by one;
[0073] The processing process for the L2P table includes: N second unit processes corresponding one-to-one to the N target physical blocks;
[0074] The second unit process includes: marking the target data page in the nth target physical block recorded in the L2P table as invalid according to the location information, and adjusting the number of valid data pages in the nth target physical block recorded in the valid page count VPC table according to the data information, N≥n≥1;
[0075] The alternating condition indicates that n′ second unit processes are executed every time m′ first unit processes are completed; wherein, M≥m′≥1, N≥n′≥1.
[0076] Specifically, Figure 2 As shown, Figure 2 A schematic diagram of two processing processes provided in an embodiment of the present application being performed alternately, Figure 2 In the figure, m′=4, n′=2; during the SSD processing of the L2P table, if a read or write request is received from the computer, m′ first unit processes and n′ second unit processes are controlled to be executed alternately, that is, n′ second unit processes are executed after m′ first unit processes are executed.
[0077] In an implementation process, when the type of the read / write request is pure write, the ratio between m′ and n′ is a first value; when the type of the read / write request is pure read, the ratio between m′ and n′ is a second value; when the type of the read / write request is mixed read / write, the ratio between m′ and n′ is a third value; the magnitude relationship among the first value, the second value and the third value is: the second value> the third value> the first value;
[0078] In addition, when the types of read and write requests are pure write, pure read, and mixed read and write, the corresponding n′ 纯写 , n′ 纯读 and n′ 读写混合 The size relationship between them is: n′ 纯写 >n′ 读写混合 >n′ 纯读 .
[0079] Specifically, in the embodiment of the present application, the alternation condition is further specified according to the type of read and write request; wherein different read and write requests correspond to different ratios of the number of unit processes, and the ratio of the number of unit processes is the ratio between m′ and n′; different read and write requests correspond to different n′.
[0080] During actual execution, the second value corresponding to the pure read read / write request>the third value corresponding to the mixed read / write read / write request>the first value corresponding to the pure write read / write request.
[0081] n′ corresponding to pure write read and write requests 纯写 >n′ corresponding to mixed read and write requests 读写混合 >n′ corresponding to pure read read and write requests 纯读 .
[0082] For example, when the type of read / write request is pure write, 4 second unit processes are executed after each 4 first unit processes are completed; when the type of read / write request is pure read, 2 second unit processes are executed after each 6 first unit processes are executed; when the type of read / write request is mixed read / write, 3 second unit processes are executed after each 6 first unit processes are executed.
[0083] In one implementation, the number of Trim commands is P; the method further includes: step (4), details of which are as follows:
[0084] Step (4): During the process of processing the L2P table for the i-th time in the alternating process, if the N corresponding to the p-th Trim command is p The second unit process is completed and N p<n′, continue to process at least one second unit process corresponding to the subsequent Trim command until the number of second unit processes processed in the i-th process of processing the L2P table reaches n′; where i ≥ 1;
[0085] Among them, the subsequent Trim command indicates at least one Trim command that is subsequent to the p-th Trim command in the Trim command sorting, and the Trim command sorting indicates P Trim commands in the order in which they are transmitted to the solid-state drive, where P ≥ p ≥ 1.
[0086] Specifically, during the alternating process of processing read / write requests and processing the L2P table, each process of processing the L2P table can process at most n′ second unit processes, but the number of second unit processes corresponding to the Trim command is not necessarily an integer multiple of n′. There must be a number N of second unit processes processed in the i-th process of processing the L2P table p <n′, in this case, if there is no Trim command to be processed, directly continue the process of processing read / write requests. If there is a Trim command to be processed, execute the number of second unit processes corresponding to the Trim command to be processed until the number of second unit processes processed in the i-th process of processing the L2P table reaches n′.
[0087] In actual execution, when the N p th second unit process corresponding to the p-th Trim command is processed and N p <n′, if the number of Trim commands to be processed is 1, directly determine the Trim command to be processed as the (p + 1)-th Trim command, and then process the second unit process corresponding to the (p + 1)-th Trim command; if the number of Trim commands to be processed is multiple, determine the next Trim command to be processed subsequent to the p-th Trim command as the (p + 1)-th Trim command in the order of receiving multiple Trim commands.
[0088] Second, the embodiment of the present application also proposes a Trim command processing device, which is applied to a solid-state drive, as Figure 3 shown, Figure 3 is a schematic structural diagram of the Trim command processing device provided by the embodiment of the present application. The device includes: a parsing module 310, a processing module 320, and a scheduling module 330;
[0089] The parsing module 310 is configured to parse the received Trim command to obtain logical block address LBA information.
[0090] The processing module 320 processes the logical block to physical block L2P table according to the LBA information.
[0091] The scheduling module 330 is used to control the processing of the read / write request and the processing of the L2P table to be performed alternately according to the read / write request if a read / write request is received during the processing of the L2P table.
[0092] In one implementation, the scheduling module 330 is further used to determine the type of the read / write request according to the read / write request; wherein the types of the read / write request include: pure write, pure read, and mixed read / write;
[0093] The scheduling module 330 is further used to determine, according to the type of the read / write request, a current alternating condition that needs to be satisfied when controlling the alternating processing of the read / write request and the processing of the L2P table from among the multiple alternating conditions;
[0094] The scheduling module 330 is further used to control the processing process for the read / write request and the processing process for the L2P table to be performed alternately according to the current alternation condition.
[0095] In one implementation, the LBA information indicates location information and data information of a target data page in a target physical block storing target data in the solid state drive, and the target data is data that needs to be deleted in the solid state drive as indicated by the Trim command;
[0096] The processing process for the read and write requests includes: M first unit processes corresponding to the M read and write requests one by one;
[0097] The processing process for the L2P table includes: N second unit processes corresponding one-to-one to the N target physical blocks;
[0098] The second unit process includes: marking the target data page in the nth target physical block recorded in the L2P table as invalid according to the location information, and adjusting the number of valid data pages in the nth target physical block recorded in the valid page count VPC table according to the data information, N≥n≥1;
[0099] The alternating condition indicates that n′ second unit processes are executed every time m′ first unit processes are completed; wherein, M≥m′≥1, N≥n′≥1.
[0100] In one implementation, when the type of the read / write request is pure write, the ratio between m′ and n′ is a first value;
[0101] When the type of the read / write request is pure read, the ratio between m′ and n′ is a second value;
[0102] When the type of the read / write request is read / write mixed, the ratio between m′ and n′ is a third value.
[0103] In one implementation, the magnitude relationship among the first value, the second value, and the third value satisfies the following conditions:
[0104] The second value > the third value > the first value;
[0105] The n′ corresponding when the types of read-write requests are pure write, pure read, and read-write mixed respectively 纯写 , n′ 纯读 and n′ 读写混合 The magnitude relationship among them satisfies the following conditions:
[0106] n′ 纯写 > n′ 读写混合 > n′ 纯读 .
[0107] In one implementation, the number of Trim commands is P; the scheduling module 330 is further configured to, in the i-th process of processing the L2P table during the alternating process, if the N p th second unit process corresponding to the p-th Trim command is processed and N p < n′, continue to process at least one second unit process corresponding to the subsequent Trim commands until the number of second unit processes processed in the i-th process of processing the L2P table reaches n′; where i ≥ 1;
[0108] Among them, the subsequent Trim commands refer to at least one Trim command located after the p-th Trim command in the Trim command sorting, and the Trim command sorting indicates the order in which the P Trim commands are transmitted to the solid-state drive, P ≥ p ≥ 1.
[0109] Third, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of S110 - S130 provided in the above embodiments are implemented.
[0110] Fourth, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of S110 - S130 in the above embodiments are executed.
[0111] Fifth, the computer program product provided by the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the foregoing method embodiments. For specific implementation, reference can be made to the steps of S110 - S130 in the method embodiments, which will not be elaborated here.
[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0113] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0115] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM) random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0116] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0117] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A Trim command processing method, characterized in that: Applied to a solid state drive, the method comprises: Parse the received Trim command to obtain the logical block address LBA information; According to the LBA information, a logical block to physical block L2P table is processed; In the process of processing the L2P table, if a read / write request is received, the process of processing the read / write request and the process of processing the L2P table are controlled to be performed alternately according to the read / write request.
2. The method according to claim 1, characterized in that According to the read / write request, controlling the processing process for the read / write request and the processing process for the L2P table to be performed alternately includes: Determine the type of the read / write request according to the read / write request; The types of read and write requests include: pure write, pure read, and mixed read and write; According to the type of the read / write request, determining, from among a plurality of alternating conditions, a current alternating condition that needs to be satisfied when controlling the alternating processing of the read / write request and the processing of the L2P table; According to the current alternation condition, the processing process for the read / write request and the processing process for the L2P table are controlled to be performed alternately.
3. The method according to claim 2, characterized in that The LBA information indicates location information and data information of a target data page in a target physical block storing target data in the solid state drive, and the target data is data that needs to be deleted in the solid state drive as indicated by the Trim command; The processing process for the read / write request includes: M first unit processes corresponding to the M read / write requests one by one; The processing process for the L2P table includes: N second unit processes corresponding one-to-one to the N target physical blocks; The second unit process includes: marking the target data page in the nth target physical block recorded in the L2P table as invalid according to the location information, and adjusting the number of valid data pages in the nth target physical block recorded in the valid page count VPC table according to the data information, where N≥n≥1; The alternating condition indicates that whenever m ′ After the first unit process is completed, execute n ′ The second unit process; where M ≥ m ′ ≥1, N≥n ′ ≥1.
4. The method according to claim 3, characterized in that When the type of the read / write request is pure write, m ′ With n ′ The ratio between them is the first value; When the type of the read / write request is the pure read, m ′ With n ′ The ratio between them is the second value; When the type of the read / write request is the read / write mix, m ′ With n ′ The ratio between them is the third value.
5. The method according to claim 4, characterized in that The magnitude relationship among the first value, the second value and the third value satisfies the following condition: The second value>the third value>the first value; When the types of the read and write requests are respectively the pure write, the pure read, and the read-write mixed, the corresponding n ′ 纯写 、n ′ 纯读 and n ′ 读写混合 The size relationship between them satisfies the following conditions: n ′ 纯写 >n ′ 读写混合 >n ′ 纯读 。 6. The method according to claim 3, characterized in that The number of the p commands is P; the method further includes: In the process of processing the L2P table in the i-th step during the alternating process, if the N corresponding to the p-th Trim command is p The second unit process is completed and N p <n ′ , continue to process at least one of the second unit processes corresponding to the subsequent p command until the number of the second unit processes processed by the i-th process for processing the L2P table reaches n ′ ; where i≥1; The subsequent Trim command indicates at least one Trim command that is located subsequent to the pth Trim command in the Trim command sorting, and the Trim command sorting indicates the order in which P Trim commands are transmitted to the solid state drive, P≥p≥1.
7. A Trim command processing device, characterized in that: Applied to a solid state drive, the device comprises: a parsing module, a processing module and a scheduling module; The parsing module is used to parse the received Trim command to obtain the logical block address LBA information; The processing module processes the logical block to physical block L2P table according to the LBA information; The scheduling module is used for, during the process of processing the L2P table, if a read / write request is received, controlling the processing of the read / write request and the processing of the L2P table to be performed alternately according to the read / write request.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, the memory is used to store a software program, and the processor runs or executes the software program stored in the memory so that the electronic device implements the Trim command processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes executed by a processor, wherein the program codes include code for implementing the Trim command processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises program codes, and when a computer runs the computer program product, the computer executes the Trim command processing method according to any one of claims 1 to 6.