SLC cache management method, device, equipment and storage medium

By training neural network models and designing secondary LRU cache structures, and dynamically adjusting SLC cache strategies, the problem of performance degradation in existing technologies under high loads is solved, and more efficient cache management and data replacement are achieved to adapt to complex workloads.

CN118606229BActive Publication Date: 2024-12-13SHEN ZHEN XINCUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411077379.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-13
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

The existing SLC cache management methods have degraded efficiency and performance in high load or irregular write modes, and cannot dynamically adjust the strategy, making it difficult to meet the high performance and high reliability requirements of modern storage requirements.

Method used

By training neural network models, designing a secondary LRU cache structure, and making cache decisions based on the optimization model, generating compressed address mapping tables and dynamic data replacement strategies, intelligently place and migrating data to adapt to workload characteristics.

Benefits of technology

Improves the utilization rate of SLC cache, dynamically adapts to complex workloads, avoids the defects of fixed strategies, and improves overall performance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606229B_ABST
    Figure CN118606229B_ABST
Patent Text Reader

Abstract

The present invention provides an SLC cache management method, device, equipment and storage medium, wherein the method includes: using historical write request feature data to train and optimize a neural network classifier to obtain an optimized SLC cache decision model; designing a secondary LRU cache structure to achieve efficient management of logical address indexes and data pages; when a new write request arrives, making a cache decision based on the optimization model and obtaining the working parameters of the cache structure; performing continuous compression processing on the cached address mapping information to obtain a compressed address mapping table; generating a dynamic data replacement strategy based on the address mapping table and cache usage status; and intelligently placing and migrating new write request data based on the cache decision results and replacement strategy. The method effectively improves the utilization rate of the SLC cache by dynamically adapting to workload characteristics, optimizing cache decisions and data replacement strategies, and avoiding the defect that fixed strategies are difficult to cope with complex workloads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of solid state drives, and in particular to an SLC cache management method, device, equipment and storage medium. Background Art

[0002] Existing SLC cache management methods mainly rely on fixed strategies and simple algorithms (such as the LRU algorithm) to manage cache. However, these methods have obvious defects, mainly reflected in the inability to effectively cope with complex and changing workload characteristics. Fixed strategies lack flexibility and intelligence, and cannot dynamically adjust cache management strategies according to different write requests, resulting in a significant decrease in cache efficiency and overall SSD performance under high load or irregular write modes. This static cache management method seems to be powerless in the face of modern storage needs and is difficult to meet users' requirements for high performance and high reliability. Summary of the invention

[0003] The main purpose of the present invention is to solve the technical problem that the efficiency of the cache and the overall performance of the SSD decrease under high load or irregular write mode in the existing SLC cache management.

[0004] A first aspect of the present invention provides an SLC cache management method, the SLC cache management method comprising:

[0005] Training and optimizing a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision making;

[0006] Perform secondary LRU structure design processing on the SLC cache to obtain a secondary LRU cache structure including logical address index and data page management;

[0007] When a new write request occurs, an SLC cache decision process is performed according to the new write request and the optimized neural network model to obtain a cache decision result, and the working parameters of the secondary LRU cache structure are obtained, wherein the working parameters include usage status, current workload characteristics, and current occupancy status;

[0008] According to the cache decision result and the logical address information of the new write request, the address mapping information of the SLC cache is continuously compressed to obtain a compressed address mapping table;

[0009] generating a data replacement strategy for the SLC cache according to the address mapping table, the usage status and current workload characteristics;

[0010] The new write request is intelligently placed and migrated according to the cache decision result and the data replacement strategy to obtain a data storage location management solution for the new write request.

[0011] Optionally, in a first implementation of the first aspect of the present invention, the training and optimization processing of a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision includes:

[0012] Performing feature extraction processing on historical write requests within a preset time period to obtain an initial historical data feature set, and performing cluster analysis processing on the initial historical data feature set to obtain an enhanced historical data feature set with cluster labels;

[0013] Performing model training on a preset neural network classifier according to the enhanced historical data feature set and the actual SLC cache hit rate corresponding to the historical write request to obtain a trained neural network model;

[0014] The training neural network model is pruned and quantized to obtain a lightweight optimized neural network model.

[0015] Optionally, in a second implementation of the first aspect of the present invention, performing a secondary LRU structure design process on the SLC cache to obtain a secondary LRU cache structure including a logical address index and data page management includes:

[0016] Partitioning the cache space of the SLC cache to obtain a logical address index area and a data page storage area, and performing a hash table construction process on the logical address index area to obtain a logical address index structure that supports fast search;

[0017] The data page storage area is grouped according to the logical address index structure to obtain a plurality of data page groups, and an LRU linked list is constructed for each of the data page groups to obtain an intra-group LRU linked list;

[0018] Performing a global LRU linked list construction process on all the LRU linked lists within the group to obtain a cross-group LRU linked list;

[0019] Perform access path optimization processing according to the logical address index structure, the intra-group LRU linked list, and the inter-group LRU linked list to obtain an optimized secondary LRU access structure;

[0020] A concurrent control mechanism is designed for the optimized secondary LRU access structure to obtain a secondary LRU cache structure that supports multi-threaded access.

[0021] Optionally, in a third implementation of the first aspect of the present invention, the access path optimization processing is performed according to the logical address index structure, the intra-group LRU linked list, and the cross-group LRU linked list to obtain an optimized secondary LRU access structure, including:

[0022] Performing access frequency statistics processing on the index items in the logical address index structure to obtain an index access frequency list, and sorting the logical address index structure according to the index access frequency list to obtain a priority-sorted index structure;

[0023] Performing access sequence recording processing on the LRU linked list in the group to obtain an access sequence in the group, and reordering the LRU linked list in the group according to the access sequence in the group to obtain an optimized LRU linked list in the group;

[0024] Performing inter-group data movement analysis processing on the cross-group LRU linked list to obtain an inter-group data flow pattern, and performing link optimization processing on the cross-group LRU linked list according to the inter-group data flow pattern to obtain an optimized cross-group LRU linked list;

[0025] Access path integration processing is performed on the priority-sorted index structure, the optimized intra-group LRU linked list, and the optimized inter-group LRU linked list to obtain an integrated secondary LRU access structure.

[0026] Optionally, in a fourth implementation of the first aspect of the present invention, the address mapping information of the SLC cache is continuously compressed according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table, including:

[0027] Performing continuity detection processing on the logical address information of the new write request to obtain continuous logical address segments, and performing continuity detection on the physical addresses corresponding to the continuous logical address segments in the SLC cache to obtain continuous physical address segments;

[0028] Performing start address and length recording processing on the continuous logical address segments and the continuous physical address segments to obtain compression mapping entries;

[0029] Constructing a compressed address mapping table according to the compressed mapping entries to obtain an initial compressed address mapping table, and performing index structure design processing on the initial compressed address mapping table to obtain an indexed compressed address mapping table;

[0030] The indexed compressed address mapping table is updated according to the cache decision result to obtain a compressed address mapping table.

[0031] Optionally, in a fifth implementation of the first aspect of the present invention, generating the data replacement strategy of the SLC cache according to the address mapping table, the usage status and the current workload characteristics includes:

[0032] Performing access frequency statistics processing on the data items in the address mapping table to obtain data access frequency distribution;

[0033] Performing a heat evaluation process on the data in the SLC cache according to the usage status to obtain a data heat score, and performing a pattern recognition process on the current workload feature to obtain a workload type identifier;

[0034] According to the data access frequency distribution and the data hotness and coldness score, priority calculation processing is performed on the data items in the SLC cache to obtain an initial replacement priority list;

[0035] Performing weighted fusion processing on the workload type identifier and the initial replacement priority list to obtain a comprehensive replacement priority list;

[0036] Grouping the data items in the SLC cache according to the comprehensive replacement priority list to obtain a plurality of priority groups, and performing replacement strategy allocation processing on the plurality of priority groups to obtain a group replacement strategy set;

[0037] The group replacement policy set and the comprehensive replacement priority list are subjected to policy integration processing to obtain a data replacement policy for the SLC cache.

[0038] Optionally, in a sixth implementation of the first aspect of the present invention, the intelligent placement and migration processing of the new write request according to the cache decision result and the data replacement strategy to obtain the data storage location management solution for the new write request includes:

[0039] Classify and process the newly arrived write request data according to the cache decision result to obtain an SLC cache storage data set and a QLC direct storage data set;

[0040] Performing SLC cache space check processing on the SLC cache storage data set to obtain SLC cache space status information;

[0041] Determine whether the SLC cache is full according to the SLC cache space status information, and if not full, directly write the SLC cache storage data set into the SLC cache;

[0042] If it is full, cold data identification processing is performed on the data in the SLC cache according to the data replacement strategy to obtain a data set to be migrated, and QLC area migration processing is performed on the data set to be migrated to obtain an updated SLC cache space;

[0043] Performing write processing on the SLC cache storage data set according to the updated SLC cache space to obtain an updated SLC cache data distribution;

[0044] Performing QLC area write processing on the QLC direct storage data set to obtain QLC area data distribution;

[0045] Storage location record processing is performed according to the updated SLC cache data distribution and the QLC area data distribution to obtain a data storage location management solution for a new write request.

[0046] A second aspect of the present invention provides an SLC cache management device, the SLC cache management device comprising:

[0047] A model generation module, used to train and optimize a preset neural network classifier according to feature data of historical write requests within a preset time period, to obtain an optimized neural network model for SLC cache decision;

[0048] A structure design module is used to perform a secondary LRU structure design process on the SLC cache to obtain a secondary LRU cache structure including a logical address index and data page management;

[0049] A cache decision module, configured to, when a new write request occurs, perform SLC cache decision processing according to the new write request and the optimized neural network model, obtain a cache decision result, and obtain working parameters of the secondary LRU cache structure, wherein the working parameters include usage status, current workload characteristics, and current occupancy;

[0050] An address mapping module, used to continuously compress the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table;

[0051] A cache replacement module, configured to generate a data replacement strategy for the SLC cache according to the address mapping table, the usage status and current workload characteristics;

[0052] The data management module performs intelligent placement and migration processing on the new write request according to the cache decision result and the data replacement strategy to obtain a data storage location management solution for the new write request.

[0053] A third aspect of the present invention provides an SLC cache management device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the SLC cache management device executes the steps of the above-mentioned SLC cache management method.

[0054] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned SLC cache management method.

[0055] The above-mentioned SLC cache management method, device, equipment and storage medium use historical write request feature data to train and optimize the neural network classifier to obtain an optimized SLC cache decision model; design a secondary LRU cache structure to achieve efficient management of logical address indexes and data pages; when a new write request arrives, make a cache decision based on the optimization model and obtain the working parameters of the cache structure; continuously compress the cached address mapping information to obtain a compressed address mapping table; generate a dynamic data replacement strategy based on the address mapping table and cache usage status; and intelligently place and migrate new write request data based on the cache decision results and replacement strategy. This method effectively improves the utilization rate of the SLC cache by dynamically adapting to workload characteristics, optimizing cache decisions and data replacement strategies, and avoiding the defect that fixed strategies are difficult to cope with complex workloads.

[0056] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0057] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A schematic diagram of a first embodiment of an SLC cache management method according to an embodiment of the present invention;

[0059] Figure 2 Schematic diagram of a second embodiment of the SLC cache management method according to an embodiment of the present invention;

[0060] Figure 3 A schematic diagram of an embodiment of an SLC cache management device according to an embodiment of the present invention;

[0061] Figure 4 It is a schematic diagram of an embodiment of an SLC cache management device in an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.

[0064] To facilitate understanding of this embodiment, a SLC cache management method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps:

[0065] 101. Train and optimize a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision;

[0066] In one embodiment of the present invention, the preset neural network classifier is trained and optimized according to the feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision, including: feature extraction processing of historical write requests within a preset time period to obtain an initial historical data feature set, and clustering analysis processing of the initial historical data feature set to obtain an enhanced historical data feature set with clustering labels; model training of the preset neural network classifier is performed according to the enhanced historical data feature set and the actual SLC cache hit rate corresponding to the historical write requests to obtain a trained neural network model; pruning and quantization processing of the trained neural network model to obtain a lightweight optimized neural network model.

[0067] Specifically, it is necessary to perform feature extraction on historical write requests within a preset time period. This process involves extracting multiple key features, including logical block address (LBA), I / O request size, request type (read / write), access frequency, request interval, nearest placement location, ratio of SLC cache to QLC area, and SSD space utilization. These features together constitute the initial historical data feature set, which fully reflects the workload characteristics and status of the SSD. For example, in an enterprise-level SSD, a large number of 4KB random writes and a small number of 128KB sequential writes may be observed, and this information will be captured in the feature set. Next, this initial feature set is clustered and analyzed. By applying clustering algorithms such as K-means or DBSCAN, groups of write requests with similar features can be identified, and a cluster label is assigned to each write request, thereby obtaining an enhanced historical data feature set with clustering information. This step can help to more finely distinguish which types of write requests are more suitable for SLC cache and which can be written directly to the QLC area. For example, cluster analysis may find that write requests with a size of 4KB and high access frequency form a cluster, and such requests are usually more suitable for SLC cache to improve performance. With this enhanced feature set, you can start training a neural network classifier. According to the paper, the model uses an artificial neural network (ANN) structure with an input layer, two hidden layers, and an output layer. The input layer and hidden layers use ReLU activation functions, and the output layer uses Sigmoid functions. This structure is suitable for binary classification, that is, deciding whether to put data into the SLC cache or write it directly to the QLC area. The training process used 60% of the data set, with actual cache hits as the training target. With this enhanced feature set, you can start training a neural network classifier. According to the paper, the model uses an artificial neural network (ANN) structure with an input layer, two hidden layers, and an output layer. The input layer and hidden layers use ReLU activation functions, and the output layer uses Sigmoid functions. This structure is suitable for binary classification, that is, deciding whether to put data into the SLC cache or write it directly to the QLC area. The training process used 60% of the data set, with actual cache hits as the training target. Considering the resource limitations of the SSD controller, further optimization of the trained neural network model is necessary. Model pruning aims to remove neurons or connections that have little impact on the prediction results, thereby reducing the model size. For example, it may be found that some features related to write size have a greater impact on the prediction results, while some time-related features have a smaller impact, then the neurons corresponding to these features can be selectively retained or removed. Quantization is the conversion of model parameters from floating point numbers to low-precision integers, which can significantly reduce the storage and computing requirements of the model.

[0068] 102. Perform secondary LRU structure design processing on the SLC cache to obtain a secondary LRU cache structure including a logical address index and data page management;

[0069] In one embodiment of the present invention, the SLC cache space is divided into a logical address index area and a data page storage area. The logical address index area adopts a hash table structure to support fast search, while the data page storage area manages actual data according to the LRU principle. In the logical address index area, each entry contains index information of the logical page number. For example, for a 4KB logical page, its index may be the logical page number divided by the number of mapping entries that can be stored in each translation page. This design allows the system to quickly locate the data page location corresponding to a specific logical address. In the data page storage area, an LRU linked list is used to manage data pages, with the most recently accessed page located at the head of the linked list and the page that has not been accessed for the longest time located at the tail. The core of the secondary LRU structure is to organically combine these two areas. The first-level LRU is used to manage the logical address index, and the second-level LRU is used to manage the actual data page. When the system needs to access a certain logical address, it first searches for the index in the first-level LRU. If it hits, the index is moved to the head of the first-level LRU, and the actual data page is located and accessed in the second-level LRU according to the index information, and the data page is moved to the head of the second-level LRU. This two-level structure is particularly suitable for processing compressed mapping entries in the SLC cache. For example, when a continuous write request of 32KB in size comes, it may only need to create an index entry in the first-level LRU, and store 8 consecutive 4KB data pages in the second-level LRU. This approach not only reduces the index overhead, but also maintains the flexibility of data access. When data needs to be eliminated, a smarter decision can be made based on the status of the two-level LRU, taking into account both the access frequency of the index and the usage of the actual data pages.

[0070] 103. When a new write request appears, perform SLC cache decision processing according to the new write request and the optimized neural network model, obtain a cache decision result, and obtain working parameters of the secondary LRU cache structure, wherein the working parameters include usage status, current workload characteristics, and current occupancy status;

[0071] In one embodiment of the present invention, when a new write request appears, key features are first extracted from the new write request, including logical block address (LBA), request size, request type, etc. At the same time, the system also collects the current SSD status information, such as the capacity ratio of the SLC cache to the QLC area, the overall space utilization of the SSD, etc. These information together constitute the input feature set, which is then sent to the optimized neural network model for processing. Based on these input features, the neural network model calculates a binary classification result through forward propagation, that is, whether to put the data of the write request into the SLC cache. For example, for a random write request of 4KB in size, if the model predicts that it is likely to be accessed again in the future, it will decide to put it into the SLC cache; on the contrary, if it is a sequential write request of 128KB, the model may predict that its probability of repeated access is low, so it chooses to write directly to the QLC area. After obtaining the cache decision result, the system also needs to obtain the working parameters of the secondary LRU cache structure to comprehensively evaluate the current state of the SLC cache. The usage status reflects the overall utilization efficiency of the SLC cache, which can be expressed by calculating the cache hit rate. For example, if the cache hit rate in the recent period exceeds 80%, it means that the current SLC cache is being used well. The current workload characteristics can be obtained by analyzing the I / O request pattern in the recent period, including the distribution of request sizes, the read-write ratio, the ratio of sequential access to random access, etc. This information helps to predict the I / O behavior in the short term and thus optimize the cache strategy. The current occupancy directly reflects the space utilization of the SLC cache, including the percentage of used space, the number of free pages, etc. This parameter is crucial for subsequent cache management. For example, when the occupancy of the SLC cache is close to 90%, the system may need to consider starting data migration or garbage collection procedures to free up space for new data. By comprehensively considering these working parameters, the system can manage the SLC cache more intelligently. For example, if the current workload presents a highly random small write pattern and the SLC cache is being used well, the system may tend to put data into the SLC cache more aggressively. On the contrary, if a large number of sequential writes are observed and the SLC cache space is tight, the system may use the SLC cache more conservatively and prioritize those data that are most likely to be frequently accessed.

[0072] 104. Perform continuous compression processing on the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table;

[0073] In one embodiment of the present invention, the address mapping information of the SLC cache is subjected to continuity compression processing according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table, including: performing continuity detection processing on the logical address information of the new write request to obtain continuous logical address segments, and performing continuity detection on the physical addresses corresponding to the continuous logical address segments in the SLC cache to obtain continuous physical address segments; performing starting address and length record processing on the continuous logical address segments and the continuous physical address segments to obtain compressed mapping entries; constructing a compressed address mapping table according to the compressed mapping entries to obtain an initial compressed address mapping table, and performing index structure design processing on the initial compressed address mapping table to obtain an indexed compressed address mapping table; updating the indexed compressed address mapping table according to the cache decision result to obtain a compressed address mapping table.

[0074] Specifically, the logical address information of the new write request needs to be checked for continuity first. This step aims to identify continuous logical address segments, which is crucial to improving the performance and management efficiency of SSDs. For example, when a large file is written to an SSD, it usually occupies a series of continuous logical addresses. By identifying these continuous address segments, the amount of mapping information that needs to be stored can be greatly reduced.

[0075] Specifically, the system checks whether the logical address of the new write request forms a continuous sequence with the previous write request. Assuming there is a 32KB write request, the corresponding logical page numbers are 1024 to 1031 (assuming each page is 4KB), the system will identify these 8 consecutive logical page numbers as a continuous logical address segment. Next, the system will perform a continuity check on the physical addresses corresponding to this continuous logical address segment in the SLC cache. This step is necessary because even if the logical addresses are continuous, the corresponding physical addresses may not be continuous due to the write characteristics and wear leveling strategy of the SSD. Assume that after the test, it is found that these 8 logical pages are mapped to physical page numbers 257 to 264, forming a continuous physical address segment. At this point, the system can record the starting address and length of this continuous logical address segment and continuous physical address segment to obtain a compressed mapping entry. In this example, the compressed mapping entry may be recorded as: (1024, 257, 8), where 1024 is the starting logical page number, 257 is the starting physical page number, and 8 is the number of continuous pages. Compared with the traditional one-to-one mapping, this compression method greatly reduces the amount of mapping information that needs to be stored. With these compressed mapping entries, the system can build an initial compressed address mapping table. This table contains the compressed mapping information of all identified continuous address segments. However, in order to improve query efficiency, it is also necessary to design an index structure for this initial compressed address mapping table. A common method is to use a tree structure, such as a B-tree or a red-black tree, to organize these compressed mapping entries. This allows fast search of any logical address, and the time complexity can reach O(log n), where n is the number of compressed mapping entries. In this case, the logical address range can be used as the index key. For example, for the compressed mapping entry (1024, 257, 8), [1024, 1031] can be used as the index key. In this way, when it is necessary to find the physical page number corresponding to the logical page number 1027, the system can quickly locate this compressed mapping entry, and then through simple calculation, it is known that its corresponding physical page number is 260. Finally, the indexed compressed address mapping table is updated according to the cache decision result. If the cache decision result indicates that a write request should be placed in the SLC cache, the system needs to add or update the corresponding mapping information in the compression address mapping table. This process may involve splitting or merging existing compression mapping entries. For example, if there is a new 4KB write request with a logical page number of 1032, it is decided to be placed in the SLC cache and assigned a physical page number of 265, the system needs to check whether it can be merged into the existing compression mapping entry. In this case, the original entry (1024, 257, 8) may be updated to (1024, 257, 9).However, if a new write request interrupts the original continuity, for example, a 4KB write request with a logical page number of 1028 is assigned to a physical page number of 1000, then the original compression mapping entry needs to be split into two: (1024, 257, 4) and (1029, 261, 3), and a new entry (1028, 1000, 1) is added. This dynamic adjustment ensures that the compressed address mapping table always maintains the optimal compression state while accurately reflecting the current address mapping relationship. Through this continuous compression process, the address mapping information of the SLC cache can be significantly compressed, greatly reducing the storage space required for the mapping table. This not only improves the memory utilization efficiency of the SSD controller, but also reduces the amount of data transmission during the address conversion process, thereby improving the overall I / O performance.

[0076] 105. Generate a data replacement strategy for the SLC cache according to the address mapping table, the usage status, and the current workload characteristics;

[0077] In one embodiment of the present invention, the data replacement strategy of the SLC cache generated according to the address mapping table, the usage status and the current workload characteristics includes: performing access frequency statistics processing on the data items in the address mapping table to obtain data access frequency distribution; performing hot and cold evaluation processing on the data in the SLC cache according to the usage status to obtain a data hot and cold score, and performing pattern recognition processing on the current workload characteristics to obtain a workload type identifier; performing priority calculation processing on the data items in the SLC cache according to the data access frequency distribution and the data hot and cold score to obtain an initial replacement priority list; performing weighted fusion processing on the workload type identifier and the initial replacement priority list to obtain a comprehensive replacement priority list; performing grouping processing on the data items in the SLC cache according to the comprehensive replacement priority list to obtain multiple priority groups, and performing replacement strategy allocation processing on the multiple priority groups to obtain a group replacement strategy set; performing strategy integration processing on the group replacement strategy set and the comprehensive replacement priority list to obtain the data replacement strategy of the SLC cache.

[0078] Specifically, first, the access frequency statistics of the data items in the address mapping table are processed to obtain the data access frequency distribution. This step generates a distribution diagram reflecting the data heat by analyzing the number of times each data item is accessed within a certain time window. For example, in a typical SSD working scenario, it may be found that 20% of the data items account for 80% of the access times, which conforms to the Pareto principle and helps to identify the most frequently accessed hot data. Next, the data in the SLC cache is evaluated for coldness and heat according to the usage status to obtain the data coldness and heat score. This evaluation not only considers the access frequency, but also the factors such as the recent access time and the data size. For example, a small data item that has been frequently accessed recently may get a higher heat score, while a data item with a large volume but low access frequency may be considered as cold data. At the same time, the current workload characteristics are processed for pattern recognition to obtain the workload type identification. This may involve identifying whether the workload is mainly random read and write or sequential access, read-intensive or write-intensive, etc. Different types of workloads have different requirements for cache strategies, so this identification is crucial for subsequent strategy formulation. Based on the data access frequency distribution and data hotness and coldness scores, the data items in the SLC cache are prioritized and processed to obtain an initial replacement priority list. This list preliminarily determines which data items should be retained in the cache and which can be replaced first. However, this initial list needs to be further adjusted in combination with the workload type. Therefore, the workload type identifier and the initial replacement priority list are weighted and fused to obtain a comprehensive replacement priority list. For example, if it is detected that the current workload is write-intensive, the priority of those data items that are frequently written may be increased to reduce the write amplification effect. With the comprehensive replacement priority list, the next step is to group the data items in the SLC cache according to this list to obtain multiple priority groups. This grouping can manage the cache space more finely. For example, data may be divided into three groups: high priority, medium priority, and low priority. Replacement strategy allocation is performed on these priority groups to obtain a group replacement strategy set. The high priority group may adopt a more conservative replacement strategy to keep it in the cache as long as possible; while the low priority group may adopt a more aggressive replacement strategy to be eliminated first when the cache space is insufficient. Finally, the group replacement policy set and the comprehensive replacement priority list are integrated to obtain the final SLC cache data replacement policy. This policy not only includes the processing methods for data of different priorities, but also needs to consider the overall cache management efficiency. For example, the policy may stipulate that when the cache usage reaches 90%, low-priority data will be actively eliminated, even if there is no risk of this data being overwritten by new data. At the same time, the policy also needs to take into account the characteristics of the SSD, such as write amplification and wear leveling.Therefore, the final replacement strategy may choose to retain some lower priority but appropriately located data in some cases, rather than frequently moving high priority data to reduce unnecessary write operations. In actual applications, this complex replacement strategy can flexibly cope with various workload scenarios. For example, in a working environment that mixes database transaction processing and large file transfers, the strategy may prioritize retaining frequently accessed small database records in the SLC cache, while directing sequential read and write operations of large files directly to the QLC area. This not only improves the cache hit rate, but also reduces unnecessary data migration between SLC and QLC, thereby improving overall performance and extending the life of the SSD.

[0079] 106. Intelligently place and migrate new write requests based on cache decision results and data replacement strategies to obtain a data storage location management solution for new write requests.

[0080] In one embodiment of the present invention, the intelligent placement and migration processing of the new write request according to the cache decision result and the data replacement strategy to obtain the data storage location management scheme of the new write request includes: classifying the newly arrived write request data according to the cache decision result to obtain an SLC cache storage data set and a QLC direct storage data set; performing SLC cache space check processing on the SLC cache storage data set to obtain SLC cache space status information; judging whether the SLC cache is full according to the SLC cache space status information, and if not, directly writing the SLC cache storage data set into the SLC cache; if If it is full, cold data identification processing is performed on the data in the SLC cache according to the data replacement strategy to obtain a data set to be migrated, and QLC area migration processing is performed on the data set to be migrated to obtain an updated SLC cache space; write processing is performed on the SLC cache storage data set according to the updated SLC cache space to obtain an updated SLC cache data distribution; QLC area write processing is performed on the QLC direct storage data set to obtain QLC area data distribution; storage location recording processing is performed according to the updated SLC cache data distribution and the QLC area data distribution to obtain a data storage location management solution for a new write request.

[0081] Specifically, the newly arrived write request data is classified and processed according to the cache decision results, and is divided into an SLC cache storage data set and a QLC direct storage data set. This step is based on the previously trained neural network model and takes into account the data access pattern, size and other characteristics. For example, small data blocks that are frequently accessed may be classified into the SLC cache storage data set, while large sequential write data may be classified into the QLC direct storage data set. Subsequently, the system performs an SLC cache space check on the SLC cache storage data set to obtain SLC cache space status information. This step is intended to evaluate the available space of the current SLC cache, including the number of free pages, the degree of fragmentation, etc. Based on this information, the system determines whether the SLC cache is full. If the SLC cache is not full, the system will directly write the SLC cache storage data set to the SLC cache, which is the most ideal situation because it does not require additional data migration operations and can quickly complete the writing process. However, in actual applications, the SLC cache is often in a state close to saturation. When the SLC cache is full, the system needs to perform cold data identification processing on the data in the SLC cache according to the previously formulated data replacement strategy to obtain the data set to be migrated. This process considers factors such as data access frequency, last access time, and data size. For example, a large data block that has not been accessed for a long time may be identified as cold data and become a candidate for migration. Next, the system performs QLC region migration processing on the data set to be migrated, moving these cold data from the SLC cache to the QLC region, thereby freeing up the SLC cache space. This process needs to be carefully managed to balance the impact of performance and write amplification. For example, the system may choose to slowly migrate data in the background to avoid significantly affecting the foreground I / O performance. After completing the data migration, the system obtains the updated SLC cache space. Subsequently, the system writes the SLC cache storage data set based on this updated SLC cache space to obtain the updated SLC cache data distribution. This step needs to consider the continuity and spatial locality of the data to optimize subsequent read performance. For example, the system may try to store related data blocks in adjacent physical locations to improve read efficiency. At the same time, for the QLC direct storage data set, the system performs QLC region write processing to obtain the QLC region data distribution. This process needs to consider the characteristics of QLC, such as longer write time and lower durability. The system may adopt special write strategies, such as distributing large sequential write data to multiple parallel QLC chips to increase the write speed. Finally, the system performs storage location record processing based on the updated SLC cache data distribution and QLC area data distribution to obtain the data storage location management plan for the new write request. This plan includes not only the physical location information of the data, but also some metadata, such as the data's heat score, last access time, etc. This information is crucial for future cache management and data migration decisions.In practical applications, this intelligent placement and migration process can significantly improve the performance and life of SSDs. For example, in a database system with a mixture of OLTP (online transaction processing) and OLAP (online analytical processing) workloads, the frequent small writes of OLTP may be placed preferentially in the SLC cache, while the large batch reads of OLAP may be directly performed from the QLC area. This strategy can not only improve the responsiveness of OLTP operations, but also reduce unnecessary data migration between the SLC cache and the QLC area, thereby reducing the write amplification effect. In addition, this dynamic data management scheme can also adapt to changes in workloads. For example, when the system detects that the workload changes from transaction-intensive during the day to batch tasks at night, it may adjust its data placement strategy to allocate more SLC cache space to the data required by batch tasks to improve the execution efficiency of nighttime tasks. At the same time, the system may actively reorganize and migrate data during the idle period at night to prepare for the peak period of the next day.

[0082] In this embodiment, by using historical write request feature data, training and optimizing a neural network classifier, an optimized SLC cache decision model is obtained; a secondary LRU cache structure is designed to achieve efficient management of logical address indexes and data pages; when a new write request arrives, a cache decision is made based on the optimization model, and the working parameters of the cache structure are obtained; the cached address mapping information is continuously compressed to obtain a compressed address mapping table; a dynamic data replacement strategy is generated based on the address mapping table and cache usage status; based on the cache decision results and replacement strategy, new write request data is intelligently placed and migrated. This method effectively improves the utilization rate of the SLC cache by dynamically adapting to workload characteristics, optimizing cache decisions and data replacement strategies, and avoiding the defect that fixed strategies are difficult to cope with complex workloads.

[0083] See also Figure 2 The second embodiment of the building area statistics method in the embodiment of the present invention includes:

[0084] 201. Train and optimize a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision;

[0085] In this embodiment, step 201 is similar to step 101 in the previous embodiment and will not be described in detail here.

[0086] 202. Partition the cache space of the SLC cache to obtain a logical address index area and a data page storage area, and construct a hash table for the logical address index area to obtain a logical address index structure that supports fast search;

[0087] In this embodiment, the cache space of the SLC cache is partitioned. First, the total size of the SLC cache needs to be determined based on the total capacity of the SSD and the configuration ratio of the SLC cache. Assuming a 256GB SSD, 5% of the space is configured as an SLC cache, the total size of the SLC cache is approximately 12.8GB. On this basis, the SLC cache space is divided into a logical address index area and a data page storage area. Usually, the index area occupies a smaller space. For example, 1GB can be allocated for the logical address index area, and the remaining 11.8GB is used for the data page storage area. This partitioning method can effectively balance the storage of index information and the cache requirements of actual data. Constructing a hash table for the logical address index area is a key step to improve search efficiency. Considering that SSDs usually use a 4KB page size, a 12.8GB SLC cache can store approximately 3,276,800 pages. In order to support fast search, a hash table with a size that is a power of 2 can be constructed. For example, 2^22 (approximately 4,194,304) can be selected as the size of the hash table. This ensures that there is enough space to store all possible page indexes while maintaining a low conflict rate. The hash function can choose a simple and efficient method, such as performing a modulo operation on the logical page number and the hash table size. In this hash table, each entry stores the logical page number and the corresponding physical page number information, as well as some additional metadata, such as access frequency and last access time. Through this structure, the system can quickly locate the physical location corresponding to any logical page number within the time complexity of O(1), greatly improving the efficiency of address conversion. For example, when a read request arrives, the system can immediately find the physical location of the data through the hash table without traversing the entire mapping table.

[0088] 203. Grouping the data page storage area according to the logical address index structure to obtain multiple data page groups, and constructing an LRU linked list for each data page group to obtain an intra-group LRU linked list;

[0089] In this embodiment, it is necessary to divide the data page groups based on the continuity of the logical addresses or certain predefined rules. For example, in a 12.8GB SLC cache, assuming that the data page storage area occupies 11.8GB, every 1024 consecutive logical pages can be divided into a group, so that about 3200 data page groups can be formed. This grouping method takes into account the common locality principle in SSD workloads, that is, continuous logical addresses are often accessed together. After the grouping is completed, each data page group is subjected to LRU (least recently used) linked list construction processing to obtain the LRU linked list within the group. The head of the LRU linked list stores the most recently accessed data page, and the tail stores the data page that has not been accessed for the longest time. This structure can effectively manage the data in the cache and improve the cache hit rate. For example, when a 4KB data page is accessed, it will be moved to the head of the LRU linked list of its group, and when it is necessary to make room for new data, the system can give priority to eliminating the data pages at the tail of each group of LRU linked lists.

[0090] This combination of grouping and LRU linked list structure is particularly effective when processing mixed workloads. For example, in a database system that runs OLTP (online transaction processing) and OLAP (online analytical processing) tasks simultaneously, the frequent small random accesses of OLTP may be concentrated in a few data page groups, while the large-scale sequential scans of OLAP may span multiple groups. Through intra-group LRU management, the system can effectively process the data stream of OLAP while retaining hot OLTP data. In addition, this structure also provides a basis for more complex cache replacement strategies. For example, a global LRU strategy can be implemented between groups. When the cache pressure is high, data is eliminated from the group at the end of the global LRU first. This not only maintains the access order within the group, but also balances the importance of data over a larger range, further improving the utilization efficiency of the SLC cache and the overall performance of the SSD.

[0091] 204. Perform global LRU chain list construction processing on all LRU chain lists in all groups to obtain a cross-group LRU chain list;

[0092] In this embodiment, it is necessary to create a new data structure based on the established intra-group LRU linked list to maintain the global access order. Specifically, a bidirectional linked list can be designed as the skeleton of the cross-group LRU linked list, in which each node represents a data page group, rather than a single data page. In the implementation process, whenever a data page is accessed, not only its position in the intra-group LRU linked list is updated, but also the group to which it belongs needs to be moved to the head of the cross-group LRU linked list. In this way, the head of the cross-group LRU linked list always represents the most recently accessed data page group, and the tail is the group that has not been accessed for the longest time. For example, in a 12.8GB SLC cache, assuming that there are 3200 data page groups, when a data page of group 3 is accessed, the entire group 3 will be moved to the head of the cross-group LRU linked list, indicating that this group contains the most recently accessed hot data. This global LRU strategy is particularly suitable for handling mixed workloads in SSDs. When dealing with scenarios where large-scale sequential reads and writes and random access coexist, the cross-group LRU linked list can better balance different types of access modes. For example, in a system that runs database OLTP transactions and big data analysis tasks at the same time, OLTP operations may frequently access certain specific groups, keeping these groups at the front of the cross-group LRU linked list, while big data analysis tasks may sequentially scan a large amount of data, causing multiple groups to be moved to the front of the linked list in turn. In addition, the cross-group LRU linked list provides more flexibility for cache replacement strategies. When the SLC cache space is insufficient and data needs to be eliminated, the system can give priority to the group at the end of the cross-group LRU linked list. This means that the entire group of data pages that have not been accessed for the longest time may be eliminated, not just a single data page. This strategy can more effectively free up cache space, reduce fragmentation, and may improve cache hit rates. For example, if the system detects that the cache pressure is increasing, it can choose to migrate the entire group of data to the QLC area one by one, starting from the end of the cross-group LRU linked list, until enough space is freed up.

[0093] 205. Perform access path optimization processing according to the logical address index structure, the intra-group LRU linked list, and the inter-group LRU linked list to obtain an optimized secondary LRU access structure;

[0094] In the present embodiment, the access path optimization processing is performed according to the logical address index structure, the intra-group LRU linked list and the cross-group LRU linked list to obtain the optimized secondary LRU access structure, including: performing access frequency statistics processing on the index items in the logical address index structure to obtain an index access frequency list, and sorting the logical address index structure according to the index access frequency list to obtain a priority-sorted index structure; performing access sequence recording processing on the intra-group LRU linked list to obtain an intra-group access sequence, and re-arranging the intra-group LRU linked list according to the intra-group access sequence to obtain an optimized intra-group LRU linked list; performing inter-group data movement analysis processing on the cross-group LRU linked list to obtain an inter-group data flow pattern, and performing link optimization processing on the cross-group LRU linked list according to the inter-group data flow pattern to obtain an optimized cross-group LRU linked list; performing access path integration processing on the priority-sorted index structure, the optimized intra-group LRU linked list and the optimized cross-group LRU linked list to obtain an integrated secondary LRU access structure.

[0095] Specifically, it is necessary to first perform access frequency statistics on the index items in the logical address index structure. This step involves recording and analyzing the number of times each index item is accessed, thereby obtaining an index access frequency list. For example, in the SLC cache of an SSD, it may be found that certain specific logical address intervals are frequently accessed, and these intervals may correspond to the index or hot data of the database. Based on this frequency list, the system can sort the logical address index structure and place the index items with high access frequency in a more easily accessible position, thereby obtaining a priority-sorted index structure. Next, the LRU linked list in the group is recorded in the order of access to obtain the access sequence in the group. This process not only considers the access frequency of the data page, but also the time order of the access. Based on this access sequence, the system can reorder the LRU linked list in the group, move the most frequently accessed and recently accessed data pages to the front of the linked list, and obtain an optimized LRU linked list in the group. This optimization is particularly effective for processing workloads with strong locality, such as database transaction processing, where frequently accessed records can be quickly located and accessed. For the cross-group LRU linked list, the system needs to perform inter-group data movement analysis and processing to observe how data flows between different groups, so as to obtain the inter-group data flow pattern. This analysis can reveal the overall access pattern of the workload, such as whether there is a large-scale sequential scan or frequent random access. According to this flow pattern, the system can optimize the links of the cross-group LRU linked list, adjust the link relationship between groups, and obtain the optimized cross-group LRU linked list. This optimization can better adapt to mixed workloads, for example, in an environment where OLTP and OLAP are mixed, different types of data access patterns can be managed more efficiently. Finally, the system needs to integrate the access paths of the priority-sorted index structure, the optimized intra-group LRU linked list, and the optimized cross-group LRU linked list. This process involves creating a unified access mechanism so that data queries can quickly locate the correct group through the optimized index structure, and then efficiently find the required data pages within the group. This integrated secondary LRU access structure can significantly improve the access efficiency of the SLC cache, reduce unnecessary query overhead, and thus improve the performance of the entire SSD.

[0096] 206. Design and process a concurrent control mechanism for the optimized secondary LRU access structure to obtain a secondary LRU cache structure that supports multi-threaded access.

[0097] In this embodiment, first, a segmented locking strategy can be adopted to divide the entire cache space into multiple independent segments, each segment is equipped with a mutex lock. In this way, different threads can access different cache segments at the same time, greatly improving concurrency. For example, in a 16GB SLC cache, it can be divided into 16 1GB segments, each with its own lock. Next, for the logical address index structure, a lock-free hash table can be implemented. This structure ensures concurrency safety through atomic operations and memory barriers, avoiding the performance overhead caused by the traditional lock mechanism. In high-concurrency SSD read and write scenarios, this lock-free structure can significantly improve the efficiency of index queries. For the LRU linked list within the group, a fine-grained lock strategy can be adopted. Each LRU linked list can use a read-write lock (Read-WriteLock), allowing multiple read operations to be performed simultaneously, while write operations require exclusive access. This design is particularly effective in scenarios with more reads and fewer writes, such as under the OLAP workload of the database, a large number of concurrent read requests can access cache data at the same time. The concurrency control of the cross-group LRU linked list can adopt an optimistic locking strategy. When the cross-group LRU linked list needs to be updated, the thread first obtains a snapshot of the linked list, makes necessary modifications, and then tries to update the linked list through atomic operations. If the linked list has not been modified by other threads during this period, the update is successful; otherwise, the operation is retried. This method can effectively reduce thread competition and is suitable for handling frequent cache status update operations in SSDs. To further optimize performance, a wait-free algorithm can be introduced to handle certain critical paths. For example, when determining whether a data page is in the cache, a wait-free search algorithm can be used to ensure that the query operation can be completed within a bounded time even under high load. This is crucial to ensure the stability and response time of the SSD. Finally, in order to avoid excessive competition, a dynamic load balancing mechanism can be implemented. The system can monitor the access frequency and competition level of each cache segment, dynamically adjust the segment size or redistribute hot data to balance the load of each thread. For example, if it is detected that a cache segment is accessed very frequently, the system can automatically further subdivide the segment or migrate some hot data to other less busy segments.

[0098] 207. When a new write request appears, perform SLC cache decision processing according to the new write request and the optimized neural network model, obtain a cache decision result, and obtain working parameters of the secondary LRU cache structure, wherein the working parameters include usage status, current workload characteristics, and current occupancy status;

[0099] 208. Perform continuous compression processing on the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table;

[0100] 209. Generate a data replacement strategy for the SLC cache according to the address mapping table, the usage status, and the current workload characteristics;

[0101] 210. Intelligently place and migrate new write requests based on cache decision results and data replacement strategies to obtain a data storage location management solution for new write requests.

[0102] In this embodiment, steps 207-201 are similar to steps 103-106 in the previous embodiment and are not described again here.

[0103] In this embodiment, by using historical write request feature data, training and optimizing a neural network classifier, an optimized SLC cache decision model is obtained; a secondary LRU cache structure is designed to achieve efficient management of logical address indexes and data pages; when a new write request arrives, a cache decision is made based on the optimization model, and the working parameters of the cache structure are obtained; the cached address mapping information is continuously compressed to obtain a compressed address mapping table; a dynamic data replacement strategy is generated based on the address mapping table and cache usage status; based on the cache decision results and replacement strategy, new write request data is intelligently placed and migrated. This method effectively improves the utilization rate of the SLC cache by dynamically adapting to workload characteristics, optimizing cache decisions and data replacement strategies, and avoiding the defect that fixed strategies are difficult to cope with complex workloads.

[0104] The SLC cache management method in the embodiment of the present invention is described above. The SLC cache management device in the embodiment of the present invention is described below. Figure 3 In one embodiment of the present invention, an SLC cache management device includes:

[0105] The model generation module 301 is used to train and optimize a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision;

[0106] The structure design module 302 is used to perform a secondary LRU structure design process on the SLC cache to obtain a secondary LRU cache structure including a logical address index and data page management;

[0107] The cache decision module 303 is used to perform SLC cache decision processing according to the new write request and the optimized neural network model when a new write request occurs, obtain a cache decision result, and obtain the working parameters of the secondary LRU cache structure, wherein the working parameters include usage status, current workload characteristics, and current occupancy;

[0108] The address mapping module 304 is used to continuously compress the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table;

[0109] A cache replacement module 305, configured to generate a data replacement strategy for the SLC cache according to the address mapping table, the usage status and current workload characteristics;

[0110] The data management module 306 performs intelligent placement and migration processing on the new write request according to the cache decision result and the data replacement strategy to obtain a data storage location management solution for the new write request.

[0111] In an embodiment of the present invention, the SLC cache management device runs the above-mentioned SLC cache management method. The SLC cache management device uses historical write request feature data to train and optimize the neural network classifier to obtain an optimized SLC cache decision model; designs a secondary LRU cache structure to achieve efficient management of logical address indexes and data pages; when a new write request arrives, makes a cache decision based on the optimization model and obtains the working parameters of the cache structure; performs continuous compression processing on the cached address mapping information to obtain a compressed address mapping table; generates a dynamic data replacement strategy based on the address mapping table and cache usage status; and intelligently places and migrates new write request data based on the cache decision results and replacement strategy. This method effectively improves the utilization rate of the SLC cache by dynamically adapting to workload characteristics, optimizing cache decisions and data replacement strategies, and avoiding the defect that fixed strategies are difficult to cope with complex workloads.

[0112] above Figure 3 The SLC cache management device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The SLC cache management device in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0113] Figure 44 is a schematic diagram of the structure of an SLC cache management device provided by an embodiment of the present invention. The SLC cache management device 400 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (for example, one or more processors) and a memory 420, and one or more storage media 430 (for example, one or more mass storage device terminals) storing application programs 433 or data 432. Among them, the memory 420 and the storage medium 430 can be short-term storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the SLC cache management device 400. Furthermore, the processor 410 may be configured to communicate with the storage medium 430, and execute a series of instruction operations in the storage medium 430 on the SLC cache management device 400 to implement the steps of the above-mentioned SLC cache management method.

[0114] The SLC cache management device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 4 The illustrated SLC cache management device structure does not constitute a limitation on the SLC cache management device provided by the present invention, and may include more or fewer components than illustrated, or a combination of certain components, or a different arrangement of components.

[0115] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the steps of the SLC cache management method.

[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0117] If the 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 invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0118] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A SLC cache management method, characterized in that: The SLC cache management method comprises: Training and optimizing a preset neural network classifier according to feature data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision making; Perform secondary LRU structure design processing on the SLC cache to obtain a secondary LRU cache structure including logical address index and data page management; When a new write request occurs, an SLC cache decision process is performed according to the new write request and the optimized neural network model to obtain a cache decision result, and the working parameters of the secondary LRU cache structure are obtained, wherein the working parameters include usage status, current workload characteristics, and current occupancy status; According to the cache decision result and the logical address information of the new write request, the address mapping information of the SLC cache is continuously compressed to obtain a compressed address mapping table; generating a data replacement strategy for the SLC cache according to the address mapping table, the usage status and current workload characteristics; The new write request is intelligently placed and migrated according to the cache decision result and the data replacement strategy to obtain a data storage location management solution for the new write request.

2. The SLC cache management method according to claim 1, characterized in that: The training and optimization of a preset neural network classifier according to the characteristic data of historical write requests within a preset time period to obtain an optimized neural network model for SLC cache decision-making includes: Performing feature extraction processing on historical write requests within a preset time period to obtain an initial historical data feature set, and performing cluster analysis processing on the initial historical data feature set to obtain an enhanced historical data feature set with cluster labels; Performing model training on a preset neural network classifier according to the enhanced historical data feature set and the actual SLC cache hit rate corresponding to the historical write request to obtain a trained neural network model; The training neural network model is pruned and quantized to obtain a lightweight optimized neural network model.

3. The SLC cache management method according to claim 1, characterized in that: The second-level LRU structure design processing is performed on the SLC cache to obtain a second-level LRU cache structure including a logical address index and data page management, including: Partitioning the cache space of the SLC cache to obtain a logical address index area and a data page storage area, and performing a hash table construction process on the logical address index area to obtain a logical address index structure that supports fast search; The data page storage area is grouped according to the logical address index structure to obtain a plurality of data page groups, and an LRU linked list is constructed for each of the data page groups to obtain an intra-group LRU linked list; Performing a global LRU linked list construction process on all the LRU linked lists within the group to obtain a cross-group LRU linked list; Perform access path optimization processing according to the logical address index structure, the intra-group LRU linked list, and the inter-group LRU linked list to obtain an optimized secondary LRU access structure; A concurrent control mechanism is designed for the optimized secondary LRU access structure to obtain a secondary LRU cache structure that supports multi-threaded access.

4. The SLC cache management method according to claim 3, characterized in that: The access path optimization processing is performed according to the logical address index structure, the intra-group LRU linked list and the inter-group LRU linked list to obtain an optimized secondary LRU access structure, which includes: Performing access frequency statistics processing on the index items in the logical address index structure to obtain an index access frequency list, and sorting the logical address index structure according to the index access frequency list to obtain a priority-sorted index structure; Performing access sequence recording processing on the LRU linked list in the group to obtain an access sequence in the group, and reordering the LRU linked list in the group according to the access sequence in the group to obtain an optimized LRU linked list in the group; Performing inter-group data movement analysis processing on the cross-group LRU linked list to obtain an inter-group data flow pattern, and performing link optimization processing on the cross-group LRU linked list according to the inter-group data flow pattern to obtain an optimized cross-group LRU linked list; Access path integration processing is performed on the priority-sorted index structure, the optimized intra-group LRU linked list, and the optimized inter-group LRU linked list to obtain an integrated secondary LRU access structure.

5. The SLC cache management method according to claim 1, characterized in that: The step of continuously compressing the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table includes: Performing continuity detection processing on the logical address information of the new write request to obtain continuous logical address segments, and performing continuity detection on the physical addresses corresponding to the continuous logical address segments in the SLC cache to obtain continuous physical address segments; Performing start address and length recording processing on the continuous logical address segments and the continuous physical address segments to obtain compression mapping entries; Constructing a compressed address mapping table according to the compressed mapping entries to obtain an initial compressed address mapping table, and performing index structure design processing on the initial compressed address mapping table to obtain an indexed compressed address mapping table; The indexed compressed address mapping table is updated according to the cache decision result to obtain a compressed address mapping table.

6. The SLC cache management method according to claim 1, characterized in that: Generating the data replacement strategy of the SLC cache according to the address mapping table, the usage status and the current workload characteristics includes: Performing access frequency statistics processing on the data items in the address mapping table to obtain data access frequency distribution; Performing a heat evaluation process on the data in the SLC cache according to the usage status to obtain a data heat score, and performing a pattern recognition process on the current workload feature to obtain a workload type identifier; According to the data access frequency distribution and the data hotness and coldness score, priority calculation processing is performed on the data items in the SLC cache to obtain an initial replacement priority list; Performing weighted fusion processing on the workload type identifier and the initial replacement priority list to obtain a comprehensive replacement priority list; Grouping the data items in the SLC cache according to the comprehensive replacement priority list to obtain a plurality of priority groups, and performing replacement strategy allocation processing on the plurality of priority groups to obtain a group replacement strategy set; The group replacement policy set and the comprehensive replacement priority list are subjected to policy integration processing to obtain a data replacement policy for the SLC cache.

7. The SLC cache management method according to claim 1, characterized in that: The intelligent placement and migration processing of the new write request according to the cache decision result and the data replacement strategy to obtain the data storage location management solution of the new write request includes: Classify and process the newly arrived write request data according to the cache decision result to obtain an SLC cache storage data set and a QLC direct storage data set; Performing SLC cache space check processing on the SLC cache storage data set to obtain SLC cache space status information; Determine whether the SLC cache is full according to the SLC cache space status information, and if not full, directly write the SLC cache storage data set into the SLC cache; If it is full, cold data identification processing is performed on the data in the SLC cache according to the data replacement strategy to obtain a data set to be migrated, and QLC area migration processing is performed on the data set to be migrated to obtain an updated SLC cache space; Performing write processing on the SLC cache storage data set according to the updated SLC cache space to obtain an updated SLC cache data distribution; Performing QLC area write processing on the QLC direct storage data set to obtain QLC area data distribution; Storage location record processing is performed according to the updated SLC cache data distribution and the QLC area data distribution to obtain a data storage location management solution for a new write request.

8. An SLC cache management device, characterized in that: The SLC cache management device comprises: A model generation module, used to train and optimize a preset neural network classifier according to feature data of historical write requests within a preset time period, to obtain an optimized neural network model for SLC cache decision; A structure design module is used to perform a secondary LRU structure design process on the SLC cache to obtain a secondary LRU cache structure including a logical address index and data page management; A cache decision module, configured to, when a new write request occurs, perform SLC cache decision processing according to the new write request and the optimized neural network model, obtain a cache decision result, and obtain working parameters of the secondary LRU cache structure, wherein the working parameters include usage status, current workload characteristics, and current occupancy; An address mapping module, used to continuously compress the address mapping information of the SLC cache according to the cache decision result and the logical address information of the new write request to obtain a compressed address mapping table; A cache replacement module, configured to generate a data replacement strategy for the SLC cache according to the address mapping table, the usage status and current workload characteristics; The data management module performs intelligent placement and migration processing on the new write request according to the cache decision result and the data replacement strategy to obtain a data storage location management solution for the new write request.

9. An SLC cache management device, characterized in that: The SLC cache management device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the SLC cache management device to perform the steps of the SLC cache management method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the SLC cache management method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Flash memory page-level address mapping method and system based on access locality

    CN111506517A

  • Adaptive Cache Partitioning

    CN114077553A