A garbage collection system based on genetic algorithm
By using a garbage collection system based on genetic algorithms to dynamically optimize parameters and adapt to multiple scenarios, the system solves the problem of low performance of traditional garbage collection methods in mixed hot and cold data scenarios. It achieves a multi-objective balance between write amplification and wear leveling, thereby improving the robustness and stability of storage devices.
Patent Information
- Application Number
- CN202510401646.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-04-01
AI Technical Summary
Traditional garbage collection methods struggle to balance write amplification, block efficiency, and wear leveling in mixed hot and cold data scenarios, resulting in poor and unbalanced performance.
A garbage collection system based on genetic algorithms is adopted, including an environmental perception module, a dynamic excitation pool module, a gene encoding module, a genetic operation module, a strategy evaluation module, a cold and hot data verification bridge module, and a wear leveling compensator. Through dynamic parameter optimization and multi-scenario adaptation, a multi-objective balance between write amplification, block efficiency, and wear leveling is achieved.
Maintaining high robustness and long-term stability under complex load scenarios, achieving a multi-objective balance between write amplification and block efficiency, and improving the performance and efficiency of storage devices.
Smart Images

Figure CN120371205B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of garbage collection algorithm, and particularly to a garbage collection system based on genetic algorithm. BACKGROUND
[0002] The garbage collection system is a key mechanism for automatically recycling invalid data occupying space in a storage device to improve storage efficiency, and its core task is to release available storage space and optimize device performance by selecting a source block to be recycled, migrating valid data and erasing invalid data.
[0003] Generally, the traditional garbage collection method usually adopts a fixed strategy of FIFO and greedy algorithm to select a source block, and makes decisions based on a single index of invalid data proportion or wear leveling. The fixed strategy cannot adapt to dynamic load changes of diversified user scenarios, which may lead to high write amplification factor, low block efficiency and long-term uneven wear, especially in mixed hot and cold data scenarios, which is rigid and difficult to balance multiple target optimization.
[0004] Therefore, the present application provides a garbage collection system based on genetic algorithm to solve the above technical problems. SUMMARY
[0005] The present application aims to provide a garbage collection system based on genetic algorithm to solve the problems mentioned in the background.
[0006] To achieve the above-mentioned purpose, the present application provides the following technical scheme:
[0007] The present application provides a garbage collection system based on genetic algorithm, which comprises an environment 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 environment perception module is used for scene feature extraction and load mode classification. The dynamic incentive pool module is used for dynamic management and weight distribution of incentive samples. The gene coding module is used for parameter discretization and gene sequence reconstruction. The genetic operation module is used for elite reservation, gene recombination and mutation injection. The strategy evaluation module is used for calculating write amplification factor and source block efficiency evaluation. 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.
[0008] Preferably, the environment perception module further comprises a scene feature extraction unit and a load mode classification unit.
[0009] The scene feature extraction unit extracts the I / O load, write frequency and data survival period of the user scene through a time series decomposition algorithm, and is used to construct a dynamic incentive sample pool;
[0010] The load mode classification unit classifies the extracted scene features through a spectral clustering algorithm to form incentive labels of different load modes, and provides input basis for strategy adaptation.
[0011] Preferably, the dynamic incentive pool module further comprises an incentive sample dynamic management unit and a weight allocation unit;
[0012] The incentive sample dynamic management unit dynamically classifies and stores real-time user scene data through an online clustering algorithm, ensuring the diversity and timeliness of the incentive sample pool;
[0013] The weight allocation unit dynamically adjusts the weights of different incentive samples based on the entropy weight method, ensuring that high-frequency scene data has a higher priority in genetic iteration;
[0014] The weight allocation of the dynamic incentive pool module is realized by the entropy weight method, and the steps are as follows:
[0015] The n-dimensional feature matrix of m incentive samples is normalized, as shown in equation (1):
[0016]
[0017] In the formula, x ij is the i-th sample of the top feature value, p ij is the standardization result, and the information entropy is calculated, as shown in equation (2):
[0018]
[0019] When p ij = 0, define p ij ln p ij = 0, and the dynamic weight allocation 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 encoding module further comprises a parameter discretization unit and a gene sequence reconstruction unit;
[0023] The parameter discretization unit discretizes the continuous GC strategy parameters into finite candidate values through a uniform sampling algorithm, reduces the search space, and discretizes the continuous parameters x∈[a,b] through uniform sampling to generate N candidate values, as shown in equation (4):
[0024]
[0025] In the formula, 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 is reduced from to
[0026] The gene sequence reconstruction unit converts the discrete parameter combination into a gene sequence in a Gray code encoding manner, avoiding fitness shock caused by sudden changes in adjacent parameter values.
[0027] Preferably, the genetic operation module further comprises an elite reservation unit, a gene recombination unit, and a mutation injection unit.
[0028] The elite reservation unit filters the top 10% of the strategy parameter combination in terms of fitness through a tournament selection algorithm and directly reserves it to the next generation population.
[0029] The gene recombination unit mixes the parent gene sequence using a simulated binary crossover algorithm to generate a child parameter combination, balancing global search and local convergence.
[0030] The mutation injection unit randomly adjusts a specific parameter bit in the gene sequence based on a polynomial mutation, introduces controllable disturbance to jump out of a local optimal solution, and performs mutation on the kth parameter x k ∈l k ,u k ] in the gene sequence through a polynomial, calculates a mutation disturbance factor, as shown in equation (5):
[0031]
[0032] In the formula, u~U(0,1) is a uniformly distributed random number, η m is a mutation distribution index, and η m = 20, is a normalized parameter position, and a 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 the data is out of the range, the data is truncated to the interval [l k , k ].
[0035] Preferably, the policy evaluation module further comprises 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 write data volume to the user request volume through a physical page mapping algorithm in real time.
[0037] The block efficiency evaluation unit quantifies the recovery efficiency by detecting the proportion of valid data in the recovery source block based on an invalid data marking detection algorithm.
[0038] Preferably, the cold and hot data verification bridge module further comprises a data state simulation unit and a policy stability detection unit;
[0039] The data state simulation unit predicts the state transition probability of cold and hot data distribution under different GC policies through a hidden Markov chain, and verifies the adaptability of the policy to data dynamic changes.
[0040] The policy stability detection unit generates extreme cold and hot data proportion scenarios randomly using Monte Carlo simulation to test the robustness of the current optimal policy.
[0041] Preferably, the wear leveling compensator further comprises a wear prediction unit and a bias compensation unit;
[0042] The wear prediction unit models the relationship between source block wear values and parameter adjustments through a backpropagation neural network to predict the long-term impact of the policy on overall disk wear leveling.
[0043] The bias compensation unit dynamically corrects the wear difference parameter in the genetic code based on a gradient descent algorithm to suppress the risk of local over-wear. Gradient descent correction defines 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 entire disk, M is the total number of source blocks, and the gradient is calculated and the wear difference parameter ΔW is corrected as shown in equation (8):
[0046]
[0047] In the formula, α is the learning rate 0.01, The BPNN backpropagation chain rule is used for calculation.
[0048] Preferably, the iterative deployment module further comprises a convergence determination unit and a parameter solidification unit;
[0049] The convergence determination unit determines the convergence state of the algorithm by using Kolmogorov-Smirnov test to compare the difference of fitness distribution of multi-generation populations.
[0050] The parameter solidification unit converts the optimal gene sequence into executable GC strategy configuration parameters through a gene decoding mapping table and deploys them to the storage device controller.
[0051] Compared with the prior art, the beneficial effects of the present application are: the garbage collection system based on genetic algorithm of the present application realizes multi-objective balance of write amplification, block efficiency and wear leveling through dynamic parameter optimization and multi-scene adaptation mechanism, automatically searches for optimal strategy parameter combination using genetic algorithm, dynamically adjusts sample weight using entropy weight method and introduces controllable disturbance using polynomial mutation, predicts data state migration trend and actively corrects parameter deviation through cold and hot data verification bridge and wear leveling compensator module, and still maintains 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 DRAWINGS
[0052] Figure 1 The garbage collection system topology based on genetic algorithm of the present application is shown;
[0053] Figure 2 The garbage collection method flowchart of the present application based on genetic algorithm is shown. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0055] Embodiment 1, please refer to Figure 1The application provides a garbage recycling system based on a genetic algorithm, which comprises an environment sensing 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.
[0056] In the embodiment, it is also necessary to point out that the environment sensing module further comprises a scene feature extraction unit and a load mode classification unit.
[0057] Further, the scene feature extraction unit extracts the I / O load, the write frequency and the data survival period of the user scene through a time series decomposition algorithm, and is used for constructing the dynamic incentive sample pool.
[0058] Further, the load mode classification unit classifies the extracted scene features through a spectral clustering algorithm, forms the incentive labels of different load modes, and provides the input basis for strategy adaptation.
[0059] In the embodiment, it is also necessary to point out that the dynamic incentive pool module further comprises an incentive sample dynamic management unit and a weight distribution unit.
[0060] Further, the incentive sample dynamic management unit dynamically classifies and stores the real-time user scene data through an online clustering algorithm, and ensures the diversity and timeliness of the incentive sample pool.
[0061] Further, the weight distribution unit dynamically adjusts the weights of different incentive samples based on an entropy weight method, and ensures that the high-frequency scene data occupies a higher priority in the genetic iteration.
[0062] Further, the weight distribution of the dynamic incentive pool module is realized through the entropy weight method, and the steps are as follows:
[0063] The n-dimensional feature matrix of m incentive samples is normalized, as shown in formula (1):
[0064]
[0065] In the formula, x ij is the i-th feature value of the sample, p ij is the standardization result, the information entropy is calculated, as shown in formula (2):
[0066]
[0067] when p ij = 0, p ij ln p ij = 0, the dynamic weight distribution is seen in equation (3):
[0068]
[0069] where w j is the weight of the Jth feature, and the smaller the entropy value E j is, the greater the weight is.
[0070] In this embodiment, it is also necessary to point out that the gene coding module further comprises a parameter discretization unit and a gene sequence reconstruction unit;
[0071] Furthermore, the parameter discretization unit discretizes the continuous GC strategy parameters into limited candidate values through a uniform sampling algorithm, reduces the search space, and discretizes the continuous parameters x ∈ [a, b] through uniform sampling to generate N candidate values, as seen in equation (4):
[0072]
[0073] where x i is the discretized parameter candidate value, Δ is the sampling step, and N is the preset discretization granularity. After discretization, the total search space is reduced from to
[0074] Furthermore, the gene sequence reconstruction unit converts the discrete parameter combination into a gene sequence in a Gray code encoding manner, avoiding fitness shock caused by sudden changes in adjacent parameter values.
[0075] In this embodiment, it is also necessary to point out that the genetic operation module further comprises an elite reservation unit, a gene recombination unit, and a mutation injection unit;
[0076] Furthermore, the elite reservation unit filters the top 10% of the strategy parameter combinations in terms of fitness through a tournament selection algorithm and directly reserves them to the next generation population;
[0077] Furthermore, the gene recombination unit mixes the parent gene sequences using a simulated binary crossover algorithm to generate offspring parameter combinations, balancing global search and local convergence;
[0078] Furthermore, the mutation injection unit randomly adjusts a specific parameter bit in the gene sequence based on a polynomial mutation, introduces controllable disturbance to jump out of a local optimal solution, and introduces a controllable disturbance to jump out of a local optimal solution. The polynomial is multiplied by the kth parameter x k ∈ [l k , uk ]mutation, calculate mutation disturbance factor, see formula (5):
[0079]
[0080] In the formula, u ~ U (0, 1) is a uniform distribution random number, η m is the mutation distribution index, control disturbance amplitude η m = 20, is the normalized parameter position, generate new parameter value, see formula (6):
[0081] x′ k = x k + δ q · (u k -l k ) (6);
[0082] The constraint is that x′ k out of bounds, then truncated to the interval [l k , u k ].
[0083] In this embodiment, it also needs to be explained that the policy evaluation module further includes a write amplification calculation unit and a block efficiency evaluation unit;
[0084] Further, the write amplification calculation unit calculates the write amplification coefficient by tracking the ratio of the actual write data volume to the user request volume through a physical page mapping algorithm;
[0085] Further, the block efficiency evaluation unit quantifies the recycling efficiency by detecting the proportion of valid data in the recycling source block based on an invalid data marking detection algorithm.
[0086] In this embodiment, it also needs to be explained that the cold and hot data verification bridge module further includes a data state simulation unit and a policy stability detection unit;
[0087] Further, the data state simulation unit predicts the state transition probability of cold and hot data distribution under different GC policies through a hidden Markov chain, and verifies the adaptability of the policy to data dynamic changes;
[0088] Further, the policy stability detection unit generates extreme cold and hot data proportion scenarios randomly by Monte Carlo simulation, and tests the robustness of the current optimal policy.
[0089] In this embodiment, it also needs to be explained that the wear leveling compensator further includes a wear prediction unit and a bias compensation unit;
[0090] Further, the wear prediction unit models the relationship between the source block wear value and the parameter adjustment through a back propagation neural network, and predicts the long-term impact of the policy on the overall disk wear leveling.
[0091] Further, the deviation compensation unit dynamically corrects the wear difference value parameter in the gene code based on the gradient descent algorithm to suppress the risk of local over-wear. Gradient descent correction defines the loss function, as shown in equation (7):
[0092]
[0093] In the formula, Wi is the i-th source block wear value predicted by BPNN, W min is the minimum wear value of the whole disk, M is the total number of source blocks, and the gradient is calculated and the wear difference value parameter AW is corrected, as shown in equation (8):
[0094]
[0095] In the formula, a is the learning rate 0.01, The chain rule is calculated by BPNN back propagation.
[0096] In this embodiment, it should be further pointed out that the iterative deployment module further includes a convergence determination unit and a parameter solidification unit;
[0097] Further, the convergence determination unit uses the Kolmogorov-Smirnov test to compare the difference between the fitness distributions of multiple generations of populations to determine the convergence state of the algorithm;
[0098] Further, the parameter solidification unit converts the optimal gene sequence into executable GC strategy configuration parameters through a gene decoding mapping table and deploys them to the storage device controller.
[0099] Embodiment 2, please refer to Figure 2 In actual application, based on the method of the above system, specifically, the following steps are included:
[0100] S1. User scenario feature extraction and load classification:
[0101] S1.1. Data acquisition and preprocessing:
[0102] Real-time data collection, continuously acquiring I / O load logs, write operation frequency, data block survival period, and other raw data from the storage device;
[0103] Data cleaning, eliminating outliers and invalid records to ensure data quality;
[0104] Time alignment, aligning data of different time granularities to a fixed time window (such as every 5 minutes), to facilitate subsequent analysis;
[0105] S1.2. Feature extraction and decomposition:
[0106] Time series decomposition, decompose I / O load data using STL algorithm to separate periodic (daily peak), trend (long-term growth) and residual (random fluctuations) components;
[0107] Key indicator calculation:
[0108] Write frequency density, the number of write requests per unit time;
[0109] Data survival rate, statistics of data survival period exceeding the preset threshold (24 hours) proportion;
[0110] S1.3. Load pattern classification:
[0111] Feature vector construction, combine the decomposed periodic intensity, trend slope, write frequency density and other indicators into a multi-dimensional feature vector;
[0112] Spectral clustering classification:
[0113] Calculate the similarity matrix of the feature vector, and reduce the dimension through Laplacian matrix;
[0114] Use K-means to cluster the reduced data and generate load pattern labels ("high write low survival" "periodic fluctuation");
[0115] S2. Dynamic incentive sample pool construction and optimization:
[0116] S2.1. Dynamic management of samples:
[0117] Online clustering storage:
[0118] Use CluStream algorithm to process new scene data in real time and generate micro-cluster (Micro-cluster) to represent data distribution;
[0119] Merge similar micro-clusters, dynamically adjust the sample pool structure, and 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 scene data;
[0121] S2.2. Dynamic weight allocation
[0122] Feature normalization, minimum-maximum normalization of feature values of each sample in the sample pool, eliminate dimension difference, normalize n-dimensional feature matrix of m incentive samples:
[0123]
[0124] Where x ij is the i ij th feature value of the sample, p is the standardization result;
[0125] Information entropy calculation, calculate the information entropy of each feature according to the normalized result, and calculate the information entropy:
[0126]
[0127] When p ij = 0, define p ij ln p ij = 0, and the lower the entropy value, the higher the feature discrimination;
[0128] Weight distribution, the weight is inversely proportional to the entropy value, and the dynamic weight distribution is as follows:
[0129]
[0130] In the formula, w j is the weight of the Jth feature, and the smaller the entropy value E j , the greater the weight, and the high-weight feature (such as write frequency) dominates the subsequent genetic optimization;
[0131] S3. Strategy parameter encoding and discretization:
[0132] S3.1. Parameter space compression:
[0133] Continuous parameter discretization:
[0134] Uniform sampling of continuous parameters (such as cold and hot ratio threshold) in the definition domain, and the continuous GC strategy parameters are discretized into finite candidate values through the uniform sampling algorithm, which reduces the search space. Through uniform sampling, continuous parameters x∈[a,b] are discretized to generate N candidate values:
[0135]
[0136] In the formula, x i is the discretized parameter candidate value, Δ is the sampling step, N is the preset discretization granularity, and the total search space is reduced from to Generate finite candidate values (such as 0.2, 0.4,.., 0.8);
[0137] Discrete granularity is set according to parameter sensitivity (sensitive parameters have finer granularity);
[0138] Candidate value verification, exclude physically infeasible values (negative wear difference);
[0139] S3.2. Gene encoding conversion:
[0140] Gray code encoding, convert discrete parameter values into Gray code sequences, for example: parameter value 0.4 is encoded as “1100”;
[0141] Sequence splicing, concatenate all parameter's Gray code into complete gene sequence ("1100|1010|..");
[0142] S4. Genetic iterative optimization:
[0143] S4.1. Initial population generation:
[0144] Random sampling, randomly select parameter combination from discretized parameter space, form initial population (100 groups);
[0145] Elite pre-selection, pre-evaluate initial population, reserve top 5% of fitness as elite seeds;
[0146] S4.2. Fitness evaluation:
[0147] Simulation execution strategy, simulate running each group of parameters in a virtual storage environment, record write amplification factor and block efficiency;
[0148] Fitness calculation:
[0149] Fitness = a · (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 operation:
[0152] Elite preservation, directly copy the top 10% of individuals in fitness to the next generation;
[0153] Tournament selection, randomly select two groups from the remaining individuals, and reserve the one with higher fitness as the parent;
[0154] Simulated binary crossover (SBX):
[0155] Exchange fragments according to probability for parent gene sequence (crossing 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 position according to mutation probability;
[0159] Calculate the disturbance value, mutate the kth parameter x k ∈[l k ,u k ] in the gene sequence by polynomial, calculate the mutation disturbance factor:
[0160]
[0161] where u ~ U(0, 1) is a uniformly distributed random number, η m is the mutation distribution index, controlling the disturbance amplitude η m = 20, is the normalized parameter position, generating a new parameter value:
[0162] x′ k = x k + δ q · (u k -l k ) ;
[0163] The constraint is that x′ k out of bounds, then truncated to the interval [l k , u k ], adjusting the parameter value;
[0164] S5. Strategy performance evaluation:
[0165] S5.1. Write amplification factor calculation:
[0166] Physical page tracking, recording the actual number of physical pages migrated in each garbage collection operation;
[0167] User request volume statistics, statistics of logical write request volume initiated by users in the same time period: WA = actual write volume / user request volume, the smaller the value, the better the strategy;
[0168] S5.2. Block efficiency evaluation:
[0169] Invalid data marking, scanning the source block before recovery, marking the data pages that have been logically deleted;
[0170] Efficiency calculation, BlockEff = valid page number / total page number, the higher the value, the lower the recovery 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 hidden states as "cold data", "warm data", and "hot data";
[0175] Learn the state transition probability matrix according to historical data;
[0176] Dynamic prediction, input current data distribution, predict the change of cold and hot ratio after N times of operation;
[0177] S6.2. Extreme scenario test:
[0178] Monte Carlo simulation, randomly generate extreme scenarios with 90% cold data or 80% hot data;
[0179] Policy stability verification, run the current optimal strategy in the simulation environment, and observe whether the write amplification and block efficiency are significantly deteriorated;
[0180] S7. Wear leveling correction:
[0181] S7.1. Wear prediction model construction:
[0182] Neural network training: input strategy parameters, historical wear data, output predicted wear values of each source block in the future period;
[0183] Model verification, ensure that the prediction error is lower than the threshold through cross-validation;
[0184] S7.2. Dynamic parameter correction:
[0185] Loss function calculation, based on gradient descent algorithm to dynamically correct wear difference parameters in gene encoding, inhibit local over-wear risk, gradient descent correction, define loss function:
[0186]
[0187] where, is the predicted wear value of the ith source block by BPNN, W min is the minimum wear value of the whole disk, M is the total number of source blocks, and the mean square error of the predicted wear and the ideal minimum value is calculated;
[0188] Gradient descent optimization, calculate the gradient and correct the wear difference parameter ΔW:
[0189]
[0190] where, α is the learning rate 0.01, Calculate by BPNN backpropagation chain rule, adjust wear difference parameters through backpropagation, gradually reduce the wear difference of the whole disk;
[0191] S8. Convergence determination and strategy deployment:
[0192] S8.1. Convergence detection:
[0193] Fitness distribution comparison, take the fitness distribution of the last 10 generations of population, and judge whether it is stable (p value> 0.05) through K-S test;
[0194] Early stopping mechanism, if the fitness change rate is less than 1% for 3 consecutive generations, terminate the iteration in advance;
[0195] S8.2. Strategy parameter solidification:
[0196] Gene decoding, converting the optimal gene sequence into actual parameter values according to Gray code rules;
[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 to enable the new garbage collection strategy.
[0199] In summary, through dynamic parameter optimization and multi-scenario adaptation mechanism, the genetic algorithm is used to automatically search for the optimal strategy parameter combination, the entropy weight method is used to dynamically adjust the sample weight, and the polynomial mutation is used to introduce controllable disturbance, to realize 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 the wear leveling compensator module, the data state migration trend is predicted and the parameter deviation is actively corrected, which can still maintain high robustness and long-term stability under complex load scenarios, and finally form a closed-loop adaptive garbage collection strategy generation system.
[0200] In the description of the present specification, the description of the terms "one embodiment", "example", "specific example" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0201] The preferred embodiments of the application disclosed above are only used to help explain the application. The preferred embodiments do not describe all the details and do not limit the application to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the present specification. The present specification selects and describes these embodiments in order to better explain the principles and practical applications of the application, so that those skilled in the art can well understand and utilize the application. The application is limited only by the claims and their entire scope and equivalents.
Claims
1. A garbage collection system based on genetic algorithm, characterized by, The environment perception module, the dynamic incentive pool module, the gene coding module, the genetic operation module, the strategy evaluation module, the cold and hot data verification bridge module, the wear leveling compensator, and the iterative deployment module are included. The genetic operation module further includes an elite reservation unit, a gene recombination unit, and a mutation injection unit. The elite reservation unit filters the top 10% of strategy parameter combinations in terms of fitness through a tournament selection algorithm and directly reserves them to the next generation population. The gene recombination unit mixes parent gene sequences using a simulated binary crossover algorithm to generate offspring parameter combinations. The mutation injection unit randomly adjusts a specific parameter bit in the gene sequence based on a polynomial mutation, introduces controllable disturbance to jump out of a local optimal solution, and calculates a variation disturbance factor through a polynomial on the kth parameter in the gene sequence Variation is performed, and a variation disturbance factor is calculated, as shown in formula (5): (5); wherein is a uniformly distributed random number, is a mutation distribution exponent, controlling the perturbation amplitude , is a normalized parameter position, generating a new parameter value, see equation (6): (6); The constraint is If the value is out of bounds, it is truncated to the interval .
2. The garbage collection system based on genetic algorithm as claimed in claim 1 wherein, The environment perception module further includes a scene feature extraction unit and a load pattern classification unit. The scene feature extraction unit extracts features such as I / O load, write frequency, and data survival period of user scenarios 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 input basis for strategy adaptation.
3. The garbage collection system based on genetic algorithm as claimed in claim 2 wherein, The dynamic incentive pool module further includes an incentive sample dynamic management unit and a weight allocation unit. The incentive sample dynamic management unit is used for dynamic classification and storage of real-time user scenario 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 achieved through the entropy weight method, and the steps are as follows: The m excitation samples are normalized with respect to the m eigenvalues of the m x m excitation matrix, see equation (1): The m x m excitation matrix is normalized with respect to the m eigenvalues of the m x m excitation matrix, see equation (1): (1); In the formula, is the i-th feature value of the top, is the normalized result, and the information entropy is calculated, as shown in formula (2): (2); When , define , the dynamic weight distribution formula (3): (3); wherein is the weight of the Jth feature, and the entropy value The smaller the value, the greater the weight.
4. The garbage collection system based on genetic algorithm as claimed in claim 3 wherein, The gene coding module further includes a parameter discretization unit and a gene sequence reconstruction unit. The parameter discretization unit discretizes the continuous GC strategy parameters into finite candidate values through a uniform sampling algorithm, narrows the search space, and generates N candidate values through uniform sampling discretization of the continuous parameters , as shown in equation (4): (4). In the formula, is a discrete parameter candidate value, is a sampling step, is a preset discrete granularity, and the total search space after discretization is from to ; The gene sequence reconstruction unit converts discrete parameter combinations into gene sequences using Gray code encoding.
5. The garbage collection system based on genetic algorithm as claimed in claim 4 wherein, 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 coefficient by tracking the ratio of actual write data volume to user request volume using a physical page mapping algorithm. The block efficiency evaluation unit quantifies the recovery efficiency by calculating the proportion of valid data in the recovered source block based on an invalid data marker detection algorithm.
6. The garbage collection system based on genetic algorithm as claimed in claim 5 wherein, 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 cold and hot data distribution under different GC strategies using a hidden Markov chain to verify the adaptability of the strategy to data dynamics. The strategy stability detection unit tests the robustness of the current optimal strategy by randomly generating extreme cold and hot data proportion scenarios using Monte Carlo simulation.
7. The garbage collection system based on genetic algorithm as claimed in claim 6 wherein, The wear leveling compensator further includes a wear prediction unit and a bias compensation unit. The wear prediction unit models the relationship between the wear value and the parameter adjustment through a back propagation neural network, and predicts the long-term influence of the strategy on the overall wear balance; and the bias compensation unit dynamically corrects the wear difference parameter in the gene code based on a gradient descent algorithm, and suppresses the risk of local over-wear, wherein the gradient descent correction is defined as a loss function, as shown in formula (7): (7); wherein is the i-th source block wear value predicted by the BPNN, is the minimum wear value for the entire disc, is the total number of source blocks, the gradient is calculated and the wear difference parameter is corrected , see equation (8): (8); In the formula, is the learning rate , is calculated by the back propagation chain rule of BPNN.
8. The garbage collection system based on genetic algorithm as claimed in claim 7 wherein, The iterative deployment module further includes a convergence judgment unit and a parameter solidification unit. The convergence judging unit judges the convergence state of the algorithm by using Kolmogorov-Smirnov test to compare the difference of fitness distribution of multi-generation populations. The parameter solidification unit converts the optimal gene sequence into executable GC strategy configuration parameters through a gene decoding mapping table and deploys the parameters to a 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