Hard disk link speed adjusting method and storage device
By monitoring hard drive load status and bandwidth trends in real time and dynamically adjusting PCIe link speed, the problem of power redundancy and insufficient performance of solid-state drives under low load and high load is solved, realizing high-efficiency intelligent management.
Patent Information
- Application Number
- CN202511448054.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-02-17
AI Technical Summary
Existing PCIe link speed adjustment technologies for solid-state drives employ fixed levels or simple threshold strategies, resulting in power redundancy under low load and insufficient performance under high load, failing to dynamically adapt to load changes.
By monitoring the hard drive workload status in real time, determining the bandwidth change trend, and dynamically adjusting the PCIe link speed, including data volume integration, fitting, and threshold comparison within the sampling period, a link speed adjustment strategy is formulated.
It achieves significant reduction in system power consumption and heat generation while ensuring high-performance data transmission, extending equipment life, and providing intelligent energy efficiency management.
Smart Images

Figure CN121541765A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a method for adjusting hard disk link speed and a storage device. Background Technology
[0002] With the development of computer technology, solid-state drives (SSDs) have become one of the core hardware components for data storage, thanks to their advantages such as fast read / write speeds, strong shock resistance, and low noise. They interact with the computer motherboard and processor via high-speed serial computer expansion bus standards such as Peripheral Component Interconnect Express (PCIe). The speed of this link directly determines data transfer efficiency and is a key factor affecting SSD performance.
[0003] Currently, in related technologies, the PCIe link speed adjustment technology for solid-state drives (SSDs) generally adopts a fixed level or a simple threshold triggering strategy. Most SSDs have their PCIe link speed set to a fixed level at the factory, and they also operate at a fixed rate during operation, resulting in redundant power consumption under low load and insufficient performance under high load.
[0004] In summary, existing technical solutions suffer from the problem of high power consumption during solid-state drive (SSD) operation. Summary of the Invention
[0005] To solve the above-mentioned technical problems, or at least partially solve them, this application provides a method for adjusting hard disk link speed and a storage device.
[0006] This application provides a method for adjusting the hard disk link speed, including: Real-time acquisition of hard drive workload status; Based on the aforementioned workload status, determine the bandwidth change trend; Based on the bandwidth change trend, a strategy for adjusting the link speed of the hard drive is determined.
[0007] Optionally, determining the bandwidth change trend based on the workload state includes: determining a sampling period based on the workload state; determining the amount of data transferred by the hard disk within a single sampling period to obtain a transmission result; integrating the transmission result to obtain the bandwidth data; fitting the bandwidth data to obtain a fitting result; and determining the bandwidth change trend based on the fitting result.
[0008] Optionally, integrating the transmission results to obtain the bandwidth data includes: determining bandwidth data points within a single sampling period; repeating the operation of determining the bandwidth data points within a single sampling period to obtain multiple bandwidth data points for multiple sampling periods; and integrating the bandwidth data points to obtain the bandwidth data.
[0009] Optionally, determining the bandwidth change trend based on the fitting result includes: when the fitting result is equal to a preset threshold, determining the bandwidth change trend as a first change trend; wherein the first change trend indicates that the bandwidth data is stable; when the fitting result is greater than the preset threshold, determining the bandwidth change trend as a second change trend; wherein the second change trend indicates that the bandwidth data is increasing; when the fitting result is less than the preset threshold, determining the bandwidth change trend as a third change trend; wherein the third change trend indicates that the bandwidth data is decreasing.
[0010] Optionally, determining the link speed adjustment strategy for the hard disk based on the bandwidth change trend includes: when the bandwidth change trend is the first change trend, determining the adjustment strategy as a first adjustment strategy; wherein the first adjustment strategy is to keep the link speed unchanged.
[0011] Optionally, determining the adjustment strategy for the hard disk's link speed based on the bandwidth change trend includes: when the bandwidth change trend is the second change trend, determining the adjustment strategy as a second adjustment strategy; wherein the second adjustment strategy is to increase the link speed; or when the bandwidth change trend is the second change trend, and the current link speed is at its maximum or minimum value, determining the adjustment strategy as a first adjustment strategy; or when the bandwidth change trend is the third change trend, determining the adjustment strategy as a third adjustment strategy; wherein the third adjustment strategy is to decrease the link speed; or when the bandwidth change trend is the third change trend, and the current link speed is at its minimum value, determining the adjustment strategy as a first adjustment strategy.
[0012] Optionally, when the bandwidth change trend is the second change trend or the third change trend, the method further includes: determining the average data of the bandwidth data; and determining the adjustment strategy of the link speed based on the average data and the bandwidth change trend.
[0013] Optionally, determining the average data of the bandwidth data includes: determining the average value of multiple bandwidth data points within the bandwidth data; and integrating the average values to obtain the average data.
[0014] Optionally, determining the adjustment strategy for the link speed based on the average data and the bandwidth change trend includes: comparing the average data with a bandwidth threshold; when the bandwidth change trend is the second change trend and the average data is greater than the bandwidth threshold, determining the adjustment strategy as a second adjustment strategy; wherein the second adjustment strategy is to increase the link speed; or when the bandwidth change trend is the second change trend and the average data is less than or equal to the bandwidth threshold, determining the adjustment strategy as a first adjustment strategy, wherein the first adjustment strategy is to keep the link speed unchanged; or when the bandwidth change trend is the third change trend and the average data is less than the bandwidth threshold, determining the adjustment strategy as a third adjustment strategy; wherein the third adjustment strategy is to decrease the link speed; or when the bandwidth change trend is the third change trend and the average data is greater than or equal to the bandwidth threshold, determining the adjustment strategy as a first adjustment strategy.
[0015] This application provides a device for adjusting the hard disk link speed, comprising: The acquisition unit is used to acquire the workload status of the hard drive in real time. The first determining unit is used to determine the bandwidth change trend based on the workload status; The second determining unit is used to determine the link speed adjustment strategy of the hard disk based on the bandwidth change trend.
[0016] This application provides a storage device, including: Memory, used to store computer programs; A processor, used to implement the method for adjusting the hard disk link speed when executing the computer program.
[0017] This application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of a method for adjusting the hard disk link speed. Data is typically stored and retrieved on a page-by-page basis on the storage medium, while data is erased on a block-by-block basis, where a block contains multiple pages.
[0018] By adopting the above technical solution, the beneficial effect of this application is that it can dynamically and adaptively adjust the PCIe link speed by monitoring the hard disk workload in real time and intelligently predicting its bandwidth change trend. This achieves a significant reduction in system power consumption and heat generation while ensuring high-performance data transmission requirements, extending equipment life, and providing users with an intelligent energy efficiency management experience that does not require manual intervention. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is one of the flowcharts illustrating a method for adjusting hard disk link speed according to an embodiment of this application; Figure 2 This is a second schematic flowchart illustrating a method for adjusting hard disk link speed according to an embodiment of this application; Figure 3 This is a schematic diagram illustrating the relationship between bandwidth variation trend and threshold coefficient as described in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the process of firmware dynamically adjusting link speed based on bandwidth according to an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a hard disk link speed adjustment device according to an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a solid-state storage device according to an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0023] The following detailed embodiments are provided to aid the reader in gaining a comprehensive understanding of the methods, apparatus, and / or systems described herein. However, various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but may be changed as will become clear upon understanding this disclosure, except for operations that must occur in a specific order. Furthermore, for the sake of clarity and conciseness, descriptions of features known upon understanding this disclosure may be omitted.
[0024] The features described herein may be implemented in different forms and should not be construed as being limited to the examples described herein. Rather, the examples described herein are provided merely to illustrate some of the many feasible ways of implementing the methods, apparatus, and / or systems described herein that will be clear upon understanding the disclosure of this application.
[0025] Although terms such as “first,” “second,” and “third” may be used herein to describe various components, assemblies, regions, layers, or parts, these components, assemblies, regions, layers, or parts are not limited by these terms. Rather, these terms are used only to distinguish one component, assembly, region, layer, or part from another. Therefore, without departing from the teaching of the examples described herein, the first component, first assembly, first region, first layer, or first part referred to as the first component, first assembly, first region, first layer, or first part may also be referred to as the second component, second assembly, second region, second layer, or second part.
[0026] The terminology used herein is for the purpose of describing various examples only and is not intended to limit disclosure. Unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. The terms “comprising,” “including,” and “having” indicate the presence of the features, quantities, operations, components, elements, and / or combinations thereof stated therein, but do not preclude the presence or addition of one or more other features, quantities, operations, components, elements, and / or combinations thereof.
[0027] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0028] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as understood based on the disclosure of this application and as commonly understood by one of ordinary skill in the art to which this application pertains. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having the same meaning as they have in the context of the relevant art and in the disclosure of this application, and shall not be interpreted ideally or overly formally. The use of the term “may” herein with respect to examples or embodiments (e.g., regarding what an example or embodiment may include or implement) indicates the existence of at least one example or embodiment that includes or implements such a feature, while not all examples are limited thereto.
[0029] PCIe has evolved to its fifth generation, with each iteration resulting in significant speed improvements. New-generation data centers are gradually deploying PCIe 5.0 products (server platforms, enterprise-grade storage devices, etc.). Its high bandwidth and low latency offer substantial advantages in current technological advancements, particularly in the field of AI.
[0030] Since PCIe products are backward compatible, Table 1 illustrates the PCIe single-channel link speed. As shown in Table 1, a PCIe Gen5 platform is compatible with PCIe Gen4 or PCIe Gen3 products, which makes it possible to dynamically adjust the PCIe link speed of storage devices. Enterprise-grade solid-state drives can modify the PCIe link speed by adjusting parameters. The PCIe bandwidth calculation formula is as follows: Effective bandwidth = Link rate × Number of channels × Coding efficiency.
[0031] Table 1. Schematic diagram of PCIe single-channel link speed
[0032] For example, Table 2 compares the effective bandwidth of x4 links across different PCIe standards. As shown in Table 2, taking the PCIe Gen5 platform with x4 lanes and 128 / 130 encoding as an example: 32 GT / s × 4 lanes × (128 / 130 encoding) ≈ 126 Gb / s = 15.75 GB / s. Table 2 shows that with each iteration of the PCIe version, the bandwidth of the x4 lane has increased exponentially. This has resulted in a significant performance boost for devices relying on the PCIe interface, completely eliminating storage bottlenecks and providing a solid foundation for applications requiring extremely high data throughput.
[0033] Table 2 Comparison of Effective Bandwidth of x4 Link in PCIe Standards of Different Generations
[0034] A PCIe Gen5 solid-state drive was inserted into a PCIe Gen5-enabled host. By setting different PCIe link speeds for the solid-state drive (with a fixed number of channels of 4), the power consumption was tested under different write bandwidths. Table 3 shows the relationship between PCIe link speed and power consumption under different write bandwidths. Table 3. Relationship between PCIe link speed and power consumption under different write bandwidths.
[0035] As shown in Table 3, horizontally, at a specific PCIe link speed, write bandwidth and power consumption are basically linearly related; the higher the write bandwidth, the higher the power consumption. Vertically, at a specific write bandwidth, PCIe link speed and power consumption are basically linearly related; the higher the PCIe link speed, the higher the power consumption.
[0036] Based on this, and after verifying the relationship between PCIe link speed and power consumption, this application proposes a method for adjusting hard disk link speed. Figure 1 This is a flowchart illustrating a method for adjusting hard disk link speed according to an embodiment of this application; as shown below. Figure 1 As shown, the method for adjusting the hard drive link speed includes: S101. Obtain the hard drive's workload status in real time.
[0037] The workload status may include at least the amount of data read / write on the hard drive and the idle time. It should be noted that this is only an example and does not limit the specific content of the workload status.
[0038] For example, the real-time data read / write command frequency and data transmission bandwidth utilization can be collected through the solid-state drive controller to obtain the data read / write volume; the duration of no data read / write commands on the solid-state drive can be recorded through a timer to obtain the idle time.
[0039] S102. Determine the bandwidth change trend based on workload status.
[0040] After S101 obtains the workload status, it converts the real-time hard disk workload into continuous and quantified bandwidth data, thereby analyzing the bandwidth data to determine the bandwidth change trend.
[0041] Specifically, based on the workload status, the pattern of load fluctuation is determined, thereby determining the sampling period. The sampling period needs to match the fluctuation characteristics of the actual hard drive load. If the load fluctuates frequently (such as intermittent read and write of mobile devices), the sampling period should be shorter (such as 100ms) to capture details; if the load is relatively stable (such as continuous data processing of servers), the sampling period can be appropriately extended (such as 200ms) to reduce the consumption of computing resources.
[0042] After determining the sampling period, the amount of transmitted data is sampled within the sampling period to determine the bandwidth data. Then, the bandwidth data is analyzed to determine the bandwidth change trend. That is, the load change pattern is extracted from the bandwidth data arranged in chronological order to clearly determine whether the bandwidth is continuously rising, continuously falling, or remaining stable, so as to avoid misjudgment due to short-term fluctuations.
[0043] For example, analyzing the sequence patterns and trends of bandwidth data through mathematical algorithms or models can quantify the current bandwidth change trend (such as rising, falling, or stabilizing) and its strength. This is merely an example and does not limit the specific methods for determining bandwidth change trends.
[0044] In this embodiment, by transforming discrete bandwidth values into explicit trend classifications, link speed adjustment no longer depends on instantaneous data but is based on continuous load characteristics. This fundamentally solves the problem of frequent speed adjustments caused by short-term fluctuations in the prior art, and provides a scientific basis for subsequent precise adjustment of link speed.
[0045] S103. Based on the bandwidth change trend, determine the adjustment strategy for the hard disk link speed.
[0046] Based on the bandwidth change trend determined by S103, a strategy for adjusting the hard drive's link speed is determined.
[0047] Specifically, when an upward trend in bandwidth is predicted, the link speed / width is increased to ensure that the channel is ready when high load arrives, avoiding performance bottlenecks and stuttering; when the bandwidth trend is downward or remains low, the link speed / width is reduced after a brief confirmation to enter a low-power state for energy saving and cooling.
[0048] For example, when high-speed data transfer is required (such as copying large videos or loading large games), the link speed is adjusted to a high level to ensure transmission efficiency; when data transfer demand is low (such as standby or small file operations), the speed is automatically reduced to a low level to reduce power consumption; the entire adjustment process is intelligent and does not require manual operation, and will be automatically triggered according to the trend of hard drive bandwidth changes.
[0049] In this embodiment, by capturing the hard drive workload status in real time, the appropriate bandwidth change trend is accurately determined, and a targeted hard drive link speed adjustment strategy is formulated. This process enables dynamic and intelligent matching between the link speed and the actual operating requirements of the hard drive, avoiding resource waste and energy redundancy caused by excessive speed, and preventing performance bottlenecks caused by insufficient speed. Ultimately, it effectively improves the stability, efficiency and resource utilization of hard drive data transmission, and optimizes the overall performance of the storage system.
[0050] In some embodiments, such as Figure 2 As shown, bandwidth data is determined based on workload status, including: S121. Within a single sampling period, determine the amount of data transferred by the hard disk and obtain the transfer result.
[0051] Specifically, within a sampling period, the number of data frames processed by the firmware is counted, that is, the amount of data transferred by the hard drive is determined. For example, the firmware can periodically sample and monitor the bandwidth of the solid-state drive's internal write command processing.
[0052] For example, assuming a 4K data frame as the basic unit (the standard transmission unit of a solid-state drive), the total number of 4K data frames successfully processed in this period (denoted as N) is counted; the transmission result = the size of a single 4K data frame (fixed at 4KB) × the number of frames processed (N), which is the total amount of data transmitted in this period (e.g., 4KB × 100 frames = 400KB).
[0053] The load fluctuation characteristics and sampling period can be determined based on the workload status of the solid-state drive. The sampling period must be matched with the load fluctuation characteristics to avoid data lag due to an excessively long period or waste of computing resources due to an excessively short period.
[0054] For example, based on the initial load determination (such as "high fluctuation load" or "low fluctuation load"), a preset period is used: for high fluctuation scenarios (such as intermittent read and write of mobile devices): a short period (such as 100ms) is used to ensure that instantaneous changes are captured; for low fluctuation scenarios (such as continuous data processing of servers): a long period (such as 200ms) is used to reduce invalid calculations. It should be noted that this is only an example and does not limit the specific value of the sampling period.
[0055] S122. Integrate the transmission results and determine the bandwidth data points within a single sampling period to obtain the bandwidth data.
[0056] Specifically, the transmission results are integrated to determine the bandwidth data point within a single sampling period; that is, the bandwidth within a single sampling period is calculated as a data point.
[0057] For example, assuming 100ms = 400KB transmitted within a period, then the bandwidth data point = 400KB ÷ 0.1s = 4MB / s. It should be noted that this is only an example and does not limit the specific method for determining the bandwidth data point.
[0058] After determining a bandwidth data point, repeat the above operation of determining bandwidth data points within a set sampling period (e.g., obtaining 10 bandwidth data points over 10 consecutive sampling periods). Combine multiple bandwidth data points arranged in chronological order to form bandwidth data (e.g., [4MB / s, 5MB / s, ..., 3MB / s]), that is, continuously sample multiple data points to form an array, creating a continuous load quantization record.
[0059] This embodiment dynamically adjusts the sampling period based on the real-time workload and accurately calculates the amount of data in each period to generate bandwidth data points. Finally, it integrates these data points to form a high-fidelity bandwidth sequence, achieving refined and adaptive monitoring of hard disk performance. This provides a highly accurate and efficient data foundation for subsequent trend prediction and link control, significantly improving system resource utilization and response efficiency.
[0060] S123. Fit the bandwidth data to obtain the fitting result.
[0061] Specifically, for the bandwidth data obtained from sampling, a linear regression method can be used to fit the bandwidth data using the least squares method.
[0062] For example, in a univariate linear regression model, the two variables are linearly correlated, so the fitted result is a sample regression line with the equation: y = a + bx. The values of a and b can be obtained by solving the differential equation using the least squares method, where a represents the intercept of the line and b represents the slope. The values of a and b are calculated using the following formula:
[0063] The elements in the bandwidth data are represented as follows: , Where b represents the slope of the line, a represents the direct intercept, and n represents the number of elements. Represents n items Summation, Represents n items Summation, Represents n items The average value, Represents n items The average value.
[0064] S124. Based on the fitting results, determine the bandwidth change trend.
[0065] Specifically, since the slope value in the fitting result can reflect the trend of sampled data changes, taking a slope greater than 0 as an example, the data shows an upward trend. The larger the slope, the greater the data change per unit time, and the faster the upward trend; the smaller the slope, the smaller the data change per unit time, and the slower the upward trend. When bandwidth data increases rapidly, it is desirable to adjust to a higher link speed as soon as possible to prevent bandwidth from being limited due to insufficient link speed; when bandwidth data increases slowly, it is desirable to delay adjusting to a higher link speed, running at a lower link speed for as long as possible while meeting bandwidth requirements, in order to reduce power consumption. The least squares method can be used to fit the bandwidth change trend, which helps the firmware determine the changes in the bandwidth of the solid-state drive's write command processing at this time.
[0066] To address the complex scenarios described above, simply comparing with a fixed bandwidth threshold is insufficient. Therefore, a method is adopted that compares different bandwidth thresholds for different slopes. By determining different preset thresholds, link speeds can be switched more precisely to control power consumption. The formula for calculating the bandwidth threshold is: Bandwidth threshold = PCIe link speed * threshold coefficient.
[0067] For example, Figure 3 This is a schematic diagram illustrating the relationship between bandwidth variation trend and threshold coefficient as described in an embodiment of this application; as shown below. Figure 3 As shown, the steeper the slope of the fitted line for bandwidth change, the faster the bandwidth increases. Therefore, in line A, choosing a smaller threshold coefficient of 1 allows for earlier detection of exceeding the bandwidth threshold, enabling timely switching of the PCIe link speed to a higher speed. Conversely, the smaller the slope of the fitted line, the slower the bandwidth increases. In line B, choosing a larger threshold coefficient of 4 delays the detection of exceeding the bandwidth threshold. Switching to a higher link speed too early will increase power consumption.
[0068] After determining the preset threshold, the fitting results are compared with the preset threshold to determine the bandwidth change trend.
[0069] When the fitting result equals the preset threshold, it indicates that the actual data transmission demand of the hard drive has not changed significantly. Based on this, the bandwidth change trend is determined as the first change trend; where the first change trend indicates that the bandwidth data is stable.
[0070] When the fitting result is greater than the preset threshold, it indicates that the actual data transmission demand of the hard drive is gradually increasing over time. Based on this, the bandwidth change trend is determined to be the second change trend; where the second change trend indicates that the bandwidth data is increasing.
[0071] When the fitting result is less than the preset threshold, it indicates that the actual data transmission demand of the hard drive gradually decreases over time. Based on this, the bandwidth change trend is determined to be the third change trend; where the third change trend indicates a decrease in bandwidth data.
[0072] This embodiment fits bandwidth data and compares its slope with a preset threshold to accurately and automatically identify whether the bandwidth is stable, rising, or falling in real time. This provides a clear and reliable basis for subsequent dynamic adjustment of link speed, thereby achieving an intelligent balance between performance assurance and energy saving in the system.
[0073] S125. Based on the bandwidth change trend, determine the adjustment strategy for the hard disk link speed.
[0074] When the bandwidth change trend is the first change trend, it means that when the load is stable, the current link speed has adapted to the actual transmission demand. Frequent adjustments will consume additional controller resources and increase ineffective power consumption. Maintaining the speed can maximize the balance between efficiency and energy consumption. Based on this, the adjustment strategy is determined to be the first adjustment strategy; where the first adjustment strategy is to keep the link speed unchanged.
[0075] When the bandwidth change trend is the second trend, it indicates that the bandwidth data is showing an upward trend. Based on this, the adjustment strategy is determined to be the second adjustment strategy; wherein, the second adjustment strategy is to increase the link speed.
[0076] When the bandwidth change trend is the second change trend, and the current link speed is at its maximum or minimum value, the adjustment strategy is determined to be the first adjustment strategy.
[0077] When the bandwidth change trend is the third trend, it indicates that the bandwidth data is showing a downward trend. Based on this, the adjustment strategy is determined to be the third adjustment strategy, which is to reduce the link speed.
[0078] When the bandwidth change trend is the third trend and the current link speed is at its minimum, the adjustment strategy is determined to be the first adjustment strategy.
[0079] When the bandwidth change trend is the second or third trend, it indicates that the bandwidth data is showing an upward or downward trend. Only by fitting the results can the direction of the trend be determined, but the true intensity of the load cannot be accurately grasped. Based on this, the average value of multiple bandwidth data points within the bandwidth data is determined and integrated to determine the average value of the bandwidth data. The average value is a core quantitative indicator that reflects the true and continuous level of the current load. Compared with a single bandwidth data point, it eliminates the influence of instantaneous fluctuations and is more representative of the actual load intensity under a gradual upward or downward trend.
[0080] After determining the average data, the average data is compared with the bandwidth threshold. When the bandwidth change trend is the second trend and the average data is greater than the bandwidth threshold, it indicates that the load is continuously rising and has reached a level that requires higher link speed to support it. It is necessary to increase the link speed to avoid performance bottlenecks. Based on this, the adjustment strategy is determined to be the second adjustment strategy, which is to increase the link speed.
[0081] When the bandwidth change trend is the second trend and the average data is less than or equal to the bandwidth threshold, it indicates that although there is an upward trend, the actual load has not exceeded the adaptation range of the current link speed. It is necessary to keep the link speed unchanged to avoid blindly increasing power consumption. Based on this, the adjustment strategy is determined to be the first adjustment strategy.
[0082] When the bandwidth change trend is the third trend and the average data is less than the bandwidth threshold, it indicates that the load is continuously decreasing and has dropped to a level where the link speed can be reduced. It is necessary to reduce the link speed and reduce ineffective power consumption. Based on this, the adjustment strategy is determined to be the third adjustment strategy, which is to reduce the link speed.
[0083] When the bandwidth change trend is the third trend and the average data is greater than or equal to the bandwidth threshold, it indicates that although it is showing a downward trend, the actual load still needs to be supported by the current link speed. It is necessary to keep the link speed unchanged to avoid excessive speed reduction affecting performance. Based on this, the adjustment strategy is determined to be the first adjustment strategy.
[0084] Based on the above method, switching between GEN3, GEN4, and GEN5 can be achieved (GEN5 has the highest link speed, and GEN3 has the lowest link speed). Figure 4 This is a schematic diagram illustrating a process for firmware to dynamically adjust link speed based on bandwidth, as described in an embodiment of this application. Figure 4 As shown, it includes: S401, Data sampling and detection bandwidth.
[0085] Real-time sampling of hard drive bandwidth is performed to obtain bandwidth data reflecting the current data transfer volume and other load conditions. This is the basic input for subsequent analysis.
[0086] S402. Calculate the trend of change in the moving average bandwidth.
[0087] By calculating a moving average, the sampled bandwidth data is processed to analyze bandwidth change trends. The moving average effectively filters out instantaneous fluctuations and more accurately reflects continuous bandwidth changes.
[0088] S403. Determine the trend of bandwidth changes.
[0089] The trend of bandwidth change after moving average processing is judged, and there are three cases: no change, upward trend, and downward trend. When the bandwidth trend is no change, S407 is executed; when the bandwidth trend is upward, S404 is executed; when the bandwidth trend is downward, S408 is executed.
[0090] S404. Determine if the current GenX is the maximum value.
[0091] Check if the current link speed specification (GenX, such as PCIe Gen3, Gen4, etc.) is the maximum speed supported by the system. If yes, execute S407 with the parameters unchanged; if not, execute S405.
[0092] S405. Determine whether the sliding average value is greater than the current GenX link speed multiplied by the threshold coefficient.
[0093] Further determine whether the bandwidth value after moving average exceeds the current GenX link speed multiplied by the set threshold coefficient. If not, execute S407 with the parameters unchanged; if yes, execute S406.
[0094] S406, Set parameters to GenX+1 link speed.
[0095] When conditions are met, the link speed will be upgraded to a higher specification (GenX+1) to accommodate the increased bandwidth and load, ensuring data transmission performance.
[0096] S407, parameters remain unchanged.
[0097] Keep the link speed-related parameters unchanged.
[0098] S408. Determine if the current GenX is the minimum value.
[0099] Check if the current link speed specification is the minimum speed supported by the system. If yes, execute S407 with the parameters unchanged; if not, execute S409.
[0100] S409. Determine whether the sliding average value is less than GenX-1 link speed * threshold coefficient.
[0101] Determine if the bandwidth value after moving average is lower than the value obtained by multiplying the lower specification (GenX-1) link speed by a set threshold coefficient. If not, execute S407 with the parameters unchanged; if yes, execute S410. Here, GenX-1 refers to a speed one level lower than GenX.
[0102] S410, set parameters to GenX-1 link speed.
[0103] When conditions are met, the link speed is reduced to a lower specification (GenX-1) to reduce unnecessary power consumption when the load decreases, thus achieving power optimization.
[0104] This embodiment performs fitting analysis on bandwidth data and determines whether it is a stable, rising, or falling trend by combining it with a preset threshold. Then, it formulates a link speed adjustment strategy for different trends. When the trend is stable, the speed is maintained to avoid unnecessary power consumption. When the trend is rising or falling, the average value of the bandwidth data is calculated first. Based on the comparison results of the average value and the bandwidth threshold, the speed is increased only when the trend is rising and the average value exceeds the threshold, and the speed is decreased when the trend is falling and the average value is lower than the threshold. In other cases, the speed is maintained.
[0105] Its beneficial effects are as follows: it can filter out instantaneous fluctuations through trend analysis, avoiding the instability and additional power consumption caused by frequent switching of link speeds; and it can ensure that the link speed only operates when the load changes continuously and needs to be adjusted through the dual judgment of average value and threshold, so as to achieve load adaptation and on-demand speed adjustment, balance hard drive data transmission performance and power consumption, avoid latency caused by insufficient speed under high load, and reduce energy waste caused by excessive speed under low load, significantly improving hard drive operating efficiency and device battery life.
[0106] This application also provides a device for adjusting the hard disk link speed. Figure 5 This is a schematic diagram of a hard disk link speed adjustment device 500 according to an embodiment of this application. The hard disk link speed adjustment device 500 includes: The acquisition unit 501 is used to acquire the workload status of the hard disk in real time. The first determining unit 502 is used to determine the bandwidth change trend based on the workload status; The third determining unit 503 is used to determine the adjustment strategy for the hard disk link speed based on the bandwidth change trend.
[0107] This application also provides a solid-state storage device, such as... Figure 6 As shown, the storage device may include a processor 610 and a memory 620, wherein the memory 620 stores a computer program. When the computer program is executed by the processor 610, it can implement the method provided in any of the above embodiments. The execution method and beneficial effects are similar and will not be described again here.
[0108] This application also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors. For example, the one or more processors can execute the hard disk link speed adjustment method in any of the above method embodiments, such as executing the hard disk link speed adjustment method in any of the above method embodiments, or executing the steps described above.
[0109] The apparatus or device embodiments described above are merely illustrative. The unit modules described as separate components may or may not be physically separate, and the components shown as module units may or may not be physical units; that is, they may be located in one place or distributed across multiple network module units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general-purpose hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions for a computer device (which may be a personal computer, server, or network device, etc.) to execute the various embodiments or some parts of the embodiments.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above. For the sake of brevity, they are not provided in detail; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for adjusting the link speed of a hard disk, characterized by, The method comprises: acquiring a working load state of a hard disk in real time; determining a bandwidth change trend based on the working load state; determining an adjustment strategy of a link speed of the hard disk based on the bandwidth change trend.
2. The method of claim 1, wherein, The determining of the bandwidth change trend based on the working load state comprises: determining a sampling period based on the working load state; determining a data amount transmitted by the hard disk in a single sampling period to obtain a transmission result; integrating the transmission result to obtain the bandwidth data; fitting the bandwidth data to obtain a fitting result; determining the bandwidth change trend based on the fitting result.
3. The method of claim 2, wherein, The integrating of the transmission result to obtain the bandwidth data comprises: determining a bandwidth data point in a single sampling period; repeating the operation of determining the bandwidth data point in a single sampling period to obtain a plurality of bandwidth data points in a plurality of sampling periods; integrating the bandwidth data points to obtain the bandwidth data.
4. The method of claim 2, wherein the step of adjusting the link speed of the hard disk drive is performed by a driver of the hard disk drive. The determining of the bandwidth change trend based on the fitting result comprises: when the fitting result is equal to a preset threshold, determining that the bandwidth change trend is a first change trend; wherein the first change trend indicates that the bandwidth data is stable; when the fitting result is greater than the preset threshold, determining that the bandwidth change trend is a second change trend; wherein the second change trend indicates that the bandwidth data is rising; when the fitting result is less than the preset threshold, determining that the bandwidth change trend is a third change trend; wherein the third change trend indicates that the bandwidth data is falling.
5. The method of claim 4, wherein, The determining of the adjustment strategy of the link speed of the hard disk based on the bandwidth change trend comprises: when the bandwidth change trend is the first change trend, determining that the adjustment strategy is a first adjustment strategy; wherein the first adjustment strategy is to keep the link speed unchanged.
6. The method of claim 4, wherein, The determining of the adjustment strategy of the link speed of the hard disk based on the bandwidth change trend comprises: when the bandwidth change trend is the second change trend, determining that the adjustment strategy is a second adjustment strategy; wherein the second adjustment strategy is to increase the link speed; or when the bandwidth change trend is the second change trend and a current link speed is a maximum value or a minimum value, determining that the adjustment strategy is the first adjustment strategy; or when the bandwidth change trend is the third change trend, determining that the adjustment strategy is a third adjustment strategy; wherein the third adjustment strategy is to decrease the link speed; or when the bandwidth change trend is the third change trend and the current link speed is the minimum value, determining that the adjustment strategy is the first adjustment strategy.
7. The method of claim 4, wherein the step of adjusting the link speed of the hard disk is performed by a driver of the hard disk. When the bandwidth change trend is the second change trend or the third change trend, the method further comprises: determining average data of the bandwidth data; determining the adjustment strategy of the link speed based on the average data and the bandwidth change trend.
8. The method of claim 7, wherein, The determining of the average data of the bandwidth data comprises: determining an average value of a plurality of bandwidth data points in the bandwidth data; integrating the average value to obtain the average data.
9. The method of claim 7, wherein the step of adjusting the link speed of the hard disk is performed by a driver of the hard disk. The determining the adjustment strategy of the link speed based on the average data and the bandwidth change trend comprises: comparing the average data with a bandwidth threshold value; when the bandwidth change trend is the second change trend and the average data is greater than the bandwidth threshold value, determining the adjustment strategy as a second adjustment strategy; wherein the second adjustment strategy is to increase the link speed; or when the bandwidth change trend is the second change trend and the average data is less than or equal to the bandwidth threshold value, determining the adjustment strategy as a first adjustment strategy; wherein the first adjustment strategy is to keep the link speed unchanged; or when the bandwidth change trend is the third change trend and the average data is less than the bandwidth threshold value, determining the adjustment strategy as a third adjustment strategy; wherein the third adjustment strategy is to decrease the link speed; or when the bandwidth change trend is the third change trend and the average data is greater than or equal to the bandwidth threshold value, determining the adjustment strategy as the first adjustment strategy.
10. A storage device, comprising: comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the hard disk link speed adjustment method according to any one of claims 1 to 9.