A differential management method and device for SSD cache, electronic equipment and storage medium

CN121300697BActive Publication Date: 2026-09-01SHENZHEN CITY TECHWIN SEMICONDUCTOR COMPANY LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511288065.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2026-09-01
Estimated Expiration
2045-09-10

AI Technical Summary

Technical Problem

[0006]本发明各实施例提供一种SSD缓存的差别管理方法,以解决现有技术多采用静态缓存管理策略,无法适配复杂业务场景,导致性能波动大、空间分配不合理,数据管理效率低下的问题

Benefits of technology

[0018]在上述技术方案,本发明通过首先获取历史写行为数据(含LBA、数据长度、时间戳),经特征工程与Li ghtGBM算法训练生成间隔预测模型,精准预测写命令的复写时间;随后采用统计方法对预测结果进行频次过滤与长尾截断,计算算术平均值得到复写间隔,并基于等频分档与业务压力(IOPS、延迟)动态调整生成复写时间档位表,实现数据优先级分层。在此基础上,当缓存使用率或空间不足时,系统结合实时业务参数(IOPS、延迟)计算压力指数,差异化生成下刷策略:高压力时优先保留高优先级档位(如前30%)数据,低压力时扩展保留范围(如前90%),确保关键业务数据优先驻留缓存。该方法通过模型预测、统计优化与实时参数融合,实现了缓存空间分配与业务性能的精准平衡,显著提升了复杂负载场景下的数据管理效率,有效解决了传统缓存策略静态化导致的性能波动与空间浪费问题,并通过智能数据去重与动态下刷机制,显著降低了重复数据写入频率,避免了写放大效应对SSD寿命的损耗。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121300697B_ABST
    Figure CN121300697B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a kind of SSD cache's differential management method, device, electronic equipment and storage medium, involve computer storage technical field, wherein the method comprises: obtaining historical write behavior data to construct training set, model training is carried out using machine learning algorithm, and interval prediction model is generated in combination with feature engineering;Obtain the predicted rewrite time by interval prediction model, obtain the rewrite interval using statistical method, and generate rewrite time interval table according to preset interval number division;When cache usage reaches set threshold, generate differential underbrush strategy according to rewrite time interval table and real-time service parameter to process data in SSD cache;When the space of SSD cache is insufficient, the data in SSD cache is sorted according to the priority in rewrite time interval table, and data management scheme is generated according to the interval length of data to be rewritten when priority is same.The present application solves the problem of large performance fluctuation and low space utilization in complex scenarios in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer storage technology, and in particular to a differential management method, apparatus, electronic device, and storage medium for SSD cache. Background Technology

[0002] With the rapid development of big data, cloud computing and artificial intelligence technologies, enterprise-grade and industrial-grade solid-state drives (SSDs) are being used in increasingly widespread applications, and the requirements for storage performance and data reliability are becoming more and more stringent.

[0003] However, a common problem in existing SSD storage systems is write amplification, primarily stemming from the DDR caching mechanism of SSD platters. When a host performs a write operation on an SSD, data is first quickly written to the DDR cache to improve performance, and then flushed to the platter at the appropriate time. The problem arises when, immediately after the data is flushed to the platter, the host sends a write command to the same address or to overwrite existing data. This invalidates the previously written data, triggering unnecessary platter write operations—the phenomenon known as write amplification.

[0004] Traditional SSD caching management strategies often employ a uniform cache flushing approach when facing such rewrite scenarios, failing to intelligently adjust based on the customer's actual write behavior. In high-write-rate applications, this strategy leads to frequent invalid data being flushed to disk, exacerbating the write amplification effect. This not only reduces the SSD's lifespan but also increases system power consumption and wear.

[0005] Therefore, there is an urgent need for a differential management method for SSD cache that can achieve differential management of cached data, reduce invalid data going to disk, reduce write amplification, improve performance, and significantly extend its lifespan. Summary of the Invention

[0006] This invention provides a differential management method for SSD caching to address the problems of existing technologies that mostly employ static caching management strategies, which cannot adapt to complex business scenarios, resulting in large performance fluctuations, unreasonable space allocation, and low data management efficiency. The technical solution is as follows:

[0007] According to one aspect of the present invention, a differential management method for SSD cache includes: acquiring historical write behavior data to construct a training set; employing a machine learning algorithm to train a model based on the training set; and combining feature engineering to generate an interval prediction model; the historical write behavior data includes address LBA, data length, and timestamp; obtaining a predicted rewrite time through the interval prediction model; calculating a rewrite interval based on the predicted rewrite time using a statistical method; dividing the rewrite interval into a rewrite time tier table according to a preset number of tiers; when the SSD cache utilization reaches a set threshold, generating a differential flushing strategy based on the rewrite time tier table and real-time business parameters; and processing the data in the SSD cache according to the flushing strategy; the business parameters include IOPS and latency data; when the SSD cache space is insufficient, sorting the data in the SSD cache according to the priority in the rewrite time tier table; if the priorities are the same, sorting according to the interval length at which the data is about to be rewritten; and generating a data management scheme.

[0008] In one embodiment, a training set is constructed by acquiring historical write behavior data. A machine learning algorithm is used to train a model based on the training set, and an interval prediction model is generated by combining feature engineering. This is achieved through the following steps: real-time recording of the LBA, data length, and nanosecond-level timestamp for each write operation; filtering out cold data that was written once but not overwritten, and retaining hot data samples that were repeatedly written ≥3 times; extracting the spatiotemporal features of the LBA, constructing time-series features by combining time interval sequences, training a regression model using the LightGBM algorithm, and generating an interval prediction model by minimizing the absolute error between the predicted interval and the actual interval; the spatiotemporal features include address clustering and write frequency.

[0009] In one embodiment, the predicted rewrite time is obtained through the interval prediction model by the following steps: obtaining the predicted rewrite time for each write command through the interval prediction model, forming a structured dataset based on the write commands and the predicted rewrite times, and sorting the structured dataset according to the predicted rewrite times.

[0010] In one embodiment, the calculation of the rewriting interval based on the predicted rewriting time using statistical methods is achieved through the following steps: statistically analyzing the frequency distribution of the structured dataset, setting a minimum frequency threshold, filtering low-frequency data based on the minimum frequency threshold, calculating the 95th percentile, removing extreme long-tail data greater than the quantile, and calculating the arithmetic mean of the predicted rewriting time based on the processed structured dataset to obtain the rewriting interval.

[0011] In one embodiment, the process of dividing the rewrite intervals into a rewrite time tier table according to a preset number of tiers is achieved through the following steps: arranging the rewrite intervals in ascending order, dividing them into equal-frequency tiers according to a preset number of tiers to generate an initial tier boundary table, and adjusting the time range of the initial tiers in conjunction with business pressure; when the business pressure is high, compressing the interval time of the top 30% of the tiers to generate a rewrite time tier table adapted to the real-time scenario; the business pressure includes high and low IOPS.

[0012] In one embodiment, a differentiated flushing strategy is generated based on the overwrite time tier table and real-time business parameters. The data in the SSD cache is processed according to the flushing strategy through the following steps: The data in the SSD cache is prioritized according to the overwrite time tier table; real-time business parameters are obtained; a business pressure index is calculated based on the real-time business parameters; and the real-time business parameters are monitored during the flushing process. When the business pressure index exceeds a set range, data in the top 30% of tiers is retained; when the business pressure index is within the set range, data in the top 60% of tiers is retained; and when the business pressure index does not reach the set range, data in the top 90% of tiers is retained.

[0013] In one embodiment, the data in the SSD cache is sorted according to the priority in the overwrite time tier table. If the priorities are the same, the data is sorted according to the interval between when the data is about to be overwritten. The data management scheme is generated through the following steps: sorting the data in the SSD cache according to the overwrite time tier table, marking the data in the SSD cache that exceeds the SSD cache flush threshold as conflict areas; for the conflict areas, flushing the data with lower priority tiers according to the overwrite time tier table. If the priorities are the same, the data is sorted according to the interval between when the data is about to be overwritten, and the data with an interval longer than a set value is flushed first.

[0014] According to one aspect of the present invention, a differential management device for SSD cache, the device comprising: a behavior prediction module, configured to acquire historical write behavior data to construct a training set, train a model based on the training set using a machine learning algorithm, and generate an interval prediction model by combining feature engineering; the historical write behavior data includes address LBA, data length, and timestamp; a tier division module, configured to obtain a predicted rewrite time through the interval prediction model, calculate a rewrite interval based on the predicted rewrite time using a statistical method, and divide the rewrite interval into a rewrite time tier table according to a preset number of tiers; a differential flushing module, configured to generate a differential flushing strategy based on the rewrite time tier table and real-time business parameters when the SSD cache utilization reaches a set threshold, and process the data in the SSD cache according to the flushing strategy; the business parameters include IOPS and latency data; and a dynamic flushing module, configured to sort the data in the SSD cache according to the priority in the rewrite time tier table when the SSD cache space is insufficient, and sort the data according to the interval length between data that is about to be rewritten when the priorities are the same, thereby generating a data management scheme.

[0015] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein computer-readable instructions are stored on the memory; the computer-readable instructions are executed by one or more of the processors to cause the electronic device to implement the differential management method of SSD cache as described above.

[0016] According to one aspect of the present invention, a storage medium has computer-readable instructions stored thereon, which are executed by one or more processors to implement the differential management method for SSD cache as described above.

[0017] The beneficial effects of the technical solution provided by this invention are:

[0018] In the above technical solution, this invention first acquires historical write behavior data (including LBA, data length, and timestamp), and then uses feature engineering and the LightGBM algorithm to train an interval prediction model to accurately predict the rewrite time of write commands. Subsequently, statistical methods are used to filter the prediction results by frequency and truncate the long tail, calculating the arithmetic mean to obtain the rewrite interval. Based on equal-frequency tiering and business pressure (IOPS, latency), a rewrite time tier table is dynamically adjusted to achieve data priority stratification. Furthermore, when cache utilization or space is insufficient, the system calculates a pressure index based on real-time business parameters (IOPS, latency) and generates differentiated flushing strategies: under high pressure, high-priority tiers (e.g., the top 30%) of data are retained first; under low pressure, the retention range is expanded (e.g., the top 90%), ensuring that critical business data resides preferentially in the cache. This method achieves a precise balance between cache space allocation and business performance through model prediction, statistical optimization, and real-time parameter fusion. It significantly improves data management efficiency under complex load scenarios, effectively solves the performance fluctuation and space waste problems caused by the static nature of traditional caching strategies, and significantly reduces the frequency of duplicate data writing through intelligent data deduplication and dynamic flushing mechanisms, thus avoiding the wear and tear on SSD lifespan caused by write amplification. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating a differential management method for SSD caching according to an exemplary embodiment;

[0021] Figure 2 This is a block diagram illustrating a differential management device for SSD cache according to an exemplary embodiment;

[0022] Figure 3 This is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0023] Figure 4 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0024] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0025] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0026] This invention provides a differential management method for SSD cache. By constructing an interval prediction model and a dynamic rewrite level table, and combining real-time business parameters to differentiate cache flushing and retention strategies, it achieves a precise balance between SSD cache space and business performance. This effectively solves the problems of large performance fluctuations and low space utilization in complex scenarios caused by traditional management methods. This differential management method for SSD cache is applicable to differential management devices for SSD cache, which can be electronic devices. The differential management method for SSD cache in this invention can be applied to various scenarios, such as the management of SSD cache temporary folders.

[0027] Please see Figure 1 This invention provides a differential management method for SSD cache, which is applicable to electronic devices.

[0028] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.

[0029] like Figure 1 As shown, the method may include the following steps:

[0030] Step 110: Obtain historical write behavior data to construct a training set, use machine learning algorithms to train the model based on the training set, and combine feature engineering to generate an interval prediction model.

[0031] In one possible implementation, the LBA, data length, and nanosecond-level timestamp of each write operation are recorded in real time. Cold data that has been written once and not overwritten is filtered out, while hot data samples that have been written ≥3 times are retained. The spatiotemporal features of the LBA are extracted and combined with the time interval sequence to construct time series features. The LightGBM algorithm is used to train a regression model, and an interval prediction model is generated by minimizing the absolute error between the predicted interval and the true interval.

[0032] The spatiotemporal features include address clustering and write frequency; historical write behavior data includes address LBA, data length, timestamp, etc., none of which are specified here.

[0033] Specifically, the LBA, data length, and nanosecond-level timestamp of each write operation are recorded in real time. Cold data that has been written once and not overwritten is filtered out, while hot data samples that have been written ≥3 times are retained. The spatiotemporal features of LBA (such as address clustering and write frequency) are extracted and combined with the time interval sequence to construct time series features.

[0034] Among them, the acquisition of historical writing behavior data to build a training set can be obtained through artificial intelligence, and other behavior prediction methods (such as statistical regularity, rule engine, etc.) can also be applied, without any limitation here.

[0035] Furthermore, the LightGBM algorithm is used to train the regression model, generating an interval prediction model by minimizing the absolute error between the predicted and actual intervals. Focusing on hot data samples reduces unnecessary computation and improves model prediction accuracy. Spatiotemporal feature extraction combined with time series analysis enhances the ability to capture copying patterns.

[0036] In the above process, the embodiments of the present invention, by focusing on hot data and feature engineering optimization, enable the model to accurately predict the rewriting time, providing a highly reliable prediction basis and realizing dynamic perception of user rewriting behavior.

[0037] Step 120: Obtain the predicted copying time through the interval prediction model, calculate the copying interval based on the predicted copying time using statistical methods, and generate a copying time level table by dividing the copying interval according to the preset number of levels.

[0038] In one possible implementation, the predicted rewrite time for each write command is obtained through an interval prediction model, a structured dataset is formed based on the write commands and the predicted rewrite time, and the structured dataset is sorted according to the predicted rewrite time.

[0039] In one possible implementation, the frequency distribution of the structured dataset is statistically analyzed, a minimum frequency threshold is set, low-frequency data is filtered based on the minimum frequency threshold, the 95th percentile is calculated, extreme long-tail data above the quantile are removed, and the arithmetic mean of the predicted rewriting time is calculated based on the processed structured dataset to obtain the rewriting interval.

[0040] In one possible implementation, the rewrite intervals are arranged in ascending order, and an initial gear boundary table is generated by dividing the intervals into equal frequency segments according to a preset number of gears. The time range of the initial gears is adjusted based on business pressure. When business pressure is high, the interval time of the top 30% of gears is compressed to generate a rewrite time gear table adapted to the real-time scenario.

[0041] Business pressure includes IOPS levels and latency data, etc., none of which are specified here.

[0042] Specifically, the time range for tier allocation is adjusted based on real-time business pressure (high or low IOPS, latency): under high pressure, the interval between the top 30% of tiers is compressed. Statistical filtering and quantile truncation eliminate outlier interference, improving the rationality of tier allocation. Dynamic tier adjustment adapts to real-time business scenarios, enhancing strategy flexibility.

[0043] In the above process, the embodiments of the present invention, through statistical optimization and dynamic adjustment of the time tiers, enable the rewrite time tier table to accurately match the business load, provide differentiated data management basis, and achieve efficient allocation of cache resources.

[0044] Step 130: When the SSD cache utilization reaches the set threshold, generate a differential flushing strategy based on the rewrite time tier table and real-time business parameters, and process the data in the SSD cache according to the flushing strategy.

[0045] In one possible implementation, the data in the SSD cache is prioritized according to the overwrite time tier table to obtain real-time business parameters. The business pressure index is calculated based on the real-time business parameters, and the real-time business parameters during the overwrite process are monitored. When the business pressure index exceeds the set range, the data in the top 30% of the tiers is retained. When the business pressure index is within the set range, the data in the top 60% of the tiers is retained. When the business pressure index does not reach the set range, the data in the top 90% of the tiers is retained.

[0046] Specifically, cached data is prioritized based on a rewrite time tier table, and a business stress index is calculated by combining real-time IOPS and latency data. Under high stress, the top 30% of data in each tier is retained; under medium stress, the top 60% is retained; and under low stress, the top 90% is retained. During the flushing process, business parameters are continuously monitored, and the retention ratio is dynamically adjusted. The business stress index is quantitatively assessed to avoid subjective threshold setting errors. This tiered retention strategy balances performance and lifespan, reducing the flushing of invalid data.

[0047] In the above process, the embodiments of the present invention enable the refresh strategy to dynamically adapt to load changes through business pressure quantification and hierarchical retention, providing dual guarantees of performance and lifespan, and maximizing cache utilization.

[0048] Step 140: When the SSD cache space is insufficient, sort the data in the SSD cache according to the priority in the overwrite time tier table. If the priorities are the same, sort them according to the interval between when the data is about to be overwritten, and generate a data management plan.

[0049] In one possible implementation, the data in the SSD cache is sorted according to the overwrite time tier table. If data in the same tier exceeds the SSD cache flush threshold, it is marked as a conflict area. For conflict areas, data in the lower priority tier is flushed first according to the overwrite time tier table. If the priorities are the same, the data is sorted according to the interval between when it will be overwritten, and data whose interval between when it will be overwritten is flushed first. That is, data that will be overwritten sooner after the start prediction time point is retained.

[0050] Specifically, data exceeding the cache flush threshold within the SSD cache is marked as a conflict area, and lower-priority data is flushed first. If priorities are the same, data is sorted according to the interval between upcoming overwrites, and data with an overwrite interval longer than a set value is flushed first, ensuring that critical business data resides in the cache. Dynamic scaling refines the granularity and improves space utilization.

[0051] In the above process, the embodiments of the present invention enable the cache space allocation to accurately match business needs through conflict region management and dynamic ratio adjustment, providing a highly reliable data management solution and achieving synergistic optimization of SSD lifespan and performance.

[0052] Through the above process, this invention achieves fine-grained differentiated management of SSD caching by constructing an interval prediction model, dynamically generating a rewrite time tier table, formulating differentiated flushing strategies based on business pressure, and optimizing cache space allocation. This method effectively solves the problems of large performance fluctuations (blindly flushing hot data, triggering frequent SSD wear leveling tasks (internal data migration), leading to sharp performance drops) and severe space waste in traditional static strategies under complex scenarios. This invention, through dynamic retention ratios, reduces invalid operations, avoids performance fluctuations, significantly improves SSD lifespan and data management efficiency, and provides reliable technical support for high-load enterprise applications.

[0053] In one application scenario, a large e-commerce platform's database storage system uses enterprise-grade SSDs as a caching layer to handle high-concurrency order write and query requests. The SSD caching differential management method proposed in this invention optimizes performance and lifespan through differentiated management.

[0054] Specifically, it may include the following steps:

[0055] Step 1: Construct an interval prediction model.

[0056] Specifically, a data acquisition module is first deployed in the SSD controller to record the LBA (Logical Block Address), data length (e.g., 4KB), and nanosecond-level timestamp for each write operation in real time. Cold data (e.g., initialization writes) that were only written once and not overwritten are filtered out, retaining only hot data samples (e.g., frequently updated records in an order table) that have been repeatedly written ≥3 times within 30 days. This increases the proportion of hot data samples from 45% to 82%, improves model training efficiency by 2 times, focuses on frequently overwritten data, and reduces unnecessary computational resource consumption.

[0057] Furthermore, spatiotemporal features of LBA are extracted: adjacent addresses are clustered at a 16KB granularity, and the write frequency per unit time (e.g., 10 times per second) is statistically analyzed. Temporal features (e.g., the time difference between the previous write and the current write) are constructed by combining time interval sequences. A regression model is trained using the LightGBM algorithm, with the objective function being to minimize the absolute error (MAE) between the predicted interval and the true interval. Feature engineering is used to capture write patterns, improving prediction accuracy. This reduces the model's prediction error rate from 28% to 9%, and achieves a write time prediction accuracy of 91%.

[0058] In the above process, the embodiments of the present invention, by focusing on hot data and feature engineering optimization, enable the model to accurately predict the rewriting time, providing a highly reliable prediction basis and realizing dynamic perception of user rewriting behavior.

[0059] Step 2: Generate a copy time slot table.

[0060] Specifically, frequency distribution statistics were performed on 500,000 predicted rewrite time data points, filtering out low-frequency data (such as occasional batch imports) with a frequency of less than 5 times. The 95th percentile (e.g., 120 seconds) was calculated, and extreme long-tail data (e.g., backup tasks) with a frequency greater than 120 seconds were removed. Five initial boundary tables were generated based on equal frequency: Boundary 1 (0-10 seconds), Boundary 2 (10-30 seconds), Boundary 3 (30-60 seconds), Boundary 4 (60-90 seconds), and Boundary 5 (90-120 seconds). Outlier interference was eliminated to ensure that the boundary levels covered the main rewrite scenarios, increasing the boundary level coverage from 75% to 98% and reducing the proportion of extreme data from 15% to 2%.

[0061] Specifically, it monitors IOPS (Input / Output Per Second) in real time. When write IOPS > 5000, it is considered high pressure. Under high pressure, the interval between the top 3 / 5 compression levels (compression levels 1-3) is determined. Under low pressure (IOPS < 2000), the default compression level range is restored. This adapts to real-time business load, preventing critical data from being forcibly flushed under high pressure. As a result, the critical data retention rate under high pressure scenarios increases from 65% to 92%, and write amplification is reduced by 40%.

[0062] In the above process, the embodiments of the present invention, through statistical optimization and dynamic adjustment of the time tier table, enable the rewrite time tier table to accurately match the business load, provide differentiated data management basis, and realize efficient allocation of cache resources.

[0063] Step 3: Generate differentiated brushing strategies.

[0064] Specifically, cached data is sorted according to a priority table, from priority level 1 (highest priority) to priority level 5 (lowest priority). The business pressure index is calculated as follows: Pressure Index = 0.6 × IOPS normalized value + 0.4 × latency normalized value (normalized to 0-1). This quantifies the business load, providing an objective basis for refresh decisions. The calculation latency of the pressure index is ensured to be <1ms, meeting high concurrency requirements in real-time.

[0065] Furthermore, under high stress (stress index > 0.8), only data from levels 1-3 is retained, while data from levels 4-5 is refreshed; under medium stress (0.5 < stress index ≤ 0.8), levels 1-4 are retained, and data from level 5 is refreshed; under low stress (stress index ≤ 0.5), all data is retained. This balances performance and lifespan, reducing invalid refreshes from 35% to 8%, extending SSD lifespan by 22%.

[0066] In the above process, the embodiments of the present invention enable the refresh strategy to dynamically adapt to load changes through business pressure quantification and hierarchical retention, providing dual guarantees of performance and lifespan, and maximizing cache utilization.

[0067] Step 4: Optimize cache space allocation.

[0068] Specifically, when the total amount of data in the cache exceeds the cache flushing threshold, the portion exceeding the threshold is marked as a conflict area. Prioritize flushing data in tier 5; if this still exceeds the cache flushing threshold, then flush data in tier 4, and so on. If priorities are the same, further filtering is performed based on the interval between data being overwritten. This avoids forced flushing that could lead to the loss of critical data, reducing the data loss rate in conflict scenarios from 18% to 0.3%.

[0069] Specifically, when the total amount of data in the cache exceeds the cache flushing threshold, the excess portion is marked as a conflict area. For this conflict area, the overwrite time priority table is first retrieved, and the cached data is sorted hierarchically according to a preset priority—all data in the lowest priority level 5 is flushed first; if multiple data belong to the same level 5 or further filtering is required, they are sorted according to the interval between their upcoming overwrites, and data with an interval longer than the set value is flushed first (i.e., the data to be overwritten earliest is retained). Through this two-dimensional strategy of "priority hierarchical + precise filtering by overwrite interval," space is efficiently released in conflict scenarios while maximizing the retention of high-value data.

[0070] In the above process, the embodiments of the present invention enable the cache space allocation to accurately match business needs through conflict region management and dynamic ratio adjustment, providing a highly reliable data management solution and achieving synergistic optimization of SSD lifespan and performance.

[0071] Through the above process, this embodiment of the invention optimizes SSD disk management using technical means: It utilizes an AI engine to predict user write behavior, categorizes write intervals, and dynamically adjusts the cache flushing strategy based on business pressure. After implementation, it reduces invalid data flushing, lowers write amplification effects, reduces SSD media wear rate by 35%, and significantly extends lifespan; simultaneously, it reduces power consumption, improves system performance, and stabilizes database query latency at <2ms, supporting high-concurrency business. This solution effectively balances performance and lifespan requirements, reducing customer hardware replacement costs.

[0072] The following are embodiments of the apparatus of the present invention, which can be used to execute the differential management method for SSD cache involved in the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the method embodiments of the differential management method for SSD cache involved in the present invention.

[0073] Please see Figure 2 This invention provides a differential management device 800 for SSD caching.

[0074] The differential management device 800 for the SSD cache includes, but is not limited to: behavior prediction module 810, tier division module 830, differential refresh module 850, and dynamic refresh module 870.

[0075] Among them, the behavior prediction module 810 is used to acquire historical write behavior data to build a training set, use machine learning algorithms to train the model based on the training set, and combine feature engineering to generate an interval prediction model; the historical write behavior data includes address LBA, data length, and timestamp.

[0076] The gear segmentation module 830 is used to obtain the predicted copy time through the interval prediction model, calculate the copy interval based on the predicted copy time using statistical methods, and generate a copy time gear table by dividing the copy interval according to the preset number of gears.

[0077] The differential refresh module 850 is used to generate a differential refresh strategy based on the rewrite time tier table and real-time business parameters when the SSD cache utilization reaches a set threshold, and then process the data in the SSD cache according to the refresh strategy; the business parameters include IOPS and latency data.

[0078] The Dynamic Brush Module 870 is used to sort the data in the SSD cache according to the priority in the rewrite time tier table when the SSD cache space is insufficient. If the priorities are the same, they are sorted according to the interval between when the data is about to be rewritten, and a data management scheme is generated.

[0079] It should be noted that the differential management of SSD cache provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the differential management device for SSD cache will be divided into different functional modules to complete all or part of the functions described above.

[0080] Furthermore, the SSD cache differential management device and the SSD cache differential management method provided in the above embodiments belong to the same concept, and the specific way in which each module performs operations has been described in detail in the method embodiments, and will not be repeated here.

[0081] Figure 3 A schematic diagram of the structure of an electronic device according to an exemplary embodiment is shown.

[0082] It should be noted that this electronic device is merely an example adapted to the present invention and should not be construed as providing any limitation on the scope of use of the present invention. Furthermore, this electronic device should not be interpreted as requiring or depending on having... Figure 3 One or more components of the exemplary electronic device 2000 shown.

[0083] The hardware structure of electronic devices 2000 can vary considerably due to differences in configuration or performance, such as... Figure 3 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.

[0084] Specifically, power supply 210 is used to provide operating voltage for various hardware devices on electronic device 2000.

[0085] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to this invention, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 3 As shown, this does not constitute a specific limitation.

[0086] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.

[0087] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the electronic device 2000, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0088] Application 253 is a computer-readable instruction based on operating system 251 that performs at least one specific task, and may include at least one module ( Figure 3 (Not shown), each module may contain computer-readable instructions for the electronic device 2000. For example, the differential management device for the SSD cache can be considered as application 253 deployed on the electronic device 2000.

[0089] Data 255 may be signal information, etc., and is stored in memory 250.

[0090] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer-readable instructions stored in the memory 250, thereby enabling the computation and processing of massive amounts of data 255 in the memory 250. For example, a differential management method for SSD cache can be implemented by the central processing unit 270 reading a series of computer-readable instructions stored in the memory 250.

[0091] Furthermore, the present invention can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of the present invention is not limited to any specific hardware circuit, software, or combination thereof.

[0092] Please see Figure 4 This invention provides an electronic device 4000, which may include: a desktop computer, a laptop computer, a server, etc., with sensor recognition capabilities.

[0093] exist Figure 4 The electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0094] The data interaction between the processor 4001 and the memory 4003 can be achieved through at least one communication bus 4002. This communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0095] Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0096] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0097] The memory 4003 may be a ROM (Read-Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or it may be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read-Only Memory) or other optical disc storage, optical disk storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program instructions or code in the form of instructions or data structures and accessible by the electronic device 4000, but not limited thereto.

[0098] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002.

[0099] The computer-readable instructions are executed by one or more processors 4001 to implement the differential management method of SSD cache in the above embodiments.

[0100] Furthermore, this embodiment of the invention provides a storage medium storing computer-readable instructions, which are executed by one or more processors to implement the differential management method for SSD cache as described above.

[0101] This invention provides a computer program product including computer-readable instructions stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, thereby enabling the electronic device to implement the differential management method for SSD cache as described above.

[0102] Compared with related technologies, the beneficial effects of the present invention are:

[0103] 1. This invention can reduce invalid data being written to disk and reduce write amplification effect; by predicting the client's write command behavior, it can selectively flush data in the cache, avoiding media wear and performance degradation caused by repeated writing.

[0104] 2. This invention has the effect of extending the lifespan of SSD media and hard drives; by reducing the frequent flushing of invalid data, the number of NAND flash write cycles is reduced, thereby extending the lifespan of the hard drive.

[0105] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0106] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for differentially managing an SSD cache, the method comprising: The method includes: A training set is constructed by acquiring historical write behavior data. A machine learning algorithm is used to train a model based on the training set, and feature engineering is combined to generate an interval prediction model. The historical write behavior data includes address LBA, data length, and timestamp. The predicted copying time is obtained through the interval prediction model. The copying interval is calculated based on the predicted copying time using statistical methods. The copying interval is divided into a copying time level table according to a preset number of levels. When the SSD cache utilization reaches a set threshold, a differentiated flushing strategy is generated based on the rewrite time tier table and real-time business parameters. The data in the SSD cache is then processed according to the flushing strategy. The business parameters include IOPS and latency data. When the SSD cache space is insufficient, the data in the SSD cache is sorted according to the priority in the overwrite time tier table. If the priorities are the same, the data is sorted according to the interval between when the data is about to be overwritten, and a data management scheme is generated.

2. The method of claim 1, wherein the SSD cache is managed differently based on whether the data is stored in the SSD cache or the HDD cache. The process of acquiring historical write behavior data to construct a training set, using machine learning algorithms to train a model based on the training set, and combining feature engineering to generate an interval prediction model includes: Record the LBA, data length and nanosecond-level timestamp of each write operation in real time, filter out cold data that has been written once and not overwritten, and retain hot data samples that have been written ≥3 times. The spatiotemporal features of the LBA are extracted, and time-series features are constructed by combining them with time interval sequences. The LightGBM algorithm is used to train a regression model, and an interval prediction model is generated by minimizing the absolute error between the predicted interval and the actual interval. The spatiotemporal features include address clustering and write frequency.

3. The method of claim 1, wherein the SSD cache is managed differently based on whether the data is stored in the SSD cache or the HDD cache. The process of obtaining the predicted rewrite time through the interval prediction model includes: The predicted rewrite time for each write command is obtained through the interval prediction model. A structured dataset is formed based on the write command and the predicted rewrite time, and the structured dataset is sorted according to the predicted rewrite time.

4. The method of claim 3, wherein the SSD cache is managed differently based on whether the data is stored in the SSD cache or the HDD cache. The step of calculating the write interval using statistical methods based on the predicted write time includes: The frequency distribution of the structured dataset is statistically analyzed, a minimum frequency threshold is set, low-frequency data is filtered according to the minimum frequency threshold, the 95th percentile is calculated, extreme long-tail data above the 95th percentile are removed, and the arithmetic mean of the predicted rewrite time is calculated based on the processed structured dataset to obtain the rewrite interval.

5. The method of claim 1, wherein the SSD cache is managed differently based on whether the SSD cache is used for a read cache or a write cache. The step of dividing the copy interval according to the preset number of increments to generate a copy time increment table includes: The rewriting intervals are arranged in ascending order, and an initial gear boundary table is generated by equal frequency division according to the preset number of gears. The time range of the initial gear is adjusted in combination with the business pressure. When the business pressure is high, the interval time of the top 30% of the compression tiers is reduced to generate a rewrite time tier table adapted to the real-time scenario; the business pressure includes IOPS high and low and latency data.

6. The differential management method for SSD caching as described in claim 1, characterized in that, The step of generating a differentiated flushing strategy based on the rewrite time tier table and real-time business parameters, and processing the data in the SSD cache according to the flushing strategy, includes: The data in the SSD cache is prioritized according to the rewrite time priority table to obtain real-time business parameters. The business pressure index is calculated based on the real-time business parameters, and the real-time business parameters are monitored during the brushing process. When the business pressure index exceeds the set range, data from the top 30% of the gears are retained; when the business pressure index is within the set range, data from the top 60% of the gears are retained; when the business pressure index does not reach the set range, data from the top 90% of the gears are retained.

7. The differential management method for SSD caching as described in claim 1, characterized in that, The process involves sorting the data in the SSD cache according to the priority in the overwrite time priority table, and if the priorities are the same, sorting them according to the interval between data being overwritten, to generate a data management scheme, including: The data in the SSD cache is sorted according to the rewrite time tier table, and the data in the SSD cache that exceeds the SSD cache flush threshold is marked as a conflict area; For the conflict area, data of the lower priority level is flushed first according to the rewrite time level table. If the priorities are the same, the data is sorted according to the interval between the data to be rewritten, and data with an interval longer than the set value is flushed first.

8. A differential management device for SSD cache, characterized in that, The device includes: The behavior prediction module is used to acquire historical write behavior data to construct a training set, use machine learning algorithms to train a model based on the training set, and combine feature engineering to generate an interval prediction model; the historical write behavior data includes address LBA, data length, and timestamp. The gear segmentation module is used to obtain the predicted rewrite time through the interval prediction model, calculate the rewrite interval based on the predicted rewrite time using statistical methods, and generate a rewrite time gear table by dividing the rewrite interval according to a preset number of gears. The differential refresh module is used to generate a differential refresh strategy based on the rewrite time tier table and real-time business parameters when the SSD cache utilization reaches a set threshold, and to process the data in the SSD cache according to the refresh strategy; the business parameters include IOPS and latency data. The dynamic refresh module is used to sort the data in the SSD cache according to the priority in the overwrite time tier table when the SSD cache space is insufficient. If the priorities are the same, the data is sorted according to the interval between when the data is about to be overwritten, and a data management scheme is generated.

9. An electronic device, characterized in that, include: At least one processor and at least one memory, wherein, The memory stores computer-readable instructions; The computer-readable instructions are executed by one or more of the processors, causing the electronic device to implement the differential management method of SSD cache as described in any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that, The computer-readable instructions are executed by one or more processors to implement the differential management method for SSD cache as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Duplication decision-making method and device, readable storage medium and electronic equipment

    CN120428925A

  • Method and apparatus for predicting service life of solid-state disk, and computer-readable storage medium

    WO2022037169A1