An automatic HDD tuning method based on fuzzy algorithm
By using an automatic HDD tuning method based on fuzzy algorithms, the operating parameters of the hard drive are monitored and adjusted in real time. This solves the problems of insufficient adaptive capability and defects in fuzzy information processing in existing technologies, achieves a balance between performance and lifespan, and improves the accuracy and automation of tuning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-03
AI Technical Summary
Existing HDD tuning methods suffer from insufficient adaptability, performance-lifespan imbalance, defects in fuzzy information processing, and low automation. They cannot effectively cope with dynamically changing load scenarios, leading to performance fluctuations and resource waste, and it is difficult to quantify fuzzy information.
An automatic HDD tuning method based on fuzzy algorithms is adopted. By monitoring multi-dimensional data in real time, using triangular membership functions and Mamdani fuzzy inference method, a fuzzy output set of tuning parameters is generated. The centroid method is used for defuzzification processing, the hard drive operating parameters are dynamically adjusted, and core correction tuning is performed in combination with wear status assessment.
It achieves intelligent adaptive optimization, improves the accuracy and adaptability of optimization, dynamically balances performance and lifespan, ensures the accuracy and reliability of decision results, and extends the lifespan of hard drives.
Smart Images

Figure CN121387571B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of hard disk automatic optimization technology, and in particular relates to an automatic optimization method for HDD hard disks based on fuzzy algorithm. Background Technology
[0002] With the explosive growth in data storage demand, HDDs, as a traditional storage medium, are still widely used in servers, data centers, and other scenarios due to their advantages of large capacity and low cost. The performance and lifespan of HDDs are affected by multiple factors, including I / O load (IOPS, data transfer volume), disk rotation speed, seek time, cache utilization, temperature, and wear and tear (such as reallocation sector count and head seek count). These factors are interdependent and exhibit non-linear and fuzzy characteristics (high load, medium temperature, and other states are difficult to define with precise thresholds).
[0003] Existing HDD tuning methods have the following limitations:
[0004] Insufficient adaptability: It often uses fixed thresholds or empirical rules, which cannot cope with dynamically changing load scenarios, and is prone to performance fluctuations or resource waste.
[0005] Imbalance between performance and lifespan: Traditional tuning focuses on improving instantaneous performance, such as increasing rotation speed and enabling write caching, while ignoring long-term wear accumulation, such as frequent seeks that exacerbate head wear and high temperatures that accelerate platter aging, thus shortening the lifespan of the hard drive.
[0006] Defects in fuzzy information processing: Key states such as load type and temperature level are fuzzy. For example, medium load has no clear boundary. Existing algorithms have difficulty quantifying this kind of information, resulting in low accuracy of optimization decisions.
[0007] Low level of automation: It relies on manual intervention, such as maintenance personnel manually modifying the I / O scheduler, resulting in high response latency and making it unsuitable for large-scale storage clusters.
[0008] Therefore, there is an urgent need for an automatic optimization method that can dynamically sense the operating status of HDDs, quantify fuzzy information, and balance performance and lifespan. Summary of the Invention
[0009] The purpose of this invention is to provide an automatic optimization method for HDD hard disks based on fuzzy algorithms, in order to solve the technical problem.
[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0011] An automatic HDD tuning method based on fuzzy algorithm includes the following steps:
[0012] S1: Real-time monitoring of HDD operating status, collection of multi-dimensional monitoring data, including I / O load, disk speed, seek time, cache utilization and disk temperature, and preprocessing of the data;
[0013] S2: Using I / O load (including IOPS and data transfer volume), disk speed and disk temperature as core fuzzy input variables, the domain of each variable is divided, and each variable is mapped to three fuzzy subsets of low, medium and high. The triangular membership function is used to fuzzify the multi-dimensional monitoring data to obtain the fuzzy membership values of each input variable.
[0014] S3: Call the preset load type-tuning parameter fuzzy rule library, and use the Mamdani fuzzy inference method to match the fuzzy membership values with the rule library to generate a fuzzy output set of tuning parameters;
[0015] S4: The centroid method is used to defuzzify the fuzzy output set to obtain specific target values for pre-read size, I / O scheduler type, disk rotation speed, cache switch status, and number of I / O queue requests, i.e., fuzzy optimization decision;
[0016] S5: Automatically adjusts the operating parameters of the HDD hard drive based on fuzzy optimization decisions;
[0017] S6: Real-time acquisition of HDD wear status parameters, and wear risk assessment based on wear status parameters; if the fuzzy inference result determines that the wear risk is medium or high, the core correction and optimization parameters are adjusted.
[0018] Preferably, the specific process of step S2 is as follows:
[0019] S21: Set the domain ranges for IOPS, data transfer rate, disk rotation speed, and disk temperature to [0, 200] times / second, [0, 2048] KB / second, [0, 15000] rpm, and [25, 65] ℃, respectively.
[0020] S22: Map the domain range of IOPS, data transfer volume, disk rotation speed, and disk temperature into three fuzzy subsets: low, medium, and high.
[0021] S23: For each input variable, the real-time monitoring value is calculated using the triangular membership function to determine its membership value in the low, medium, and high subsets.
[0022] S24: Collect all IOPS, data transfer volume, hard drive speed, and hard drive temperature, calculate membership values, and finally output a set of low, medium, and high membership values for each variable.
[0023] Preferably, the specific process of step S23 is as follows:
[0024] S231: Set the triangular membership function: defined by three parameters: left endpoint (a), peak point (b), and right endpoint (c), corresponding to the range of each fuzzy subset;
[0025] S232: For any actual monitored value x Its membership value μ ( x The calculation rules are as follows:
[0026] like x≤a or x≥c : μ ( x )=0;
[0027] like a <x≤b : μ ( x )=( xa ) / ( ba );
[0028] like b <x<c : μ ( x )=( cx ) / ( cb );
[0029] Preferably, the specific process of matching fuzzy membership values with the rule base and generating a fuzzy output set for tuning parameters using the Mamdani fuzzy inference method in step S3 is as follows:
[0030] S31: Membership-based matching of preconditions: Calculate the joint membership degree of each rule's precondition, i.e., the activation strength, and retain only rules with activation strength > 0, i.e., rules whose preconditions are satisfied:
[0031] S311: Activation strength calculation method: For each rule with multiple premises, take the minimum value of the membership degree of the fuzzy subset corresponding to each premise variable as the activation strength of the rule;
[0032] S32: Constrain the output subset using activation strength:
[0033] S33: Merge the pruning results of all activation rules to form a fuzzy output set of tuning parameters.
[0034] Preferably, the specific process of step S32 is as follows:
[0035] S321: Divide the output variables into discrete output variables and continuous output variables, and prune the discrete output variables;
[0036] S322: Prune continuous output variables.
[0037] Preferably, the specific process of step S4 is as follows:
[0038] S41: Determine the actual value range and centroid coordinates of the output variables for each fuzzy output set;
[0039] S42: Divide the above output variables into two categories and perform the corresponding centroid method to resolve the fuzziness for each category;
[0040] S43: Summarize the defuzzification results of the output variables to obtain specific optimization decisions.
[0041] Preferably, the specific process of step S42 is as follows:
[0042] S421: Defuzzify continuous output variables including prefetch size, disk rotation speed, and number of I / O queue requests: calculate the average of the actual values weighted by membership degree;
[0043] S422: Centroid method for defuzzification of discrete output variables including I / O scheduler and write buffer: Select the "fuzzy subset with the highest membership degree" as the specific target value.
[0044] Preferably, the specific process of performing wear risk assessment based on the wear state parameters in step S6 is as follows:
[0045] S61: Map the wear status parameters, including the reallocated sector count, the unprocessed sector count, and the number of head seeks, as well as the associated parameter disk temperature, into three fuzzy subsets: low, medium, and high.
[0046] S63: Construct a fuzzy rule base for wear risk assessment;
[0047] S64: Based on the parameter membership degree and rule base calculated above, execute the reasoning process to obtain a fuzzy output set of wear risk levels;
[0048] S65: Output the results of the defuzzification and risk assessment.
[0049] Preferably, the specific process of adjusting the core correction and optimization parameters in step S6 is as follows:
[0050] S61: Based on the risk level of the triggering scenario, and combined with the triangular balance principle of performance-energy consumption-lifetime, determine the core objectives of the correction and optimization;
[0051] S62: Adjust the core correction and optimization parameters.
[0052] The beneficial effects of this invention include:
[0053] 1. Intelligent adaptive optimization: By using fuzzy algorithms to quantify fuzzy information such as I / O load, speed, and temperature, it breaks through the limitations of fixed thresholds and can dynamically adapt to complex scenarios such as large file load, small file load, and low load, thereby improving the accuracy and adaptability of optimization.
[0054] 2. Dynamic balance between performance and lifespan: Real-time optimization of parameters such as read-ahead size, I / O scheduler, and rotation speed to improve performance; synchronous monitoring of wear status parameters, reallocation of sector counts, head seek times, etc., assessment of risk level through fuzzy inference, and targeted correction of optimization strategies to extend hard drive lifespan while ensuring basic performance.
[0055] 3. Accuracy and reliability of optimization decisions: The centroid method is used to defuzzify the fuzzy output set. For continuous parameters (pre-read size, speed), a weighted average is calculated. For discrete parameters (I / O scheduler, buffer switch), the subset with the highest membership degree is selected to ensure a seamless transition of decision results from fuzzy inference to precise execution. Attached Figure Description
[0056] Figure 1 This is a flowchart illustrating the automatic optimization method for HDD hard disks based on fuzzy algorithms according to the present invention. Detailed Implementation
[0057] The following is in conjunction with the appendix Figure 1 The present invention will be further described in detail below:
[0058] Example 1
[0059] See appendix Figure 1 As shown, an automatic HDD hard disk tuning method based on fuzzy algorithm is characterized by the following steps:
[0060] S1: Real-time monitoring of HDD operating status, collecting multi-dimensional monitoring data, including I / O load, disk speed, seek time, cache utilization and disk temperature, and preprocessing the data, including data cleaning, data smoothing and data standardization.
[0061] S2: Define the input variables of the fuzzy algorithm: I / O load parameters, disk speed, and disk temperature are the core fuzzy input variables. The I / O load parameters include IOPS and data transfer volume to divide the domain of each variable and map each variable into three fuzzy subsets: low, medium, and high. The triangular membership function is used to fuzzify the multi-dimensional monitoring data to obtain the fuzzy membership values of each input variable.
[0062] S3: Call the preset "load type - tuning parameters" fuzzy rule base. The rule base is built based on different application scenarios of HDD hard drives. The core rule form is "If [I / O load is X and data transfer volume is Y and disk temperature is Z], then [it is determined to be load type A, with the corresponding prefetch size set to B, I / O scheduler set to C, disk speed set to D, cache switch status set to E, and I / O queue request quantity set to F], where X, Y, and Z are "low / medium / high" fuzzy subsets, A is "large file load / small file load / low load", and B, C, D, E, and F are specific tuning parameter target values. Through the Mamdani fuzzy inference method, the fuzzy membership values are matched with the rule base to generate a fuzzy output set of tuning parameters.
[0063] S4: The centroid method is used to defuzzify the fuzzy output set to obtain specific target values for pre-read size, I / O scheduler type, disk rotation speed, cache switch status, and number of I / O queue requests, which are the fuzzy tuning decision results.
[0064] S5: Based on the fuzzy tuning decision results, automatically adjust the operating parameters of the HDD hard disk. The adjustment methods include setting the pre-read size through the blockdev command, controlling the disk rotation speed and write cache switch through the hdparm command, modifying the configuration file under the / sys / block / $device / queue / path to switch the I / O scheduler, and adjusting the number of I / O queue requests.
[0065] S6: Real-time acquisition of HDD hard drive wear status parameters, including the number of reallocated sectors, the number of sectors to be processed, and the number of head seeks. Wear risk assessment is performed based on the wear status parameters. If the fuzzy inference result determines "high wear risk", a fault warning message is output, and the core correction and optimization parameters are adjusted.
[0066] The specific process of step S2 is as follows:
[0067] S21: Set the domain ranges for IOPS, data transfer rate, disk rotation speed, and disk temperature to [0, 200] times / second, [0, 2048] KB / second, [0, 15000] rpm, and [25, 65] ℃, respectively.
[0068] S22: Map the domain ranges of IOPS, data transfer volume, disk rotation speed, and disk temperature to three fuzzy subsets: low, medium, and high. The mapping rules are shown in Table 1 below.
[0069] Table 1. Fuzzy Subset Mapping Rules
[0070]
[0071] The subset ranges overlap, such as 5 to 10 IOPS per second covering both L and M, which conforms to the "gradual membership" characteristic of fuzzy algorithms and avoids black-and-white judgment errors.
[0072] S23: For each input variable, the real-time monitoring value is calculated using the triangular membership function to determine its membership value in the low, medium, and high subsets, ranging from 0 to 1. The larger the value, the more the variable belongs to that subset.
[0073] S24: Collect all IOPS, data transfer volume, hard drive speed, and hard drive temperature, calculate membership values, and finally output a set of low, medium, and high membership values for each variable.
[0074] The specific process of step S23 is as follows:
[0075] S231: Set the membership function of the triangle: defined by three parameters: left endpoint (a), peak point (b), and right endpoint (c), corresponding to the range of each fuzzy subset.
[0076] S232: For any actual monitored value x Its membership value μ ( x The calculation rules are as follows:
[0077] like x≤a or x≥c : μ ( x ) = 0 (the variable does not belong to this subset at all);
[0078] like a <x≤b : μ ( x )=( xa ) / ( ba (Membership degree increases linearly with x to a peak value of 1);
[0079] like b <x<c : μ ( x )=( cx ) / ( cb (Membership degree decreases linearly to 0 as x increases);
[0080] Specific calculations using disk temperature as an example:
[0081] Assuming the actual temperature of a certain HDD is collected as x=45℃, and considering the disk temperature subset ranges: L: a=25, b=30, c=35; M: a=30, b=40, c=50; H: a=45, b=55, c=65, calculate the membership values:
[0082] Membership degree belonging to "low": x=45>c=35→μ_L(45)=0;
[0083] Membership degree belonging to "medium": b = 40 < x = 45 < c = 50 → μ_M(45) = (50 - 45) / (50 - 40) = 0.5;
[0084] Membership degree belonging to "high": a = 45 ≤ x = 45 ≤ b = 55 → μ_H(45) = (45 - 45) / (55 - 45) = 0;
[0085] Final fuzzy membership degree result: (μ_L = 0, μ_M = 0.5, μ_H = 0) → The temperature has a "medium membership degree of 0.5", corresponding to the "medium temperature warning state" in the document. It is necessary to adjust the rotation speed in combination with the IO load to prevent the temperature from rising further.
[0086] Specific calculation taking "I / O load - IOPS" as an example:
[0087] Suppose the actual IOPS x = 90 times per second of a certain HDD is collected. Combining with the IOPS subset range (L: a = 0, b = 5, c = 10; M: a = 5, b = 50, c = 100; H: a = 80, b = 150, c = 200), calculate the membership degree value:
[0088] Membership degree belonging to "low": x = 90 > c = 10 → μ_L(90) = 0;
[0089] Membership degree belonging to "medium": b = 50 < x = 90 < c = 100 → μ_M(90) = (100 - 90) / (100 - 50) = 0.2;
[0090] Membership degree belonging to "high": a = 80 < x = 90 ≤ b = 150 → μ_H(90) = (90 - 80) / (150 - 80) ≈ 0.14;
[0091] Final fuzzy membership degree result: (μ_L = 0, μ_M = 0.2, μ_H = 0.14) → The IOPS has a "higher medium membership degree", initially tending to a "large file load". Subsequently, it is necessary to further confirm the load type in combination with the membership degree value of "data transfer volume".
[0092] Example 2
[0093] Based on Example 1, in step S3, through the Mamdani fuzzy inference method, the specific process of matching the fuzzy membership degree value with the rule base to generate the fuzzy output set of tuning parameters is as follows:
[0094]
[0095] Table 2 Fuzzy Rule Base for "Load Type - Tuning Parameters"
[0096]
[0097] In this context, “∧” represents “and”.
[0098] S31: Membership-based matching preconditions (rule activation): Calculate the "joint membership (activation strength)" of each rule precondition, and retain only rules with activation strength > 0, i.e., rules whose preconditions are satisfied:
[0099] S311: Activation Intensity Calculation Method
[0100] For each rule with multiple premises, such as "IOPS in progress ∧ transmission in progress ∧ temperature in progress" in R1, the minimum value of the membership degree of the fuzzy subset corresponding to each premise variable is taken as the activation strength of the rule, representing the degree to which the premise conditions are satisfied. The formula is as follows:
[0101] σ_Rn=min(μ_variable1(subset1),μ_variable2(subset2),...,μ_variablek(subsetk));
[0102] Where σ_Rn is the activation strength of the nth rule, 0≤σ_Rn≤1, and μ_variable_i (subset_i) is the membership value of the premise subset corresponding to input variable_i.
[0103] S312: Rule activation calculation using input membership degree as an example:
[0104] μ_IOPS(low / medium / high) = (0, 0.2, 0.14);
[0105] μ_transmission (low / medium / high) = (0, 0.9, 0.1);
[0106] μ_temperature (low / medium / high) = (0, 0.5, 0);
[0107] Calculate the activation strength of each of the three rules:
[0108] Rule R1 (Large File Load): Prerequisites are "IOPS in progress ∧ Transfer in progress ∧ Temperature in progress";
[0109] σ_R1=min(μ_IOPS(medium)=0.2,μ_transmission(medium)=0.9,μ_temperature(medium)=0.5)=0.2 (activation intensity>0, rule R1 is activated);
[0110] Rule R2 (Small File Load): Prerequisites are "High IOPS ∧ Low Transfer ∧ Medium Temperature";
[0111] σ_R2=min(μ_IOPS(High)=0.14,μ_Transmission(Low)=0,μ_Temperature(Medium)=0.5)=0 (Activation intensity=0, rule R2 is not activated);
[0112] Rule R3 (Low Load): The prerequisite is "low IOPS ∧ low transmission ∧ low temperature";
[0113] σ_R3=min(μ_IOPS(low)=0,μ_transmission(low)=0,μ_temperature(low)=0)=0 (Activation intensity=0, rule R3 is not activated);
[0114] Final activation result: Only rule R1 (large file load) is activated, and subsequent fuzzy outputs of tuning parameters are generated only based on R1.
[0115] S32: Constrain the output subset using activation strength:
[0116] Mamdani inference's "pruning" logic is as follows: the upper limit of the membership function of the conclusion of the activated rule (the fuzzy subset of the output variable) cannot exceed the activation strength of the rule; that is, the "confidence" of the output cannot be higher than the "satisfaction" of the premise. Because the I / O scheduler and write buffer are "discrete types," such as the scheduler being only one of deadline / cfq / noop, their membership is "1 (belongs to)" or "0 (does not belong to)." The prefetch size, rotation speed, and queue size are "continuous ranges" and need to be pruned based on the triangular membership function, as detailed below:
[0117] S321: Pruning of discrete output variables, taking I / O scheduler and write buffer as examples:
[0118] Rule R1 concludes that "I / O scheduler = deadline, write cache = on". The original fuzzy subset membership degree of these two variables was 1 (completely belonging). After pruning, the membership degree = activation strength σ_R1 = 0.2, indicating that because the premise satisfaction degree is 0.2, the confidence level for outputting "deadline scheduler" and "write cache on" is 0.2.
[0119] I / O scheduler: μ_deadline=0.2, μ_cfq=0, μ_noop=0;
[0120] Write cache: μ_on = 0.2, μ_off = 0.
[0121] S322: Pruning of continuous output variables, taking prefetch size and disk rotation speed as examples:
[0122] Rule R1 concludes that the prefetch size is medium (1024KB) and the disk rotation speed is medium (7200~10000rpm). Its original fuzzy subset is a triangular membership function, such as the function for the prefetch size "medium": left endpoint a=512KB, peak b=1024KB, right endpoint c=2048KB. During pruning, the membership degree at the peak of the function (originally 1) is reduced to the activation strength of 0.2, forming a flat-topped triangle.
[0123] Pre-read size "medium": After clipping, the membership function is "a=512KB (μ=0) → b=1024KB (μ=0.2) → c=2048KB (μ=0)";
[0124] Disk speed "Medium": After clipping, the membership function is "a=4800rpm (μ=0) → b=7200rpm (μ=0.2) → c=10000rpm (μ=0)":
[0125] The following is an example of the output subset after cropping:
[0126] Table 3. Examples of Output Subsets After Clipping
[0127]
[0128] S33: Merge the pruning results of all activation rules:
[0129] If multiple rules are activated, such as when the input parameters simultaneously satisfy some features of both large and small files, the trimmed subsets of each rule for the same output variable need to be "aggregated" into a unified fuzzy output set, i.e., the final fuzzy membership distribution of the output variable, as follows:
[0130] Aggregation logic:
[0131] Suppose that a certain input membership degree simultaneously activates both R1 (σ=0.2) and R2 (σ=0.1):
[0132] R1 outputs "prefetch size": M → μ = 0.2;
[0133] R2's output for "prefetch size": small (S) → μ=0.1;
[0134] The fuzzy output set of "pre-read size" after aggregation: small (S) μ=0.1, medium (M) μ=0.2, large (L) μ=0 (taking the maximum membership degree of each subset).
[0135] Aggregation results based on single-rule activation:
[0136] Since only R1 was activated in the previous example, the fuzzy output sets of each output variable after aggregation are the same as the clipping result of R1, and finally the fuzzy output set of the tuning parameter is formed, which can be directly used for subsequent defuzzification processing.
[0137] Embodiment 3
[0138] Based on Embodiment 1 or Embodiment 2, the specific process of step S4 is as follows:
[0139] S41: Determine the "actual value range" (universe of discourse) and "centroid coordinate" (midpoint of the interval, corresponding to the specific tuning value) of the output variable of each fuzzy output set. The example is as follows:
[0140] Table 4 Example table of the actual value range and centroid coordinate of the output variable of each fuzzy output set
[0141]
[0142] S42: Divide the above output variables into two categories and perform the corresponding centroid method defuzzification respectively;
[0143] S43: Summarize the defuzzification results of the output variables to obtain the specific tuning decision for the large file load scenario, which can be directly implemented as a script operation. See the following table for details:
[0144] Table 5 Specific tuning decision table for the large file load scenario
[0145]
[0146] The specific process of step S42 is as follows:
[0147] S421: For continuous output variables including prefetch size, disk rotation speed, and number of I / O queue requests:
[0148] Calculate the average value of the actual values weighted by membership degree. The formula is as follows (only calculate the subsets with membership degree > 0):
[0149] Specific target value = (S1_centroid × S1_membership degree + S2_centroid × S2_membership degree +... + Sn_centroid × Sn_membership degree) / (S1_membership degree + S2_membership degree +... + Sn_membership degree);
[0150] Where: S1~Sn are fuzzy subsets, S_centroid is the centroid coordinate of the subset, and S_membership degree is the membership degree value of the subset.
[0151] For example: Defuzzification of prefetch size (large file load scenario):
[0152] Fuzzy output set: Only the membership degree of the "medium" subset = 0.2, and the other subsets = 0;
[0153] Center of gravity coordinates: Medium = 1024 KB;
[0154] Calculation process:
[0155] Specific target value = (1024 KB × 0.2 + 96 KB × 0 + 3072 KB × 0) / (0.2 + 0 + 0)
[0156] = (204.8) / 0.2 = 1024 KB;
[0157] Corresponding operation: blockdev --setra 2048, because the unit of --setra is 512 bytes, 2048 × 512 bytes = 1024 KB, which exactly matches the calculation result;
[0158] Defuzzification of disk rotation speed (large file load scenario):
[0159] Fuzzy output set: Only the membership degree of the "Medium" subset = 0.2, other subsets = 0;
[0160] Center of gravity coordinates: Medium = 7200 rpm, from the medium speed setting in the large file script, balancing performance and wear;
[0161] Calculation process:
[0162] Specific target value = (7200 rpm × 0.2 + 5400 rpm × 0 + 10000 rpm × 0) / 0.2
[0163] = 1440 / 0.2 = 7200 rpm;
[0164] Document corresponding operation: Set the rotation speed to 7200 rpm through the hdparm command, meeting the requirement of the large file scenario not pursuing extreme high speed but requiring stable throughput.
[0165] Defuzzification of the number of I / O queue requests (large file load scenario):
[0166] Fuzzy output set: Only the membership degree of the "Medium" subset = 0.2, other subsets = 0;
[0167] Center of gravity coordinates: Medium = 512;
[0168] Calculation process:
[0169] Specific target value = (512 × 0.2 + 64 × 0 + 1024 × 0) / 0.2 = 102.4 / 0.2 = 512;
[0170] Document corresponding operation: Directly execute echo 512 > / sys / block / $device / queue / nr_requests.
[0171] Defuzzing of multi-subset activation (derivation for mixed load scenarios):
[0172] If the fuzzy output set is "preread size medium = 0.2, large = 0.1" (e.g., close to a very large file load), then:
[0173] Calculation process:
[0174] The specific target value is calculated as follows: (1024KB × 0.2 + 3072KB × 0.1) / (0.2 + 0.1).
[0175] =(204.8+307.2) / 0.3
[0176] =512 / 0.3≈1707KB;
[0177] Document adaptation operation: blockdev--setra3414 (3414×512 bytes ≈ 1707KB), which meets the tuning goal of dynamic document adaptation load.
[0178] S422: Centroid method for defuzzification of discrete output variables, including I / O schedulers and write buffers (discrete types that are either one or the other, such as I / O schedulers which can only be deadline / cfq / noop, with no intermediate types; the core of the centroid method is to select the fuzzy subset with the highest membership degree as the specific target value, because discrete variables cannot be weighted averaged, and the tuning script only supports fixed type selection):
[0179] I / O scheduler defuzzification (large file load scenario):
[0180] Fuzzy output set: deadline=0.2, cfq=0, noop=0;
[0181] The subset with the highest membership degree: deadline (0.2 > 0);
[0182] Specific target value: deadline;
[0183] The corresponding operation in the document is: echodeadline> / sys / block / $device / queue / scheduler, which is completely consistent with the large file script and optimizes sequential read and write efficiency.
[0184] Defuzzing write cache (for scenarios with large document file loads):
[0185] Fuzzy output set: ON = 0.2, OFF = 0;
[0186] The subset with the highest membership degree: Open (ON) (0.2 > 0);
[0187] Specific target value: On;
[0188] The corresponding operation in the document is: hdparm -W1 / dev / $device, which is consistent with the logic of the large file script "Enable write caching to improve write performance".
[0189] The specific process of conducting wear risk assessment based on the wear state parameters in step S6 is as follows:
[0190] S61: The wear status parameters, including the reallocated sector count, the unprocessed sector count, and the number of head seeks, as well as the associated parameter disk temperature (excessive temperature aggravates wear), are mapped to three fuzzy subsets: low, medium, and high, respectively, as shown in Table 6 below;
[0191] Table 6 Fuzzy Subset Mapping Table
[0192]
[0193] S62: Calculate the membership value of each parameter separately:
[0194] The wear parameters of a certain HDD were collected as follows:
[0195] Reassigned sector count = 8;
[0196] Unprocessed sector count = 3;
[0197] Daily average number of head seeks = 1800;
[0198] Disk temperature = 48℃.
[0199] Based on the triangular membership function (formula: μ(x)=(xa) / (ba) (x≤b), μ(x)=(cx) / (cb) (x>b), a=left endpoint, b=peak value, c=right endpoint), calculate the membership degree of each parameter, see Table 7 below:
[0200] Table 7 Membership Degrees of Each Parameter
[0201]
[0202] S63: Construct a fuzzy rule base for wear risk assessment, see Table 8 below:
[0203] Table 8 Fuzzy Rule Base for Wear Risk Assessment
[0204]
[0205] S64: Based on the parameter membership degrees and rule base calculated above, execute the inference process to obtain a fuzzy output set of wear risk levels:
[0206] S641: Rule-based activation (calculating activation strength):
[0207] The activation strength of each rule is calculated using the "minimum method," which is the minimum membership degree in the preconditions, i.e., the degree of rule satisfaction. Only rules with activation strength > 0 are retained.
[0208] Rule R1 (High Risk: High Reassignment ∨ High Pending Processing): Since Reassignment = Medium (0.6) and Pending Processing = Low (0.66), neither of them satisfies "High", so the activation intensity = 0;
[0209] Rule R2 (High Risk: High Seeking ∧ High Temperature): Seeking = Medium (0.8), Temperature = Medium (0.87), neither of which satisfies "High", Activation Intensity = 0;
[0210] Rule R3 (Medium Risk: Re-entering Medium Risk ∧ Pending Processing ∧ Seeking): Re-entering Medium Risk = 0.6, Pending Processing = 0.33, Seeking = 0.8, Activation Intensity = min(0.6, 0.33, 0.8) = 0.33;
[0211] Rule R4 (Medium Risk: Seeking ∧ Temperature Medium ∧ Re-low ∧ Low to be processed): Seeking = 0.8, Temperature Medium = 0.87, Re-low = 0, Low to be processed = 0.66, Activation Intensity = min(0.8, 0.87, 0, 0.66) = 0;
[0212] Rule R5 (Low Risk: All Low): Re-low = 0, Pending Low = 0.66, Seek Low = 0, Temperature Low = 0, Activation Intensity = 0;
[0213] Rule R6 (Medium Risk: Re-medium ∧ Low-to-Be-Processed ∧ Low-to-Seek ∧ Medium Temperature): Re-medium = 0.6, Low-to-Be-Processed = 0.66, Low-to-Seek = 0, Medium Temperature = 0.87, Activation Intensity = min(0.6, 0.66, 0, 0.87) = 0;
[0214] Final activation rule: R3 only (activation strength = 0.33).
[0215] S642: Conclusion: Trimming and Aggregation
[0216] Pruning: Rule R3 concludes as "medium risk", and its membership is constrained by activation strength 0.33 (i.e., membership of medium risk = 0.33).
[0217] Aggregation: Only one rule is active, no merging is required, and the fuzzy output set of wear risk levels is:
[0218] {Low risk: 0, Medium risk: 0.33, High risk: 0}.
[0219] S65: Output of Defuzzification and Risk Assessment Results:
[0220] Wear risk levels are discrete variables (low, medium, high). The "maximum membership degree method" is used to defuzzify the data, and the risk level with the highest membership degree after aggregation is selected as the final assessment result.
[0221] Defuzzing results:
[0222] Based on the above fuzzy output set, the membership degree of "medium risk" (0.33) is the highest, and the final assessment result is: the current wear risk level of the HDD hard drive is medium risk.
[0223] Related document alert actions:
[0224] According to the requirements of the document "Wear Monitoring and Failure Prevention Module" and "Implementation Examples", different risk levels correspond to different handling methods:
[0225] Low risk: Continuous monitoring, no intervention required (document "Wear Monitoring": monitoring only under normal conditions);
[0226] Medium risk: A system log is generated, indicating that "the wear and tear of the hard drive needs to be monitored, and it is recommended to optimize the data storage location to reduce head movement" (document "Extend lifespan by adjusting operating strategies").
[0227] High risk: Immediately push a warning notification (email / SMS, document "Send Warning Notification"). If the parameter exceeds the threshold (e.g., reallocation of sectors > 10), prompt "It is recommended to replace the hard drive as soon as possible to avoid data loss" (document example "Warning and Replace Hard Drive").
[0228] S6: Real-time acquisition of HDD hard drive wear status parameters, including the number of reallocated sectors, the number of sectors to be processed, and the number of head seeks. Wear risk assessment is performed based on the wear status parameters, including three risk levels: low, medium, and high. When the risk level is determined to be medium or above, a correction and optimization strategy is generated. The correction and optimization strategy includes reducing frequent write operations and optimizing data storage location to reduce the head movement distance, thereby extending the life of the HDD hard drive and preventing failures.
[0229] The specific process of adjusting the core correction and optimization parameters in step S6 is as follows:
[0230] S61: Based on the risk level of the triggering scenario and in accordance with the performance-energy consumption-lifetime triangle balance principle, clarify the core objectives of the tuning and optimization, avoiding "sacrificing performance for excessive wear control" or "ignoring wear to maintain performance." Specific tuning objectives are shown in Table 9 below.
[0231] Table 9 Optimization Targets
[0232]
[0233] S62: Adjust the core tuning parameters. See Table 10 below for the adjustment logic:
[0234] Table 10 Adjustment Logic Table for Correcting Tuning Parameters
[0235] Core tuning parameters Original tuning parameters (normal scenario) Medium risk revision value High-risk correction value Purpose of revision Disk speed Large files: 7200~10000rpm; Small files: 10000~15000rpm Reduce to 5400~7200rpm Forced down to ≤5400rpm Reduce disc rotation wear and lower temperature (document "Speed Adjustment Saves Energy + Reduces Wear") Write cache state Large / Small Files: Enabled (hdparm-W1) Keep it enabled, but increase the "write cache refresh frequency". Disable (hdparm-W0, the logic for disabling low-power scripts in the documentation) In high-risk scenarios, avoid "data loss due to failure to refresh the write cache"; in medium-risk scenarios, balance performance and security. Preread size Large file: 1024KB (--setra2048); Small file: 128KB (--setra256) Large files reduced to 512KB (--setra1024); small files reduced to 64KB (--setra128) Unified down to 32KB (--setra64, minimum prefetch in the "Low Power Scripts" documentation) Reduce unnecessary head movement (excessive pre-reading leads to frequent head seeks) and slow down wear. I / O scheduler Large files: deadline; Small files: cfq Keep the deadline / cfq, but increase the "scheduling delay" (e.g., increase cfq slices from 100ms to 200ms). Force a switch to noop (documented in the "Low Power Scripts" scheduler to reduce I / O operations). The noop scheduler eliminates complex sorting, reducing frequent head orientation adjustments and minimizing mechanical wear. Write operation control Unrestricted (normal scenario) Limit the duration of consecutive write operations (each write operation ≤ 5 minutes, with a 1-minute interval). Disable "unnecessary write operations" (only allow critical write operations such as system logs). Reduce contact wear during write operations on the read / write head (document "Reducing Frequent Write Operations to Extend Lifespan")
Claims
1. An automatic optimization method for HDD hard disks based on fuzzy algorithms, characterized in that, Includes the following steps: S1: Real-time monitoring of HDD operating status, collection of multi-dimensional monitoring data, including I / O load, disk speed, seek time, cache utilization and disk temperature, and preprocessing of the data; S2: Using I / O load, disk speed, and disk temperature as fuzzy input variables, the domain of each variable is divided, and each variable is mapped to three fuzzy subsets: low, medium, and high. The triangular membership function is used to fuzzify the multi-dimensional monitoring data to obtain the fuzzy membership values of each input variable. S3: Call the preset load type-tuning parameter fuzzy rule library, and use the Mamdani fuzzy inference method to match the fuzzy membership values with the rule library to generate a fuzzy output set of tuning parameters; S4: The centroid method is used to defuzzify the fuzzy output set to obtain specific target values for pre-read size, I / O scheduler type, disk rotation speed, cache switch status, and number of I / O queue requests, i.e., fuzzy optimization decision; S5: Automatically adjusts the operating parameters of the HDD hard drive based on fuzzy optimization decisions; S6: Real-time acquisition of HDD wear status parameters, and wear risk assessment based on wear status parameters; if the fuzzy inference result determines that the wear risk is medium or high, the core correction and optimization parameters are adjusted.
2. The HDD hard disk automatic optimization method based on fuzzy algorithm according to claim 1, characterized in that, The specific process of step S2 is as follows: S21: Set the domain ranges for IOPS, data transfer rate, disk rotation speed, and disk temperature to [0, 200] times / second, [0, 2048] KB / second, [0, 15000] rpm, and [25, 65] ℃, respectively. S22: Map the domain range of IOPS, data transfer volume, disk rotation speed, and disk temperature into three fuzzy subsets: low, medium, and high. S23: For each input variable, the real-time monitoring value is calculated using the triangular membership function to determine its membership value in the low, medium, and high subsets. S24: Collect all IOPS, data transfer volume, hard drive speed, and hard drive temperature, calculate membership values, and finally output a set of low, medium, and high membership values for each variable.
3. The HDD hard disk automatic tuning method based on fuzzy algorithm according to claim 2, characterized in that, The specific process of step S23 is as follows: S231: Set the membership function of the triangle: defined by three parameters: left endpoint a, peak point b, and right endpoint c, corresponding to the range of each fuzzy subset; S232: For any actual monitored value x Its membership value μ ( x The calculation rules are as follows: like x≤a or x≥c : μ ( x )=0; like a <x≤b : μ ( x )=( xa ) / ( ba ); like b <x<c : μ ( x )=( cx ) / ( cb ).
4. The HDD hard disk automatic optimization method based on fuzzy algorithm according to claim 1, characterized in that, In step S3, the specific process of matching fuzzy membership values with the rule base using the Mamdani fuzzy inference method to generate a fuzzy output set for tuning parameters is as follows: S31: Membership-based matching of preconditions: Calculate the joint membership degree of each rule's precondition, i.e., the activation strength, and retain only rules with activation strength > 0, i.e., rules whose preconditions are satisfied: S311: Activation strength calculation method: For each rule with multiple premises, take the minimum value of the membership degree of the fuzzy subset corresponding to each premise variable as the activation strength of the rule; S32: Constrain the output subset using activation strength: S33: Merge the pruning results of all activation rules to form a fuzzy output set of tuning parameters.
5. The HDD hard disk automatic tuning method based on fuzzy algorithm according to claim 4, characterized in that, The specific process of step S32 is as follows: S321: Divide the output variables into discrete output variables and continuous output variables, and prune the discrete output variables; S322: Prune continuous output variables.
6. The HDD automatic optimization method based on fuzzy algorithm according to claim 1, characterized in that, The specific process of step S4 is as follows: S41: Determine the actual value range and centroid coordinates of the output variables for each fuzzy output set; S42: Divide the above output variables into two categories and perform the corresponding centroid method to resolve the fuzziness for each category; S43: Summarize the defuzzification results of the output variables to obtain specific optimization decisions.
7. The HDD automatic hard disk tuning method based on fuzzy algorithm according to claim 6, characterized in that, The specific process of step S42 is as follows: S421: Defuzzify continuous output variables including prefetch size, disk rotation speed, and number of I / O queue requests: calculate the average of the actual values weighted by membership degree; S422: Centroid method for defuzzification of discrete output variables including I / O scheduler and write buffer: Select the fuzzy subset with the highest membership degree as the specific target value.
8. The HDD hard disk automatic tuning method based on fuzzy algorithm according to claim 1, characterized in that, The specific process of performing wear risk assessment based on the wear state parameters in step S6 is as follows: S61: Map the wear status parameters, including the reallocated sector count, the unprocessed sector count, and the number of head seeks, as well as the associated parameter disk temperature, into three fuzzy subsets: low, medium, and high. S63: Construct a fuzzy rule base for wear risk assessment; S64: Based on membership degree and rule base, execute the reasoning process to obtain a fuzzy output set of wear risk level; S65: Output the results of the defuzzification and risk assessment.
9. The HDD hard disk automatic tuning method based on fuzzy algorithm according to claim 8, characterized in that, The specific process of adjusting the core correction and optimization parameters in step S6 is as follows: S61: Based on the risk level of the triggering scenario, and combined with the triangular balance principle of performance-energy consumption-lifetime, determine the core objectives of the correction and optimization; S62: Adjust the core correction and optimization parameters.
Citation Information
Patent Citations
Temperature control method and device for magnetic disk
CN107507636A
Detection device for cutting tool wear, detecetion method thereof and compensation method for cutting tool wear
CN109799784A