A method for host device and storage device cooperative management and a storage system thereof
By adding feature information to logical blocks, the host device and storage device can be aware of each other's status during writing and garbage collection, which solves the problem of information asymmetry between the host device and storage device, optimizes writing and garbage collection strategies, reduces bandwidth contention and write amplification factor, and extends media lifespan.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DAPUSTOR CORP
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-21
AI Technical Summary
The lack of information communication between the host device and the storage device causes the storage device to compete with the host device for bandwidth during garbage collection, resulting in an increased write amplification factor and a shortened media lifespan.
By adding feature information to logical blocks, host devices and storage devices can achieve state awareness during writes and garbage collection, thereby optimizing write and garbage collection strategies and reducing bandwidth contention.
The write and garbage collection strategies have been optimized, the write amplification factor has been reduced, and the lifespan of the storage media has been extended.
Smart Images

Figure CN116088757B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, specifically to a method and storage system for collaborative management of host devices and storage devices. Background Technology
[0002] The smallest unit of operation for a host device is a logical block (LBA), and the erase and write granularity of a logical block differs from that of a flash memory. Due to the characteristics of the flash memory, as the host device repeatedly writes data, garbage (Dirty / Invalid) data will be added inside the storage device. Therefore, the storage device needs to perform garbage collection (GC) to release garbage data for reuse.
[0003] However, in the existing technology, the host device and the storage device are not aware of each other's details and lack feature information for association. This makes it easy for the storage device to compete with the host device for bandwidth when performing garbage collection (GC). Furthermore, the host device's writing strategy is simple, which makes it impossible for the storage device to properly balance media wear during GC, resulting in an increase in the write amplification factor (WAF) and a shortened media lifespan. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a method and storage system for collaborative management of host devices and storage devices. By adding feature information to logical blocks, the method enables mutual awareness of the states of host devices and storage devices during write and GC, which is beneficial for optimizing write and GC strategies, thereby reducing bandwidth contention during GC and lowering write amplification.
[0005] To address the aforementioned technical problems, this application provides a method for collaborative management of host devices and storage devices, comprising:
[0006] The host device processes the data to be written, determines at least one logical block corresponding to the data to be written, adds feature information to the at least one logical block and saves it to the storage device;
[0007] The storage device writes the at least one logical block into the storage medium according to the feature information;
[0008] The host device determines the target area to be erased in the storage medium based on the characteristic information of the invalid logic block, and sends a garbage removal command to the storage device;
[0009] The storage device erases the target area and releases the invalid logic blocks in the target area.
[0010] Optionally, determining at least one logical block corresponding to the data to be written includes:
[0011] Obtain available logical blocks to determine at least one logical block corresponding to the data to be written, wherein the available logical blocks do not overlap with the logical blocks in the storage device.
[0012] Optionally, after the storage device erases the target area and releases the invalid logical blocks in the target area, it further includes:
[0013] First, convert the released invalid logic block into a logic block whose usage state is to be converted;
[0014] Then, the logic block whose usage state needs to be changed is converted into a usable logic block.
[0015] Optionally, before the storage device writes the at least one logical block to the storage medium based on the feature information, it further includes:
[0016] The storage device determines whether the at least one logical block is duplicated. If a duplicate logical block exists, the duplicate logical block is converted into a logical block to be converted to a different usage state.
[0017] Optionally, the method further includes:
[0018] The storage device actively determines the target area to be erased in the storage medium based on the characteristic information of the invalid logic block;
[0019] Erase the target area and release the invalid logic blocks in the target area.
[0020] Optionally, the feature information includes time information and spatial information, wherein the time information is associated with the time characteristics of the host device and / or the data to be written, and the spatial information is associated with the storage space characteristics of the storage device, and is used to ensure that the write areas between the at least one logical block are continuous or identical. The storage device writes the at least one logical block to the storage medium according to the feature information, including:
[0021] The storage device writes the at least one logical block and the time information into the storage medium according to the spatial information.
[0022] Optionally, when the host device determines the target area to be erased in the storage medium based on the feature information of the invalid logic block, or when the storage device determines the target area to be erased in the storage medium based on the feature information of the invalid logic block, it employs at least one of the following strategies:
[0023] Based on the spatial information, invalid logical blocks are selected so that the target area contains invalid logical blocks belonging to the same data to be written.
[0024] And / or select invalid logic blocks based on the spatial information, such that the number of invalid logic blocks contained in the target area is greater than or equal to a preset number;
[0025] And / or select invalid logic blocks based on the spatial information, so that the positions of invalid logic blocks contained in the target region are continuous;
[0026] And / or select invalid logic blocks based on the time information, so that the target region contains invalid logic blocks with similar lifecycles;
[0027] And / or select invalid logic blocks based on the time information, so that the target area contains invalid logic blocks with a heat value lower than the heat value threshold;
[0028] And / or select invalid logic blocks based on the time information, so that the target area contains invalid logic blocks whose clearance probability is higher than the probability threshold.
[0029] Optionally, the host device determines the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks in the storage device, and sends a garbage collection command to the storage device, including:
[0030] The target area to be erased in the storage medium is determined based on the characteristic information of the invalid logic block;
[0031] The timing for sending a garbage collection command to the storage device is selected based on the input and output status;
[0032] Send a garbage removal command to the storage device.
[0033] This application also provides a storage system, including a host device and a storage device, wherein the host device is used for:
[0034] The data to be written is processed to determine at least one logical block corresponding to the data to be written, and feature information is added to the at least one logical block and saved to the storage device, so that the storage device writes the at least one logical block and the time information into the storage medium according to the spatial information.
[0035] And, used for:
[0036] Get an invalid logic block;
[0037] The target area to be erased in the storage medium is determined based on the characteristic information of the invalid logic block, and a garbage collection command is sent to the storage device so that the storage device erases the target area and releases the invalid logic block in the target area.
[0038] The storage device is used for:
[0039] Write the at least one logical block to the storage medium according to the feature information; and erase the target area according to the garbage collection instruction to release the invalid logical blocks in the target area.
[0040] Optionally, the storage system further includes a first logical block storage module and a second logical block storage module;
[0041] The first logical block storage module is used to store usable logical blocks, which are logical blocks that do not overlap with the logical blocks in the storage device; the first logical block storage module connects the host device and the storage device, or the host device includes the first logical block storage module, or the storage device includes the first logical block storage module;
[0042] The second logical block storage module is used to store logical blocks whose usage state is to be changed; the second logical block storage module is connected to the host device and the storage device, or the host device includes the second logical block storage module, or the storage device includes the second logical block storage module;
[0043] The host device is used for:
[0044] When processing the data to be written, an available logical block is obtained from the first logical block storage module to determine at least one logical block corresponding to the data to be written;
[0045] The storage device is used for:
[0046] After releasing the invalid logic block in the target area, the released invalid logic block is transmitted to the second logic block storage module as a logic block to be converted to a different usage state.
[0047] The host device is also used for:
[0048] The logic blocks in the second logic block storage module that are to be converted to a different state are transferred to the first logic block storage module as usable logic blocks.
[0049] This application discloses a method and storage system for collaborative management of host devices and storage devices. The method includes: a host device processing data to be written, determining at least one logical block corresponding to the data to be written, adding feature information to the at least one logical block and saving it to a storage device; the storage device writing the at least one logical block to a storage medium based on the feature information; the host device determining a target area to be erased in the storage medium based on the feature information of invalid logical blocks, and sending a garbage collection command to the storage device; and the storage device erasing the target area and releasing the invalid logical blocks in the target area. The storage system includes the host device and the storage device. By adding feature information to logical blocks, this application enables mutual awareness of the states of the host device and the storage device during writing and garbage collection (GC), which is beneficial for optimizing writing and GC strategies, thereby reducing bandwidth contention during GC and reducing write amplification. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a method for collaborative management of host devices and storage devices according to an embodiment;
[0051] Figure 2 This is a detailed flowchart illustrating a method for collaborative management of host devices and storage devices according to an embodiment;
[0052] Figure 3 This is a schematic diagram of a storage system according to one embodiment. Detailed Implementation
[0053] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items. In this invention, "each" includes one or more items.
[0055] Figure 1 This is a flowchart illustrating a method for collaborative management of host devices and storage devices according to one embodiment. Figure 1 As shown, a method for collaborative management of host devices and storage devices includes the following steps:
[0056] S1, the host device processes the data to be written, determines at least one logical block corresponding to the data to be written, adds feature information to the at least one logical block and saves it to the storage device;
[0057] S2, The storage device writes at least one logical block to the storage medium based on the feature information;
[0058] S3, the host device determines the target area to be erased in the storage medium based on the characteristic information of the invalid logical block, and sends a garbage removal command to the storage device;
[0059] S4, the storage device erases the target area and releases invalid logical blocks in the target area.
[0060] This application enables mutual awareness of the host device and storage device's state during write and GC by adding feature information to logical blocks. This is beneficial for optimizing write and GC strategies, thereby reducing bandwidth contention during GC and lowering write amplification.
[0061] Optionally, the storage device is, for example, a solid-state drive (SSD), and the storage medium is, for example, NAND flash memory chips. The storage device communicates with the host device via a PCIe interface and the NVMe protocol.
[0062] Optionally, the feature information includes temporal and spatial information. The temporal information is associated with the temporal characteristics of the host device and / or the data to be written, while the spatial information is associated with the spatial characteristics of the storage device and / or the data to be written, and is used to ensure that the write areas between at least one logical block are continuous or identical. The temporal features include hotness / coldness, erase probability, and logical block creation time, while the spatial features include media physical arrangement, physical location, media boundaries, idle state, number of idle spaces, and the discreteness or continuity of the logical blocks containing the data to be written.
[0063] Optionally, in S2, the storage device writes at least one logical block to the storage medium based on the feature information, including:
[0064] The storage device writes at least one logical block and time information into the storage medium based on spatial information.
[0065] In this process, the storage device writes logical blocks and corresponding time information into the storage medium according to the spatial information of the logical blocks, such as the physical arrangement, physical location, and media boundaries of the medium, so that the write areas between at least one logical block of the same data to be processed are continuous or the same.
[0066] By writing logical blocks based on feature information, the host device and storage device achieve mutual awareness. The feature information reflects the host device's desired spatial organization, temporal organization, and other information, enabling the storage device to perceive the host device's characteristics and optimize the write strategy. This makes the position and arrangement of logical blocks in the storage medium more reasonable, which is beneficial for selecting areas with fewer or no valid logical blocks during subsequent GC, eliminating the need to read valid logical blocks and rewrite them. At the same time, the medium is evenly erased, balancing medium wear and reducing the write amplification factor.
[0067] Optionally, to reduce the generation of garbage data, in step S1, determining at least one logical block corresponding to the data to be written includes:
[0068] Obtain available logical blocks to determine at least one logical block corresponding to the data to be written, wherein the available logical blocks do not overlap with the logical blocks in the storage device.
[0069] In this process, when determining at least one logical block corresponding to the data to be written, an available logical block is used. Since the available logical block does not overlap with the logical blocks in the storage device, the writing of duplicate data can be reduced, thereby reducing the generation of garbage data.
[0070] Furthermore, to reduce the generation of junk data, before the storage device writes at least one logical block to the storage medium based on the characteristic information in step S2, the method further includes:
[0071] The storage device determines whether at least one logical block is duplicated. If duplicate logical blocks exist, the duplicate logical blocks are converted into logical blocks whose usage state is to be converted.
[0072] When a logical block is transferred to a storage device, the storage device can again determine whether the logical block is duplicated with a logical block in the storage device. If a duplicate logical block exists, the duplicate logical block is converted into a logical block in a state to be converted for use, and waits for the host device to reclaim it so that it can be converted back into a usable logical block.
[0073] Based on the mutual conversion between usable logical blocks and logical blocks awaiting conversion of usage status, discrete management of logical blocks is realized. There is no need for logical blocks to increment or decrement automatically. The host device and storage device can work together to complete tasks such as selecting logical blocks, determining continuity, and determining validity to achieve optimal decision-making. This is beneficial for the balance of logical blocks and the equalization of media erase / write, thereby improving the lifespan of the media.
[0074] After the host device transmits the logical blocks and characteristic information to the storage device, it can actively make GC decisions. Specifically, the host device determines the target area to be erased in the storage medium based on the characteristic information of the invalid logical blocks and sends a garbage collection command to the storage device.
[0075] Optionally, when the host device determines the target area to be erased in the storage medium based on the characteristic information of the invalid logical block, it adopts at least one of the following strategies:
[0076] Select invalid logical blocks based on spatial information, so that the target area contains invalid logical blocks belonging to the same data to be written.
[0077] And / or select invalid logical blocks based on spatial information, so that the number of invalid logical blocks contained in the target area is greater than or equal to a preset number;
[0078] And / or select invalid logical blocks based on spatial information to make the positions of invalid logical blocks contained in the target region continuous;
[0079] And / or select invalid logical blocks based on time information, so that the target area contains invalid logical blocks with similar lifecycles;
[0080] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks with a heat value lower than the heat value threshold;
[0081] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks whose clearance probability is higher than the probability threshold.
[0082] Invalid logical blocks, or garbage data, are the logical blocks that need to be cleared. Based on the above strategy, the host device organizes GC space and time to ensure that invalid logical blocks in the target area to be erased are basically contiguous, and that their lifespan, popularity, and erasure probability are optimally matched. Spatially, the physical arrangement, physical location, and media boundaries of invalid logical blocks meet the conditions, selecting contiguous invalid logical blocks, invalid logical blocks that do not cross boundaries, and areas with nearly identical wear. Temporally, the lifespan and popularity meet the conditions, selecting logical blocks with nearly identical lifespans, which is conducive to forming a GC strategy with better performance and better timing.
[0083] Optionally, based on this, the host device determines the target area to be erased in the storage medium according to the characteristic information of invalid logical blocks in the storage device, and sends a garbage collection command to the storage device, including:
[0084] The target area to be erased in the storage medium is determined based on the characteristic information of invalid logical blocks;
[0085] The timing for sending a garbage collection command to the storage device is selected based on the status of the inputs and outputs.
[0086] Send a garbage collection command to the storage device.
[0087] In this context, the host device, leveraging its inherent advantages, has sufficient capacity to stagger its GC strategy with its input and output (IO), reducing bandwidth contention. Therefore, during garbage collection, the host device can determine the GC timing based on its own IO load. Furthermore, when selecting invalid logical blocks, it can potentially choose regions with nearly zero valid data, thereby reducing the GC write of valid data. This optimizes the host device's bandwidth in terms of timing and reduces media wear on the storage device in terms of space.
[0088] In addition to responding to garbage collection commands from the host device, the storage device can also proactively determine the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks, erase the target area, and release the invalid logical blocks in the target area. Specifically, when determining the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks, the storage device employs at least one of the following strategies:
[0089] Select invalid logical blocks based on spatial information, so that the target area contains invalid logical blocks belonging to the same data to be written.
[0090] And / or select invalid logical blocks based on spatial information, so that the number of invalid logical blocks contained in the target area is greater than or equal to a preset number;
[0091] And / or select invalid logical blocks based on spatial information to make the positions of invalid logical blocks contained in the target region continuous;
[0092] And / or select invalid logical blocks based on time information, so that the target area contains invalid logical blocks with similar lifecycles;
[0093] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks with a heat value lower than the heat value threshold;
[0094] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks whose clearance probability is higher than the probability threshold.
[0095] Because the host device and the storage device perceive each other through feature information, the storage device itself can also make GC decisions in terms of space, such as the physical arrangement, physical location, and media boundaries of invalid logical blocks, to select consecutive invalid logical blocks, invalid logical blocks that do not cross boundaries, and areas with nearly the same wear. In terms of time, it can select logical blocks with nearly the same lifespan if the lifespan and temperature conditions are met. This is conducive to forming a GC strategy with better performance and better time.
[0096] Optionally, after the S4 storage device erases the target area and releases the invalid logical blocks in the target area, it also includes:
[0097] First, convert the released invalid logic block into a logic block whose usage state is to be converted;
[0098] Then convert the logic block whose state is to be changed into a usable logic block.
[0099] In this process, the released invalid logic blocks are converted into logic blocks in a state of pending conversion for use, waiting for the host device to reclaim them and then convert them back into usable logic blocks. This achieves discrete management of logic blocks, which is beneficial for the balance of logic blocks and the equalization of erase / write operations on the media, thereby extending the lifespan of the media.
[0100] The following combination Figure 2 The overall process of the method in this embodiment will be described.
[0101] After the host device obtains the data to be written, it identifies the available logical blocks and determines at least one logical block corresponding to the data to be written. Then, it adds feature information to the at least one logical block and saves the logical block and feature information to the storage device.
[0102] After receiving a logical block, the storage device checks if the logical block is duplicated. If duplicates are found, a new logical block is selected. The host device then acquires a new usable logical block and determines at least one logical block corresponding to the data to be written.
[0103] If there are no duplicate logical blocks, the storage device writes at least one logical block to the storage medium based on the characteristic information.
[0104] After the host device saves the logical blocks and feature information to the storage device, it determines the target area to be erased in the storage medium based on the feature information of the invalid logical blocks, actively initiates GC, and sends a garbage collection command to the storage device. The storage device then performs passive GC based on the garbage collection command.
[0105] In addition, storage devices can also proactively determine the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks, and perform proactive garbage collection (GC). During passive or proactive GC, the storage device erases the target area and releases the invalid logical blocks in the target area.
[0106] The storage device converts the released invalid logical blocks into logical blocks in a state to be converted for use, and notifies the host device to convert the logical blocks in a state to be converted for use.
[0107] The method for collaborative management of host and storage devices disclosed in this application includes: the host device processing data to be written, determining at least one logical block corresponding to the data to be written, adding feature information to the at least one logical block and saving it to the storage device; the storage device writing the at least one logical block to the storage medium based on the feature information; the host device determining a target area to be erased in the storage medium based on the feature information of invalid logical blocks, and sending a garbage collection command to the storage device; and the storage device erasing the target area and releasing the invalid logical blocks in the target area. This application, by adding feature information to logical blocks, enables mutual awareness of the states of the host device and the storage device during writing and garbage collection (GC), which is beneficial for optimizing writing and GC strategies, thereby reducing bandwidth contention and write amplification.
[0108] Figure 3 This is a schematic diagram of a storage system according to one embodiment. Figure 3 As shown, this application also provides a storage system, including a host device 10 and a storage device 20.
[0109] The host device 10 is used to process the data to be written, determine at least one logical block corresponding to the data to be written, add feature information to the at least one logical block and save it to the storage device 20, so that the storage device 20 writes the at least one logical block and time information to the storage medium according to the spatial information; and is used to obtain invalid logical blocks; determine the target area to be erased in the storage medium according to the feature information of the invalid logical blocks, and send a garbage collection command to the storage device 20, so that the storage device 20 erases the target area and releases the invalid logical blocks in the target area.
[0110] Storage device 20 is used to write at least one logical block to a storage medium based on characteristic information; and to erase a target area according to a garbage collection instruction, releasing invalid logical blocks in the target area.
[0111] Optionally, determining at least one logical block corresponding to the data to be written includes:
[0112] Obtain available logical blocks to determine at least one logical block corresponding to the data to be written, wherein the available logical blocks do not overlap with the logical blocks in storage device 20.
[0113] Optionally, the storage device 20 is further configured to determine whether the at least one logical block is duplicated before writing the at least one logical block to the storage medium based on the feature information, and if there is a duplicate logical block, convert the duplicate logical block into a logical block to be converted into a usage state.
[0114] Optionally, the storage device 20 is also configured to actively determine the target area to be erased in the storage medium based on the characteristic information of the invalid logical blocks; erase the target area and release the invalid logical blocks in the target area.
[0115] Optionally, the feature information includes time information and spatial information, wherein the time information is associated with the time characteristics of the host device 10 and / or the data to be written, and the spatial information is associated with the storage space characteristics of the storage device 20 and is used to indicate that the write areas between at least one logical block are continuous or the same.
[0116] Storage device 20 is used to write at least one logical block and time information into a storage medium based on spatial information.
[0117] Optionally, when host device 10 determines the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks, or when storage device 20 determines the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks, at least one of the following strategies shall be adopted:
[0118] Select invalid logical blocks based on spatial information, so that the target area contains invalid logical blocks belonging to the same data to be written.
[0119] And / or select invalid logical blocks based on spatial information, so that the number of invalid logical blocks contained in the target area is greater than or equal to a preset number;
[0120] And / or select invalid logical blocks based on spatial information to make the positions of invalid logical blocks contained in the target region continuous;
[0121] And / or select invalid logical blocks based on time information, so that the target area contains invalid logical blocks with similar lifecycles;
[0122] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks with a heat value lower than the heat value threshold;
[0123] And / or select invalid logic blocks based on time information, so that the target area contains invalid logic blocks whose clearance probability is higher than the probability threshold.
[0124] Optionally, the host device 10 is configured to determine the target area to be erased in the storage medium based on the characteristic information of the invalid logic block; select the time to send the garbage collection command to the storage device 20 based on the status of the input and output; and send the garbage collection command to the storage device 20.
[0125] Optionally, the storage system further includes a first logical block storage module 30 and a second logical block storage module 40.
[0126] The first logical block storage module 30 is used to store usable logical blocks, which are logical blocks that do not overlap with the logical blocks in the storage device 20; the first logical block storage module 30 is connected to the host device 10 and the storage device 20, or the host device 10 includes the first logical block storage module 30, or the storage device 20 includes the first logical block storage module 30.
[0127] The second logical block storage module 40 is used to store logical blocks whose usage state is to be changed; the second logical block storage module 40 is connected to the host device 10 and the storage device 20, or the host device 10 includes the second logical block storage module 40, or the storage device 20 includes the second logical block storage module 40.
[0128] The host device 10 is used to obtain an available logical block from the first logical block storage module 30 when processing the data to be written, so as to determine at least one logical block corresponding to the data to be written.
[0129] Storage device 20 is used to release invalid logical blocks in the target area and then transfer the released invalid logical blocks to the second logical block storage module 40 as logical blocks to be converted to a different usage state.
[0130] The host device 10 is also used to transfer the logic blocks in the second logic block storage module 40 that are to be converted to a different usage state to the first logic block storage module 30 as usable logic blocks.
[0131] For details on the implementation of the above functions of host device 10 and storage device 20, please refer to Figures 1-2 The description of the illustrated embodiments will not be repeated here.
[0132] The storage system of this application enables mutual awareness of the state of the host device and the storage device during writing and GC by adding characteristic information to logical blocks. This is beneficial for optimizing writing and GC strategies, thereby reducing bandwidth contention and write amplification.
[0133] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for collaborative management of host devices and storage devices, applied to a storage system, characterized in that, The storage system includes a host device, a storage device, a first logical block storage module, and a second logical block storage module. The first logical block storage module stores usable logical blocks, and the second logical block storage module stores logical blocks whose usage status needs to be changed. The method includes: The host device processes the data to be written, obtains usable logical blocks from the first logical block storage module, determines at least one logical block corresponding to the data to be written, adds feature information to the at least one logical block and saves it to the storage device; wherein, the usable logical block is a logical block that does not overlap with the logical blocks in the storage device, the feature information includes time information and spatial information, the time information is associated with the time characteristics of the host device and / or the data to be written, the spatial information is associated with the storage space characteristics of the storage device, and is used to make the write areas between the at least one logical block continuous or the same; The storage device writes the at least one logical block and the time information into the storage medium according to the spatial information; The host device determines the target area to be erased in the storage medium based on the characteristic information of the invalid logic block, and sends a garbage removal command to the storage device; The storage device erases the target area, releases the invalid logic blocks in the target area, and transmits the released invalid logic blocks to the second logic block storage module as logic blocks to be converted to a new usage state. The host device transmits the logic blocks in the second logic block storage module that are to be converted to a different usage state to the first logic block storage module as usable logic blocks.
2. The method according to claim 1, characterized in that, Before the storage device writes the at least one logical block to the storage medium according to the feature information, it further includes: The storage device determines whether the at least one logical block is duplicated. If a duplicate logical block exists, the duplicate logical block is converted into a logical block to be converted to a different usage state.
3. The method according to claim 1, characterized in that, The method further includes: The storage device actively determines the target area to be erased in the storage medium based on the characteristic information of the invalid logic block; Erase the target area and release the invalid logic blocks in the target area.
4. The method according to claim 1, characterized in that, When the host device determines the target area to be erased in the storage medium based on the feature information of the invalid logic block, or when the storage device determines the target area to be erased in the storage medium based on the feature information of the invalid logic block, it employs at least one of the following strategies: Based on the spatial information, invalid logical blocks are selected so that the target area contains invalid logical blocks belonging to the same data to be written. And / or select invalid logic blocks based on the spatial information, such that the number of invalid logic blocks contained in the target area is greater than or equal to a preset number; And / or select invalid logic blocks based on the spatial information, so that the positions of invalid logic blocks contained in the target region are continuous; And / or select invalid logic blocks based on the time information, so that the target region contains invalid logic blocks with similar lifecycles; And / or select invalid logic blocks based on the time information, so that the target area contains invalid logic blocks with a heat value lower than the heat value threshold; And / or select invalid logic blocks based on the time information, so that the target area contains invalid logic blocks whose clearance probability is higher than the probability threshold.
5. The method according to claim 1, characterized in that, The host device determines the target area to be erased in the storage medium based on the characteristic information of invalid logical blocks in the storage device, and sends a garbage collection command to the storage device, including: The target area to be erased in the storage medium is determined based on the characteristic information of the invalid logic block; The timing for sending a garbage collection command to the storage device is selected based on the input and output status; Send a garbage removal command to the storage device.
6. A storage system, characterized in that, The system includes a host device, a storage device, a first logical block storage module, and a second logical block storage module. The first logical block storage module stores usable logical blocks, and the second logical block storage module stores logical blocks whose usage status needs to be changed. The host device is used for: The data to be written is processed by obtaining a usable logical block from the first logical block storage module to determine at least one logical block corresponding to the data to be written. Feature information is added to the at least one logical block and saved to the storage device. The usable logical block is a logical block that does not overlap with the logical blocks in the storage device. The feature information includes time information and spatial information. The time information is associated with the time characteristics of the host device and / or the data to be written. The spatial information is associated with the storage space characteristics of the storage device and is used to make the write areas between the at least one logical block continuous or the same. And, used for: Get an invalid logic block; The target area to be erased in the storage medium is determined based on the characteristic information of the invalid logic block, and a garbage removal command is sent to the storage device. The storage device is used for: Write the at least one logical block and the time information into the storage medium according to the spatial information; and erase the target area according to the garbage collection instruction, release the invalid logical blocks in the target area, and transmit the released invalid logical blocks to the second logical block storage module as logical blocks to be converted to a new usage state. The host device is also used for: The logic blocks in the second logic block storage module that are to be converted to a different state are transferred to the first logic block storage module as usable logic blocks.
7. The storage system according to claim 6, characterized in that, The first logical block storage module connects the host device and the storage device; or, the host device includes the first logical block storage module; or, the storage device includes the first logical block storage module. The second logical block storage module connects the host device and the storage device; or, the host device includes the second logical block storage module; or, the storage device includes the second logical block storage module.