Garbage recycling system based on genetic algorithm

Through the garbage collection system based on genetic algorithm, the problem of traditional garbage collection methods being difficult to take into account write amplification, block efficiency and wear balance in diverse user scenarios is solved, and high robustness and long-term stability in complex load scenarios are achieved, forming an adaptive multi-objective optimization strategy.

CN120371205AActive Publication Date: 2025-07-25MIANCUN (ZHEJIANG) TECH CO LTD

Patent Information

Application Number
CN202510401646.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-25
Estimated Expiration
2045-04-01

AI Technical Summary

Technical Problem

When traditional garbage collection methods face dynamic load changes in diverse user scenarios, it is difficult to take into account both the write amplification coefficient, block efficiency and wear balance, especially in mixed hot and cold data scenarios, and cannot achieve multi-objective optimization.

Method used

A garbage collection system based on genetic algorithm is adopted, including an environment perception module, a dynamic excitation pool module, a gene coding module, a genetic computing module, a strategy evaluation module, a hot and cold data verification bridge module and a wear equalization compensator. Through dynamic parameter optimization and multi-scene adaptation mechanism, the genetic algorithm is used to automatically search for the optimal strategy parameter combination, and dynamically adjust sample weights and polynomial variations are combined with the entropy weight method to introduce controllable perturbation to achieve multi-objective balance of write amplification, block efficiency and wear equalization.

Benefits of technology

Maintain high robustness and long-term stability in complex load scenarios, realize multi-objective balance between write amplification and block efficiency, predict data state migration trends through hot and cold data verification bridge and wear equalization compensator modules and actively correct parameter deviations, forming a closed-loop adaptive garbage collection strategy generation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371205A_ABST
    Figure CN120371205A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of storage garbage recycling algorithms, in particular to a garbage recycling system based on a genetic algorithm, which comprises an environment sensing module, a dynamic excitation pool module, a gene coding module, a genetic operation module, a strategy evaluation module, a cold and hot data verification bridge module, a wear leveling compensator and an iterative deployment module. The environment sensing module is used for scene feature extraction and load mode classification. Through dynamic parameter optimization and a multi-scene adaptation mechanism, an optimal strategy parameter combination is automatically searched by utilizing a genetic algorithm, and controllable disturbance is introduced by dynamically adjusting sample weight and polynomial variation in combination with an entropy weight method, so that multi-target balance of write amplification, block efficiency and wear balance is realized; meanwhile, through a cold and hot data verification bridge and a wear leveling compensator module, the data state transition trend is predicted, parameter deviation is actively corrected, high robustness and long-term stability can still be kept in a complex load scene, and finally a closed-loop self-adaptive garbage collection strategy generation system is formed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage garbage collection algorithms, and specifically to a garbage collection system based on a genetic algorithm. Background Technique

[0002] The garbage collection system is a key mechanism in storage devices for automatically reclaiming the space occupied by invalid data and improving storage efficiency. Its core task is to release available storage space and optimize device performance by selecting source blocks to be reclaimed, migrating valid data, and erasing invalid data.

[0003] Generally, traditional garbage collection methods usually adopt fixed strategies such as FIFO and greedy algorithms to select source blocks, and make decisions based on single indicators such as the proportion of invalid data or wear leveling. The fixed strategies cannot adapt to the dynamic load changes of diverse user scenarios, which may lead to too high a write amplification factor, low block efficiency, and long-term wear imbalance. Especially in the scenario of mixed hot and cold data, they perform rigidly and are difficult to balance multiple objectives for optimization.

[0004] Based on this, the present invention provides a garbage collection system based on a genetic algorithm to solve the above-mentioned technical problems. Summary of the Invention

[0005] The purpose of the present invention is to provide a garbage collection system based on a genetic algorithm to solve the problems mentioned in the background technique.

[0006] To achieve the above purpose, the present invention provides the following technical solutions:

[0007] The present invention proposes a garbage collection system based on a genetic algorithm, including an environmental perception module, a dynamic incentive pool module, a gene coding module, a genetic operation module, a strategy evaluation module, a hot and cold data verification bridge module, a wear leveling compensator, and an iterative deployment module. The environmental perception module is used for scenario feature extraction and load pattern classification. The dynamic incentive pool module is used for dynamic management and weight allocation of incentive samples. The gene coding module is used for parameter discretization and gene sequence reconstruction. The genetic operation module is used for elite retention, gene recombination, and mutation injection. The strategy evaluation module is used for calculating the write amplification factor and evaluating the efficiency of source blocks. The hot and cold data verification bridge module is used for data state simulation and strategy stability detection. The wear leveling compensator is used for wear prediction and deviation compensation. The iterative deployment module is used for convergence determination and parameter solidification.

[0008] Preferably, the environmental perception module further includes a scenario feature extraction unit and a load pattern classification unit;

[0009] The scene feature extraction unit extracts features of the I / O load, write frequency, and data survival period of the user scene through a time series decomposition algorithm for constructing a dynamic excitation sample pool;

[0010] The load pattern classification unit classifies the extracted scene features through a spectral clustering algorithm to form excitation labels of different load patterns, providing an input basis for policy adaptation.

[0011] Preferably, the dynamic excitation pool module further includes an excitation sample dynamic management unit and a weight assignment unit;

[0012] The excitation sample dynamic management unit dynamically classifies and stores real-time user scene data through an online clustering algorithm to ensure the diversity and timeliness of the excitation sample pool;

[0013] The weight assignment unit dynamically adjusts the weights of different excitation samples based on the entropy weight method to ensure that high-frequency scene data occupies a higher priority in genetic iteration;

[0014] The weight assignment of the dynamic excitation pool module is realized through the entropy weight method, and its steps are as follows:

[0015] Normalize the n-dimensional feature matrix of m excitation samples, as shown in Equation (1):

[0016]

[0017] In the formula, x ij is the j-th eigenvalue of the i-th sample, and p ij is the normalization result. Calculate the information entropy, as shown in Equation (2):

[0018]

[0019] When p ij = 0, define p ij ln p ij = 0. The dynamic weight assignment is shown in Equation (3):

[0020]

[0021] In the formula, w j is the weight of the j-th feature, and the smaller the entropy value E j , the greater the weight.

[0022] Preferably, the gene coding module further includes a parameter discretization unit and a gene sequence reconstruction unit;

[0023] The parameter discretization unit discretizes the continuous GC policy parameters into finite candidate values through a uniform sampling algorithm, reducing the search space. The continuous parameter x ∈ [a, b] is discretized by uniform sampling to generate N candidate values, as shown in Equation (4):

[0024]

[0025] where x i is the candidate value of the discretized parameter, Δ is the sampling step size, and N is the preset discretization granularity. After discretization, the total search space reduces from to

[0026] The gene sequence reconstruction unit converts the discrete parameter combination into a gene sequence using the Gray code encoding method to avoid fitness oscillations caused by mutations in adjacent parameter values.

[0027] Preferably, the genetic operation module further includes an elite retention unit, a gene recombination unit, and a mutation injection unit;

[0028] The elite retention unit screens the top 10% of the policy parameter combinations with the highest fitness through the tournament selection algorithm and directly retains them in the next generation population;

[0029] The gene recombination unit mixes the parental gene sequences using the simulated binary crossover algorithm to generate offspring parameter combinations, balancing global search and local convergence;

[0030] The mutation injection unit randomly adjusts specific parameter positions in the gene sequence based on polynomial mutation to introduce controllable perturbations to jump out of the local optimal solution. The k-th parameter x in the gene sequence is mutated through the polynomial as follows: x ∈ l k , u k , and the mutation perturbation factor is calculated as shown in Equation (5): k where u ∼ U(0, 1) is a uniformly distributed random number, η

[0031]

[0032] m is the mutation distribution index that controls the perturbation amplitude η m = 20, is the normalized parameter position, and the new parameter value is generated as shown in Equation (6):

[0033] x' k = x k + δ q · (u k - l k ) (6);

[0034] The constraint is x' kIf it exceeds the boundary, truncate it to the interval [l k , u k .

[0035] Preferably, the policy evaluation module further includes a write amplification calculation unit and a block efficiency evaluation unit;

[0036] The write amplification calculation unit calculates the write amplification coefficient by tracking the ratio of the actual written data volume to the user request volume in real time through the physical page mapping tracking algorithm;

[0037] The block efficiency evaluation unit quantifies the recycling efficiency by statistically analyzing the proportion of valid data in the recycled source block based on the invalid data marking detection algorithm.

[0038] Preferably, the hot and cold data verification bridge module further includes a data state simulation unit and a policy stability detection unit;

[0039] The data state simulation unit verifies the adaptability of the policy to the dynamic changes of data by predicting the state transition probability of the hot and cold data distribution under different GC policies through the hidden Markov chain;

[0040] The policy stability detection unit uses Monte Carlo simulation to randomly generate extreme hot and cold data ratio scenarios to test the robustness of the current optimal policy.

[0041] Preferably, the wear leveling compensator further includes a wear prediction unit and a deviation compensation unit;

[0042] The wear prediction unit predicts the long-term impact of the policy on the overall wear leveling by modeling the relationship between the source block wear value and parameter adjustment through a backpropagation neural network;

[0043] The deviation compensation unit dynamically corrects the wear difference parameter in the gene encoding based on the gradient descent algorithm to suppress the risk of local over-wear. For gradient descent correction, define the loss function as shown in Equation (7):

[0044]

[0045] In the formula, is the wear value of the i-th source block predicted by BPNN, W min is the minimum wear value of the whole disk, M is the total number of source blocks, calculate the gradient and correct the wear difference parameter ΔW, as shown in Equation (8):

[0046]

[0047] In the formula, α is the learning rate of 0.01, is calculated by the backpropagation chain rule of BPNN.

[0048] Preferably, the iterative deployment module further includes a convergence determination unit and a parameter solidification unit;

[0049] The convergence determination unit uses the Kolmogorov-Smirnov test to compare the fitness distribution differences of multiple generations of populations to determine the convergence state of the algorithm;

[0050] The parameter solidification unit converts the optimal gene sequence into executable GC strategy configuration parameters through the gene decoding mapping table, and deploys them to the storage device controller.

[0051] Compared with the prior art, the beneficial effects of the present invention are as follows: the garbage collection system based on the genetic algorithm of the present invention uses dynamic parameter optimization and multi-scenario adaptation mechanism, uses the genetic algorithm to automatically search for the optimal strategy parameter combination, combines the entropy weight method to dynamically adjust the sample weight and polynomial mutation to introduce controllable disturbances, and achieves a multi-objective balance of write amplification, block efficiency and wear leveling. At the same time, through the hot and cold data verification bridge and wear leveling compensator module, it predicts the data state migration trend and actively corrects parameter deviations. It can still maintain high robustness and long-term stability under complex load scenarios, and finally forms a closed-loop adaptive garbage collection strategy generation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 The topology diagram of the garbage collection system based on the genetic algorithm of the present invention is shown;

[0053] Figure 2 The flowchart of the garbage collection method based on genetic algorithm of the present invention is shown. DETAILED DESCRIPTION

[0054] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0055] Example 1, please refer to Figure 1, the present invention proposes a garbage collection system based on genetic algorithm, including an environmental perception module, a dynamic incentive pool module, a gene coding module, a genetic operation module, a strategy evaluation module, a cold and hot data verification bridge module, a wear leveling compensator, and an iterative deployment module. The environmental perception module is used for scene feature extraction and load pattern classification. The dynamic incentive pool module is used for dynamic management and weight allocation of incentive samples. The gene coding module is used for parameter discretization and gene sequence reconstruction. The genetic operation module is used for elite retention, gene recombination, and mutation injection. The strategy evaluation module is used for calculating the write amplification factor and evaluating the efficiency of source blocks. The cold and hot data verification bridge module is used for data state simulation and strategy stability detection. The wear leveling compensator is used for wear prediction and deviation compensation. The iterative deployment module is used for convergence determination and parameter solidification.

[0056] In this embodiment, it should also be noted that the environmental perception module further includes a scene feature extraction unit and a load pattern classification unit;

[0057] Furthermore, the scene feature extraction unit extracts features of the I / O load, write frequency, and data survival period of the user scene through a time series decomposition algorithm for constructing a dynamic incentive sample pool;

[0058] Furthermore, the load pattern classification unit classifies the extracted scene features through a spectral clustering algorithm to form incentive labels of different load patterns, providing an input basis for policy adaptation.

[0059] In this embodiment, it should also be noted that the dynamic incentive pool module further includes an incentive sample dynamic management unit and a weight allocation unit;

[0060] Furthermore, the incentive sample dynamic management unit dynamically classifies and stores the real-time user scene data through an online clustering algorithm to ensure the diversity and timeliness of the incentive sample pool;

[0061] Furthermore, the weight allocation unit dynamically adjusts the weights of different incentive samples based on the entropy weight method to ensure that high-frequency scene data occupies a higher priority in genetic iteration;

[0062] Furthermore, the weight allocation of the dynamic incentive pool module is implemented through the entropy weight method, and its steps are as follows:

[0063] Normalize the n-dimensional feature matrix of m incentive samples, as shown in Equation (1):

[0064]

[0065] In the formula, x ij is the j-th feature value of the i-th sample, and p ij is the normalization result. Calculate the information entropy, as shown in Equation (2):

[0066]

[0067] When p ij = 0, define p ij ln p ij = 0, and the dynamic weight allocation is shown in Equation (3):

[0068]

[0069] where w j is the weight of the J-th feature, and the smaller the entropy value E j , the larger the weight.

[0070] In this embodiment, it should also be noted that the gene coding module further includes a parameter discretization unit and a gene sequence reconstruction unit;

[0071] Furthermore, the parameter discretization unit discretizes the continuous GC strategy parameters into finite candidate values through a uniform sampling algorithm, reducing the search space. The continuous parameter x ∈ [a, b] is discretized by uniform sampling to generate N candidate values, as shown in Equation (4):

[0072]

[0073] where x i is the candidate value of the discretized parameter, Δ is the sampling step, N is the preset discretization granularity, and the total search space after discretization decreases from to

[0074] Furthermore, the gene sequence reconstruction unit converts the discrete parameter combination into a gene sequence using the Gray code encoding method to avoid fitness oscillation caused by mutation of adjacent parameter values.

[0075] In this embodiment, it should also be noted that the genetic operation module further includes an elite retention unit, a gene recombination unit, and a mutation injection unit;

[0076] Furthermore, the elite retention unit screens the top 10% of the strategy parameter combinations with the highest fitness through the tournament selection algorithm and directly retains them in the next-generation population;

[0077] Furthermore, the gene recombination unit mixes the parental gene sequences using the simulated binary crossover algorithm to generate offspring parameter combinations, balancing global search and local convergence;

[0078] Furthermore, the mutation injection unit randomly adjusts specific parameter positions in the gene sequence based on polynomial mutation to introduce controllable perturbations to jump out of the local optimal solution. For the k-th parameter x k ∈ [l k , uk Perform mutation, calculate the mutation perturbation factor, see Equation (5):

[0079]

[0080] In the formula, u~U(0,1) is a uniformly distributed random number, η m is the mutation distribution index, which controls the perturbation amplitude η m = 20, is the position of the normalization parameter, generate a new parameter value, see Equation (6):

[0081] x′ k = x k +δ q ·(u k -l k ) (6);

[0082] The constraint is that if x′ k exceeds the boundary, it is truncated to the interval [l k ,u k .

[0083] In this embodiment, it should also be noted that the policy evaluation module further includes a write amplification calculation unit and a block efficiency evaluation unit;

[0084] Furthermore, the write amplification calculation unit calculates the write amplification coefficient by tracking the ratio of the actual written data volume to the user request volume in real time through the physical page mapping tracking algorithm;

[0085] Furthermore, the block efficiency evaluation unit quantifies the recycling efficiency by statistically calculating the proportion of valid data in the recycled source block based on the invalid data marking detection algorithm.

[0086] In this embodiment, it should also be noted that the hot and cold data verification bridge module further includes a data state simulation unit and a policy stability detection unit;

[0087] Furthermore, the data state simulation unit verifies the adaptability of the policy to data dynamic changes by predicting the state transition probability of the hot and cold data distribution under different GC policies through the hidden Markov chain;

[0088] Furthermore, the policy stability detection unit tests the robustness of the current optimal policy by randomly generating extreme hot and cold data ratio scenarios using Monte Carlo simulation.

[0089] In this embodiment, it should also be noted that the wear leveling compensator further includes a wear prediction unit and a deviation compensation unit;

[0090] Furthermore, the wear prediction unit predicts the long-term impact of the policy on the overall wear leveling by modeling the relationship between the source block wear value and parameter adjustment through the backpropagation neural network;

[0091] Furthermore, the deviation compensation unit dynamically corrects the wear difference parameter in the gene encoding based on the gradient descent algorithm to suppress the risk of local over-wear, and defines the loss function by gradient descent correction, as shown in formula (7):

[0092]

[0093] In the formula, is the wear value of the i-th source block predicted by BPNN, W min is the minimum wear value of the entire disk, M is the total number of source blocks, the gradient is calculated and the wear difference parameter ΔW is corrected, see formula (8):

[0094]

[0095] In the formula, α is the learning rate 0.01, Calculated by BPNN back-propagation chain rule.

[0096] In this embodiment, it should also be noted that the iterative deployment module also includes a convergence determination unit and a parameter solidification unit;

[0097] Furthermore, the convergence determination unit uses the Kolmogorov-Smirnov test to compare the differences in fitness distribution of multiple generations of populations and determine the convergence state of the algorithm;

[0098] Furthermore, the parameter solidification unit converts the optimal gene sequence into executable GC policy configuration parameters through the gene decoding mapping table and deploys them to the storage device controller.

[0099] Example 2, please refer to Figure 2 In practical applications, the method based on the above system specifically includes the following steps:

[0100] S1. User scenario feature extraction and load classification:

[0101] S1.1. Data collection and preprocessing:

[0102] Real-time data collection, continuously obtaining raw data such as I / O load logs, write operation frequency, and data block life cycle from storage devices;

[0103] Data cleaning, eliminating outliers and invalid records to ensure data quality;

[0104] Time alignment: aligning data of different time granularities into fixed time windows (e.g., one window every 5 minutes) to facilitate subsequent analysis;

[0105] S1.2. Feature extraction and decomposition:

[0106] Time series decomposition, using the STL algorithm to decompose I / O load data, separating out the periodic (daily peak), trend (long-term growth), and residual (random fluctuations) components;

[0107] Key metric calculation:

[0108] Write frequency density, the number of write requests per unit time;

[0109] Data survival rate, counting the proportion of data with a survival period exceeding a preset threshold (24 hours);

[0110] S1.3. Load pattern classification:

[0111] Feature vector construction, combining metrics such as the decomposed periodic intensity, trend slope, and write frequency density into a multi-dimensional feature vector;

[0112] Spectral clustering classification:

[0113] Calculate the similarity matrix of the feature vectors, and reduce the dimension through the Laplacian matrix;

[0114] Use K-means to cluster the data after dimensionality reduction to generate load pattern labels ("high write low survival", "periodic fluctuations");

[0115] S2. Dynamic incentive sample pool construction and optimization:

[0116] S2.1. Sample dynamic management:

[0117] Online clustering storage:

[0118] Adopt the CluStream algorithm to process new scenario data in real time, generating micro-clusters to represent the data distribution;

[0119] Merge similar micro-clusters, dynamically adjust the sample pool structure to ensure coverage of the latest scenarios;

[0120] Timeliness maintenance, regularly eliminate old samples that exceed the time threshold (such as 7 days), and retain recent high-frequency scenario data;

[0121] S2.2. Weight dynamic allocation

[0122] Feature normalization, perform min-max normalization on the feature values of each sample in the sample pool to eliminate the dimension difference, and normalize the n-dimensional feature matrix of m incentive samples:

[0123]

[0124] Where, x ij is the jth feature value of the ith sample, p ij is the normalization result;

[0125] Information entropy calculation: Calculate the information entropy of each feature according to the normalization result, and calculate the information entropy:

[0126]

[0127] When p ij = 0, define p ij ln p ij = 0. The lower the entropy value, the higher the discrimination degree of the feature;

[0128] Weight assignment: Assign weights inversely proportional to the entropy value. See the formula for dynamic weight assignment:

[0129]

[0130] In the formula, w j is the weight of the J-th feature. The smaller the entropy value E j , the larger the weight. High-weight features (such as write frequency) dominate subsequent genetic optimization;

[0131] S3. Policy parameter encoding and discretization:

[0132] S3.1. Parameter space compression:

[0133] Continuous parameter discretization:

[0134] Uniformly sample continuous parameters (such as the hot-cold ratio threshold) within the domain of definition. Discretize the continuous GC policy parameters into a finite number of candidate values through the uniform sampling algorithm, reduce the search space, and discretize the continuous parameter x ∈ [a, b] through uniform sampling to generate N candidate values:

[0135]

[0136] In the formula, x i is the candidate value of the discretized parameter, Δ is the sampling step size, and N is the preset discretization granularity. After discretization, the total search space is reduced from to Generate a finite number of candidate values (such as 0.2, 0.4,.., 0.8);

[0137] The discretization granularity is set according to the parameter sensitivity (the granularity of sensitive parameters is finer);

[0138] Candidate value verification: Exclude physically infeasible values (wear difference is negative);

[0139] S3.2. Gene encoding conversion:

[0140] Gray code encoding: Convert the discretized parameter values into a Gray code sequence. For example, the parameter value 0.4 is encoded as "1100";

[0141] Sequence splicing, splicing the Gray codes of all parameters into a complete gene sequence ("1100|1010|..");

[0142] S4. Genetic iterative optimization:

[0143] S4.1. Initial population generation:

[0144] Random sampling, randomly select parameter combinations from the discretized parameter space to form an initial population (100 groups);

[0145] Elite preselection, pre-evaluate the initial population, and retain the top 5% of the strategies with the highest fitness as elite seeds;

[0146] S4.2. Fitness evaluation:

[0147] Simulate the execution of the strategy, simulate the operation of each set of parameters in the virtual storage environment, and record the write amplification factor and the block efficiency;

[0148] Fitness calculation:

[0149] Fitness = α·(1 / WA) + β·BlockEff;

[0150] Calculate the comprehensive score, where WA is the write amplification factor and BlockEff is the block efficiency;

[0151] S4.3. Genetic operations:

[0152] Elite retention, directly copy the top 10% of the individuals with the highest fitness to the next generation;

[0153] Tournament selection, randomly select two groups from the remaining individuals, and retain the one with the higher fitness as the parent;

[0154] Simulated binary crossover (SBX):

[0155] Exchange segments of the parent gene sequences with a certain probability (crossover probability 0.8);

[0156] For example: Parent A "1100|1010" and Parent B "1001|1101" cross to generate offspring "1101|1010";

[0157] Polynomial mutation:

[0158] Randomly select gene positions according to the mutation probability;

[0159] Calculate the perturbation value, mutate the k-th parameter x in the gene sequence through a polynomial k ∈[l k ,u k , and calculate the mutation perturbation factor:

[0160]

[0161] where \(u\sim U(0,1)\) is a uniformly distributed random number, and \(\eta\) m is the mutation distribution exponent, which controls the perturbation amplitude \(\eta\) m \( = 20\), is the position of the normalization parameter, and a new parameter value is generated:

[0162] \(x'\) k \( = x\) k \(+\delta\) q \(\cdot(u\) k \(-l\) k );

[0163] If \(x'\) k is out of bounds, then it is truncated to the interval \([l\) k ,u\) k , and the parameter value is adjusted;

[0164] S5. Policy performance evaluation:

[0165] S5.1. Write amplification factor calculation:

[0166] Track physical pages, and record the actual number of physical pages migrated in each garbage collection operation;

[0167] Statistical user requests, and count the logical write request volume initiated by users within the same time period: \(WA=\text{actual write volume} / \text{user request volume}\), the smaller the value, the better the policy;

[0168] S5.2. Block efficiency evaluation:

[0169] Mark invalid data, scan the source block before recycling, and mark the data pages that have been logically deleted;

[0170] Efficiency calculation, \(BlockEff=\text{number of valid pages} / \text{total number of pages}\), the higher the value, the lower the recycling cost;

[0171] S6. Cold and hot data adaptability verification:

[0172] S6.1. Cold and hot state modeling:

[0173] Hidden Markov chain (HMM) training:

[0174] Define the hidden states as "cold data", "warm data", and "hot data";

[0175] Learn the state transition probability matrix based on historical data;

[0176] Dynamic prediction, input the current data distribution, and predict the change in the cold and hot ratios after the next \(N\) operations;

[0177] S6.2. Extreme scenario testing:

[0178] Monte Carlo simulation to randomly generate extreme scenarios with 90% cold data or 80% hot data;

[0179] Policy stability verification: Run the current optimal policy in the simulation environment and observe whether the write amplification and block efficiency deteriorate significantly;

[0180] S7. Wear leveling correction:

[0181] S7.1. Construction of wear prediction model:

[0182] Neural network training: Input policy parameters and historical wear data, and output the predicted wear values of each source block in the future cycle;

[0183] Model verification: Ensure that the prediction error is lower than the threshold through cross-validation;

[0184] S7.2. Dynamic parameter correction:

[0185] Calculation of loss function: Dynamically correct the wear difference parameter in the gene encoding based on the gradient descent algorithm to suppress the risk of local overwear. Gradient descent correction, define the loss function:

[0186]

[0187] In the formula, is the wear value of the i-th source block predicted by BPNN, W min is the minimum wear value of the whole disk, M is the total number of source blocks, and calculate the mean square error between the predicted wear and the ideal minimum value;

[0188] Gradient descent optimization: Calculate the gradient and correct the wear difference parameter ΔW:

[0189]

[0190] In the formula, α is the learning rate of 0.01, Calculate through the backpropagation chain rule of BPNN, adjust the wear difference parameter by backpropagation, and gradually reduce the wear difference of the whole disk;

[0191] S8. Convergence determination and policy deployment:

[0192] S8.1. Convergence detection:

[0193] Fitness distribution comparison: Take the fitness distributions of the nearest 10 generations of populations and judge whether they are stable through the K-S test (p value > 0.05);

[0194] Early stopping mechanism: If the fitness change rate of three consecutive generations < 1%, terminate the iteration in advance;

[0195] S8.2. Policy parameter solidification:

[0196] Gene decoding, converting the optimal gene sequence into actual parameter values according to the Gray code rule;

[0197] Parameter verification, verifying whether the decoded parameters are consistent with the simulation results in the test environment;

[0198] Controller deployment, writing the final parameters into the storage device firmware and enabling a new garbage collection policy.

[0199] In summary, through the dynamic parameter optimization and multi-scenario adaptation mechanism, using the genetic algorithm to automatically search for the optimal policy parameter combination, combining the entropy weight method to dynamically adjust the sample weights and polynomial mutation to introduce controllable perturbations, achieving the multi-objective balance of write amplification, block efficiency, and wear leveling. At the same time, through the cold and hot data verification bridge and wear leveling compensator module, predicting the data state migration trend and actively correcting the parameter deviation, still maintaining high robustness and long-term stability in complex load scenarios, and finally forming a closed-loop adaptive garbage collection policy generation system.

[0200] In the description of this specification, the descriptions referring to terms such as "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0201] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art in the relevant technical field can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A garbage collection system based on a genetic algorithm, characterized in that, It includes an environmental perception module, a dynamic incentive pool module, a gene coding module, a genetic operation module, a strategy evaluation module, a cold and hot data verification bridge module, a wear leveling compensator, and an iterative deployment module. The environmental perception module is used for scene feature extraction and load pattern classification. The dynamic incentive pool module is used for dynamic management and weight allocation of incentive samples. The gene coding module is used for parameter discretization and gene sequence reconstruction. The genetic operation module is used for elite retention, gene recombination, and mutation injection. The strategy evaluation module is used for calculating the write amplification factor and evaluating the source block efficiency. The cold and hot data verification bridge module is used for data state simulation and strategy stability detection. The wear leveling compensator is used for wear prediction and deviation compensation. The iterative deployment module is used for convergence determination and parameter solidification.

2. The garbage collection system based on a genetic algorithm according to claim 1, characterized in that The environmental perception module further includes a scene feature extraction unit and a load pattern classification unit; The scene feature extraction unit extracts features from the I / O load, write frequency, and data survival period of the user scene, and is used to construct a dynamic incentive sample pool; The load pattern classification unit classifies the extracted scene features to form incentive labels for different load patterns, providing an input basis for policy adaptation.

3. The garbage collection system based on genetic algorithm according to claim 2, wherein The dynamic incentive pool module further includes a dynamic management unit for incentive samples and a weight allocation unit; The dynamic management unit for incentive samples is used for dynamic classification storage of real-time user scene data; The weight allocation unit is used for dynamically adjusting the weights of different incentive samples; The weight allocation of the dynamic incentive pool module is implemented by the entropy weight method, and its steps are as follows: Normalize the n-dimensional feature matrix of m incentive samples, as shown in Equation (1): where x ij is the top eigenvalue of the i-th sample, and p ij is the normalization result. Calculate the information entropy as shown in Equation (2): When p ij = 0, define p ij ln p ij = 0, and the dynamic weight allocation is shown in Equation (3): where w j is the weight of the J-th feature, and the smaller the entropy value E j , the larger the weight.

4. The garbage collection system based on genetic algorithm according to claim 3, characterized in that, The gene coding module further includes a parameter discretization unit and a gene sequence reconstruction unit; The parameter discretization unit discretizes the continuous GC policy parameters into finite candidate values through a uniform sampling algorithm, reducing the search space. The continuous parameter x∈[a,b] is discretized by uniform sampling to generate N candidate values, as shown in Equation (4): where x i is the candidate value of the parameter after discretization, Δ is the sampling step size, and N is the preset discretization granularity. After discretization, the total search space decreases from to The gene sequence reconstruction unit converts the discrete parameter combination into a gene sequence using the Gray code encoding method.

5. The garbage collection system based on a genetic algorithm according to claim 4, characterized in that, The genetic operation module further includes an elite retention unit, a gene recombination unit, and a mutation injection unit; The elite retention unit screens the top 10% of the policy parameter combinations with fitness through the tournament selection algorithm and directly retains them in the next generation population; The gene recombination unit mixes the parental gene sequences using the simulated binary crossover algorithm to generate offspring parameter combinations; The mutation injection unit randomly adjusts specific parameter bits in the gene sequence based on polynomial mutation, introduces controllable perturbations to jump out of the local optimal solution, and uses a polynomial to mutate the k-th parameter x in the gene sequence k ∈[l k ,u k , calculates the mutation perturbation factor, as shown in Equation (5): where \(u\sim U(0,1)\) is a uniformly distributed random number, and \(\eta\) m is the mutation distribution index that controls the perturbation amplitude \(\eta\) m \( = 20\), is the position of the normalization parameter to generate a new parameter value, see Equation (6): x′ k = x k + δ q ·(u k - l k ) (6); Constrained to x' k If out of bounds, truncate to the interval [l k , u k .

6. The garbage collection system based on genetic algorithm according to claim 5, characterized in that, The strategy evaluation module further includes a write amplification calculation unit and a block efficiency evaluation unit; The write amplification calculation unit calculates the write amplification factor by tracking the ratio of the actual written data volume to the user request volume in real time through the physical page mapping tracking algorithm; The block efficiency evaluation unit quantifies the recovery efficiency by statistically calculating the proportion of valid data in the recycled source blocks based on the invalid data marking detection algorithm.

7. The garbage collection system based on a genetic algorithm according to claim 6, characterized in that, The cold and hot data verification bridge module further includes a data state simulation unit and a strategy stability detection unit; The data state simulation unit predicts the state transition probability of hot and cold data distribution under different GC strategies through hidden Markov chains, and verifies the adaptability of the strategy to dynamic changes in data; The strategy stability detection unit uses Monte Carlo simulation to randomly generate extreme cold and hot data ratio scenarios to test the robustness of the current optimal strategy.

8. A garbage collection system based on a genetic algorithm according to claim 7, characterized in that, The wear leveling compensator also includes a wear prediction unit and a deviation compensation unit; The wear prediction unit models the relationship between source block wear value and parameter adjustment through a back-propagation neural network, and predicts the long-term impact of the strategy on the overall disk wear balance; The deviation compensation unit dynamically corrects the wear difference parameter in the gene encoding based on the gradient descent algorithm, suppresses the risk of local over-wear, and defines the loss function based on the gradient descent correction, as shown in formula (7): In the formula, is the wear value of the i-th source block predicted by BPNN, and W min is the minimum wear value of the whole disk, M is the total number of source blocks, calculate the gradient and correct the wear difference parameter ΔW, see Equation (8): where α is the learning rate of 0.01, Calculated by the BPNN backpropagation chain rule.

9. A garbage collection system based on a genetic algorithm according to claim 8, characterized in that, The iterative deployment module also includes a convergence determination unit and a parameter solidification unit; The convergence determination unit uses the Kolmogorov-Smirnov test to compare the fitness distribution differences of multiple generations of populations to determine the convergence state of the algorithm; The parameter solidification unit converts the optimal gene sequence into executable GC strategy configuration parameters through the gene decoding mapping table, and deploys them to the storage device controller.

Citation Information

Patent Citations

  • Data center object storage method and system based on genetic algorithm

    CN113268376A

  • Sequence alignment with memory array

    CN117690490A

  • Optimization of flash storage

    US10481992B1

  • Operation method of memory controller, memory controller and memory system

    US20250068356A1

Cited By

  • Genetic algorithm-based polycaprolactone polyol synthesis path optimization method

    CN120808929A