WO2021232743A1 - Cache management method and apparatus, storage medium, and solid-state non-volatile storage device - Google Patents
Cache management method and apparatus, storage medium, and solid-state non-volatile storage device Download PDFInfo
- Publication number
- WO2021232743A1 WO2021232743A1 PCT/CN2020/132910 CN2020132910W WO2021232743A1 WO 2021232743 A1 WO2021232743 A1 WO 2021232743A1 CN 2020132910 W CN2020132910 W CN 2020132910W WO 2021232743 A1 WO2021232743 A1 WO 2021232743A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- mapping table
- cache
- sub
- compression ratio
- unit
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0866—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
- G06F12/0873—Mapping of cache memory to specific storage devices or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0893—Caches characterised by their organisation or structure
- G06F12/0895—Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1041—Resource optimization
- G06F2212/1044—Space efficiency improvement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/20—Employing a main memory using a specific memory technology
- G06F2212/202—Non-volatile memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/21—Employing a record carrier using a specific recording technology
- G06F2212/214—Solid state disk
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/40—Specific encoding of data in memory or cache
- G06F2212/401—Compressed data
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present disclosure relates to the technical field of solid-state non-volatile storage devices, and in particular, to a cache management method, device, storage medium, processor, and solid-state non-volatile storage device.
- the L2P mapping table that is, Logical-to-Physical, the address mapping table from logical address to physical address, can be divided into parent layer and child layer.
- the child layer includes multiple L2P mapping table sub-layer units, and the parent layer stores L2P mapping table sub-layer units. Information.
- the L2P table sub-layer units are compressed, so that more sub-layer units can be cached at the same time without increasing the on-chip cache, thereby improving the cache of the L2P sub-layer units Hit rate, so as to achieve the purpose of improving the performance of solid-state non-volatile storage devices.
- each sub-layer unit contains 1024 basic information unit entries. If each basic information unit entry occupies 4 Bytes, it occupies 32 bits. In this case, the space occupied by each sub-layer unit is 4KB, so the cache space of the cache sub-layer unit only needs to be divided and managed by the standard of 4KB.
- Different sub-layer units have different compression ratios. After compressed sub-layer units, their space occupancy is no longer uniform. However, the method of splitting and managing the cache space based on a fixed 4KB standard can still be used in the compression format. In this case, the number of sub-layer units in the compressed format that can be placed in the cache space is exactly the same as the number of sub-layer units in the uncompressed format. The compression does not improve the utilization of the cache space.
- Another management method places the compressed sub-level units tightly in the cache space, as shown in Figure 1. This can indeed increase the number of caches in the sub-level units, but the data in the cache is not static, and the sub-level units often Will need to be replaced.
- the firmware FW needs to eliminate the sub-layer unit 3 out of the cache and make room for the sub-layer unit 5. However, in this case, the void left by the elimination of the sub-layer unit 3 is not enough to place the sub-layer unit 5. If the method shown in FIG. With more replacement operations, the entire cache space will become fragmented, and the complexity of management will be completely out of control.
- the main purpose of the present disclosure is to provide a cache management method, device, storage medium, processor, and solid-state non-volatile storage device, so as to solve the utilization of the cache space of the high-speed buffer in the prior art solid-state non-volatile storage device Lower question.
- a cache management method including: determining a unified compression ratio according to a compression ratio of each first L2P mapping table sub-layer unit, the first L2P mapping table sub-layer unit being in a compressed format The L2P mapping table sub-layer unit; according to the unified compression ratio and the cache capacity to determine the number of splits of the cache space, where the cache space is the storage space of the cache memory; split the cache space according to the number of splits, Obtain multiple subspaces; use the subspace to store the first L2P mapping table sub-layer unit.
- determining the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit includes: in a case where the predetermined ratio is less than or equal to a predetermined threshold, determining that the preliminary compression ratio is the unified compression ratio, and the predetermined ratio Is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio.
- the predetermined threshold is 5%-20%.
- using the subspace to store the first L2P mapping table sublayer unit includes: numbering a plurality of the subspaces; and determining the occupied quantity according to a compressed capacity, where the compressed capacity is the first L2P
- the capacity of the mapping table sublayer unit, where the occupied quantity is the quantity of the subspace occupied by the first L2P mapping table sublayer unit; and the data of the first L2P mapping table sublayer unit is calculated according to the occupied quantity Splitting is performed to obtain split data; the split data is sequentially stored in the blank subspace in the order of the number of the blank subspace, and the blank subspace is the subspace where no data is stored.
- storing the split data in the blank subspace in the order of the number of the blank subspace includes: determining the number of the blank subspace; where the number of the blank subspace is greater than or equal to In the case of the occupied amount, the split data is sequentially stored in the blank subspace in the order of the number of the blank subspace; in the case that the amount of the blank subspace is less than the occupied amount Next, delete part of the stored first L2P mapping table sub-layer units, so that the number of blank subspaces obtained after deletion is greater than or equal to the occupied number.
- the cache management method further includes: determining the smallest number of the subspace where the split data is stored Update the minimum number to the corresponding unit of the parent layer of the L2P mapping table, the corresponding unit is used to record sub-layer information, and the first L2P mapping table sub-layer unit corresponds to the corresponding unit one-to-one.
- a cache management device including: a first determining unit configured to determine a unified compression ratio according to a compression ratio of each first L2P mapping table sub-layer unit, the first The L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit; the second determining unit is used to determine the number of splits of the cache space according to the unified compression ratio and the cache capacity, and the cache space is the amount of the cache memory.
- Storage space a first processing unit, configured to split the cache space according to the number of splits to obtain multiple subspaces; a second processing unit, configured to use the subspace to store the first L2P mapping table sublayer unit.
- a storage medium includes a stored program, wherein the program executes any one of the cache management methods described above.
- a processor is also provided, the processor is configured to run a program, wherein any one of the cache management methods is executed when the program is running.
- a solid-state non-volatile storage device including an L2P mapping table, a cache memory, and a cache management device, the cache management device being any one of the aforementioned cache management devices .
- the solid-state non-volatile storage device includes at least one of a solid-state hard disk, a general-purpose flash memory device, an embedded multimedia memory card, and a U disk.
- the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then the number of divisions of the cache space is determined according to the unified compression ratio and the cache capacity, After that, the cache space is split according to the number of splits to obtain multiple subspaces, and finally, the subspace is used to store the first L2P mapping table sub-layer unit.
- the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- FIGS 1 to 3 show schematic diagrams of cache space in the prior art
- Fig. 4 shows a flowchart of a cache management method according to an embodiment of the present disclosure
- 5 to 8 show schematic diagrams of the storage space of the cache memory according to an embodiment of the present disclosure
- Fig. 9 shows a schematic diagram of a cache management apparatus according to an embodiment of the present disclosure.
- the high-speed buffer memory located between the CPU and the main memory DRAM, a small-scale but high-speed memory
- a typical implementation of the present disclosure provides a A cache management method, device, storage medium, processor, and solid-state non-volatile storage device.
- a cache management method is provided.
- Fig. 4 is a flowchart of a cache management method according to an embodiment of the present disclosure. As shown in Figure 4, the method includes the following steps:
- Step S101 Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
- Step S102 Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
- Step S103 Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
- Step S104 using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
- the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then the number of splits of the cache space is determined according to the unified compression ratio and the cache capacity, and then the split is divided according to the number of splits.
- the buffer space is divided to obtain multiple sub-spaces, and finally, the sub-space is used to store the first L2P mapping table sub-layer unit.
- the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- determining the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit includes: when the predetermined ratio is less than or equal to a predetermined threshold, determining the preliminary compression ratio to be the above-mentioned unified compression ratio.
- the predetermined ratio is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio. Specifically, a preliminary compression ratio is selected, and a predetermined ratio is calculated.
- the preliminary compression ratio is determined to be a unified compression ratio, and when the predetermined ratio is greater than the predetermined threshold, the preliminary compression is reselected Ratio, until the predetermined ratio corresponding to the preliminary compression ratio is less than or equal to the predetermined threshold, it is determined that the preliminary compression ratio is a unified compression ratio, for example, the predetermined threshold is 10%, the preliminary compression ratio is 8, and if the predetermined ratio corresponding to the preliminary compression ratio is less than 10 %, the unified compression ratio is determined to be 8.
- the aforementioned predetermined threshold is 5%-20%.
- the predetermined threshold is set within the above range to determine an appropriate unified compression ratio, thereby determining an appropriate number of splits, and further improving the utilization of the cache space of the cache memory in the solid-state nonvolatile storage device.
- the above The predetermined threshold is not limited to this, and those skilled in the art can adjust the predetermined threshold according to the actual situation to further improve the utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device.
- using the subspace to store the sublayer unit of the first L2P mapping table includes: numbering a plurality of the subspaces; determining the occupied quantity according to the compression capacity, and the compression capacity is the first L2P mapping
- the capacity of the table sub-layer unit, the above-mentioned occupied quantity is the quantity of the above-mentioned sub-space occupied by the above-mentioned first L2P mapping table sub-layer unit; according to the above-mentioned occupied quantity, the data of the above-mentioned first L2P mapping table sub-layer unit is split to obtain a split Sub-data; the above-mentioned split data is sequentially stored in the above-mentioned blank sub-space according to the size order of the number of the blank sub-space, and the above-mentioned blank sub-space is the above-mentioned sub-space where no data is stored.
- the capacity of a single subspace can be determined according to the cache capacity of the cache memory and the number of subspaces, and the occupied amount can be determined according to the compressed capacity and the capacity of a single subspace, and then according to the occupied amount Split the data of the first L2P mapping table sub-layer unit, and store the split data in the blank subspace in the order of the number of the blank subspace to avoid missing blank subspaces, so that the subspace can store more
- the first L2P mapping table sub-layer unit in the solid-state non-volatile storage device further improves the utilization rate of the cache space of the high-speed cache memory in the solid-state non-volatile storage device.
- the cache capacity of the high-speed buffer memory is 512KB
- the capacity of a single uncompressed L2P mapping table sub-layer unit is 4KB
- the unified compression ratio is 8, then the number of splits is 1024, that is, the number of subspaces is 1024, and the number of subspaces is 1024. If the capacity is 0.5KB, the occupied number of the first L2P mapping table sublayer unit with the capacity of 2.7KB is 6.
- storing the split data in the blank subspace in the order of the size of the blank subspace includes: determining the number of the blank subspace; where the number of the blank subspace is greater than or equal to In the case of the above-mentioned occupied quantity, the above-mentioned split data is sequentially stored in the above-mentioned blank sub-space in the order of the number of the above-mentioned blank sub-space; in the case where the number of the above-mentioned blank sub-space is less than the above-mentioned occupied quantity, the deleted part is already stored The above-mentioned first L2P mapping table sub-layer unit, so that the quantity of the above-mentioned blank subspace obtained after deletion is greater than or equal to the above-mentioned occupied quantity.
- the above method determines whether to delete some of the stored first L2P mapping table sublayer units by comparing the current number of blank subspaces with the occupied number, so as to ensure that the number of blank subspaces is greater than or equal to the occupied number, so that the split
- the data may be sequentially stored in the blank subspace in the order of the number of the blank subspace, so as to ensure that the cache memory can retrieve the required first L2P mapping table sublayer unit.
- the cache space of the cache memory stores three first L2P mapping table sublayer units, and the numbers of the subspaces storing the first L2P mapping table sublayer unit X are 1, 2, respectively. 3 and 4, the numbers of the subspaces storing the first L2P mapping table sub-layer unit Y are 6, 7, 8, 10, and 11, respectively, and the numbers of the subspaces storing the first L2P mapping table sub-layer unit Z are 15, respectively 16 and 17, the cache memory retrieves the first L2P mapping table sub-layer unit A occupying 6, and stores the split data of the first L2P mapping table sub-layer unit A in numbers 5, 9, 12, 13, and 13, respectively.
- the cache memory retrieves the first L2P mapping table sub-layer unit B, which occupies 4, and deletes the first L2P mapping table sub-layer unit Y to obtain 5 blanks.
- the split data of the first L2P mapping table sublayer unit A is sequentially stored in the blank subspaces numbered 6, 7, 8, and 10, as shown in FIG. 8.
- the above-mentioned cache management method further includes: determining the minimum number of the above-mentioned subspace where the above-mentioned split data is stored; The minimum number is updated to the corresponding unit of the parent layer of the L2P mapping table, the corresponding unit is used to record sub-layer information, and the first L2P mapping table sub-layer unit corresponds to the corresponding unit one-to-one.
- the above method stores the minimum number of the subspace storing the first L2P mapping table sub-layer unit in the corresponding unit of the parent layer of the L2P mapping table, and establishes a linked list with the minimum number and the first L2P mapping table sub-layer unit, thereby Find the subspace storing the first L2P mapping table sub-layer unit according to the smallest number, which facilitates the subsequent deletion of the stored first L2P mapping table sub-layer unit according to the linked list, and reduces the management complexity of the cache space of the cache memory.
- the embodiments of the present disclosure also provide a cache management apparatus. It should be noted that the cache management apparatus of the embodiments of the present disclosure may be used to execute the cache management method provided by the embodiments of the present disclosure. The following describes the cache management device provided by the embodiment of the present disclosure.
- Fig. 9 is a schematic diagram of a cache management device according to an embodiment of the present disclosure, and the above-mentioned control device includes:
- the first determining unit 10 is configured to determine the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
- the second determining unit 20 is configured to determine the number of splits of the cache space according to the above-mentioned unified compression ratio and the cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
- the first processing unit 30 is configured to split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
- the second processing unit 40 is configured to use the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
- the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit
- the second determining unit determines the number of divisions of the cache space according to the unified compression ratio and the cache capacity
- the first processing The unit splits the cache space according to the number of splits to obtain multiple subspaces
- the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit.
- the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- the first determining unit includes a first determining module, wherein the first determining module is configured to determine that the preliminary compression ratio is the unified compression ratio when the predetermined ratio is less than or equal to a predetermined threshold,
- the predetermined ratio is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio. Specifically, a preliminary compression ratio is selected, and a predetermined ratio is calculated.
- the preliminary compression ratio is determined to be a unified compression ratio, and when the predetermined ratio is greater than the predetermined threshold, the preliminary compression is reselected Ratio, until the predetermined ratio corresponding to the preliminary compression ratio is less than or equal to the predetermined threshold, it is determined that the preliminary compression ratio is a unified compression ratio, for example, the predetermined threshold is 10%, the preliminary compression ratio is 8, and if the predetermined ratio corresponding to the preliminary compression ratio is less than 10 %, the unified compression ratio is determined to be 8.
- the aforementioned predetermined threshold is 5%-20%.
- the predetermined threshold is set within the above range to determine an appropriate unified compression ratio, thereby determining an appropriate number of splits, and further improving the utilization of the cache space of the cache memory in the solid-state nonvolatile storage device.
- the above The predetermined threshold is not limited to this, and those skilled in the art can adjust the predetermined threshold according to the actual situation to further improve the utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device.
- the above-mentioned second processing unit includes a first processing module, a second determining module, a second processing module, and a third processing module, wherein the above-mentioned first processing module is used to perform multiple sub-spaces Number; the second determining module is used to determine the occupied quantity according to the compressed capacity, the compressed capacity is the capacity of the first L2P mapping table sublayer unit, and the occupied quantity is the subspace occupied by the first L2P mapping table sublayer unit
- the above-mentioned second processing module is used to split the data of the first L2P mapping table sub-layer unit according to the above-mentioned occupancy quantity to obtain split data;
- the above-mentioned third processing module is used to divide the above-mentioned split data according to blanks
- the numbers of the spaces are sequentially stored in the blank subspace in order, and the blank subspace is the subspace where no data is stored.
- the capacity of a single subspace can be determined according to the cache capacity of the cache memory and the number of subspaces, and the occupied amount can be determined according to the compressed capacity and the capacity of a single subspace, and then according to the occupied amount Split the data of the first L2P mapping table sub-layer unit, and store the split data in the blank subspace in the order of the number of the blank subspace to avoid missing blank subspaces, so that the subspace can store more
- the first L2P mapping table sub-layer unit in the solid-state non-volatile storage device further improves the utilization rate of the cache space of the high-speed cache memory in the solid-state non-volatile storage device.
- the cache capacity of the high-speed buffer memory is 512KB
- the capacity of a single uncompressed L2P mapping table sub-layer unit is 4KB
- the unified compression ratio is 8, then the number of splits is 1024, that is, the number of subspaces is 1024, and the number of subspaces is 1024. If the capacity is 0.5KB, the occupied number of the first L2P mapping table sublayer unit with the capacity of 2.7KB is 6.
- the above-mentioned third processing module includes a determination sub-module, a first processing sub-module, and a second processing sub-module, wherein the above-mentioned determination sub-module is used to determine the number of the above-mentioned blank subspaces; the above-mentioned first processing The submodule is used to store the split data in the blank subspace in the order of the numbers of the blank subspaces in order when the number of the blank subspaces is greater than or equal to the occupied amount; the second processing subspace The module is used to delete part of the stored first L2P mapping table sub-layer units when the amount of the blank subspace is less than the occupied amount, so that the amount of the blank subspace obtained after the deletion is greater than or equal to the occupied amount quantity.
- the above-mentioned device determines whether to delete part of the stored first L2P mapping table sub-layer units by comparing the current number of blank subspaces with the occupied number, so as to ensure that the number of blank subspaces is greater than or equal to the occupied number, so that the split
- the data may be sequentially stored in the blank subspace in the order of the number of the blank subspace, so as to ensure that the cache memory can retrieve the required first L2P mapping table sublayer unit.
- the cache space of the cache memory stores three first L2P mapping table sublayer units, and the numbers of the subspaces storing the first L2P mapping table sublayer unit X are 1, 2, respectively. 3 and 4, the numbers of the subspaces storing the first L2P mapping table sub-layer unit Y are 6, 7, 8, 10, and 11, respectively, and the numbers of the subspaces storing the first L2P mapping table sub-layer unit Z are 15, respectively 16 and 17, the cache memory retrieves the first L2P mapping table sub-layer unit A occupying 6, and stores the split data of the first L2P mapping table sub-layer unit A in numbers 5, 9, 12, 13, and 13, respectively.
- the cache memory retrieves the first L2P mapping table sub-layer unit B, which occupies 4, and deletes the first L2P mapping table sub-layer unit Y to obtain 5 blanks.
- the split data of the first L2P mapping table sublayer unit A is sequentially stored in the blank subspaces numbered 6, 7, 8, and 10, as shown in FIG. 8.
- the above-mentioned cache management device further includes a recording unit, and the above-mentioned recording unit includes a third determining module and a recording module.
- the aforementioned recording module After storing the data in the aforementioned subspace, determine the minimum number of the aforementioned subspace storing the aforementioned split data; the aforementioned recording module is used to update the aforementioned minimum number to the corresponding unit of the parent layer of the L2P mapping table, and the aforementioned corresponding unit is used for recording Sub-layer information, the sub-layer unit of the first L2P mapping table corresponds to the corresponding unit in a one-to-one correspondence.
- the above device stores the minimum number of the subspace storing the first L2P mapping table sub-layer unit in the corresponding unit of the parent layer of the L2P mapping table, and establishes a linked list with the minimum number and the first L2P mapping table sub-layer unit, thereby Find the subspace storing the first L2P mapping table sub-layer unit according to the smallest number, which facilitates the subsequent deletion of the stored first L2P mapping table sub-layer unit according to the linked list, and reduces the management complexity of the cache space of the cache memory.
- the embodiment of the present disclosure also provides a solid-state non-volatile storage device, including an L2P mapping table, a cache memory, and a cache management device.
- the above-mentioned cache management device is any one of the above-mentioned cache management devices.
- the above solid-state non-volatile storage device includes a cache management device, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the second determining unit determines the cache space according to the unified compression ratio and the cache capacity
- the first processing unit splits the buffer space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit.
- the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- the foregoing cache management device includes a processor and a memory.
- the foregoing first determination unit, second determination unit, first processing unit, and second processing unit are all stored in the memory as program units, and the processor executes the foregoing stored in the memory. Program unit to realize the corresponding function.
- the foregoing solid-state non-volatile storage device includes at least one of a solid-state hard disk, a universal flash storage (Universal Flash Storage, UFS), an embedded MultiMedia Card (eMMC), and a U disk.
- a solid-state hard disk includes at least one of a solid-state hard disk, a universal flash storage (Universal Flash Storage, UFS), an embedded MultiMedia Card (eMMC), and a U disk.
- UFS Universal Flash Storage
- eMMC embedded MultiMedia Card
- solid-state non-volatile storage device may also include other corresponding devices.
- the processor contains the kernel, and the kernel calls the corresponding program unit from the memory.
- One or more kernels can be set, and the kernel parameters are adjusted to solve the problem of low utilization of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- the memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one Memory chip.
- RAM random access memory
- ROM read-only memory
- flash RAM flash random access memory
- the embodiment of the present disclosure provides a storage medium on which a program is stored, and the program is executed by a processor to implement the above-mentioned cache management method.
- the embodiments of the present disclosure provide a processor, and the above-mentioned processor is used for running a program, wherein the above-mentioned cache management method is executed when the above-mentioned program is running.
- the embodiments of the present disclosure provide a device that includes a processor, a memory, and a program stored on the memory and capable of running on the processor, and the processor implements at least the following steps when the program is executed:
- Step S101 Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
- Step S102 Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
- Step S103 Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
- Step S104 using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
- the devices in this article can be servers, PCs, PADs, mobile phones, etc.
- the present disclosure also provides a computer program product, which when executed on a data processing device, is suitable for executing a program that initializes at least the following method steps:
- Step S101 Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
- Step S102 Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
- Step S103 Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
- Step S104 using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
- the disclosed technical content can be implemented in other ways.
- the above-described device embodiments are only illustrative.
- the division of the above-mentioned units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or integrated. To another system, or some features can be ignored, or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
- the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional units in the various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
- the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of the present disclosure essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium.
- a computer device which may be a personal computer, a server, or a network device, etc.
- the aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code .
- the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then, the number of splits of the cache space is determined according to the unified compression ratio and the cache capacity, and then, The cache space is split according to the number of splits to obtain multiple subspaces. Finally, the subspace is used to store the first L2P mapping table sub-layer unit.
- the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit
- the second determining unit determines the division of the cache space according to the unified compression ratio and the cache capacity
- the first processing unit splits the buffer space according to the number of splits to obtain multiple subspaces
- the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit.
- the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
- the solid-state non-volatile storage device of the present disclosure includes a cache management device, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the second determining unit determines the unified compression ratio according to the unified compression ratio and
- the cache capacity determines the number of splits of the cache space, the first processing unit splits the cache space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit.
- the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility
- the utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Provided are a cache management method and apparatus, a storage medium, and a solid-state non-volatile storage device. The cache management method comprises: determining a uniform compression ratio according to a compression ratio of each first L2P mapping table sub-layer unit, wherein the first L2P mapping table sub-layer unit is an L2P mapping table sub-layer unit in a compressed format; determining a splitting number of a cache space according to the uniform compression ratio and a cache capacity, wherein the cache space is a storage space of a cache memory; splitting the cache space according to the splitting number, so as to obtain a plurality of sub-spaces; and storing the first L2P mapping table sub-layer unit by using the sub-spaces. By means of the method, a uniform compression ratio is determined according to a compression ratio of each first L2P mapping table sub-layer unit, and a storage space is split into an appropriate number of sub-spaces according to the uniform compression ratio and a cache capacity, such that the sub-spaces can store more first L2P mapping table sub-layer units, thereby improving the utilization rate of the cache space of a cache memory.
Description
本公开以2020年05月21日递交的、申请号为202010437457.4且名称为“缓存管理方法、装置、存储介质和固态非易失存储设备”的专利文件为优先权文件,该文件的全部内容通过引用结合在本公开中。This disclosure takes the patent document with the application number 202010437457.4 and the name "Cache Management Method, Device, Storage Medium and Solid State Non-volatile Storage Device" filed on May 21, 2020 as the priority document, and the entire content of the document is approved Reference is incorporated in this disclosure.
本公开涉及固态非易失存储设备技术领域,具体而言,涉及一种缓存管理方法、装置、存储介质、处理器和固态非易失存储设备。The present disclosure relates to the technical field of solid-state non-volatile storage devices, and in particular, to a cache management method, device, storage medium, processor, and solid-state non-volatile storage device.
L2P映射表,即Logical-to-Physical,逻辑地址到物理地址的地址映射表,可以分为父层和子层,子层包括多个L2P映射表子层单元,父层存储L2P映射表子层单元的信息。为改善DRAMLESS固态非易失存储设备的性能,对L2P表子层单元做压缩,从而在不增大片上缓存的情况下,可以同时缓存更多的子层单元,进而提升L2P子层单元的cache命中率,从而达到提升固态非易失存储设备性能的目的。The L2P mapping table, that is, Logical-to-Physical, the address mapping table from logical address to physical address, can be divided into parent layer and child layer. The child layer includes multiple L2P mapping table sub-layer units, and the parent layer stores L2P mapping table sub-layer units. Information. In order to improve the performance of DRAMLESS solid-state non-volatile storage devices, the L2P table sub-layer units are compressed, so that more sub-layer units can be cached at the same time without increasing the on-chip cache, thereby improving the cache of the L2P sub-layer units Hit rate, so as to achieve the purpose of improving the performance of solid-state non-volatile storage devices.
未压缩的L2P表子层单元,其占用的空间都是固定统一的。例如,子层单元是以1024为限拆分而来,则每个子层单元均包含1024个基本信息单位entry,每个基本信息单位entry如果占用4Bytes,即占用32bits。这种情况下每个子层单元的空间占用都是4KB,那么,缓存子层单元的cache空间只需要以4KB为标准拆分开来加以管理就可以了。The space occupied by uncompressed L2P table sub-layer units is fixed and unified. For example, if the sub-layer units are split up to a limit of 1024, each sub-layer unit contains 1024 basic information unit entries. If each basic information unit entry occupies 4 Bytes, it occupies 32 bits. In this case, the space occupied by each sub-layer unit is 4KB, so the cache space of the cache sub-layer unit only needs to be divided and managed by the standard of 4KB.
不同的子层单元,会有不同的压缩率,经过压缩后的子层单元,其空间占用不再统一,但是,以固定4KB为标准拆分cache空间并管理的方法,仍然可以用在压缩格式的子层单元上,在这种情况下,cache空间能够放下的压缩格式的子层单元数量和不压缩格式的子层单元数量完全一样,压缩没有提高cache空间的利用率。Different sub-layer units have different compression ratios. After compressed sub-layer units, their space occupancy is no longer uniform. However, the method of splitting and managing the cache space based on a fixed 4KB standard can still be used in the compression format. In this case, the number of sub-layer units in the compressed format that can be placed in the cache space is exactly the same as the number of sub-layer units in the uncompressed format. The compression does not improve the utilization of the cache space.
另外一种管理方法将各压缩的子层单元紧密的放置在cache空间中,如图1所示,如此确实可以提升子层单元的缓存数量,但是cache中的数据不是一成不变的,子层单元经常会需要替换。Another management method places the compressed sub-level units tightly in the cache space, as shown in Figure 1. This can indeed increase the number of caches in the sub-level units, but the data in the cache is not static, and the sub-level units often Will need to be replaced.
如图2所示,固件FW需要将子层单元3淘汰出cache,腾出空间放子层单元5。但在这种情况下,淘汰子层单元3所腾出的空隙并不足以放下子层单元5,如果采用图3所示的方法,将子层单元5拆开放置,那么,随着后续更多的替换操作,整个cache空间会变得支离破碎,管理工作的复杂度会彻底失控。As shown in Figure 2, the firmware FW needs to eliminate the sub-layer unit 3 out of the cache and make room for the sub-layer unit 5. However, in this case, the void left by the elimination of the sub-layer unit 3 is not enough to place the sub-layer unit 5. If the method shown in FIG. With more replacement operations, the entire cache space will become fragmented, and the complexity of management will be completely out of control.
在背景技术部分中公开的以上信息只是用来加强对本文所描述技术的背景技术的理解,因此,背景技术中可能包含某些信息,这些信息对于本领域技术人员来说并未形成在本国已知的现有技术。The above information disclosed in the background technology section is only used to strengthen the understanding of the background technology of the technology described in this article. Therefore, the background technology may contain certain information, which is not formed in the country for those skilled in the art. Known prior art.
发明内容Summary of the invention
本公开的主要目的在于提供一种缓存管理方法、装置、存储介质、处理器和固态非易失存储设备,以解决现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。The main purpose of the present disclosure is to provide a cache management method, device, storage medium, processor, and solid-state non-volatile storage device, so as to solve the utilization of the cache space of the high-speed buffer in the prior art solid-state non-volatile storage device Lower question.
根据本公开实施例的一个方面,提供了一种缓存管理方法,包括:根据各第一L2P映射表子层单元的压缩比确定统一压缩比,所述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;根据所述统一压缩比和缓存容量确定缓存空间的拆分数量,所述缓存空间为高速缓冲存储器的存储空间;按照所述拆分数量拆分所述缓存空间,得到多个子空间;采用所述子空间存储所述第一L2P映射表子层单元。According to one aspect of the embodiments of the present disclosure, there is provided a cache management method, including: determining a unified compression ratio according to a compression ratio of each first L2P mapping table sub-layer unit, the first L2P mapping table sub-layer unit being in a compressed format The L2P mapping table sub-layer unit; according to the unified compression ratio and the cache capacity to determine the number of splits of the cache space, where the cache space is the storage space of the cache memory; split the cache space according to the number of splits, Obtain multiple subspaces; use the subspace to store the first L2P mapping table sub-layer unit.
可选地,根据第一L2P映射表子层单元的压缩比确定统一压缩比,包括:在预定比例小于或者等于预定阈值的情况下,确定预备压缩比为所述统一压缩比,所述预定比例为所述第一L2P映射表子层单元中第二L2P映射表子层单元的数量比例,所述第二L2P映射表子层单元的压缩比大于所述预备压缩比。Optionally, determining the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit includes: in a case where the predetermined ratio is less than or equal to a predetermined threshold, determining that the preliminary compression ratio is the unified compression ratio, and the predetermined ratio Is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio.
可选地,所述预定阈值为5%~20%。Optionally, the predetermined threshold is 5%-20%.
可选地,采用所述子空间存储所述第一L2P映射表子层单元,包括:将多个所述子空间进行编号;根据压缩容量确定占用数量,所述压缩容量为所述第一L2P映射表子层单元的容量,所述占用数量为所述第一L2P映射表子层单元占用的所述子空间的数量;根据所述占用数量将所述第一L2P映射表子层单元的数据进行拆分,得到拆分数据;将所述拆分数据按照空白子空间的编号的大小顺序依次存储在所述空白子空间内,所述空白子空间为未存储数据的所述子空间。Optionally, using the subspace to store the first L2P mapping table sublayer unit includes: numbering a plurality of the subspaces; and determining the occupied quantity according to a compressed capacity, where the compressed capacity is the first L2P The capacity of the mapping table sublayer unit, where the occupied quantity is the quantity of the subspace occupied by the first L2P mapping table sublayer unit; and the data of the first L2P mapping table sublayer unit is calculated according to the occupied quantity Splitting is performed to obtain split data; the split data is sequentially stored in the blank subspace in the order of the number of the blank subspace, and the blank subspace is the subspace where no data is stored.
可选地,将所述拆分数据按照空白子空间的编号的大小顺序存储在所述空白子空间内,包括:确定所述空白子空间的数量;在所述空白子空间的数量大于或者等于所述占用数量的情况下,将所述拆分数据按照所述空白子空间的编号的大小顺序依次存储在所述空白子空间内;在所述空白子空间的数量小于所述占用数量的情况下,删除部分已存储的所述第一L2P映射表子层单元,以使得删除后得到的所述空白子空间的数量大于或者等于所述占用数量。Optionally, storing the split data in the blank subspace in the order of the number of the blank subspace includes: determining the number of the blank subspace; where the number of the blank subspace is greater than or equal to In the case of the occupied amount, the split data is sequentially stored in the blank subspace in the order of the number of the blank subspace; in the case that the amount of the blank subspace is less than the occupied amount Next, delete part of the stored first L2P mapping table sub-layer units, so that the number of blank subspaces obtained after deletion is greater than or equal to the occupied number.
可选地,将所述拆分数据按照编号顺序依次存储在未存储数据的所述子空间内之后,所述缓存管理方法还包括:确定存储所述拆分数据的所述子空间的最小编号;将所述最小编号更新至L2P映射表的父层的对应单元,所述对应单元用于记录子层信息,所述第一L2P映射表子层单元与所述对应单元一一对应。Optionally, after the split data is sequentially stored in the subspace where the data is not stored in the order of numbers, the cache management method further includes: determining the smallest number of the subspace where the split data is stored Update the minimum number to the corresponding unit of the parent layer of the L2P mapping table, the corresponding unit is used to record sub-layer information, and the first L2P mapping table sub-layer unit corresponds to the corresponding unit one-to-one.
根据本公开实施例的另一方面,还提供了一种缓存管理装置,包括:第一确定单元,用于根据各第一L2P映射表子层单元的压缩比确定统一压缩比,所述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;第二确定单元,用于根据所述统一压缩比和缓存容量确定缓存空间的拆分数量,所述缓存空间为高速缓冲存储器的存储空间;第一处理单元,用于按照所述拆分数量拆分所述缓存空间,得到多个子空间;第二处理单元,用于采用所述子空 间存储所述第一L2P映射表子层单元。According to another aspect of the embodiments of the present disclosure, there is also provided a cache management device, including: a first determining unit configured to determine a unified compression ratio according to a compression ratio of each first L2P mapping table sub-layer unit, the first The L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit; the second determining unit is used to determine the number of splits of the cache space according to the unified compression ratio and the cache capacity, and the cache space is the amount of the cache memory. Storage space; a first processing unit, configured to split the cache space according to the number of splits to obtain multiple subspaces; a second processing unit, configured to use the subspace to store the first L2P mapping table sublayer unit.
根据本公开实施例的再一方面,还提供了一种存储介质,所述存储介质包括存储的程序,其中,所述程序执行任意一种所述的缓存管理方法。According to still another aspect of the embodiments of the present disclosure, a storage medium is also provided, the storage medium includes a stored program, wherein the program executes any one of the cache management methods described above.
根据本公开实施例的又一方面,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行任意一种所述的缓存管理方法。According to another aspect of the embodiments of the present disclosure, a processor is also provided, the processor is configured to run a program, wherein any one of the cache management methods is executed when the program is running.
根据本公开实施例的再一方面,还提供了一种固态非易失存储设备,包括L2P映射表、高速缓冲存储器和缓存管理装置,所述缓存管理装置为任意一种所述的缓存管理装置。According to another aspect of the embodiments of the present disclosure, there is also provided a solid-state non-volatile storage device, including an L2P mapping table, a cache memory, and a cache management device, the cache management device being any one of the aforementioned cache management devices .
可选地,所述固态非易失存储设备包括固态硬盘,通用闪存设备、嵌入式的多媒体存储卡以及U盘中的至少一种。Optionally, the solid-state non-volatile storage device includes at least one of a solid-state hard disk, a general-purpose flash memory device, an embedded multimedia memory card, and a U disk.
在本公开实施例中,上述缓存管理方法中,首先,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,然后,根据统一压缩比和缓存容量确定缓存空间的拆分数量,之后,按照拆分数量拆分缓存空间,得到多个子空间,最后,采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述方法根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。In the embodiment of the present disclosure, in the above-mentioned cache management method, firstly, the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then the number of divisions of the cache space is determined according to the unified compression ratio and the cache capacity, After that, the cache space is split according to the number of splits to obtain multiple subspaces, and finally, the subspace is used to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
构成本公开的一部分的说明书附图用来提供对本公开的进一步理解,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:The drawings of the specification constituting a part of the present disclosure are used to provide a further understanding of the present disclosure, and the exemplary embodiments and descriptions of the present disclosure are used to explain the present disclosure, and do not constitute an improper limitation of the present disclosure. In the attached picture:
图1至图3示出了现有技术中cache空间的示意图;Figures 1 to 3 show schematic diagrams of cache space in the prior art;
图4示出了根据本公开的一种实施例的缓存管理方法的流程图;Fig. 4 shows a flowchart of a cache management method according to an embodiment of the present disclosure;
图5至图8示出了根据本公开的一种实施例的高速缓冲存储器的存储空间的示意图;5 to 8 show schematic diagrams of the storage space of the cache memory according to an embodiment of the present disclosure;
图9示出了根据本公开的一种实施例的缓存管理装置的示意图。Fig. 9 shows a schematic diagram of a cache management apparatus according to an embodiment of the present disclosure.
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other if there is no conflict. Hereinafter, the present disclosure will be described in detail with reference to the drawings and in conjunction with the embodiments.
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开 一部分的实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only These are a part of the embodiments of the present disclosure, but not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of the present disclosure.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances for the purposes of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those clearly listed. Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
应该理解的是,当元件(诸如层、膜、区域、或衬底)描述为在另一元件“上”时,该元件可直接在该另一元件上,或者也可存在中间元件。而且,在说明书以及权利要求书中,当描述有元件“连接”至另一元件时,该元件可“直接连接”至该另一元件,或者通过第三元件“连接”至该另一元件。It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element can be directly on the other element, or intervening elements may also be present. Moreover, in the specification and claims, when it is described that an element is "connected" to another element, the element can be "directly connected" to the other element, or "connected" to the other element through a third element.
为了便于描述,以下对本公开实施例涉及的部分名词或术语进行说明:For ease of description, some terms or terms involved in the embodiments of the present disclosure are described below:
cache:即高速缓冲存储器,位于CPU和主存储器DRAM之间,规模较小但速度很高的存储器;cache: the high-speed buffer memory, located between the CPU and the main memory DRAM, a small-scale but high-speed memory;
正如背景技术中所说的,现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低,为了解决上述问题,本公开的一种典型的实施方式中,提供了一种缓存管理方法、装置、存储介质、处理器和固态非易失存储设备。As mentioned in the background art, the utilization rate of the cache space of the cache memory in the prior art solid-state non-volatile storage device is low. In order to solve the above problem, a typical implementation of the present disclosure provides a A cache management method, device, storage medium, processor, and solid-state non-volatile storage device.
根据本公开的实施例,提供了一种缓存管理方法。According to an embodiment of the present disclosure, a cache management method is provided.
图4是根据本公开实施例的缓存管理方法的流程图。如图4所示,该方法包括以下步骤:Fig. 4 is a flowchart of a cache management method according to an embodiment of the present disclosure. As shown in Figure 4, the method includes the following steps:
步骤S101,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,上述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;Step S101: Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
步骤S102,根据上述统一压缩比和缓存容量确定缓存空间的拆分数量,上述缓存空间为高速缓冲存储器的存储空间;Step S102: Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
步骤S103,按照上述拆分数量拆分上述缓存空间,得到多个子空间;Step S103: Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
步骤S104,采用上述子空间存储上述第一L2P映射表子层单元。Step S104, using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
上述缓存管理方法中,首先,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,然后,根据统一压缩比和缓存容量确定缓存空间的拆分数量,之后,按照拆分数量拆分缓存空间,得到多个子空间,最后,采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述方法根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更 多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。In the above-mentioned cache management method, first, the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then the number of splits of the cache space is determined according to the unified compression ratio and the cache capacity, and then the split is divided according to the number of splits. The buffer space is divided to obtain multiple sub-spaces, and finally, the sub-space is used to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical sequence is shown in the flowchart, in some cases, The steps shown or described can be performed in a different order than here.
本公开的一种实例中,根据第一L2P映射表子层单元的压缩比确定统一压缩比,包括:在预定比例小于或者等于预定阈值的情况下,确定预备压缩比为上述统一压缩比,上述预定比例为上述第一L2P映射表子层单元中第二L2P映射表子层单元的数量比例,上述第二L2P映射表子层单元的压缩比大于上述预备压缩比。具体地,选取一个预备压缩比,计算得到预定比例,在预定比例小于或者等于预定阈值的情况下,确定该预备压缩比为统一压缩比,在预定比例大于预定阈值的情况下,重新选取预备压缩比,直至预备压缩比对应的预定比例小于或者等于预定阈值,确定该预备压缩比为统一压缩比,例如,预定阈值为10%,预备压缩比为8,若预备压缩比对应的预定比例小于10%,则确定统一压缩比为8。In an example of the present disclosure, determining the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit includes: when the predetermined ratio is less than or equal to a predetermined threshold, determining the preliminary compression ratio to be the above-mentioned unified compression ratio. The predetermined ratio is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio. Specifically, a preliminary compression ratio is selected, and a predetermined ratio is calculated. When the predetermined ratio is less than or equal to a predetermined threshold, the preliminary compression ratio is determined to be a unified compression ratio, and when the predetermined ratio is greater than the predetermined threshold, the preliminary compression is reselected Ratio, until the predetermined ratio corresponding to the preliminary compression ratio is less than or equal to the predetermined threshold, it is determined that the preliminary compression ratio is a unified compression ratio, for example, the predetermined threshold is 10%, the preliminary compression ratio is 8, and if the predetermined ratio corresponding to the preliminary compression ratio is less than 10 %, the unified compression ratio is determined to be 8.
本公开的一种实例中,上述预定阈值为5%~20%。具体地,将预定阈值设置在上述范围内,以确定合适的统一压缩比,从而确定合适的拆分数量,进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,当然,上述预定阈值也不限于此,本领域技术人员可以根据实际情况调整预定阈值,以进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率。In an example of the present disclosure, the aforementioned predetermined threshold is 5%-20%. Specifically, the predetermined threshold is set within the above range to determine an appropriate unified compression ratio, thereby determining an appropriate number of splits, and further improving the utilization of the cache space of the cache memory in the solid-state nonvolatile storage device. Of course, the above The predetermined threshold is not limited to this, and those skilled in the art can adjust the predetermined threshold according to the actual situation to further improve the utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device.
本公开的一种实例中,采用上述子空间存储上述第一L2P映射表子层单元,包括:将多个上述子空间进行编号;根据压缩容量确定占用数量,上述压缩容量为上述第一L2P映射表子层单元的容量,上述占用数量为上述第一L2P映射表子层单元占用的上述子空间的数量;根据上述占用数量将上述第一L2P映射表子层单元的数据进行拆分,得到拆分数据;将上述拆分数据按照空白子空间的编号的大小顺序依次存储在上述空白子空间内,上述空白子空间为未存储数据的上述子空间。具体地,将多个子空间进行编号,根据高速缓冲存储器的缓存容量和子空间的数量,即可确定单个子空间的容量,根据压缩容量和单个子空间的容量即可确定占用数量,再根据占用数量将第一L2P映射表子层单元的数据进行拆分,将拆分数据按照空白子空间的编号的大小顺序依次存储在空白子空间内,避免漏用空白子空间,使得子空间可以存储更多的第一L2P映射表子层单元,进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率。例如,高速缓冲存储器的缓存容量为512KB,单个不压缩L2P映射表子层单元的容量为4KB,统一压缩比为8,则拆分数量为1024,即子空间的数量为1024,单个子空间的容量为0.5KB,则容量为2.7KB的第一L2P映射表子层单元的占用数量为6。In an example of the present disclosure, using the subspace to store the sublayer unit of the first L2P mapping table includes: numbering a plurality of the subspaces; determining the occupied quantity according to the compression capacity, and the compression capacity is the first L2P mapping The capacity of the table sub-layer unit, the above-mentioned occupied quantity is the quantity of the above-mentioned sub-space occupied by the above-mentioned first L2P mapping table sub-layer unit; according to the above-mentioned occupied quantity, the data of the above-mentioned first L2P mapping table sub-layer unit is split to obtain a split Sub-data; the above-mentioned split data is sequentially stored in the above-mentioned blank sub-space according to the size order of the number of the blank sub-space, and the above-mentioned blank sub-space is the above-mentioned sub-space where no data is stored. Specifically, multiple subspaces are numbered, and the capacity of a single subspace can be determined according to the cache capacity of the cache memory and the number of subspaces, and the occupied amount can be determined according to the compressed capacity and the capacity of a single subspace, and then according to the occupied amount Split the data of the first L2P mapping table sub-layer unit, and store the split data in the blank subspace in the order of the number of the blank subspace to avoid missing blank subspaces, so that the subspace can store more The first L2P mapping table sub-layer unit in the solid-state non-volatile storage device further improves the utilization rate of the cache space of the high-speed cache memory in the solid-state non-volatile storage device. For example, the cache capacity of the high-speed buffer memory is 512KB, the capacity of a single uncompressed L2P mapping table sub-layer unit is 4KB, and the unified compression ratio is 8, then the number of splits is 1024, that is, the number of subspaces is 1024, and the number of subspaces is 1024. If the capacity is 0.5KB, the occupied number of the first L2P mapping table sublayer unit with the capacity of 2.7KB is 6.
本公开的一种实例中,将上述拆分数据按照空白子空间的编号的大小顺序存储在上述空白子空间内,包括:确定上述空白子空间的数量;在上述空白子空间的数量大于或者等于上述占用数量的情况下,将上述拆分数据按照上述空白子空间的编号的大小顺序依次存储在上 述空白子空间内;在上述空白子空间的数量小于上述占用数量的情况下,删除部分已存储的上述第一L2P映射表子层单元,以使得删除后得到的上述空白子空间的数量大于或者等于上述占用数量。具体地,上述方法通过比较当前的空白子空间的数量和占用数量,确定是否删除部分已存储的第一L2P映射表子层单元,以确保空白子空间的数量大于或者等于占用数量,使得拆分数据可以按照空白子空间的编号的大小顺序依次存储在空白子空间内,以保证高速缓冲存储器可以调取需要的第一L2P映射表子层单元。In an example of the present disclosure, storing the split data in the blank subspace in the order of the size of the blank subspace includes: determining the number of the blank subspace; where the number of the blank subspace is greater than or equal to In the case of the above-mentioned occupied quantity, the above-mentioned split data is sequentially stored in the above-mentioned blank sub-space in the order of the number of the above-mentioned blank sub-space; in the case where the number of the above-mentioned blank sub-space is less than the above-mentioned occupied quantity, the deleted part is already stored The above-mentioned first L2P mapping table sub-layer unit, so that the quantity of the above-mentioned blank subspace obtained after deletion is greater than or equal to the above-mentioned occupied quantity. Specifically, the above method determines whether to delete some of the stored first L2P mapping table sublayer units by comparing the current number of blank subspaces with the occupied number, so as to ensure that the number of blank subspaces is greater than or equal to the occupied number, so that the split The data may be sequentially stored in the blank subspace in the order of the number of the blank subspace, so as to ensure that the cache memory can retrieve the required first L2P mapping table sublayer unit.
需要说明的是,如图5所示,高速缓冲存储器的缓存空间存储3个第一L2P映射表子层单元,存储第一L2P映射表子层单元X的子空间的编号分别为1、2、3和4,存储第一L2P映射表子层单元Y的子空间的编号分别为6、7、8、10和11,存储第一L2P映射表子层单元Z的子空间的编号分别为15、16和17,高速缓冲存储器调取占用数量为6的第一L2P映射表子层单元A,将第一L2P映射表子层单元A的拆分数据依次存储在编号5、9、12、13、14和18的空白子空间内,如图6所示,高速缓冲存储器调取占用数量为4的第一L2P映射表子层单元B,删除第一L2P映射表子层单元Y,得到5个空白子空间,如图7所示,将第一L2P映射表子层单元A的拆分数据依次存储在编号6、7、8和10的空白子空间内,如图8所示。It should be noted that, as shown in FIG. 5, the cache space of the cache memory stores three first L2P mapping table sublayer units, and the numbers of the subspaces storing the first L2P mapping table sublayer unit X are 1, 2, respectively. 3 and 4, the numbers of the subspaces storing the first L2P mapping table sub-layer unit Y are 6, 7, 8, 10, and 11, respectively, and the numbers of the subspaces storing the first L2P mapping table sub-layer unit Z are 15, respectively 16 and 17, the cache memory retrieves the first L2P mapping table sub-layer unit A occupying 6, and stores the split data of the first L2P mapping table sub-layer unit A in numbers 5, 9, 12, 13, and 13, respectively. In the blank subspaces of 14 and 18, as shown in FIG. 6, the cache memory retrieves the first L2P mapping table sub-layer unit B, which occupies 4, and deletes the first L2P mapping table sub-layer unit Y to obtain 5 blanks. In the subspace, as shown in FIG. 7, the split data of the first L2P mapping table sublayer unit A is sequentially stored in the blank subspaces numbered 6, 7, 8, and 10, as shown in FIG. 8.
需要说明的是,图5、图6、图7和图8中子空间中不同的填充表示子空间的占用状态不同,具体的占用状态包括是否被占用以及被哪个第一L2P映射表子层单元占用的状态。It should be noted that the different fillings in the subspaces in Figure 5, Figure 6, Figure 7 and Figure 8 indicate that the occupancy status of the subspace is different. The specific occupancy status includes whether it is occupied and which first L2P mapping table sub-layer unit is used. Occupied state.
本公开的一种实例中,将上述拆分数据按照编号顺序依次存储在未存储数据的上述子空间内之后,上述缓存管理方法还包括:确定存储上述拆分数据的上述子空间的最小编号;将上述最小编号更新至L2P映射表的父层的对应单元,上述对应单元用于记录子层信息,上述第一L2P映射表子层单元与上述对应单元一一对应。具体地,上述方法将存储第一L2P映射表子层单元的子空间的最小编号存储在L2P映射表的父层的对应单元,并将最小编号与第一L2P映射表子层单元建立链表,从而根据最小编号找到存储第一L2P映射表子层单元的子空间,便于后续根据链表删除已存储的第一L2P映射表子层单元,降低了高速缓冲存储器的缓存空间的管理复杂度。In an example of the present disclosure, after the above-mentioned split data are sequentially stored in the above-mentioned subspace where the data is not stored in the order of numbers, the above-mentioned cache management method further includes: determining the minimum number of the above-mentioned subspace where the above-mentioned split data is stored; The minimum number is updated to the corresponding unit of the parent layer of the L2P mapping table, the corresponding unit is used to record sub-layer information, and the first L2P mapping table sub-layer unit corresponds to the corresponding unit one-to-one. Specifically, the above method stores the minimum number of the subspace storing the first L2P mapping table sub-layer unit in the corresponding unit of the parent layer of the L2P mapping table, and establishes a linked list with the minimum number and the first L2P mapping table sub-layer unit, thereby Find the subspace storing the first L2P mapping table sub-layer unit according to the smallest number, which facilitates the subsequent deletion of the stored first L2P mapping table sub-layer unit according to the linked list, and reduces the management complexity of the cache space of the cache memory.
本公开实施例还提供了一种缓存管理装置,需要说明的是,本公开实施例的缓存管理装置可以用于执行本公开实施例所提供的缓存管理方法。以下对本公开实施例提供的缓存管理装置进行介绍。The embodiments of the present disclosure also provide a cache management apparatus. It should be noted that the cache management apparatus of the embodiments of the present disclosure may be used to execute the cache management method provided by the embodiments of the present disclosure. The following describes the cache management device provided by the embodiment of the present disclosure.
图9是根据本公开实施例的缓存管理装置的示意图,上述控制装置包括:Fig. 9 is a schematic diagram of a cache management device according to an embodiment of the present disclosure, and the above-mentioned control device includes:
第一确定单元10,用于根据第一L2P映射表子层单元的压缩比确定统一压缩比,上述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;The first determining unit 10 is configured to determine the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
第二确定单元20,用于根据上述统一压缩比和缓存容量确定缓存空间的拆分数量,上述缓存空间为高速缓冲存储器的存储空间;The second determining unit 20 is configured to determine the number of splits of the cache space according to the above-mentioned unified compression ratio and the cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
第一处理单元30,用于按照上述拆分数量拆分上述缓存空间,得到多个子空间;The first processing unit 30 is configured to split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
第二处理单元40,用于采用上述子空间存储上述第一L2P映射表子层单元。The second processing unit 40 is configured to use the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
上述缓存管理装置中,第一确定单元根据各第一L2P映射表子层单元的压缩比确定统一压缩比,第二确定单元根据统一压缩比和缓存容量确定缓存空间的拆分数量,第一处理单元按照拆分数量拆分缓存空间,得到多个子空间,第二处理单元采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述装置根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。In the above-mentioned cache management device, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, the second determining unit determines the number of divisions of the cache space according to the unified compression ratio and the cache capacity, and the first processing The unit splits the cache space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
本公开的一种实例中,上述第一确定单元包括第一确定模块,其中,上述第一确定模块用于在预定比例小于或者等于预定阈值的情况下,确定预备压缩比为上述统一压缩比,上述预定比例为上述第一L2P映射表子层单元中第二L2P映射表子层单元的数量比例,上述第二L2P映射表子层单元的压缩比大于上述预备压缩比。具体地,选取一个预备压缩比,计算得到预定比例,在预定比例小于或者等于预定阈值的情况下,确定该预备压缩比为统一压缩比,在预定比例大于预定阈值的情况下,重新选取预备压缩比,直至预备压缩比对应的预定比例小于或者等于预定阈值,确定该预备压缩比为统一压缩比,例如,预定阈值为10%,预备压缩比为8,若预备压缩比对应的预定比例小于10%,则确定统一压缩比为8。In an example of the present disclosure, the first determining unit includes a first determining module, wherein the first determining module is configured to determine that the preliminary compression ratio is the unified compression ratio when the predetermined ratio is less than or equal to a predetermined threshold, The predetermined ratio is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit, and the compression ratio of the second L2P mapping table sublayer unit is greater than the preliminary compression ratio. Specifically, a preliminary compression ratio is selected, and a predetermined ratio is calculated. When the predetermined ratio is less than or equal to a predetermined threshold, the preliminary compression ratio is determined to be a unified compression ratio, and when the predetermined ratio is greater than the predetermined threshold, the preliminary compression is reselected Ratio, until the predetermined ratio corresponding to the preliminary compression ratio is less than or equal to the predetermined threshold, it is determined that the preliminary compression ratio is a unified compression ratio, for example, the predetermined threshold is 10%, the preliminary compression ratio is 8, and if the predetermined ratio corresponding to the preliminary compression ratio is less than 10 %, the unified compression ratio is determined to be 8.
本公开的一种实例中,上述预定阈值为5%~20%。具体地,将预定阈值设置在上述范围内,以确定合适的统一压缩比,从而确定合适的拆分数量,进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,当然,上述预定阈值也不限于此,本领域技术人员可以根据实际情况调整预定阈值,以进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率。In an example of the present disclosure, the aforementioned predetermined threshold is 5%-20%. Specifically, the predetermined threshold is set within the above range to determine an appropriate unified compression ratio, thereby determining an appropriate number of splits, and further improving the utilization of the cache space of the cache memory in the solid-state nonvolatile storage device. Of course, the above The predetermined threshold is not limited to this, and those skilled in the art can adjust the predetermined threshold according to the actual situation to further improve the utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device.
本公开的一种实例中,上述第二处理单元包括第一处理模块、第二确定模块、第二处理模块和第三处理模块,其中,上述第一处理模块用于将多个上述子空间进行编号;上述第二确定模块用于根据压缩容量确定占用数量,上述压缩容量为上述第一L2P映射表子层单元的容量,上述占用数量为上述第一L2P映射表子层单元占用的上述子空间的数量;上述第二处理模块用于根据上述占用数量将上述第一L2P映射表子层单元的数据进行拆分,得到拆分数据;上述第三处理模块用于将上述拆分数据按照空白子空间的编号的大小顺序依次存储在上述空白子空间内,上述空白子空间为未存储数据的上述子空间。具体地,将多个子空间进行编号,根据高速缓冲存储器的缓存容量和子空间的数量,即可确定单个子空间的容量,根据压缩容量和单个子空间的容量即可确定占用数量,再根据占用数量将第一L2P映射表子层单元的数据进行拆分,将拆分数据按照空白子空间的编号的大小顺序依次存储在空白子空间内,避免漏用空白子空间,使得子空间可以存储更多的第一L2P映射表子层单元,进一步提高固态非易失存储设备中高速缓冲存储器的缓存空间的利用率。例如,高速缓冲存储器的缓存容量为512KB,单个不压缩L2P映射表子层单元的容量为4KB,统一压缩比为8,则拆分数量为1024,即子空间的数量为1024,单个子空间的容量为0.5KB,则容量为2.7KB的第一L2P映射表子层单元的占用数量为6。In an example of the present disclosure, the above-mentioned second processing unit includes a first processing module, a second determining module, a second processing module, and a third processing module, wherein the above-mentioned first processing module is used to perform multiple sub-spaces Number; the second determining module is used to determine the occupied quantity according to the compressed capacity, the compressed capacity is the capacity of the first L2P mapping table sublayer unit, and the occupied quantity is the subspace occupied by the first L2P mapping table sublayer unit The above-mentioned second processing module is used to split the data of the first L2P mapping table sub-layer unit according to the above-mentioned occupancy quantity to obtain split data; the above-mentioned third processing module is used to divide the above-mentioned split data according to blanks The numbers of the spaces are sequentially stored in the blank subspace in order, and the blank subspace is the subspace where no data is stored. Specifically, multiple subspaces are numbered, and the capacity of a single subspace can be determined according to the cache capacity of the cache memory and the number of subspaces, and the occupied amount can be determined according to the compressed capacity and the capacity of a single subspace, and then according to the occupied amount Split the data of the first L2P mapping table sub-layer unit, and store the split data in the blank subspace in the order of the number of the blank subspace to avoid missing blank subspaces, so that the subspace can store more The first L2P mapping table sub-layer unit in the solid-state non-volatile storage device further improves the utilization rate of the cache space of the high-speed cache memory in the solid-state non-volatile storage device. For example, the cache capacity of the high-speed buffer memory is 512KB, the capacity of a single uncompressed L2P mapping table sub-layer unit is 4KB, and the unified compression ratio is 8, then the number of splits is 1024, that is, the number of subspaces is 1024, and the number of subspaces is 1024. If the capacity is 0.5KB, the occupied number of the first L2P mapping table sublayer unit with the capacity of 2.7KB is 6.
本公开的一种实例中,上述第三处理模块包括确定子模块、第一处理子模块和第二处理子模块,其中,上述确定子模块用于确定上述空白子空间的数量;上述第一处理子模块用于在上述空白子空间的数量大于或者等于上述占用数量的情况下,将上述拆分数据按照上述空白子空间的编号的大小顺序依次存储在上述空白子空间内;上述第二处理子模块用于在上述空白子空间的数量小于上述占用数量的情况下,删除部分已存储的上述第一L2P映射表子层单元,以使得删除后得到的上述空白子空间的数量大于或者等于上述占用数量。具体地,上述装置通过比较当前的空白子空间的数量和占用数量,确定是否删除部分已存储的第一L2P映射表子层单元,以确保空白子空间的数量大于或者等于占用数量,使得拆分数据可以按照空白子空间的编号的大小顺序依次存储在空白子空间内,以保证高速缓冲存储器可以调取需要的第一L2P映射表子层单元。In an example of the present disclosure, the above-mentioned third processing module includes a determination sub-module, a first processing sub-module, and a second processing sub-module, wherein the above-mentioned determination sub-module is used to determine the number of the above-mentioned blank subspaces; the above-mentioned first processing The submodule is used to store the split data in the blank subspace in the order of the numbers of the blank subspaces in order when the number of the blank subspaces is greater than or equal to the occupied amount; the second processing subspace The module is used to delete part of the stored first L2P mapping table sub-layer units when the amount of the blank subspace is less than the occupied amount, so that the amount of the blank subspace obtained after the deletion is greater than or equal to the occupied amount quantity. Specifically, the above-mentioned device determines whether to delete part of the stored first L2P mapping table sub-layer units by comparing the current number of blank subspaces with the occupied number, so as to ensure that the number of blank subspaces is greater than or equal to the occupied number, so that the split The data may be sequentially stored in the blank subspace in the order of the number of the blank subspace, so as to ensure that the cache memory can retrieve the required first L2P mapping table sublayer unit.
需要说明的是,如图5所示,高速缓冲存储器的缓存空间存储3个第一L2P映射表子层单元,存储第一L2P映射表子层单元X的子空间的编号分别为1、2、3和4,存储第一L2P映射表子层单元Y的子空间的编号分别为6、7、8、10和11,存储第一L2P映射表子层单元Z的子空间的编号分别为15、16和17,高速缓冲存储器调取占用数量为6的第一L2P映射表子层单元A,将第一L2P映射表子层单元A的拆分数据依次存储在编号5、9、12、13、14和18的空白子空间内,如图6所示,高速缓冲存储器调取占用数量为4的第一L2P映射表子层单元B,删除第一L2P映射表子层单元Y,得到5个空白子空间,如图7所示,将第一L2P映射表子层单元A的拆分数据依次存储在编号6、7、8和10的空白子空间内,如图8所示。It should be noted that, as shown in FIG. 5, the cache space of the cache memory stores three first L2P mapping table sublayer units, and the numbers of the subspaces storing the first L2P mapping table sublayer unit X are 1, 2, respectively. 3 and 4, the numbers of the subspaces storing the first L2P mapping table sub-layer unit Y are 6, 7, 8, 10, and 11, respectively, and the numbers of the subspaces storing the first L2P mapping table sub-layer unit Z are 15, respectively 16 and 17, the cache memory retrieves the first L2P mapping table sub-layer unit A occupying 6, and stores the split data of the first L2P mapping table sub-layer unit A in numbers 5, 9, 12, 13, and 13, respectively. In the blank subspaces of 14 and 18, as shown in FIG. 6, the cache memory retrieves the first L2P mapping table sub-layer unit B, which occupies 4, and deletes the first L2P mapping table sub-layer unit Y to obtain 5 blanks. In the subspace, as shown in FIG. 7, the split data of the first L2P mapping table sublayer unit A is sequentially stored in the blank subspaces numbered 6, 7, 8, and 10, as shown in FIG. 8.
本公开的一种实例中,上述缓存管理装置还包括记录单元,上述记录单元包括第三确定模块和记录模块,其中,上述第三确定模块用于将上述拆分数据按照编号顺序依次存储在未存储数据的上述子空间内之后,确定存储上述拆分数据的上述子空间的最小编号;上述记录模块用于将上述最小编号更新至L2P映射表的父层的对应单元,上述对应单元用于记录子层信息,上述第一L2P映射表子层单元与上述对应单元一一对应。具体地,上述装置将存储第一L2P映射表子层单元的子空间的最小编号存储在L2P映射表的父层的对应单元,并将最小编号与第一L2P映射表子层单元建立链表,从而根据最小编号找到存储第一L2P映射表子层单元的子空间,便于后续根据链表删除已存储的第一L2P映射表子层单元,降低了高速缓冲存储器的缓存空间的管理复杂度。In an example of the present disclosure, the above-mentioned cache management device further includes a recording unit, and the above-mentioned recording unit includes a third determining module and a recording module. After storing the data in the aforementioned subspace, determine the minimum number of the aforementioned subspace storing the aforementioned split data; the aforementioned recording module is used to update the aforementioned minimum number to the corresponding unit of the parent layer of the L2P mapping table, and the aforementioned corresponding unit is used for recording Sub-layer information, the sub-layer unit of the first L2P mapping table corresponds to the corresponding unit in a one-to-one correspondence. Specifically, the above device stores the minimum number of the subspace storing the first L2P mapping table sub-layer unit in the corresponding unit of the parent layer of the L2P mapping table, and establishes a linked list with the minimum number and the first L2P mapping table sub-layer unit, thereby Find the subspace storing the first L2P mapping table sub-layer unit according to the smallest number, which facilitates the subsequent deletion of the stored first L2P mapping table sub-layer unit according to the linked list, and reduces the management complexity of the cache space of the cache memory.
本公开实施例还提供了一种固态非易失存储设备,包括L2P映射表、高速缓冲存储器和缓存管理装置,上述缓存管理装置为任意一种上述的缓存管理装置。The embodiment of the present disclosure also provides a solid-state non-volatile storage device, including an L2P mapping table, a cache memory, and a cache management device. The above-mentioned cache management device is any one of the above-mentioned cache management devices.
上述固态非易失存储设备中,包括缓存管理装置,第一确定单元根据各第一L2P映射表子层单元的压缩比确定统一压缩比,第二确定单元根据统一压缩比和缓存容量确定缓存空间的拆分数量,第一处理单元按照拆分数量拆分缓存空间,得到多个子空间,第二处理单元采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述装置根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提 高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。The above solid-state non-volatile storage device includes a cache management device, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the second determining unit determines the cache space according to the unified compression ratio and the cache capacity The first processing unit splits the buffer space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
上述缓存管理装置包括处理器和存储器,上述第一确定单元、第二确定单元、第一处理单元和第二处理单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The foregoing cache management device includes a processor and a memory. The foregoing first determination unit, second determination unit, first processing unit, and second processing unit are all stored in the memory as program units, and the processor executes the foregoing stored in the memory. Program unit to realize the corresponding function.
上述固态非易失存储设备包括固态硬盘,通用闪存设备(Universal Flash Storage,简称UFS)、嵌入式的多媒体存储卡(embedded Multi Media Card,简称eMMC)以及U盘中的至少一种。The foregoing solid-state non-volatile storage device includes at least one of a solid-state hard disk, a universal flash storage (Universal Flash Storage, UFS), an embedded MultiMedia Card (eMMC), and a U disk.
当然,实际的应用中,并不限于上述的具体存储设备,固态非易失存储设备还可以包括其他的对应设备。Of course, the actual application is not limited to the specific storage device mentioned above, and the solid-state non-volatile storage device may also include other corresponding devices.
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来解决现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。The processor contains the kernel, and the kernel calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters are adjusted to solve the problem of low utilization of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。The memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one Memory chip.
本公开实施例提供了一种存储介质,其上存储有程序,该程序被处理器执行时实现上述缓存管理方法。The embodiment of the present disclosure provides a storage medium on which a program is stored, and the program is executed by a processor to implement the above-mentioned cache management method.
本公开实施例提供了一种处理器,上述处理器用于运行程序,其中,上述程序运行时执行上述缓存管理方法。The embodiments of the present disclosure provide a processor, and the above-mentioned processor is used for running a program, wherein the above-mentioned cache management method is executed when the above-mentioned program is running.
本公开实施例提供了一种设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器执行程序时实现至少以下步骤:The embodiments of the present disclosure provide a device that includes a processor, a memory, and a program stored on the memory and capable of running on the processor, and the processor implements at least the following steps when the program is executed:
步骤S101,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,上述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;Step S101: Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
步骤S102,根据上述统一压缩比和缓存容量确定缓存空间的拆分数量,上述缓存空间为高速缓冲存储器的存储空间;Step S102: Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
步骤S103,按照上述拆分数量拆分上述缓存空间,得到多个子空间;Step S103: Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
步骤S104,采用上述子空间存储上述第一L2P映射表子层单元。Step S104, using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
本文中的设备可以是服务器、PC、PAD、手机等。The devices in this article can be servers, PCs, PADs, mobile phones, etc.
本公开还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有至少如下方法步骤的程序:The present disclosure also provides a computer program product, which when executed on a data processing device, is suitable for executing a program that initializes at least the following method steps:
步骤S101,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,上述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;Step S101: Determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the first L2P mapping table sub-layer unit is a compressed format L2P mapping table sub-layer unit;
步骤S102,根据上述统一压缩比和缓存容量确定缓存空间的拆分数量,上述缓存空间为高速缓冲存储器的存储空间;Step S102: Determine the number of splits of the cache space according to the above-mentioned unified compression ratio and cache capacity, where the above-mentioned cache space is the storage space of the cache memory;
步骤S103,按照上述拆分数量拆分上述缓存空间,得到多个子空间;Step S103: Split the above-mentioned buffer space according to the above-mentioned number of splits to obtain multiple subspaces;
步骤S104,采用上述子空间存储上述第一L2P映射表子层单元。Step S104, using the aforementioned subspace to store the aforementioned first L2P mapping table sub-layer unit.
在本公开的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present disclosure, the description of each embodiment has its own focus. For a part that is not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
在本公开所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The above-described device embodiments are only illustrative. For example, the division of the above-mentioned units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本公开各个实施例上述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present disclosure essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the foregoing methods of the various embodiments of the present disclosure. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code .
从以上的描述中,可以看出,本公开上述的实施例实现了如下技术效果:From the above description, it can be seen that the above-mentioned embodiments of the present disclosure achieve the following technical effects:
1)、本公开的缓存管理方法中,首先,根据各第一L2P映射表子层单元的压缩比确定统一压缩比,然后,根据统一压缩比和缓存容量确定缓存空间的拆分数量,之后,按照拆分数量拆分缓存空间,得到多个子空间,最后,采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述方法根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的 缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。1). In the cache management method of the present disclosure, first, the unified compression ratio is determined according to the compression ratio of each first L2P mapping table sub-layer unit, and then, the number of splits of the cache space is determined according to the unified compression ratio and the cache capacity, and then, The cache space is split according to the number of splits to obtain multiple subspaces. Finally, the subspace is used to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above method determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
2)、本公开的缓存管理装置中,第一确定单元根据各第一L2P映射表子层单元的压缩比确定统一压缩比,第二确定单元根据统一压缩比和缓存容量确定缓存空间的拆分数量,第一处理单元按照拆分数量拆分缓存空间,得到多个子空间,第二处理单元采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述装置根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。2) In the cache management device of the present disclosure, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the second determining unit determines the division of the cache space according to the unified compression ratio and the cache capacity The first processing unit splits the buffer space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
3)、本公开的固态非易失存储设备中,包括缓存管理装置,第一确定单元根据各第一L2P映射表子层单元的压缩比确定统一压缩比,第二确定单元根据统一压缩比和缓存容量确定缓存空间的拆分数量,第一处理单元按照拆分数量拆分缓存空间,得到多个子空间,第二处理单元采用子空间存储第一L2P映射表子层单元。由于单个不压缩L2P映射表子层单元的容量为固定的,但是各第一L2P映射表子层单元的压缩比不同,上述装置根据各第一L2P映射表子层单元的压缩比确定统一压缩比,根据统一压缩比和缓存容量,从而将高速缓冲存储器的存储空间拆分成合适数量的子空间,使得子空间可以存储更多的第一L2P映射表子层单元,从而提高了固态非易失存储设备中高速缓冲存储器的缓存空间的利用率,解决了现有技术的固态非易失存储设备中高速缓冲存储器的缓存空间的利用率较低的问题。3) The solid-state non-volatile storage device of the present disclosure includes a cache management device, the first determining unit determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, and the second determining unit determines the unified compression ratio according to the unified compression ratio and The cache capacity determines the number of splits of the cache space, the first processing unit splits the cache space according to the number of splits to obtain multiple subspaces, and the second processing unit uses the subspace to store the first L2P mapping table sub-layer unit. Since the capacity of a single uncompressed L2P mapping table sub-layer unit is fixed, but the compression ratio of each first L2P mapping table sub-layer unit is different, the above device determines the unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit According to the unified compression ratio and cache capacity, the storage space of the cache memory is split into a suitable number of sub-spaces, so that the sub-space can store more first L2P mapping table sub-layer units, thereby improving the solid-state non-volatility The utilization rate of the cache space of the cache memory in the storage device solves the problem of low utilization rate of the cache space of the cache memory in the solid-state non-volatile storage device in the prior art.
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。The above descriptions are only preferred embodiments of the present disclosure and are not used to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims (11)
- 一种缓存管理方法,其特征在于,包括:A cache management method is characterized in that it includes:根据各第一L2P映射表子层单元的压缩比确定统一压缩比,所述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;Determining a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, where the first L2P mapping table sub-layer unit is an L2P mapping table sub-layer unit in a compressed format;根据所述统一压缩比和缓存容量确定缓存空间的拆分数量,所述缓存空间为高速缓冲存储器的存储空间;Determining the number of splits of the cache space according to the unified compression ratio and the cache capacity, where the cache space is the storage space of the cache memory;按照所述拆分数量拆分所述缓存空间,得到多个子空间;Split the cache space according to the split number to obtain multiple subspaces;采用所述子空间存储所述第一L2P映射表子层单元。The subspace is used to store the first L2P mapping table sublayer unit.
- 根据权利要求1所述的缓存管理方法,其特征在于,根据第一L2P映射表子层单元的压缩比确定统一压缩比,包括:The cache management method according to claim 1, wherein determining the unified compression ratio according to the compression ratio of the first L2P mapping table sub-layer unit comprises:在预定比例小于或者等于预定阈值的情况下,确定预备压缩比为所述统一压缩比,所述预定比例为所述第一L2P映射表子层单元中第二L2P映射表子层单元的数量比例,所述第二L2P映射表子层单元的压缩比大于所述预备压缩比。In the case that the predetermined ratio is less than or equal to the predetermined threshold, it is determined that the preliminary compression ratio is the unified compression ratio, and the predetermined ratio is the ratio of the number of second L2P mapping table sublayer units in the first L2P mapping table sublayer unit , The compression ratio of the second L2P mapping table sub-layer unit is greater than the preliminary compression ratio.
- 根据权利要求2所述的缓存管理方法,其特征在于,所述预定阈值为5%~20%。The cache management method according to claim 2, wherein the predetermined threshold is 5%-20%.
- 根据权利要求1所述的缓存管理方法,其特征在于,采用所述子空间存储所述第一L2P映射表子层单元,包括:The cache management method according to claim 1, wherein using the subspace to store the first L2P mapping table sub-layer unit comprises:将多个所述子空间进行编号;Numbering a plurality of said subspaces;根据压缩容量确定占用数量,所述压缩容量为所述第一L2P映射表子层单元的容量,所述占用数量为所述第一L2P映射表子层单元占用的所述子空间的数量;Determining the occupied quantity according to the compressed capacity, where the compressed capacity is the capacity of the first L2P mapping table sublayer unit, and the occupied quantity is the quantity of the subspace occupied by the first L2P mapping table sublayer unit;根据所述占用数量将所述第一L2P映射表子层单元的数据进行拆分,得到拆分数据;Splitting the data of the sub-layer unit of the first L2P mapping table according to the occupied amount to obtain split data;将所述拆分数据按照空白子空间的编号的大小顺序依次存储在所述空白子空间内,所述空白子空间为未存储数据的所述子空间。The split data is sequentially stored in the blank subspace in the order of the number of the blank subspace, and the blank subspace is the subspace where no data is stored.
- 根据权利要求4所述的缓存管理方法,其特征在于,将所述拆分数据按照空白子空间的编号的大小顺序存储在所述空白子空间内,包括:The cache management method according to claim 4, wherein storing the split data in the blank subspace in the order of the number of the blank subspace comprises:确定所述空白子空间的数量;Determining the number of blank subspaces;在所述空白子空间的数量大于或者等于所述占用数量的情况下,将所述拆分数据按照所述空白子空间的编号的大小顺序依次存储在所述空白子空间内;In the case that the number of the blank subspaces is greater than or equal to the occupied number, the split data are sequentially stored in the blank subspaces in the order of the numbers of the blank subspaces;在所述空白子空间的数量小于所述占用数量的情况下,删除部分已存储的所述第一L2P映射表子层单元,以使得删除后得到的所述空白子空间的数量大于或者等于所述占用数量。In the case that the number of blank subspaces is less than the occupied number, delete part of the first L2P mapping table sublayer units that have been stored, so that the number of blank subspaces obtained after deletion is greater than or equal to all. The number of occupancy.
- 根据权利要求5所述的缓存管理方法,其特征在于,将所述拆分数据按照编号顺序依次存储在未存储数据的所述子空间内之后,所述缓存管理方法还包括:The cache management method according to claim 5, characterized in that, after the split data is sequentially stored in the subspace where no data is stored in order of number, the cache management method further comprises:确定存储所述拆分数据的所述子空间的最小编号;Determine the smallest number of the subspace storing the split data;将所述最小编号更新至L2P映射表的父层的对应单元,所述对应单元用于记录子层信息,所述第一L2P映射表子层单元与所述对应单元一一对应。The minimum number is updated to the corresponding unit of the parent layer of the L2P mapping table, the corresponding unit is used to record sub-layer information, and the first L2P mapping table sub-layer unit corresponds to the corresponding unit one-to-one.
- 一种缓存管理装置,其特征在于,包括:A cache management device is characterized in that it comprises:第一确定单元,用于根据各第一L2P映射表子层单元的压缩比确定统一压缩比,所述第一L2P映射表子层单元为压缩格式的L2P映射表子层单元;The first determining unit is configured to determine a unified compression ratio according to the compression ratio of each first L2P mapping table sub-layer unit, where the first L2P mapping table sub-layer unit is an L2P mapping table sub-layer unit in a compressed format;第二确定单元,用于根据所述统一压缩比和缓存容量确定缓存空间的拆分数量,所述缓存空间为高速缓冲存储器的存储空间;The second determining unit is configured to determine the number of splits of the cache space according to the unified compression ratio and the cache capacity, where the cache space is the storage space of the cache memory;第一处理单元,用于按照所述拆分数量拆分所述缓存空间,得到多个子空间;The first processing unit is configured to split the buffer space according to the split number to obtain multiple subspaces;第二处理单元,用于采用所述子空间存储所述第一L2P映射表子层单元。The second processing unit is configured to use the subspace to store the first L2P mapping table sub-layer unit.
- 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,所述程序执行权利要求1至6中任意一项所述的缓存管理方法。A storage medium, characterized in that the storage medium includes a stored program, wherein the program executes the cache management method according to any one of claims 1 to 6.
- 一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时执行权利要求1至6中任意一项所述的缓存管理方法。A processor, characterized in that the processor is used to run a program, wherein the cache management method according to any one of claims 1 to 6 is executed when the program is running.
- 一种固态非易失存储设备,包括L2P映射表、高速缓冲存储器和缓存管理装置,其特征在于,所述缓存管理装置为权利要求7所述的缓存管理装置。A solid-state non-volatile storage device, comprising an L2P mapping table, a cache memory, and a cache management device, wherein the cache management device is the cache management device according to claim 7.
- 根据权利要求10所述的固态非易失存储设备,其特征在于,所述固态非易失存储设备包括固态硬盘,通用闪存设备、嵌入式的多媒体存储卡以及U盘中的至少一种。The solid-state non-volatile storage device according to claim 10, wherein the solid-state non-volatile storage device comprises at least one of a solid-state hard disk, a general-purpose flash memory device, an embedded multimedia memory card, and a U disk.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010437457.4A CN111597129B (en) | 2020-05-21 | 2020-05-21 | Cache management method and device, storage medium and solid-state nonvolatile storage device |
CN202010437457.4 | 2020-05-21 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021232743A1 true WO2021232743A1 (en) | 2021-11-25 |
Family
ID=72187463
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/132910 WO2021232743A1 (en) | 2020-05-21 | 2020-11-30 | Cache management method and apparatus, storage medium, and solid-state non-volatile storage device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111597129B (en) |
WO (1) | WO2021232743A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111597129B (en) * | 2020-05-21 | 2022-06-07 | 北京泽石科技有限公司 | Cache management method and device, storage medium and solid-state nonvolatile storage device |
CN112069189B (en) * | 2020-09-16 | 2024-05-17 | 深圳市硅格半导体有限公司 | Method, system, terminal equipment and storage medium for updating multi-level mapping table |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100042775A1 (en) * | 2008-08-12 | 2010-02-18 | Phison Electronics Corp. | Block management method for flash memory, and storage system and controller using the same |
CN106776376A (en) * | 2015-11-24 | 2017-05-31 | 群联电子股份有限公司 | Buffer storage supervisory method, memorizer control circuit unit and storage device |
CN109933545A (en) * | 2017-12-18 | 2019-06-25 | 慧荣科技股份有限公司 | The data processing method of data memory device and memory device |
CN110618786A (en) * | 2018-06-20 | 2019-12-27 | 爱思开海力士有限公司 | Memory system and operation method of memory system |
US10613758B2 (en) * | 2017-11-22 | 2020-04-07 | SK Hynix Inc. | Memory system and method of operating the same |
CN111104345A (en) * | 2019-12-12 | 2020-05-05 | 苏州浪潮智能科技有限公司 | SSD power-on recovery method, system and host |
CN111597129A (en) * | 2020-05-21 | 2020-08-28 | 北京泽石科技有限公司 | Cache management method and device, storage medium and solid-state nonvolatile storage device |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8751830B2 (en) * | 2012-01-23 | 2014-06-10 | International Business Machines Corporation | Memory address translation-based data encryption/compression |
US9229874B2 (en) * | 2013-09-27 | 2016-01-05 | Intel Corporation | Apparatus and method for compressing a memory address |
US9229876B2 (en) * | 2013-12-17 | 2016-01-05 | Sandisk Technologies Inc. | Method and system for dynamic compression of address tables in a memory |
US10067881B2 (en) * | 2016-06-15 | 2018-09-04 | Western Digital Technologies, Inc. | Compression and caching for logical-to-physical storage address mapping tables |
KR102571629B1 (en) * | 2018-05-23 | 2023-08-29 | 에스케이하이닉스 주식회사 | Memory system and operaiton method for thereof |
KR20200006379A (en) * | 2018-07-10 | 2020-01-20 | 에스케이하이닉스 주식회사 | Controller and operating method thereof |
CN111104052B (en) * | 2018-10-26 | 2023-08-25 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer readable storage medium for storing data |
CN109992530A (en) * | 2019-03-01 | 2019-07-09 | 晶天电子(深圳)有限公司 | A kind of solid state drive equipment and the data read-write method based on the solid state drive |
-
2020
- 2020-05-21 CN CN202010437457.4A patent/CN111597129B/en active Active
- 2020-11-30 WO PCT/CN2020/132910 patent/WO2021232743A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100042775A1 (en) * | 2008-08-12 | 2010-02-18 | Phison Electronics Corp. | Block management method for flash memory, and storage system and controller using the same |
CN106776376A (en) * | 2015-11-24 | 2017-05-31 | 群联电子股份有限公司 | Buffer storage supervisory method, memorizer control circuit unit and storage device |
US10613758B2 (en) * | 2017-11-22 | 2020-04-07 | SK Hynix Inc. | Memory system and method of operating the same |
CN109933545A (en) * | 2017-12-18 | 2019-06-25 | 慧荣科技股份有限公司 | The data processing method of data memory device and memory device |
CN110618786A (en) * | 2018-06-20 | 2019-12-27 | 爱思开海力士有限公司 | Memory system and operation method of memory system |
CN111104345A (en) * | 2019-12-12 | 2020-05-05 | 苏州浪潮智能科技有限公司 | SSD power-on recovery method, system and host |
CN111597129A (en) * | 2020-05-21 | 2020-08-28 | 北京泽石科技有限公司 | Cache management method and device, storage medium and solid-state nonvolatile storage device |
Also Published As
Publication number | Publication date |
---|---|
CN111597129B (en) | 2022-06-07 |
CN111597129A (en) | 2020-08-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10198215B2 (en) | System and method for multi-stream data write | |
TWI709073B (en) | Distributed storage system, distributed storage method and distributed facility | |
US10452562B2 (en) | File access method and related device | |
US8347050B2 (en) | Append-based shared persistent storage | |
US8856484B2 (en) | Mass storage system and methods of controlling resources thereof | |
US9798655B2 (en) | Managing a cache on storage devices supporting compression | |
US20200356277A1 (en) | De-duplication of client-side data cache for virtual disks | |
US10339079B2 (en) | System and method of interleaving data retrieved from first and second buffers | |
US10303374B2 (en) | Data check method and storage system | |
US9355121B1 (en) | Segregating data and metadata in a file system | |
WO2021232743A1 (en) | Cache management method and apparatus, storage medium, and solid-state non-volatile storage device | |
US9658774B2 (en) | Storage system and storage control method | |
US8281321B2 (en) | Method, system and storage medium for implementing a message board cache system | |
CN104054071A (en) | Method for accessing storage device and storage device | |
US20210141721A1 (en) | System and method for facilitating efficient utilization of nand flash memory | |
WO2018024214A1 (en) | Io flow adjustment method and device | |
US11449270B2 (en) | Address translation method and system for KV storage device | |
KR20150142583A (en) | A method of organizing an address mapping table in a flash storage device | |
WO2020192710A1 (en) | Method for processing garbage based on lsm database, solid state hard disk, and storage apparatus | |
CN107423425A (en) | A kind of data quick storage and querying method to K/V forms | |
CN110515861B (en) | Memory device for processing flash command and method thereof | |
CN108614669B (en) | Key-data access method for solving hash collision and solid-state storage device | |
WO2023071137A1 (en) | Data processing method and related apparatus | |
JP2002182967A (en) | Www proxy device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20936967 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20936967 Country of ref document: EP Kind code of ref document: A1 |