Method and system for managing compressed data of a solid state drive
By combining logical blocks into logical block groups in solid-state drives and optimizing L2P table management, the problem of increased DDR capacity requirements due to compression technology is solved, achieving efficient resource utilization.
Patent Information
- Application Number
- CN202311754451.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-12-18
AI Technical Summary
The introduction of compression technology in existing technologies has increased the demand for dynamic random access memory (DDR) capacity in solid-state drives, leading to resource waste and increased costs.
A compressed data management method for solid-state drives is constructed. By combining multiple logical blocks into logical block groups and updating the logical mapping address and metadata during writing, the L2P table management is optimized and the DDR capacity requirement is reduced.
Without increasing DDR capacity, effectively manage compressed data, keep the increase in the number of logical blocks within a flash page from affecting the L2P table entry length, and avoid additional resource consumption.
Smart Images

Figure CN117891392B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software, and more particularly to a method and system for managing compressed data from a solid-state drive. Background Technology
[0002] like Figure 1 As shown, a solid-state drive (SSD) typically includes: a controller, a NAND flash memory array, dynamic random access memory (such as DDR or DRAM), and connectors. The controller manages the internal system of the SSD; the flash memory array stores user data and system data, generally presenting multiple flash channels (CHs), with each channel independently connecting to a group of flash memory, such as... Figure 1 CH0, CH1, ..., CHx are used to represent the components of a flash memory. Flash memory requires erasing before writing, and the number of erasure cycles is limited. Dynamic random access memory (DRAM) is used to store algorithm tables. Connectors connect the host (such as a PC or server) to other peripheral units (such as peripherals, serial ports, sensors, power chips, etc.).
[0003] The smallest programming unit for flash memory is a flash page, such as... Figure 2 A flash memory page contains several error correction units (Code Words) for protecting user data. Each error correction unit consists of valid data and error correction verification data. The error correction verification data is data generated by the error correction algorithm. The valid data is further divided into user data and metadata. The metadata is used for firmware algorithm management and contains at least one logical address, which corresponds to a logical block (user data).
[0004] Generally, host data addresses are defined as LBAs (Logical Block Addresses). Data distribution is managed through the mapping from logical addresses to physical addresses (i.e., L2P management). Typically, logical mapping addresses (LMA - Logic Mapping Address, LPA - Logic Page Address, or others) are defined based on the mapped data granularity (e.g., 512B or 4KB), and physical page addresses (PMA - Physical Mapping Address, or PPA - Physical Page Address) are used as the page addresses for flash memory. For example... Figure 3 If the host's data granularity is 512B, the SSD's mapping management data granularity is 4KB, and the flash memory page size is 16KB, then LBA0-7 are combined into logical block data at address LMA0, and four LMA0-3 logical blocks are combined into a page at address PMA0. Mapping management is performed through an L2P table, such as... Figure 4Using LMA as an index, the page address W1 and the offset address W2′ within the page of the corresponding flash page can be found.
[0005] Additionally, the metadata includes the LMA (Logical Mapping Address), which is used for L2P recovery (i.e., finding the LMA of the stored data through the PMA, thereby recovering the L2P entry). For example... Figure 5 A flash memory page stores several logical blocks, metadata, and verification data.
[0006] like Figure 6 As shown, during the write and read processes of a solid-state drive (SSD), data distribution management is achieved through the management of the L2P table. When writing data, the page address W1 and the offset address W2′ of the logical block within the page are written into the L2P table entry; when reading data, the LMA is used as an index to obtain the page address W1 and the offset address W2′ of the logical block within the page from the L2P table, thereby reading the logical block data.
[0007] Current page mapping technology manages flash memory pages based on 4K mapping NAND flash memory. Therefore, the L2P table occupies the majority of the DDR capacity within the SSD. Generally, the ratio of DDR capacity requirement to SSD capacity is 1:1000; for example, a 1TB SSD has 1GB of DDR capacity. However, with the application of compression technology in SSDs, multiple 4K logical blocks of data are compressed into a single error-correcting unit before being stored in the flash memory page, resulting in more logical blocks of data being stored within each flash memory page.
[0008] As can be seen from the above, in existing data distribution management, after using compression technology, as the number of logical blocks within a flash memory page increases, the length required for the page offset address of each logical block in the table increases. (Refer to...) Figure 4 The offset address of a logical block typically occupies 2 bits to manage the offset of 4 logical blocks within a page (0 / 1 / 2 / 3). When the number of logical blocks within a page increases to 64, 6 bits are needed to manage the offset (0~63). The length of each entry increases by 4 bits. If the length occupied by the logical block offset address is increased, the DDR capacity requirement increases. For example, for a 1TB disk, adding 1 bit means adding 1×1G / 8=128MB. Summary of the Invention
[0009] The technical problem to be solved by the present invention is to provide a method and system for managing compressed data in solid-state drives (SSDs) to address the shortcomings of existing technologies that increase DDR demand after the introduction of compression technology into SSDs.
[0010] The technical solution adopted by this invention to solve its technical problem is: constructing a compressed data management method for a solid-state drive, wherein the following steps are performed when writing data to the solid-state drive:
[0011] Step S11: Compress the multiple target logic blocks to be written separately, and combine the compressed target logic blocks into a target logic block group;
[0012] Step S12: Obtain the page address and page offset corresponding to the target logic block group, and determine the offset of each target logic block within the target logic block group according to the arrangement position of each target logic block in the target logic block group.
[0013] Step S13: Based on the intra-group offset of each target logic block, update the logical mapping address of each target logic block to the corresponding position of the target metadata of the target logic block group.
[0014] Step S14: Based on the page address and the page offset, write the target logical block group and the target metadata into the corresponding positions of the corresponding flash memory pages, and update the L2P table.
[0015] Preferably, step S14 includes:
[0016] Based on the page address and the page offset, the target logical block group and the target metadata are combined and written into the corresponding position of the corresponding flash memory page;
[0017] Update the page address and the page offset to the L2P table.
[0018] Preferably, step S14 includes:
[0019] Based on the page offset, the position of the target metadata corresponding to the target logical block group within the metadata group is determined, and the target metadata is updated to the corresponding position in the metadata group. The metadata group includes the metadata corresponding to each logical block group within the flash page.
[0020] Based on the page address and the page offset, the target logical block group is written to the corresponding position of the corresponding flash page; and based on the page address, the target metadata group is written to a specific position of the corresponding flash page.
[0021] Preferably, the step of writing the target metadata group to a specific location in the corresponding flash memory page includes:
[0022] The target metadata group is written to the header of the corresponding flash memory page.
[0023] This invention also constructs a method for managing compressed data on a solid-state drive (SSD), comprising the following steps when reading data from the SSD:
[0024] Step S21: Based on the L2P table and the logical mapping address of the target logical block to be read, obtain the page address, page offset and target metadata corresponding to the target logical block group where the target logical block is located;
[0025] Step S22: Based on the logical mapping address and the target metadata, determine the offset of the target logic block within the target logic block group;
[0026] Step S23: Read the target logic block of the target logic block group according to the offset within the group.
[0027] Preferably, step S21 includes:
[0028] Based on the logical mapping address of the target logical block to be read, the page address and page offset of the target logical block group where the target logical block is located are obtained by querying the L2P table. The L2P table stores the logical mapping addresses of multiple logical blocks of the corresponding flash page and the page address and page offset of the logical block group where the logical block mapped by each logical mapping address is located.
[0029] Based on the obtained page address and page offset, the target logical block group and target metadata of the corresponding flash page are read.
[0030] Preferably, step S21 includes:
[0031] Based on the logical mapping address of the target logical block to be read, the page address of the target logical block group to which the target logical block belongs is obtained by querying the L2P table;
[0032] Based on the page address, the corresponding flash page is read, and the metadata group is extracted from a specific location of the flash page;
[0033] The target metadata information storing the logical mapping address is obtained by parsing the metadata group, and the position of the target metadata information in the metadata group is obtained. The offset of the target logical block group within the flash memory page is obtained according to the determined position.
[0034] The target logical block group is read based on the page offset.
[0035] Preferably, the step of extracting the metadata group from a specific location of the flash memory page includes:
[0036] Extract the metadata group from the header of the flash memory page.
[0037] The present invention also constructs a compressed data management system for a solid-state drive, including a processor and a memory storing a computer program, wherein the processor implements the steps of the compressed data management method for a solid-state drive described above when executing the computer program.
[0038] This invention also constructs a compressed data management system for a solid-state drive, comprising a data distribution processing unit, a command operation controller, and a data path unit, wherein,
[0039] The data path unit is used to compress multiple target logical blocks to be written separately when writing data to the solid-state drive, and to combine the compressed multiple target logical blocks into a target logical block group.
[0040] The data distribution processing unit is configured to, when writing data to the solid-state drive, obtain the page address and page offset corresponding to the target logical block group, and determine the offset of each target logical block within the target logical block group based on the arrangement position of each target logical block in the target logical block group; and, when reading data from the solid-state drive, obtain the page address, page offset, and target metadata corresponding to the target logical block group where the target logical block is located based on the L2P table and the logical mapping address of the target logical block to be read, and determine the offset of the target logical block within the target logical block group based on the logical mapping address and the target metadata.
[0041] The command operation controller is configured to, when writing data to the solid-state drive, update the logical mapping address of each target logical block to the corresponding position of the target metadata corresponding to the target logical block group according to the group offset of each target logical block; write the target logical block group and the target metadata to the corresponding positions of the corresponding flash pages according to the page address and the page offset, and update the L2P table; and, when reading data from the solid-state drive, read the target logical block of the target logical block group according to the group offset.
[0042] The technical solution of this invention includes multiple compressed logical blocks within a logical block group. Furthermore, a correspondence is established between the arrangement rules of each logical mapping address (LMA value) in the metadata and the arrangement rules of each logical block within the logical block group. Thus, during data writing, this correspondence can be used to determine the arrangement position of each logical mapping address (LMA value) in the metadata based on the arrangement position of each logical block within the logical block group. Similarly, during data reading, this correspondence can be used to determine the arrangement position of the target logical block within the logical block group based on the arrangement position of the target logical mapping address (LMA value) in the metadata. Therefore, in this data management method, even if the number of logical blocks within a flash memory page increases due to compression of each logical block, the data length occupied by the L2P table entry will not increase, thus eliminating the need for additional DDR capacity. Attached Figure Description
[0043] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0044] Figure 1 This is a logical structure diagram of solid-state drives in existing technology;
[0045] Figure 2 This is a data structure diagram of a flash page in existing technology;
[0046] Figure 3 This is a diagram illustrating the relationship between the granularity of solid-state drive (SSD) mapping management data and the host's data granularity and flash memory page size.
[0047] Figure 4 This is a schematic diagram of using logically mapped addresses to index L2P tables in existing technology;
[0048] Figure 5 This is a data structure diagram of a flash page in existing technology;
[0049] Figure 6 This is a schematic diagram of the existing solid-state drive (SSD) compressed data management method;
[0050] Figure 7 This is a data distribution diagram of the compressed logic block in the flash memory page in an embodiment of the present invention;
[0051] Figure 8 This is a flowchart of data writing in the compressed data management method of the solid-state drive in the first embodiment of the present invention;
[0052] Figure 9 This is a flowchart of data reading in the compressed data management method of the solid-state drive in the first embodiment of the present invention;
[0053] Figure 10 This is a schematic diagram of indexing an L2P table using a logically mapped address in the second embodiment of the present invention;
[0054] Figure 11 This is a data structure diagram of metadata in the second embodiment of the present invention;
[0055] Figure 12 This is a flowchart illustrating the compressed data management method for a solid-state drive in the second embodiment of the present invention;
[0056] Figure 13 This is a flowchart of data writing in the compressed data management method of the solid-state drive in the second embodiment of the present invention;
[0057] Figure 14 This is a flowchart of data reading in the compressed data management method of the solid-state drive in the second embodiment of the present invention;
[0058] Figure 15 This is a schematic diagram of using logically mapped addresses to index L2P tables in the third embodiment of the present invention;
[0059] Figure 16 This is a data distribution diagram in a flash memory page according to the third embodiment of the present invention;
[0060] Figure 17 This is a data structure diagram of a flash page in the third embodiment of the present invention;
[0061] Figure 18 This is a data structure diagram of metadata in the third embodiment of the present invention;
[0062] Figure 19 This is a flowchart of data writing in the compressed data management method of the solid-state drive in the third embodiment of the present invention;
[0063] Figure 20 This is a flowchart of data reading in the compressed data management method of the solid-state drive in the third embodiment of the present invention;
[0064] Figure 21 This is a logical structure diagram of a first embodiment of the compressed data management system (flash controller) for the solid-state drive of the present invention;
[0065] Figure 22 This is a diagram illustrating the time overhead of flash memory read operations in existing technologies.
[0066] Figure 23 This is a time overhead diagram of the flash memory read process in the second embodiment of the present invention;
[0067] Figure 24 This is a time overhead diagram of the flash memory read process in the third embodiment of the present invention;
[0068] Figure 25 yes Figure 21 Logical structure diagram of the data distribution processing unit in Embodiment 1;
[0069] Figure 26 This is a logic structure diagram of a first embodiment of the solid-state drive controller of the present invention. Detailed Implementation
[0070] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0071] Figure 8 This is a flowchart of a first embodiment of the compressed data management method for a solid-state drive according to the present invention. In this embodiment, the following steps are performed when writing data to the solid-state drive:
[0072] Step S11: Compress the multiple target logic blocks to be written separately, and combine the compressed target logic blocks into a target logic block group;
[0073] Step S12: Obtain the page address and page offset corresponding to the target logic block group, and determine the offset of each target logic block within the target logic block group according to the arrangement position of each target logic block in the target logic block group.
[0074] Step S13: Based on the intra-group offset of each target logic block, update the logical mapping address of each target logic block to the corresponding position of the target metadata of the target logic block group.
[0075] Step S14: Based on the page address and the page offset, write the target logical block group and the target metadata into the corresponding positions of the corresponding flash memory pages, and update the L2P table.
[0076] Figure 9 This is a flowchart of a second embodiment of the compressed data management method for a solid-state drive according to the present invention. In this embodiment, the following steps are performed when reading data from the solid-state drive:
[0077] Step S21: Based on the L2P table and the logical mapping address of the target logical block to be read, obtain the page address, page offset and target metadata corresponding to the target logical block group where the target logical block is located;
[0078] Step S22: Based on the logical mapping address and the target metadata, determine the offset of the target logic block within the target logic block group;
[0079] Step S23: Read the target logic block of the target logic block group according to the offset within the group.
[0080] In the above embodiments, a logic block group is introduced, that is, a logic block group includes multiple compressed logic blocks, such as... Figure 7As shown, logical blocks LMA0-2 are grouped into one logical block group, and logical blocks LMAn-3-LMAn are grouped into another logical block group. Furthermore, a correspondence is established between the arrangement rules of each logical mapping address (LMA value) in the metadata and the arrangement rules of each logical block within the logical block group. Thus, during data writing, this correspondence can be used to determine the arrangement position of each logical mapping address (LMA value) in the metadata based on the arrangement position of each logical block within the logical block group; during data reading, this correspondence can be used to determine the arrangement position of the target logical block within the logical block group based on the arrangement position of the target logical mapping address (LMA value) in the metadata. Therefore, in this data management method, even if the number of logical blocks within a flash page is increased due to compression of each logical block, it is not necessary to increase the data length in the L2P table entries, and thus no additional DDR capacity is required.
[0081] Specifically, this application optimizes the management of compressed data through the following methods.
[0082] In one implementation, while introducing logical block groups, reference is made to... Figure 10 The L2P table entries divide the logical blocks within a page into multiple logical block groups according to certain rules. The page address of the flash memory page and the offset address within the logical block group (i.e., the page offset) are recorded in the L2P table entries. In this way, a flash memory page still consists of four logical block groups, and the required length of the logical block group offset address in the L2P table remains unchanged. Furthermore, when indexing the L2P table entries, the address of the logical block is not directly accessed; instead, the address of the logical block group is found first.
[0083] Furthermore, by using the LMA recorded within the metadata to determine the intra-group offset of a logic block within a logic block group, the LMA arrangement rules within the metadata can be set to reflect the intra-group offset of the mapped logic block. This allows for the retrieval of the intra-group offset address of the logic block mapped by the LMA through metadata searching. (See reference...) Figure 11 This can be understood as using the sequence number of LMA1 within the metadata as the offset address of the logical block mapped by LMA1 within the logical block group. This allows for clear compression management of data distribution and index lookup.
[0084] Furthermore, refer to Figure 12 In addition to recording the page address of the flash memory page, the L2P table entry also records the "page offset address of the logical block group" in the position where the "page offset address of the logical block" was originally recorded. If the granularity of the compressed mapping management is still 4KB, then the only difference between the uncompressed management and the management is how to perform in-group indexing. This embodiment uses the LMA in the metadata for further indexing and sets the relationship between the LMA arrangement rules and the offset of the logical block it maps.
[0085] In this implementation method, when writing data to the solid-state drive, step S14 further includes: combining the target logical block group and the target metadata according to the page address and the page offset, and writing them to the corresponding position of the corresponding flash memory page; updating the page address and the page offset to the L2P table.
[0086] The following reference Figure 13 Explain the data writing process (referring only to the relevant processing, not the details of the data writing process itself):
[0087] In the first step S101, the data path processing unit combines multiple logical blocks into a logical block group, and then combines multiple logical block groups into a page of data.
[0088] In the second step S102, according to the design data distribution rules, a free page is selected as the storage object, and the page address is recorded, that is, the target storage page address of the logical block group to be written is obtained.
[0089] Step S103: Determine the offset of the target logical block group within the page and record the page offset address of the target logical block group.
[0090] Step S104: Based on the design index rules, establish the relationship between the position of LMA in the metadata and the offset of the corresponding logical block in the logical block group.
[0091] Step 5, S105: Update the LMA value to the corresponding position in the metadata.
[0092] Step 6: Write data (not shown in the diagram);
[0093] Step 7 S107: After writing is complete, update the L2P table entry, that is, update the page address of the logical block group corresponding to the LMA, and update the page offset of the logical block group corresponding to the LMA.
[0094] Accordingly, in this implementation method, when reading data from the solid-state drive, step S21 further includes: obtaining the page address and page offset of the target logical block group where the target logical block is located by querying the L2P table according to the logical mapping address of the target logical block to be read, wherein the L2P table stores the logical mapping addresses of multiple logical blocks of the corresponding flash page and the page address and page offset of the logical block group where the logical block mapped by each logical mapping address is located; and reading the target logical block group and target metadata of the corresponding flash page according to the obtained page address and page offset.
[0095] The following reference Figure 14 Explanation of the data reading process:
[0096] In step S108, the L2P table is consulted based on the LMA1 index to obtain the page address W1 of the flash memory page and the page offset address W2 of the logical block group. It should be noted that the page address and page offset address are recorded in the L2P table during the data writing process.
[0097] In the second step S109, a flash page read operation is initiated based on the page address and the offset address within the page to obtain the logical block group and the corresponding metadata. The logical block group includes the logical blocks mapped by LMA0 to 2.
[0098] In the third step, S110, based on LMA1 and the metadata, the offset address (i.e., the offset within the group) of the target logic block is calculated. This offset is used to separate the logic block pointed to by LMA1. In other words, LMA1 needs to be found within LMA0~2. At this point, the L2P table cannot determine its location, so the metadata needs to be processed (searched according to set rules). Therefore, a module (e.g., a data distribution processing unit) is needed for this calculation. Its input requirements are "LMA1" and "meta-information," and its output is the offset address of the target logic block mapped by LMA1 within the logic block group. After obtaining this offset address, the target logic block can be obtained.
[0099] In another implementation, while introducing logical block groups, referencing Figure 15 The L2P table has removed records of page offset addresses. That is, L2P table entries only retain page addresses and no longer retain logical block page offset addresses or logical block group page offset addresses.
[0100] In addition, the meta-information group is introduced, for reference Figure 16 The metadata corresponding to each logical block group is combined to form a metadata group, which is an independent error correction unit. This metadata group can be placed at the beginning of a flash memory page, that is, stored starting from the beginning address of the page, followed by the logical block groups. Of course, in other embodiments, the metadata group can also have a deterministic offset address within the page when stored.
[0101] The LMA recorded in the metadata is used to determine the offset of the logical block group within the page and the offset of the logical block within the group. Furthermore, when storing the LMA in the metadata, rules are set to reflect: the offset of its logical block group within the page; and the offset of the logical block it maps to within the group. (See reference...) Figure 17 , 18 The page offset address is set as the sequence number of the metadata containing LMA1 within the metadata group; the group offset address is set as the sequence number of LMA1 within the metadata. For example, metadata 0 corresponds to logic block group 0, and LMA0~2 in the metadata corresponds to logic blocks LMA0~LMA2 within the logic block group.
[0102] In this alternative implementation, step S14 further includes:
[0103] Based on the page offset, the position of the target metadata corresponding to the target logical block group within the metadata group is determined, and the target metadata is updated to the corresponding position in the metadata group. The metadata group includes metadata corresponding to each logical block group within the flash page. Based on the page address and the page offset, the target logical block group is written to the corresponding position in the corresponding flash page. Furthermore, based on the page address, the target metadata group is written to a specific position in the corresponding flash page; for example, the target metadata group can be written to the header position of the corresponding flash page.
[0104] The following reference Figure 19 Explain the data writing process (referring to the corresponding processing, not the details of the data writing process itself):
[0105] In the first step S201, the data path processing unit combines multiple logical blocks into a logical block group, and then combines multiple logical block groups into a page of data.
[0106] In the second step S202, according to the design data distribution rules, a free page is selected as the storage object, and the page address is recorded, that is, the page address of the logical block group to be written is obtained;
[0107] In step S203, according to the design data distribution rules, the offset of the logical block group corresponding to LMA is determined within the page, and according to the design indexing rules, the relationship between the position of the metadata corresponding to the logical block group of LMA1 in the metadata group and the offset position of the logical group data corresponding to LMA1 within the page is established.
[0108] Step 4, S204: According to the design index rules, establish the relationship between the position of LMA1 in the metadata and the offset of the logic block mapped by LMA1 within the logic block group.
[0109] Step 5 S205: Update LMA1 to the corresponding position in the metadata, and update the metadata to the corresponding position in the metadata group;
[0110] Step 6: Write data (not shown in the diagram);
[0111] In step S207, after the write operation is complete, update the L2P table entry, that is, update the page address where the logical block group target corresponding to LMA1 is stored.
[0112] Accordingly, in this alternative implementation, when reading data from the solid-state drive, step S21 further includes:
[0113] Based on the logical mapping address of the target logical block to be read, the page address of the target logical block group to which the target logical block belongs is obtained by querying the L2P table;
[0114] Based on the page address, the corresponding flash page is read, and a metadata group is extracted from a specific location of the flash page. For example, the metadata group can be extracted from the header of the flash page.
[0115] The target metadata information storing the logical mapping address is obtained by parsing the metadata group, and the position of the target metadata information in the metadata group is obtained. The offset of the target logical block group within the flash memory page is obtained according to the determined position.
[0116] The target logical block group is read based on the page offset.
[0117] The following reference Figure 20 Explanation of the data reading process:
[0118] In step S208, the page address of the flash memory page can be obtained by looking up the L2P table based on the LMA1 index. It should be noted that the correspondence between LMA1 and the page address is determined during the data writing process and recorded in the L2P table.
[0119] In the second step S209, based on the page address, a flash page read operation is initiated to obtain the corresponding metadata group.
[0120] In the third step S210, according to the set retrieval rules, the metadata group is processed. The input requirements are "LMA1" and "metadata group". The output is the offset address of the "logical block group" where the logical block pointed to by LMA1 is located in the flash memory page, and the offset address of the logical block pointed to by LMA1 in the logical block group.
[0121] In step S211, a second reading is performed based on the page address and offset address within the flash memory page to obtain the corresponding logical block group;
[0122] In step S212, based on the obtained intra-group offset address and the read logical block group, obtain the logical block pointed to by LMA1.
[0123] This invention also constructs a compressed data management system (i.e., a flash memory controller) for a solid-state drive, such as... Figure 21As shown, the compressed data management system includes a data distribution processing unit, a command operation controller, a data path unit, and also includes a flash timing processor and a flash I / O interface. The data path unit is used to compress multiple target logical blocks to be written to the solid-state drive (SSD) separately during data writing, and then combine the compressed target logical blocks into a target logical block group. The data distribution processing unit is used to obtain the page address and page offset corresponding to the target logical block group during data writing to the SSD, and determine the offset of each target logical block within the target logical block group based on the arrangement position of each target logical block in the target logical block group. Furthermore, during data reading from the SSD, it uses the L2P table and the logical mapping address of the target logical block to be read... The system obtains the page address, page offset, and target metadata corresponding to the target logical block group where the target logical block is located, and determines the offset of the target logical block within the target logical block group based on the logical mapping address and the target metadata. The command operation controller is used to update the logical mapping address of each target logical block to the corresponding position of the target metadata corresponding to the target logical block group based on the offset within the group when writing data to the solid-state drive (SSD), write the target logical block group and the target metadata to the corresponding positions of the corresponding flash pages based on the page address and the page offset, and update the L2P table. Furthermore, when reading data from the SSD, the system reads the target logical block of the target logical block group based on the offset within the group.
[0124] In this embodiment, a data distribution processing unit is added within the flash memory controller and placed between the command operation controller and the data path unit. The required metadata can be directly input to the data distribution processing unit, and commands can be output to the command operation controller when a read operation is needed, thus quickly implementing the read operation. Furthermore, by placing the data distribution processing unit within the flash memory controller, not only is internal transmission overhead reduced, but also the time overhead of restarting the read operation is minimized.
[0125] The present invention also constructs a compressed data management system for a solid-state drive, including a processor and a memory storing a computer program. When the processor executes the computer program, it implements the steps of the compressed data management method for a solid-state drive described in the above embodiments.
[0126] Regarding the above embodiments, it should be noted that the management of compressed data on a solid-state drive can be implemented by either hardware or software. Furthermore, when reading compressed data, the hardware processing divides the reading process into two steps: first, it reads the metadata group, then calculates the page offset and group offset corresponding to the LMA, and then performs a second read based on these offsets to obtain the corresponding logical block within the logical block group. Clearly, implementing this function in software would significantly impact performance. Specifically, in... Figure 22 In the prior art time overhead diagram for flash memory read process, tb represents the time for reading logical blocks and metadata. Figure 23 In the time overhead diagram of the flash memory read process shown in the second embodiment of the present invention, tb represents the time for reading the logical block group and metadata. Figure 24 In the time overhead diagram of the flash memory read process shown in the third embodiment of the present invention, t2 represents the time for reading the metadata group, t3 represents the time for determining the page offset and group offset corresponding to the logic block (i.e., the time required for the data distribution processing unit to process), and t5 represents the time for reading the logic block. Therefore, it is preferable to use hardware logic to implement the function of the data distribution processing unit in the design.
[0127] Furthermore, such as Figure 25 As shown, the data distribution processing unit in this embodiment mainly implements address indexing through a data distribution rule table and a retrieval processing unit. The data distribution processing unit includes a data distribution rule table, a retrieval processing unit, and a data interface. The data distribution rule table can predefine the following: 1. In the first method, it defines the arrangement rules of logical mapping addresses within the metadata to reflect the intra-group offset of the logical blocks mapped by each logical mapping address; 2. In the second method, it defines the arrangement rules of the metadata containing the logical mapping addresses to reflect the intra-page offset of each logical block group. The retrieval processing unit is used to retrieve metadata data according to the rules in the rule table to obtain relevant offset addresses. The data interface is used to receive input data from the data path, mainly metadata and logical block groups, and output offset addresses to the command operation controller for further operation.
[0128] Additionally, the flash memory controller can be used as part of the solid-state drive controller, such as... Figure 26As shown, the solid-state drive controller includes a CPU module and, respectively connected to the CPU module, a flash controller, a DDR controller, a PCIe controller, an NVMe controller, a data path processor, and a peripheral module. Of course, in other embodiments, the flash controller may also be connected to the solid-state drive controller as a separate component.
[0129] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any alterations, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for managing compressed data in a solid-state drive, characterized in that, When writing data to the solid-state drive, the following steps are performed: Step S11: Compress the multiple target logic blocks to be written separately, and combine the compressed target logic blocks into a target logic block group; Step S12: Obtain the page address and page offset corresponding to the target logic block group, and determine the offset of each target logic block within the target logic block group according to the arrangement position of each target logic block in the target logic block group. Step S13: Based on the intra-group offset of each target logic block, update the logical mapping address of each target logic block to the corresponding position of the target metadata of the target logic block group. Step S14: Based on the page address and the page offset, write the target logical block group and the target metadata into the corresponding positions of the corresponding flash memory pages, and update the L2P table. Step S14 includes: Based on the page offset, the position of the target metadata corresponding to the target logical block group within the metadata group is determined, and the target metadata is updated to the corresponding position in the metadata group. The metadata group includes the metadata corresponding to each logical block group within the flash page. Based on the page address and the page offset, the target logic block group is written to the corresponding position of the corresponding flash page; and based on the page address, the metadata group is written to the header position of the corresponding flash page.
2. A method for managing compressed data in a solid-state drive, characterized in that, When reading data from the solid-state drive, the following steps are performed: Step S21: Based on the L2P table and the logical mapping address of the target logical block to be read, obtain the page address, page offset and target metadata corresponding to the target logical block group where the target logical block is located; Step S22: Based on the logical mapping address and the target metadata, determine the offset of the target logic block within the target logic block group; Step S23: Read the target logic block of the target logic block group according to the offset within the group; Step S21 includes: Based on the logical mapping address of the target logical block to be read, the page address of the target logical block group to which the target logical block belongs is obtained by querying the L2P table; Based on the page address, the corresponding flash page is read, and the metadata group is extracted from the header of the flash page; The target metadata information storing the logical mapping address is obtained by parsing the metadata group, and the position of the target metadata information in the metadata group is obtained. The offset of the target logical block group within the flash memory page is obtained according to the determined position. The target logical block group is read based on the page offset.
3. A compressed data management system for a solid-state drive, comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the compressed data management method for the solid-state drive according to any one of claims 1-2.
4. A compressed data management system for a solid-state drive, characterized in that, It includes a data distribution processing unit, a command operation controller, and a data path unit, among which, The data path unit is used to compress multiple target logical blocks to be written separately when writing data to the solid-state drive, and to combine the compressed multiple target logical blocks into a target logical block group. The data distribution processing unit is configured to, when writing data to the solid-state drive, obtain the page address and page offset corresponding to the target logical block group, and determine the offset of each target logical block within the target logical block group based on the arrangement position of each target logical block in the target logical block group; and, when reading data from the solid-state drive, obtain the page address, page offset, and target metadata corresponding to the target logical block group where the target logical block is located based on the L2P table and the logical mapping address of the target logical block to be read, and determine the offset of the target logical block within the target logical block group based on the logical mapping address and the target metadata. The command operation controller is configured to, when writing data to the solid-state drive, update the logical mapping address of each target logical block to the corresponding position of the target metadata corresponding to the target logical block group according to the group offset of each target logical block; write the target logical block group and the target metadata to the corresponding positions of the corresponding flash pages according to the page address and the page offset, and update the L2P table; and, when reading data from the solid-state drive, read the target logical block of the target logical block group according to the group offset. In the command operation controller, the step of writing the target logical block group and the target metadata into the corresponding positions of the corresponding flash pages according to the page address and the page offset, and updating the L2P table, includes: Based on the page offset, the position of the target metadata corresponding to the target logical block group within the metadata group is determined, and the target metadata is updated to the corresponding position in the metadata group. The metadata group includes the metadata corresponding to each logical block group within the flash page. Based on the page address and the page offset, the target logic block group is written to the corresponding position of the corresponding flash page; and based on the page address, the metadata group is written to the header position of the corresponding flash page. In the data distribution processing unit, the step of obtaining the page address, page offset, and target metadata corresponding to the target logical block group where the target logical block is located, based on the L2P table and the logical mapping address of the target logical block to be read, includes: Based on the logical mapping address of the target logical block to be read, the page address of the target logical block group to which the target logical block belongs is obtained by querying the L2P table; Based on the page address, the corresponding flash page is read, and the metadata group is extracted from the header of the flash page; The target metadata information storing the logical mapping address is obtained by parsing the metadata group, and the position of the target metadata information in the metadata group is obtained. The offset of the target logical block group within the flash memory page is obtained according to the determined position. The target logical block group is read based on the page offset.
Citation Information
Patent Citations
Method for rapidly booting solid state disc and solid state disc thereof
CN103744795A
Meta-information management method, solid state disk controller and solid state disk
CN113724775A
