Dynamic capacity cache accelerated ssd device
By introducing a cache allocator and executor into SSD devices, the number of cache units can be dynamically adjusted, solving the problem of the inability to dynamically configure cache units in existing technologies, thereby improving cache hit rate and storage device performance.
Patent Information
- Application Number
- CN202310095418.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-02-03
AI Technical Summary
Existing storage devices cannot dynamically adjust the number of cache units in storage subspaces without resetting the device, which makes it impossible to dynamically configure the number of cache units in different storage subspaces according to external requests, affecting cache hit rate.
SSD devices that introduce dynamic capacity caching acceleration dynamically adjust the number of cache units based on the cache configuration requests of storage subspaces through cache allocators and cache executors. They also manage the configuration and status of cache units through metadata structures, thereby dynamically adjusting the correspondence between storage subspaces and cache subspaces.
Without resetting the device, dynamically adjusting the number of cache units improves cache hit rate, optimizes the read and write performance of storage devices, and reduces the consumption of system memory and computing resources.
Smart Images

Figure CN116088764B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of SSD technology, and in particular to an SSD device with dynamic capacity caching acceleration. Background Technology
[0002] This section is intended to provide background or context for the embodiments of this application as set forth in the claims. The description herein is not intended to imply that it is prior art that has been disclosed, simply because it is included in this section.
[0003] Storage devices divide all storage units into several storage subspaces according to external requirements. Existing storage devices provide high-speed read / write caching for these storage subspaces. To accelerate read / write bandwidth and reduce read / write latency, storage devices configure a certain number of on-device cache units for a certain number of storage units. The number of storage units and the corresponding number of cache units belonging to a storage subspace are fixed or cannot be configured at runtime. That is, unless the device is reset, the number of corresponding cache units cannot be changed in response to external requests, thus affecting the average cache hit rate of this storage subspace. Due to this limitation, a device that dynamically allocates storage subspace capacity based on external requests at runtime cannot simultaneously provide selectable average cache hit rates for each storage subspace.
[0004] Building upon this, existing operating systems use system memory to provide high-speed read / write caches for storage subspaces outside the device. The operating system adjusts the mapping between cache units and all accessed storage units within the device during runtime. Compared to in-device cache adjustment, this method consumes additional computational and memory resources outside the device and cannot configure different numbers of cache units for different storage subspaces according to external requirements without resetting the system. Summary of the Invention
[0005] The purpose of this application is to provide an SSD device with dynamic capacity caching acceleration, which allows the number of cache units belonging to the cache subspace to be configured and changed without resetting the device.
[0006] This application discloses a dynamically caching accelerated SSD device, comprising:
[0007] The memory is configured to include multiple storage subspaces;
[0008] The cache is configured to include multiple cache subspaces, and the cache subspaces correspond one-to-one with the storage subspaces.
[0009] The cache allocator is configured to: calculate the cache execution configuration for a storage subspace based on the cache configuration request for that storage subspace;
[0010] The cache executor is configured to: select a traversal range and traversal order based on the cache execution configuration of the cache subspace corresponding to the storage subspace to which a storage unit belongs, the traversal history data structure, and the virtual index of the storage unit, and calculate the minimum cost threshold and the maximum cost threshold. The traversal range includes a group of cache units in the corresponding cache subspace, which is divided into several candidate windows. The executor traverses the several candidate windows according to the traversal order, calculates the cost function of each cache unit in the current candidate window according to the structured state table of the corresponding cache subspace, and selects cache units whose cost function is less than the minimum cost threshold, or selects the cache unit with the smallest cost function and less than the maximum cost threshold after traversing the several candidate windows. Furthermore, the executor updates the structured state table corresponding to the cache units in the current candidate window and includes the cost function values of the traversed candidate windows and the selected cache units in the traversal history data structure.
[0011] In a preferred embodiment, the cache executor is further configured to: if no cache unit is selected after traversing the plurality of candidate windows, select the cache unit with the smallest cost function; if the content of the cache unit is inconsistent with the content of the corresponding storage unit, write the content in the cache unit into the corresponding storage unit, recalculate the cost function of the cache unit; if the cost function is less than the maximum cost threshold, include the cost function value of the cache unit in the traversal history data structure.
[0012] In a preferred embodiment, it further includes: a metadata storage device, wherein:
[0013] The storage subspace metadata structure is used to record the metadata of each storage subspace. Each storage subspace includes several contiguous storage block areas, each contiguous storage block area includes several storage blocks with device index contiguous, each storage block includes several storage units, and each storage subspace has a corresponding virtual index space. The metadata of each storage subspace includes a contiguous storage block area index table, a storage block virtual index space table, and a storage unit mapping table in each storage subspace.
[0014] A cache subspace metadata structure is used to record the metadata of each cache subspace. Each cache subspace includes several contiguous cache block regions, each contiguous cache block region includes several cache blocks with contiguous device indexes, each cache block includes several cache units, and each cache subspace has a corresponding virtual index space. The metadata of each cache subspace includes a cache block contiguous region index table, a cache block virtual index space table, a cache unit mapping table, a unit structured status table, a configuration data structure, and a traversal history data structure. The configuration data structure includes cache request configuration and cache execution configuration. The cache request configuration includes cache capacity and cache policy options. The cache execution configuration includes cache execution capacity configuration and cache execution policy options. The cache execution capacity configuration includes minimum cache capacity, necessary cache capacity, peak read cache capacity, and peak write cache capacity. The cache execution policy options include configuration policy options, traversal policy options, and disk persistence policy options.
[0015] In a preferred embodiment, the cache allocator is further configured as follows:
[0016] Configure cache request calculation and cache execution for the cache subspace corresponding to the storage subspace that will be run, and complete the configuration.
[0017] Traverse other cache subspaces, group unallocated cache units into contiguous cache blocks, and allocate them to the cache subspace according to the configuration policy options;
[0018] The cache block contiguous area is recorded in the cache block contiguous area index table. The cache request configuration and cache execution configuration are recorded in the configuration data structure. All entries of the cell mapping table of the storage subspace are initialized to be empty. All entries of the cell mapping table of the cache subspace are initialized to be empty. The cell structured state table of the cache subspace is initialized to the initial state of each cell structured state machine.
[0019] In a preferred embodiment, the cache allocator is further configured as follows:
[0020] Configure compute cache for cache requests in the cache subspace corresponding to a running storage subspace. After configuration is complete,
[0021] The cache executor is notified to suspend all operations of the storage subspace and its corresponding cache subspace;
[0022] Traverse other cache subspaces, group unallocated cache units into contiguous cache blocks, and allocate them to the cache subspace according to the configuration policy options;
[0023] The cache block contiguous area is recorded in the cache block contiguous area index table. The cache request configuration and cache execution configuration are recorded in the configuration data structure. The table entries of the unit mapping table of the cache subspace to which the newly allocated cache unit belongs are initialized to be empty. The unit structured state table of the cache subspace to which the newly allocated cache unit belongs is initialized to the initial state of each unit structured state machine.
[0024] The cache executor is notified to resume all actions of the storage subspace and its corresponding cache subspace.
[0025] In a preferred embodiment, the cache allocator is further configured as follows:
[0026] Configure compute cache for cache requests in the cache subspace corresponding to a running storage subspace. After configuration is complete,
[0027] The cache executor is notified to suspend all operations of the storage subspace and its corresponding cache subspace;
[0028] The cache executor is notified to write the contents of all cache units in the corresponding cache subspace that are different from the contents of the corresponding storage unit into the corresponding storage unit;
[0029] Traverse all cache units in the block contiguous area index table of this cache subspace, and reduce a certain number of cache units according to the configuration policy options;
[0030] Record the contiguous block regions belonging to this cache subspace after reduction in the cache block contiguous region index table. Record the cache request configuration and cache execution configuration in the configuration data structure. Initialize all entries of the unit mapping table of this storage subspace to be empty. Initialize all entries of the unit mapping table of this cache subspace to be empty. Initialize the unit structured state table of this cache subspace to be the initial state of each unit structured state machine.
[0031] The cache executor is notified to resume all actions of the storage subspace and its corresponding cache subspace.
[0032] In a preferred embodiment, the cache executor is further configured as follows:
[0033] In response to a read request for a storage unit, calculate the virtual index of the cache unit corresponding to the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace;
[0034] If a corresponding cache unit is found, check the structured status of that cache unit. If the content of the cache unit is valid, update the content of the cache unit in the unit structured status table, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If invalid, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
[0035] If no corresponding cache unit is found, traverse and select a cache unit in the cache subspace corresponding to the storage subspace to which the storage unit belongs, match the storage unit with the cache unit one-to-one, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace, calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace, update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
[0036] In a preferred embodiment, the cache executor is further configured as follows:
[0037] In response to a write request for a storage unit, calculate the virtual index of the cache unit corresponding to the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace;
[0038] If a corresponding cache unit is found, check the structured status of that cache unit. If the content of the cache unit is valid or the size of the write request matches the size of the storage unit, update the content of the cache unit in the unit structured status table, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If it is invalid and inconsistent, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
[0039] If no corresponding cache unit is found, traverse and select a cache unit in the cache subspace corresponding to the storage subspace to which the storage unit belongs, and match the storage unit with the cache unit one-to-one. If the size of the write request is inconsistent with the size of the storage unit, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If they match, update the content of the cache unit in the unit structured status table, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
[0040] In a preferred embodiment, the cache executor is further configured as follows:
[0041] In response to a request to write a cache unit to the corresponding storage unit, the virtual index of the storage unit corresponding to the cache unit is calculated based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace.
[0042] The cache subspace is traversed according to the cache write-to-disk policy options and the structured state of the cache unit. If a new cache unit different from the cache unit is found, the new cache unit is set to no mapping. The device index of the storage unit is calculated according to the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. The device index of the cache unit is calculated according to the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. The contents of the cache unit and the new cache unit in the unit structured state table are updated. The contents of the cache unit are written to the new cache unit. The contents of the cache unit and the new cache unit in the unit structured state table are updated again. The contents of the new cache unit are written to the storage unit. The contents of the cache unit and the new cache unit in the unit structured state table are updated again.
[0043] If no new cache unit different from the cache unit is found, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the cache unit to the storage unit, and update the content of the cache unit in the unit structured status table again.
[0044] In a preferred embodiment, it also includes:
[0045] The cache configuration interface is configured to receive external cache configuration requests, which include cache capacity and cache adjustment strategy options.
[0046] The external read / write interface is configured to respond to external read / write requests, read out all or part of the contents of the corresponding storage unit, or write all or part of the contents received by the external read / write interface to the corresponding storage unit.
[0047] The internal read / write interface is configured to enable read and write operations between the cache unit and the storage unit.
[0048] In the embodiments of this application, an SSD storage device with dynamic capacity caching acceleration is introduced. Without resetting the device, the number of cache units corresponding to each storage subspace can be configured according to a limited set of options based on external requests received by the device. Furthermore, when the configuration remains unchanged, the actual number of cache units serving each subspace is independent of each other.
[0049] The specification of this application contains numerous technical features distributed across various technical solutions. Listing all possible combinations of these technical features (i.e., technical solutions) would make the specification excessively lengthy. To avoid this problem, the various technical features disclosed in the above-described invention, the various technical features disclosed in the following embodiments and examples, and the various technical features disclosed in the accompanying drawings can be freely combined to form various new technical solutions (all of which should be considered as described in this specification), unless such a combination of technical features is technically infeasible. For example, one example discloses feature A+B+C, and another example discloses feature A+B+D+E. Features C and D are equivalent technical means that serve the same function, and technically only one needs to be used; they cannot be used simultaneously. Feature E can technically be combined with feature C. Therefore, the solution A+B+C+D should not be considered as described because it is technically infeasible, while the solution A+B+C+E should be considered as described. Attached Figure Description
[0050] Figure 1 This is a schematic diagram of the structure of an SSD device with dynamic capacity caching acceleration according to one embodiment of this application. Detailed Implementation
[0051] In the following description, many technical details are presented to help the reader better understand this application. However, those skilled in the art will understand that the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments.
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0053] One embodiment of this application relates to a dynamically caching accelerated SSD device, the structure of which is as follows: Figure 1 As shown, the SSD device includes a memory 101, a cache 102, a cache executor 103, and a cache allocator 104. The memory 101 is configured to include multiple storage subspaces. The cache 102 is configured to include multiple cache subspaces, with each cache subspace corresponding to a storage subspace.
[0054] Specifically, all storage units in an SSD device are grouped into several storage blocks of the same size according to their device index. Each storage block contains the same number of storage units, which are powers of 2 (2, 4, 8, 16, ...). The high-order bits of the device index of each storage unit are the device index of its storage block, and the low-order bits are its relative index within that device block. An SSD device contains several storage subspaces. Each storage subspace contains several areas of continuous blocks, and each area of continuous blocks contains several storage blocks with contiguous device indices. Each storage subspace has a virtual index space. Within this virtual index space, all storage blocks belonging to this storage subspace are indexed sequentially from low to high according to the virtual index. The high-order bits of the virtual index of each storage unit are the virtual index of its storage block, and the low-order bits are its relative index within that storage block.
[0055] In an SSD device, all cache units are grouped into cache blocks of equal size according to their device index. Each cache block contains the same number of cache units, in powers of 2 (2, 4, 8, 16, ...). The high-order bits of each cache unit's device index are the device index of its cache block, and the low-order bits are its relative index within that device block. An SSD device contains several storage subspaces. Each storage subspace contains several contiguous block regions, and each contiguous block region contains several storage blocks with contiguous device indices. Each storage subspace has a virtual index space. Within this virtual index space, all cache blocks belonging to this storage subspace are indexed sequentially from low to high according to the virtual index. The high-order bits of each cache unit's virtual index are the virtual index of its cache block, and the low-order bits are its relative index within that cache block. The device has a fixed number of storage subspaces and a fixed number of cache subspaces. Each storage subspace corresponds to one cache subspace, and this correspondence is fixed. The index of a storage subspace within a device is equal to the index of a cache subspace within the device; this is simply referred to as the subspace index.
[0056] The capacity of a storage unit is the same as the capacity of a cache unit. If a storage unit is divided into smaller pages of the same size (powers of two), the cache unit pages are also divided into pages of the same size, number, and order. These storage pages correspond one-to-one with the cache pages. Their relative indices within their respective units are consistent.
[0057] In one embodiment, the SSD device further includes a metadata storage 105, which stores:
[0058] 1) The structured metadata for storage subspaces records the metadata of a fixed number of storage subspaces. The metadata for each storage subspace includes:
[0059] 1.1) Index Table for Continuous Blocks: This table arranges the continuous blocks belonging to this subspace in a specific order. The index of this table is the sequence number of the continuous block within this arrangement. Each entry in this table contains the following data: the device index of the starting block of this continuous block; and the number of blocks in this continuous block.
[0060] 1.2) Virtual Index Table for Blocks: This table arranges contiguous blocks belonging to this storage subspace in a specific order. The resulting list of ordered, contiguous blocks is the index of each block within this arrangement, and the table value is the device index of each block.
[0061] 1.3) Mapping Table for Units: This mapping table is indexed by a virtual index of all storage units within this storage subspace. Each entry in this mapping table contains the following: if there is no corresponding cache unit, the entry is empty; if there is a corresponding cache unit, the virtual index of that cache unit in the cache subspace is recorded.
[0062] 2) The structured metadata for the cache subspace records a fixed number of metadata entries for each cache subspace. The metadata for each cache subspace includes:
[0063] 2.1) Block Contiguous Region Index Table: This table arranges the block contiguous regions belonging to this subspace in a specific order. The index of this table is the sequence number of the block contiguous region within this arrangement. Each entry in this table contains the following data: the device index of the starting block of this block contiguous region; and the number of blocks in this block contiguous region.
[0064] 2.2) Block Virtual Index Space Table: This table arranges contiguous blocks belonging to this cache subspace in a specific order. The resulting list of ordered, contiguous blocks is the index of each block within this arrangement, and the table value is the device index of each block.
[0065] 2.3) Cell Mapping Table: The index of this table is a virtual index of all cache cells within this cache subspace. Each entry in this table contains the following: if there is no corresponding storage cell, the entry is empty; if there is a corresponding storage cell, the virtual index of that storage cell in the storage subspace is recorded.
[0066] 2.4) Structured Status Table for Units: The index of this table is a virtual index of all cache units within this cache subspace. The entries in this table contain the structured state of the structured state machine for this cache unit. The structured state includes at least: whether the content of this cache unit is valid; whether the content of this cache unit is consistent with the content of its corresponding storage unit, including whether the content of smaller pages within this cache unit is consistent with the content of pages in their corresponding storage units; the history of read access for this cache unit; and the history of write access for this cache unit.
[0067] 2.4) Structured Configuration: This includes cache request configuration and cache execution configuration. Cache request configuration includes cache capacity and cache strategy options. Cache execution configuration includes cache execution capacity configuration and cache execution strategy options. Cache execution capacity configuration includes minimum cache capacity, necessary cache capacity, peak read cache capacity, and peak write cache capacity. Cache execution strategy options include configuration strategy options, traversal strategy options, and disk persistence strategy options.
[0068] 2.5) Traverse the historical data structure.
[0069] The SSD device also includes a configuration interface 106 connecting the SSD to the outside world. This interface 106 responds to requests initiated by external parties, sending a configuration request to the cache allocator for a cache subspace corresponding to a storage subspace. It also sends back the configuration results received from the cache allocator. The cache subspace configuration request includes cache capacity and cache tuning strategy options.
[0070] The SSD device also includes an internal read / write interface 107 that connects to an internal storage reader / writer (not shown). This interface 107 writes the contents of a cache unit to a storage unit and returns the execution result, or reads the contents of a storage unit to a cache unit and returns the execution result. Each unit is addressed using a device index.
[0071] The cache allocator 104 can receive configuration requests from the configuration interface at runtime, calculate the cache execution configuration of the storage subspace, and allocate cache capacity to empty cache subspaces of storage subspaces that are about to run, increase cache capacity to existing cache subspaces of running storage subspaces, and decrease cache capacity to existing cache subspaces of running storage subspaces when other storage subspaces and cache subspaces are running.
[0072] The cache executor 103 can execute the following sequence of actions in an ordered manner:
[0073] (1) Based on the storage subspace index of a storage unit and its virtual index within that storage subspace, determine its device index.
[0074] (2) Based on the storage subspace index of a cache unit and its virtual index within that cache subspace, calculate its device index.
[0075] (3) Based on the device index of a storage block, determine the storage subspace to which it belongs.
[0076] (4) Based on the device index of a cache block, determine the cache subspace to which it belongs.
[0077] (5) Based on the subspace index of the storage subspace where a storage unit is located and its virtual index in this storage subspace, calculate the virtual index of the corresponding cache unit.
[0078] (6) Based on the subspace index of the cache subspace where a cache unit is located and its virtual index in this cache subspace, calculate the virtual index of the corresponding storage unit.
[0079] (7) For a storage unit, traverse and select the cache unit for reading or writing in the cache subspace corresponding to its storage subspace.
[0080] (8) In this cache space, for a known cache unit, traverse this cache space and select a new cache unit.
[0081] (9) Set a cache unit that is indexed by a cache subspace and addressed by a virtual index within that cache space to be unmapped.
[0082] (10) A storage unit addressed by a storage subspace index and a virtual index within that storage space is mapped one-to-one with a cache unit addressed by a cache subspace index and a virtual index within that cache space.
[0083] To better understand the technical solution of this application, the functions and action sequences of the cache allocator and cache executor are explained in detail below.
[0084] When the cache allocator 104 receives a configuration request from the configuration interface at runtime, it allocates cache capacity to the empty cache subspace of the storage subspace to be run in a system state where other storage subspaces and cache subspaces are running, including the following steps:
[0085] ●Calculate the cache execution configuration for this cache subspace based on the cache request configuration of the corresponding cache subspace received for this storage subspace.
[0086] ● Traverse other cache subspaces. Among all cache units in the device, remove cache units that have been allocated to other cache subspaces. Then, allocate the remaining cache units, which form a contiguous cache area, to this cache subspace according to the selection order and allocation method specified in the configuration policy options to satisfy the cache execution configuration.
[0087] ●After successful allocation
[0088] ○ Record the contiguous area allocated to this cache subspace in the block contiguous area index table. Record the cache request configuration and cache execution configuration in the configuration data structure. Unless a new configuration request is received, this recorded allocation and configuration scheme remains unchanged throughout the lifetime of the storage subspace corresponding to this cache subspace.
[0089] ○ The mapping table of the initial storage subspace is empty, the mapping table of the initial cache subspace is empty, and the content of the unit structured state table of the initial cache subspace is the initial state of each unit structured state machine.
[0090] ○ And feedback indicates successful configuration.
[0091] ●If allocation fails
[0092] ○ indicates configuration failure.
[0093] When the cache allocator 104 receives a configuration request from the configuration interface at runtime, it increases the cache capacity of the existing cache subspace of the running storage subspace under the system state where other storage subspaces and cache subspaces are running, including the following steps:
[0094] ●Based on the configuration request for the cache subspace corresponding to this storage subspace received, calculate the new cache execution configuration for this cache subspace.
[0095] ●Notify the cache executor to pause all actions involving this storage subspace and the corresponding cache subspace.
[0096] ● Traverse all cache subspaces. Among all cache units in the device, remove the cache units that have been allocated to all cache subspaces. Then, allocate the remaining cache units, which form a contiguous cache area, to this cache subspace according to the selection order and allocation method specified in the configuration policy options to satisfy the new cache execution configuration.
[0097] ●After successful allocation
[0098] ○ Record the contiguous regions allocated to this cache subspace in the block contiguous region index table.
[0099] ○ Record request configuration and cache execution configuration in the configuration data structure.
[0100] ○ The entries in the mapping table of these newly allocated cache units are set to empty, and the contents of the unit structured state table in the cache subspace are set to the initial state of the structured state machine.
[0101] ○ And feedback indicates successful configuration.
[0102] ●If allocation fails
[0103] ○ indicates configuration failure.
[0104] ●Notify the cache executor to resume all actions involving this storage subspace and the corresponding cache subspace.
[0105] When the cache allocator 104 receives a configuration request from the configuration interface at runtime, it reduces the cache capacity of the existing cache subspace of the running storage subspace under system conditions where other storage subspaces and cache subspaces are running, including the following steps:
[0106] ●Based on the configuration request for the cache subspace corresponding to this storage subspace received, calculate the new cache execution configuration for this cache subspace.
[0107] ●Notify the cache executor to pause all actions involving this storage subspace and the corresponding cache subspace.
[0108] ● Instruct the cache executor to write the contents of all cache units in this cache subspace that are different from the contents of the corresponding storage unit to the corresponding storage unit.
[0109] ● Traverse all cache units in the block contiguous area index table of the cache subspace, and attempt to reduce the number of units to meet the new cache execution configuration based on the selection order and allocation method specified by the configuration policy options.
[0110] ●After the reduction is completed
[0111] ○ Record the changed contiguous regions belonging to this cache subspace in the block contiguous region index table.
[0112] ○ Record request configuration and cache execution configuration in the configuration data structure.
[0113] ○ The mapping table of the initial storage subspace is empty, the mapping table of the initial cache subspace is empty, and the content of the cell structured state table of the initial cache subspace is the initial state of each cell structured state machine.
[0114] ○ and returns a message indicating successful configuration.
[0115] ●Notify the cache executor to resume all actions involving this storage subspace and the corresponding cache subspace.
[0116] Cache executor 103 receives and responds to a read request for a memory unit. In this request, the memory unit is addressed using the index of its own memory subspace, plus its virtual index within that subspace. Cache executor 103 performs the following steps:
[0117] ●Based on this subspace index and the virtual index of this storage unit within its respective storage subspace, calculate the virtual index of its corresponding cache unit. If the corresponding cache unit and its virtual index are found, then:
[0118] ○ Check the structured state of this cache unit. If the content within the cache unit is valid, then:
[0119] ■ Update the contents of this cache unit in the unit structured state table.
[0120] ■ Use the contents of this cache unit to respond to read requests.
[0121] ■ Update the contents of this cache unit in the unit structured state table again.
[0122] Otherwise:
[0123] ■Based on the subspace index and the virtual index of this storage unit within this storage subspace, determine its device index.
[0124] ■Based on the subspace index and the virtual index of this cache unit within this cache subspace, calculate its device index.
[0125] ■ Update the contents of this cache unit in the unit structured state table.
[0126] ■ The contents of this storage unit are read and written to this cache unit via the internal read / write interface 107. The two units are addressed using device indexes.
[0127] ■ Use the contents of this cache unit to respond to read requests.
[0128] ■ Update the contents of this cache unit in the unit structured state table again.
[0129] ●If the corresponding cache unit and its virtual index are not found:
[0130] ○ In the cache subspace corresponding to this storage subspace, traverse and select a cache unit for this storage unit and its read request.
[0131] ○ Assign a one-to-one correspondence between this storage unit and this cache unit.
[0132] ○ Based on the subspace index and the virtual index of this storage unit within this storage subspace, calculate its device index.
[0133] ○ Calculate the device index based on the subspace index and the virtual index of this cache unit within this cache subspace.
[0134] ○ Update the contents of this cache unit in the unit structured state table.
[0135] ○ The contents of this storage unit are read and written to this cache unit through the internal read / write interface 107. The two units are addressed using device indexes respectively.
[0136] ○ Respond to read requests with the contents of this cache unit.
[0137] ○ Update the contents of this cache unit in the unit structured state table again.
[0138] Cache executor 103 receives and responds to a write request for a storage unit. In this request, the storage unit is addressed using the index of its own storage subspace plus its virtual index within that subspace. Cache executor 103 performs the following steps:
[0139] ●Based on this subspace index and the virtual index of this storage unit within its respective storage subspace, calculate the virtual index of its corresponding cache unit. If the corresponding cache unit and its virtual index are found, then:
[0140] ○ Check the structured state of this cache unit. If the content within the cache unit is valid, or the size of the write request matches the size of the storage unit, then:
[0141] ■ Update the contents of this cache unit in the unit structured state table.
[0142] ■ Use this cache unit to respond to write requests.
[0143] ■ Update the contents of this cache unit in the unit structured state table again.
[0144] ○ If the content within the cache unit is invalid and the size of the write request is inconsistent with the size of the storage unit:
[0145] ■Based on the subspace index and the virtual index of this storage unit within this storage subspace, determine its device index.
[0146] ■Based on the subspace index and the virtual index of this cache unit within this cache subspace, calculate its device index.
[0147] ■ Update the contents of this cache unit in the unit structured state table.
[0148] ■ The contents of this storage unit are read into this cache unit via the internal read / write interface 107. The two units are addressed using device indexes.
[0149] ■ Use this cache unit to respond to write requests.
[0150] ■ Update the contents of this cache unit in the unit structured state table again.
[0151] ●If the corresponding cache unit and its virtual index are not found:
[0152] ○ In the cache space corresponding to this storage space, for this storage unit and its write, traverse and select a cache unit.
[0153] ○ Assign a one-to-one correspondence between this storage unit and this cache unit.
[0154] ○ If the size of the write request does not match the size of the storage unit, then:
[0155] ■Based on the subspace index and the virtual index of this storage block within this storage subspace, determine its device index.
[0156] ■Based on the subspace index and the virtual index of this cache block within this cache subspace, calculate its device index.
[0157] ■ Update the contents of this cache unit in the unit structured state table.
[0158] ■ The contents of this storage unit are read into this cache unit via the internal read / write interface 107. The two units are addressed using device indexes.
[0159] ■ Use this cache unit to respond to write requests.
[0160] ■ Update the contents of this cache unit in the unit structured state table again.
[0161] Otherwise:
[0162] ■ Update the contents of this cache unit in the unit structured state table.
[0163] ■ Use this cache unit to respond to write requests.
[0164] ■ Update the contents of this cache unit in the unit structured state table again.
[0165] The cache executor 103 receives and responds to a request to write the contents of a cache unit to the corresponding storage unit. This cache unit is addressed using its index in the cache subspace plus its virtual index within the cache subspace. The cache executor 103 performs the following steps:
[0166] ●Based on the table entry corresponding to the cache unit in the cache subspace's unit mapping table, look up the virtual index of the corresponding storage unit.
[0167] ●Based on the cache write-to-disk policy options for this cache subspace and the structured state of this cache unit, select one of the following action sequences to execute:
[0168] Option 1:
[0169] ■ Within this cache space, iterate through and find a new cache unit that is different from the corresponding cache unit. If a new cache unit is successfully found, then:
[0170] ● Set this new cache unit to no mapping.
[0171] ●Based on the subspace index and the virtual index of this storage unit within the storage subspace, determine its device index.
[0172] ●Calculate the device index based on the subspace index and the virtual index of this cache unit within this cache subspace.
[0173] ●Calculate the device index based on the subspace index and the virtual index of this new cache unit within this cache subspace.
[0174] ● Update the contents of this cache unit and the new cache unit in the unit structured state table.
[0175] ● Copy the contents of this cache unit to the new cache unit, both using the device index.
[0176] ● Update the contents of this cache unit and the new cache unit in the unit structured state table again.
[0177] ● The contents of this new cache unit are written to this storage unit via the internal read / write interface 107. Both units are addressed using device indexes.
[0178] ● Update the contents of this cache unit and the new cache unit in the unit structured state table again.
[0179] ■Otherwise:
[0180] ● Execute option two.
[0181] Option 2:
[0182] ■Based on the subspace index and the virtual index of this storage unit within the storage subspace, determine its device index.
[0183] ■Based on the subspace index and the virtual index of this cache unit within this cache subspace, calculate its device index.
[0184] ■ Update the contents of this cache unit in the unit structured state table.
[0185] ■ The contents of this cache unit are written to this storage unit via the internal read / write interface 107. Both units are addressed using device indexes.
[0186] ■ Update the contents of this cache unit in the unit structured state table again.
[0187] The cache executor 103 calculates the device index of a storage unit based on its storage subspace index and its virtual index within that storage subspace. Specifically, this includes: using the virtual index of the storage unit to calculate the virtual index of the storage block where the storage unit is located; looking up the virtual index space table of the storage subspace, using the virtual index value of the block as the index, and obtaining the device index of the block from the value of the table entry; and using the device index of the storage block and the relative index of the unit within the block to calculate the device index of the storage unit.
[0188] The cache executor 103 calculates the device index of a cache unit based on its storage subspace index and its virtual index within that cache subspace. Specifically, this includes: using the virtual index of the cache unit to calculate the virtual index of the cache block in which the cache unit is located; looking up the virtual index space table of the cache subspace, using the virtual index value of the block as the index, and obtaining the device index of the block from the value of the table entry; and using the device index of the cache block and the relative index of the unit within the block to calculate the device index of the cache unit.
[0189] The cache executor 103 determines the storage subspace to which a storage block belongs based on its device index. Specifically, this involves searching the block contiguous region index table for all storage subspaces. If the device index of a storage block is found within the range of device indexes of contiguous blocks described by an entry in the table for a storage subspace, then the storage block belongs to that storage subspace. Otherwise, the storage block does not belong to any storage subspace.
[0190] The cache executor 103 determines the cache subspace to which a cache block belongs based on its device index. Specifically, this involves looking up the block contiguous region index table for all cache subspaces. If the device index of the cache block is found within the range of device indexes of contiguous blocks described by an entry in the table for a cache subspace, then the cache block belongs to that cache subspace. Otherwise, the cache block does not belong to any cache subspace.
[0191] The cache executor 103 calculates the virtual index of the corresponding cache unit based on the subspace index of the storage subspace where the storage unit is located and its virtual index in the storage subspace. Specifically, this includes: the subspace index of the storage subspace is the subspace index of the corresponding cache subspace; in the mapping table of the storage subspace, the table entry is retrieved using the virtual index as the table index; the virtual index of the cache unit contained in the table entry is the virtual index of the corresponding cache unit in the corresponding cache space.
[0192] The cache executor 103 calculates the virtual index of the corresponding storage unit based on the subspace index of the cache subspace where the cache unit is located and its virtual index in the cache subspace. Specifically, this includes: the subspace index of the storage subspace is the subspace index of the corresponding cache subspace; in the mapping table of the cache subspace, the table entry is retrieved using the virtual index as the table index; the virtual index of the storage unit contained in the table entry is the virtual index of the corresponding storage unit in the corresponding storage space.
[0193] For a given storage unit, cache executor 103 traverses and selects a cache unit for reading or writing within the cache subspace corresponding to its storage subspace. Cache executor 103 performs the following steps:
[0194] ●(Retracing the return point) Based on the traversal strategy options for this cache subspace, the cache execution capacity configuration, the contents of the historical data structure, the virtual index of this storage unit, and the read / write type are traversed:
[0195] ○ Select a traversal range. The traversal range is a set of cache units in this cache subspace.
[0196] ○ Calculate the minimum cost threshold and the maximum cost threshold to determine the traversal termination condition. The traversal termination condition is one of the following two:
[0197] ■ A cache unit with a cost function value less than the minimum cost threshold has been found.
[0198] ■ Alternatively, it traversed all cache units within the range and found the cache unit with the smallest cost function value, and this cost function value is less than the maximum cost threshold.
[0199] Choose a traversal order. The traversal order divides all candidate buffer units within the traversal range into several candidate windows. Each window contains several candidate units. The traversal order is the order in which these windows are traversed.
[0200] ● For each traversal window, execute the following steps in traversal order, before the traversal termination condition is met:
[0201] ○ Read the entries corresponding to the candidate units within the structured state table of the cache subspace. Calculate the cost function value for each cache unit based on the structured state value of each retrieved cache unit.
[0202] Furthermore, based on the traversal strategy options, update the structured state of the candidate cells to which this traversal window belongs, and write back the corresponding entries.
[0203] ○ Include the traversed window range in the traversal history data structure.
[0204] ● After the traversal is complete, if a cache unit that meets the termination condition is found, then:
[0205] ○ The cost function value of the cache unit that meets the termination condition is included in the traversal history data structure.
[0206] ●If no cache unit that meets the termination condition is found:
[0207] ○ Based on the traversal strategy options for this cache subspace, select one of the following two behaviors:
[0208] ■ Option 1: Return to the [Re-traverse Return Point] and traverse again.
[0209] ■ Option 2: Select the cache unit with the lowest cost function value. If the content of this cache unit is inconsistent with the content of its corresponding storage unit, write the content of this cache unit to the corresponding storage unit. After writing, recalculate the cost function value of this cache unit. If the new cost function value is less than the maximum cost threshold, meaning this cache unit meets the termination condition, then:
[0210] ●Include the cost function value of cached units that meet the termination condition in the traversal history data structure.
[0211] ■If this cache unit does not meet the termination condition, then:
[0212] ● Return to the [re-traversal return point] and traverse again.
[0213] ● Select the cache unit that meets the termination condition and is addressed by the virtual index as the selection result.
[0214] In this cache space, given a known cache unit, cache executor 103 traverses the cache space and selects a new cache unit. Cache executor 103 performs the following steps:
[0215] ●(Retracing the return point) Based on the traversal strategy options for this cache subspace, the cache execution capacity configuration, the contents of the historical data structure, the virtual index of this storage unit, and the read / write type are traversed:
[0216] ○ Select a traversal range. The traversal range is a set of cache units in this cache subspace. And this set of cache units does not include the known cache unit.
[0217] ○ Calculate the minimum cost threshold and the maximum cost threshold to determine the traversal termination condition. The traversal termination condition is one of the following two:
[0218] ■ A cache unit with a cost function value less than the cost threshold has been found.
[0219] ■ Alternatively, it traversed all cache units within the range and found the cache unit with the smallest cost function value, and this cost function value is less than the maximum cost threshold.
[0220] Choose a traversal order. The traversal order divides all candidate buffer units within the traversal range into several candidate windows. Each window contains several candidate units. The traversal order is the order in which these windows are traversed.
[0221] ● For each traversal window, execute the following steps in traversal order, before the traversal termination condition is met:
[0222] ○ Read the entries corresponding to the candidate units within the structured state table of the cache subspace. Calculate the cost function value for each cache unit based on the structured state value of each retrieved cache unit.
[0223] Furthermore, based on the traversal strategy options, update the structured state of the candidate cells to which this traversal window belongs, and write back the corresponding entries.
[0224] ○ Include the traversed window range in the traversal history data structure.
[0225] ● After the traversal is complete, if a cache unit that meets the termination condition is found, then:
[0226] ○ The cost function value of the cache unit that meets the termination condition is included in the traversal history data structure.
[0227] ●If no cache unit that meets the termination condition is found:
[0228] ○ Based on the traversal strategy options for this cache subspace, select one of the following two behaviors:
[0229] ■ Option 1: Return to the [Re-traverse Return Point] and traverse again.
[0230] ■Option 2: Feedback traversal selection failed.
[0231] ● Select the cache unit that meets the termination condition and is addressed by the virtual index as the selection result.
[0232] Cache executor 103 sets a cache unit indexed by a cache subspace and addressed by a virtual index within that cache space to be unmapped. Cache executor 103 performs the following steps:
[0233] ● In the structured state table of this cache subspace, update the entry corresponding to this cache unit to the initial state of the structured state machine.
[0234] ● Within the mapping table of this cache subspace, in the table entry where the virtual index of this cache unit is the table index,
[0235] ○ Read the virtual index of the storage cell in the table entry. In the mapping table of the storage subspace to which this storage cell belongs, set the table entry whose index is the table index of this old storage cell to an empty table entry.
[0236] Set this entry to an empty entry.
[0237] The cache executor 103 maps one storage unit addressed by a storage subspace index and a virtual index within that storage space to a cache unit addressed by a cache subspace index and a virtual index within that cache space. The cache executor 103 performs the following steps:
[0238] ● In the structured state table of this cache subspace, update the entry corresponding to this cache unit to the initial state of the structured state machine.
[0239] ● Within the mapping table of this cache subspace, in the table entry where the virtual index of this cache unit is the table index,
[0240] ○ Read the virtual index of the old storage unit in the old content. In the mapping table of the storage subspace to which this old storage unit belongs, set the table entry whose index is the table index of this old storage unit to an uncorresponding cache unit.
[0241] ● Within the mapping table of this storage subspace, in the table entry where the virtual index of this storage unit is the table index,
[0242] ○ Update the table entry content to the virtual index of this cache unit.
[0243] ● Within the mapping table of this cache subspace, in the table entry where the virtual index of this cache unit is the table index,
[0244] ○ Update the table entry to the virtual index of this storage unit.
[0245] It should be noted that in this patent application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this patent application, if it refers to performing an action according to an element, it means performing the action at least according to that element, including two cases: performing the action only according to that element, and performing the action according to that element and other elements. Expressions such as "multiple," "repeatedly," and "various" include two, two times, two kinds, and more than two, more than two times, and more than two kinds.
[0246] The numbering used in describing the steps of a method does not inherently impose any restrictions on the order of these steps. For example, a step with a higher number does not necessarily have to be executed after a step with a lower number; it can be executed first and then second, or even in parallel, as long as such an execution order is reasonable to a person skilled in the art. Furthermore, having multiple steps with consecutively numbered sequences does not restrict other steps from being executed in between.
[0247] All references to this specification are considered to be incorporated integrally into the disclosure of this application so that they can serve as the basis for modifications if necessary. Furthermore, it should be understood that the above descriptions are merely preferred embodiments of this specification and are not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the scope of protection of one or more embodiments of this specification.
[0248] In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A dynamically caching-accelerated SSD device, characterized in that, include: The memory is configured to include multiple storage subspaces; The cache is configured to include multiple cache subspaces, and the cache subspaces correspond one-to-one with the storage subspaces. The cache allocator is configured to: calculate the cache execution configuration for a storage subspace based on the cache configuration request for that storage subspace; The cache executor is configured to: select a traversal range and traversal order based on the cache execution configuration of the cache subspace corresponding to the storage subspace to which a storage unit belongs, traversing historical data structures and the virtual index of the storage unit, and calculate a minimum cost threshold and a maximum cost threshold. The traversal range includes a group of cache units in the corresponding cache subspace, which is divided into several candidate windows. The executor traverses the several candidate windows according to the traversal order, calculates the cost function of each cache unit in the current candidate window based on the structured state table of the corresponding cache subspace, and selects cache units whose cost function is less than the minimum cost threshold, or traverses all the candidate windows. After selecting a cache unit with the smallest cost function that is less than the maximum cost threshold, the structured state table corresponding to the cache unit in the current candidate window is updated, and the cost function values of the traversed candidate windows and the selected cache units are included in the traversal history data structure. The table entries of the structured state table contain the structured state of the cache unit's structured state machine. The structured state includes at least: whether the content of the cache unit is valid; whether the content of the cache unit is consistent with the content of its corresponding storage unit, including whether the content of smaller pages in the cache unit is consistent with the content of pages in the corresponding storage unit; the read history of the cache unit; and the write history of the cache unit.
2. The SSD device with dynamic capacity caching acceleration according to claim 1, characterized in that, The cache executor is further configured to: if no cache unit is selected after traversing the plurality of candidate windows, select the cache unit with the smallest cost function; if the content of the cache unit is inconsistent with the content of the corresponding storage unit, write the content in the cache unit into the corresponding storage unit and recalculate the cost function of the cache unit; if the cost function is less than the maximum cost threshold, include the cost function value of the cache unit in the traversal history data structure.
3. The SSD device with dynamic capacity caching acceleration according to claim 1, characterized in that, Also includes: Metadata store, which stores: The storage subspace metadata structure is used to record the metadata of each storage subspace. Each storage subspace includes several contiguous storage block areas, each contiguous storage block area includes several storage blocks with device index contiguous, each storage block includes several storage units, and each storage subspace has a corresponding virtual index space. The metadata of each storage subspace includes a contiguous storage block area index table, a storage block virtual index space table, and a storage unit mapping table in each storage subspace. A cache subspace metadata structure is used to record the metadata of each cache subspace. Each cache subspace includes several contiguous cache block regions, each contiguous cache block region includes several cache blocks with contiguous device indexes, each cache block includes several cache units, and each cache subspace has a corresponding virtual index space. The metadata of each cache subspace includes a cache block contiguous region index table, a cache block virtual index space table, a cache unit mapping table, a unit structured status table, a configuration data structure, and a traversal history data structure. The configuration data structure includes cache request configuration and cache execution configuration. The cache request configuration includes cache capacity and cache policy options. The cache execution configuration includes cache execution capacity configuration and cache execution policy options. The cache execution capacity configuration includes minimum cache capacity, necessary cache capacity, peak read cache capacity, and peak write cache capacity. The cache execution policy options include configuration policy options, traversal policy options, and disk persistence policy options.
4. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache allocator is further configured to: Configure cache request calculation and cache execution for the cache subspace corresponding to the storage subspace that will be run, and complete the configuration. Traverse other cache subspaces, group unallocated cache units into contiguous cache blocks, and allocate them to the cache subspace according to the configuration policy options; The cache block contiguous area is recorded in the cache block contiguous area index table. The cache request configuration and cache execution configuration are recorded in the configuration data structure. All entries of the cell mapping table of the storage subspace are initialized to be empty. All entries of the cell mapping table of the cache subspace are initialized to be empty. The cell structured state table of the cache subspace is initialized to the initial state of each cell structured state machine.
5. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache allocator is further configured to: Configure compute cache for cache requests in the cache subspace corresponding to a running storage subspace. After configuration is complete, The cache executor is notified to suspend all operations of the storage subspace and its corresponding cache subspace; Traverse other cache subspaces, group unallocated cache units into contiguous cache blocks, and allocate them to the cache subspace according to the configuration policy options; The cache block contiguous area is recorded in the cache block contiguous area index table. The cache request configuration and cache execution configuration are recorded in the configuration data structure. The table entries of the unit mapping table of the cache subspace to which the newly allocated cache unit belongs are initialized to be empty. The unit structured state table of the cache subspace to which the newly allocated cache unit belongs is initialized to the initial state of each unit structured state machine. The cache executor is notified to resume all actions of the storage subspace and its corresponding cache subspace.
6. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache allocator is further configured to: Configure compute cache for cache requests in the cache subspace corresponding to a running storage subspace. After configuration is complete, The cache executor is notified to suspend all operations of the storage subspace and its corresponding cache subspace; The cache executor is notified to write the contents of all cache units in the corresponding cache subspace that are different from the contents of the corresponding storage unit into the corresponding storage unit; Traverse all cache units in the block contiguous area index table of this cache subspace, and reduce a certain number of cache units according to the configuration policy options; Record the contiguous block regions belonging to this cache subspace after reduction in the cache block contiguous region index table. Record the cache request configuration and cache execution configuration in the configuration data structure. Initialize all entries of the unit mapping table of this storage subspace to be empty. Initialize all entries of the unit mapping table of this cache subspace to be empty. Initialize the unit structured state table of this cache subspace to be the initial state of each unit structured state machine. The cache executor is notified to resume all actions of the storage subspace and its corresponding cache subspace.
7. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache executor is further configured to: In response to a read request for a storage unit, calculate the virtual index of the cache unit corresponding to the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace; If a corresponding cache unit is found, check the structured status of that cache unit. If the content of the cache unit is valid, update the content of the cache unit in the unit structured status table, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If invalid, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If no corresponding cache unit is found, traverse and select a cache unit in the cache subspace corresponding to the storage subspace to which the storage unit belongs, match the storage unit with the cache unit one-to-one, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace, calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace, update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the read request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
8. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache executor is further configured to: In response to a write request for a storage unit, calculate the virtual index of the cache unit corresponding to the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace; If a corresponding cache unit is found, check the structured status of that cache unit. If the content of the cache unit is valid or the size of the write request matches the size of the storage unit, update the content of the cache unit in the unit structured status table, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If it is invalid and inconsistent, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If no corresponding cache unit is found, traverse and select a cache unit in the cache subspace corresponding to the storage subspace to which the storage unit belongs, and match the storage unit with the cache unit one-to-one. If the size of the write request is inconsistent with the size of the storage unit, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the storage unit to the cache unit, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again. If they match, update the content of the cache unit in the unit structured status table, respond to the write request with the content of the cache unit, and update the content of the cache unit in the unit structured status table again.
9. The SSD device with dynamic capacity caching acceleration according to claim 3, characterized in that, The cache executor is further configured to: In response to a request to write a cache unit to the corresponding storage unit, the virtual index of the storage unit corresponding to the cache unit is calculated based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. The cache subspace is traversed according to the cache write-to-disk policy options and the structured state of the cache unit. If a new cache unit different from the cache unit is found, the new cache unit is set to no mapping. The device index of the storage unit is calculated according to the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. The device index of the cache unit is calculated according to the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. The contents of the cache unit and the new cache unit in the unit structured state table are updated. The contents of the cache unit are written to the new cache unit. The contents of the cache unit and the new cache unit in the unit structured state table are updated again. The contents of the new cache unit are written to the storage unit. The contents of the cache unit and the new cache unit in the unit structured state table are updated again. If no new cache unit different from the cache unit is found, calculate the device index of the storage unit based on the subspace index of the storage subspace to which the storage unit belongs and its virtual index in the storage subspace. Calculate the device index of the cache unit based on the subspace index of the cache subspace to which the cache unit belongs and its virtual index in the cache subspace. Update the content of the cache unit in the unit structured status table, write the content of the cache unit to the storage unit, and update the content of the cache unit in the unit structured status table again.
10. The SSD device with dynamic capacity caching acceleration according to claim 1, characterized in that, Also includes: The cache configuration interface is configured to receive external cache configuration requests, which include cache capacity and cache adjustment strategy options. The external read / write interface is configured to respond to external read / write requests, read out all or part of the contents of the corresponding storage unit, or write all or part of the contents received by the external read / write interface to the corresponding storage unit. The internal read / write interface is configured to enable read and write operations between the cache unit and the storage unit.
Citation Information
Patent Citations
Data caching method and device and storage medium
CN112148736A
Method and device for decoupling service and realizing automatic updating of multi-level cache
CN113836162A