Solid-state hard drive life loss detection method and device
Through the target network model and bandwidth ratio detection, the problem of low accuracy of SSD life loss detection is solved, and dynamic optimization and accurate detection of SSD performance is achieved.
Patent Information
- Application Number
- CN202411343155.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The existing solid-state drive life loss detection methods cannot reflect the actual health status in real time, resulting in low detection accuracy.
By obtaining the current running data of the solid-state drive, using the target network model trained based on historical running data and long-term neural network model, predict the number of commands, and detect life loss according to the bandwidth ratio, and perform performance adjustments in combination with dynamic optimization rules.
It improves the accuracy of SSD life loss detection and realizes dynamic optimization of SSD performance.
Smart Images

Figure CN119314540B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid-state hard disks, and in particular to a method and device for detecting life loss of solid-state hard disks. Background Art
[0002] With the rapid development of information technology, solid-state drives (SSDs), as non-volatile storage devices, have been widely used in terminal devices such as smartphones, tablets, and personal computers. Therefore, the lifespan of SSDs affects the use of terminal devices such as smartphones, tablets, and personal computers.
[0003] Existing methods for detecting SSD lifespan loss primarily rely on read / write cycle counting, which tracks the number of read and write cycles per memory cell in an SSD to assess its lifespan. However, this method only provides a rough estimate of the drive's lifespan and fails to reflect its actual health status in real time, resulting in low accuracy in detecting SSD lifespan loss. Summary of the Invention
[0004] In response to the above-mentioned problems, the present invention provides a method and device for detecting the life loss of a solid-state drive, so as to improve the accuracy of detecting the life loss of a solid-state drive.
[0005] In a first aspect, the present invention provides a method for detecting life loss of a solid-state drive, comprising:
[0006] Get the current operating data of the solid state drive;
[0007] Inputting the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to evaluate the life loss of the solid-state drive;
[0008] Determining a bandwidth ratio according to the predicted command quantity and a command quantity threshold;
[0009] The life loss of the solid state drive is detected based on the bandwidth ratio.
[0010] According to the solid-state drive life loss detection method provided by the present invention, the training process of the target network model is as follows:
[0011] Determine a time series forward arrangement training data set and a time series reverse arrangement training data set according to the training data set;
[0012] Inputting the time series forward arrangement training data set and the time series reverse arrangement training data set into the long-short term neural network model respectively to obtain a bidirectional learning network model;
[0013] Training the bidirectional learning network model according to a preset number of training times and error accuracy to obtain an initial network model;
[0014] The verification data set is input into the initial network model for model optimization to obtain the target network model.
[0015] According to the solid state drive life loss detection method provided by the present invention, determining the bandwidth ratio based on the predicted command quantity and the command quantity threshold includes:
[0016] Get the amount of data written by the command and the amount of data recovered by the command;
[0017] Obtaining a data volume ratio according to a ratio of the amount of data written by the command to the amount of data recovered by the command;
[0018] determining a quantity difference according to a difference between the predicted command quantity and a command quantity threshold;
[0019] The bandwidth ratio is determined according to the data volume ratio and the quantity difference.
[0020] According to the method for detecting life loss of a solid-state drive provided by the present invention, after detecting the life loss of the solid-state drive based on the bandwidth ratio, the method further includes:
[0021] Determine the preset ratio;
[0022] Determining a relationship between the preset ratio and the bandwidth ratio;
[0023] The bandwidth ratio is adjusted according to the relationship between the preset ratio and the bandwidth ratio and a dynamic optimization rule to obtain a performance optimization result of the solid state drive.
[0024] According to the method for detecting the life loss of a solid-state hard disk provided by the present invention, the method for detecting the life loss of a solid-state hard disk further includes:
[0025] Perform read operations on the solid-state drive;
[0026] Obtaining the number of read operations of the solid-state drive within each preset time interval and the delay time of each read operation;
[0027] A performance analysis report of the read operation is generated according to the number of reads and the delay time.
[0028] According to the method for detecting life loss of a solid-state drive provided by the present invention, before performing a read operation on the solid-state drive, the method further comprises: setting a plurality of control parameter combinations of a solid-state drive controller;
[0029] The performing of the read operation of the solid state hard disk comprises: performing the read operation of the solid state hard disk respectively under the control of the plurality of groups of control parameter combinations;
[0030] Accordingly, after generating a performance analysis report of a read operation according to the number of reads and the delay time, the method further includes:
[0031] In response to the current preset time interval not being a time interval with a preset minimum granularity, a first adjustment is made to a control parameter of the solid-state drive controller, and the preset time interval is reduced, and the process proceeds to the step of performing a read operation on the solid-state drive;
[0032] The first adjustment of the control parameters of the solid-state drive controller includes:
[0033] The multiple groups of control parameter combinations are screened according to the performance analysis report, and the control parameter combinations that meet the read latency performance requirements corresponding to the current preset time interval are retained; the value of at least one control parameter in the control parameter combination is adjusted; and / or, a new control parameter combination is added.
[0034] According to the method for detecting life loss of a solid-state drive provided by the present invention, after generating a performance analysis report of a read operation based on the number of reads and the delay time, the method further includes:
[0035] In response to the current preset time interval being the time interval of the preset minimum granularity, and knowing, according to the performance analysis report, that at least one of the multiple control parameter combinations satisfies the read latency performance requirement corresponding to the current preset time interval, terminating execution of the solid-state drive life loss detection method, and recording the at least one control parameter combination that satisfies the read latency performance requirement corresponding to the current preset time interval;
[0036] In response to the current preset time interval being the time interval of the preset minimum granularity, and knowing, according to the performance analysis report, that no control parameter combination that satisfies the read latency performance requirement corresponding to the current preset time interval exists among the multiple groups of control parameter combinations, performing a second adjustment on the control parameters of the solid-state drive controller, and proceeding to the step of executing the read operation on the solid-state drive;
[0037] The second adjustment of the control parameters of the solid-state drive controller includes:
[0038] Adjust the value of at least one control parameter in the control parameter combination; and / or add a new control parameter combination.
[0039] In a second aspect, the present invention provides a device for detecting the life loss of a solid-state drive, comprising:
[0040] The acquisition module is used to obtain the current operating data of the solid state drive;
[0041] a prediction module, configured to input the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to assess the life loss of the solid-state drive;
[0042] a determination module, configured to determine a bandwidth ratio according to the predicted command quantity and a command quantity threshold;
[0043] A loss detection module is used to detect the life loss of the solid state drive based on the bandwidth ratio.
[0044] In a third aspect, the present invention further provides an electronic device comprising: a memory for storing a computer software program; and a processor for reading and executing the computer software program, thereby implementing the solid-state hard drive life loss detection method as described in the first aspect above.
[0045] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, wherein the storage medium stores a computer software program, and when the computer software program is executed by a processor, the solid-state hard disk life loss detection method as described in the first aspect above is implemented.
[0046] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method for detecting life loss of a solid-state hard disk as described in the first aspect above.
[0047] The solid-state drive life loss detection method provided by the present invention accurately predicts the number of predicted commands used to evaluate the solid-state drive life loss through a target network model and current operating data, further accurately evaluates the bandwidth ratio based on the predicted number of commands, and then detects the solid-state drive life loss based on the accurate bandwidth ratio, thereby improving the accuracy of detecting the solid-state drive life loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 1 is a flow chart of a method for detecting life loss of a solid-state hard disk provided by the present invention;
[0050] Figure 2 It is a schematic diagram of the model structure provided by the present invention;
[0051] Figure 3 It is a structural schematic diagram of the life loss detection device of the solid state hard disk provided by the present invention;
[0052] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention;
[0053] Figure 5 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0055] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined. In the description of the present invention, the term "for example" is used to mean "serving as an example, illustration, or illustration." Any embodiment described as "for example" in the present invention is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is provided to enable anyone skilled in the art to implement and use the present invention. Details are listed in the following description for illustrative purposes. It should be understood that one of ordinary skill in the art will recognize that the present invention can be implemented without these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of the present invention with unnecessary detail. Therefore, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
[0056] See Figure 1 , Figure 1 : is a flow chart of a method for detecting the life loss of a solid-state hard disk provided by the present invention. The method for detecting the life loss of a solid-state hard disk includes:
[0057] Step 10: Obtain the current operating data of the solid state drive.
[0058] Current operation data refers to data updated and collected during SSD operation. Examples include time data, command data, block size data, write scale, and whether garbage collection (GC) is currently enabled. Time data refers to the time period of 10 sampling intensities, and command data refers to the command mode issued by the host computer, which can be divided into continuous write and random write.
[0059] In one embodiment, the specific implementation method of obtaining the current operating data of the solid-state drive includes: obtaining the initial operating data of the solid-state drive; cleaning the initial operating data for outliers and / or missing values to obtain target operating data; and normalizing the target operating data to obtain current operating data.
[0060] In this step, the initial operating data is the initial data updated and counted during the historical operation of the solid-state drive, specifically: obtaining the initial operating data updated and counted during the operation of the solid-state drive, and after obtaining the initial operating data, firstly performing data cleaning of abnormal values and / or missing values on the initial operating data to reduce the impact of abnormal data on subsequent model training, thereby obtaining target operating data; then further normalizing the target operating data so that the target operating data has a unified data specification, thereby obtaining the final current operating data, improving the accuracy of subsequent model training and model application, and reducing the impact of one data on subsequent use.
[0061] In one embodiment, the target operation data is normalized, and the normalization function is as follows: t =(x′ t -x′ min ) / (x′ max -x′ min ), where x t is the sample feature of the current running data collected at time t, x′ min is the minimum value of the sample feature, x′ max is the maximum value of the sample features collected.
[0062] In one embodiment, the target network model is trained based on historical operation data, and the historical operation data includes a training data set, a verification data set, and a test data set; after obtaining the historical operation data of the solid-state drive, it also includes: determining the training data set, the verification data set, and the test data set based on the historical operation data and data partitioning rules; wherein the data partitioning rules are pre-set partitioning ratios for partitioning the training data set, the verification data set, and the test data set.
[0063] In this step, the training data set is used to train the subsequent target network model; the validation data set is used to verify the trained target network model and determine the optimization performance of the trained target network model; the test data set is used to input the target network model for data testing.
[0064] The data partitioning rule is a pre-set partitioning ratio for dividing the training data set, verification data set and test data set. For example, the collected historical operation data can be randomly divided into three parts, such as 60% as the training data set, 20% as the verification data set, and 20% as the test data set.
[0065] Specifically, after acquiring the historical operation data of the solid state drive, the collected current operation data is randomly divided into three parts according to the historical operation data and the data division rule.
[0066] In one embodiment, when 100,080 pieces of historical operation data are obtained, the 100,080 pieces of current operation data are divided according to a data division rule such as 60% as a training data set, 20% as a verification data set, and 20% as a test data set.
[0067] In step 20, the current running data is input into the target network model as a test data set to obtain the number of predicted commands output by the target network model.
[0068] Among them, the target network model is obtained by training the training data set, verification data set and long-term and short-term neural network model based on historical operation data; the predicted number of commands is used to evaluate the life loss of the solid-state drive.
[0069] Specifically, after obtaining the historical operation data, the current operation data is input into the target network model as a test data set, and the input current operation data is processed by the target network model to obtain the predicted command data volume output by the target network model.
[0070] In one embodiment, the training process of the target network model is as follows: a time series forward arrangement training data set and a time series reverse arrangement training data set are determined based on the training data set; the time series forward arrangement training data set and the time series reverse arrangement training data set are respectively input into the long-term and short-term neural network model to obtain a bidirectional learning network model; the bidirectional learning network model is trained according to a preset number of training times and error accuracy to obtain an initial network model; the verification data set is input into the initial network model for model optimization to obtain a target network model.
[0071] See Figure 2 , Figure 2 This is a schematic diagram of the model structure provided by the present invention, such as Figure 2As shown, the inputs to the LSTN model include X1, X2, X3, ..., Xn, where X1, X2, X3, ..., Xn represent the number of currently running input data. The LSTN model consists of an input gate, a forget gate, and an output gate. Each neuron has a memory unit and three gate structures: input, output, and forget. This network uses these gates to control the flow of information and can store and recall information over long periods of time between input data. The target network model is an improvement on the traditional LSTN model: it is a fusion of a forward LSTM network and a reverse LSTM network. This improved target network model considers both past and future features of the sequence. It uses two LSTM networks, a forward input sequence, and a reverse input sequence, and then combines their outputs according to certain weights to produce the final result. The hidden layer of the improved model consists of two parts: the forward cell state and the reverse cell state. The flow sequence enters the hidden layer through the input layer and participates in the forward and reverse computations, respectively. The final output is obtained by combining the outputs of the forward LSTM network and the reverse LSTM network according to certain weights at the output layer.
[0072] The preset number of training times is the number of training times for the target network model, for example, 60 times, 80 times, 100 times, etc. The error accuracy is the accuracy that is preset to evaluate whether the training has achieved the preset error requirements. The preset error requirements can be, for example, the use of mean absolute error (MAE) and root mean square error (RMSE) as measurement indicators. MAE is the average of the absolute errors between the predicted value and the observed value, and RMSE is the expected value of the square of the difference between the predicted value and the true value. The smaller the values of these two errors, the better the performance of the model. The expressions of MAE and RMSE are as follows: Among them, m represents the total number of sampling times for the current running data, i represents the i-th sampling, R i represents the expected number of prediction commands for the i-th time, P i Represents the actual number of predicted commands for the i-th time. If the preset error requirement set for the training goal is met, the results are output and the target network model is determined. If the preset error requirement is not met, the preset number of training runs is increased or the training goal is redefined. Network model training is completed when the predetermined training goal is reached or the maximum number of training runs is reached. After multiple experiments, the optimally improved long-short-term memory network model is obtained, and the target network model is determined. The unknown number of predicted commands is predicted using known historical SSD operating data as a test dataset. After repeated experiments, the recorded results are analyzed and studied. The predicted number of commands is obtained by multiplying the output of the forward training network and the backward training network by a weighted matrix.
[0073] Specifically, first, a time series forward arrangement training data set and a time series reverse arrangement training data set are determined according to the training data set, and the time series forward arrangement training data set and the time series reverse arrangement training data set are respectively input into the long-term and short-term neural network model to strengthen and highlight the overall characteristics of the logical address of the long-term and short-term neural network model to obtain a bidirectional learning network model, and then the bidirectional learning network model is further trained according to the preset number of training times and error accuracy to obtain an initial network model, and finally, the verification data set is input into the initial network model for model optimization, and the parameters and count values are updated to obtain the target network model.
[0074] Furthermore, in the process of processing the input current running data through the target network model to obtain the predicted command data volume output by the target network model, considering the ideal situation that all blocks have no bad blocks and the GC write and host write are at a uniform speed, the data volume of the GC recovered source super data block (data block bound in units of 32 data blocks) is recorded as VDF GC , the amount of data in a super block excluding parity is recorded as VDF SBLK Then, the time it takes for GC to generate an idle superblock is equal to the total time it takes for GC and host to write a superblock. During this period, the amount of data recovered by GC is , and the amount of data written by the host is VDF WR =VDF SBLK -VDF GC , which means that the bandwidth ratio of host write bandwidth to GC write bandwidth should be equal to VDF WR / VDF GC Since GC starts when the number of free superblocks is less than a certain threshold, we hope that the number of free superblocks will be stable at a value less than this threshold to ensure that host writes do not time out and GC does not exit prematurely.
[0075] Therefore, a mechanism is needed to ensure that when there are more free super blocks, the host write bandwidth ratio is larger than the ideal steady-state bandwidth ratio, and the GC write bandwidth ratio is smaller than the ideal steady-state bandwidth ratio; and vice versa.
[0076] Step 30: Determine the bandwidth ratio according to the predicted command quantity and the command quantity threshold.
[0077] The command quantity threshold is a preset quantity.
[0078] In one embodiment, an implementation method for determining the bandwidth ratio based on the predicted command number and the command number threshold includes: obtaining the command write data volume and the command recovered data volume; obtaining a data volume ratio based on the ratio of the command write data volume and the command recovered data volume; determining a volume difference based on the difference between the predicted command number and the command number threshold; and determining the bandwidth ratio based on the data volume ratio and the volume difference.
[0079] The command quantity threshold is a preset value used to evaluate the predicted command quantity.
[0080] Specifically, the bandwidth ratio refers to the ratio of the expected write bandwidth to the expected recycle bandwidth. To write bandwidth expectations, To recover bandwidth expectation, VDF WR The amount of data written for the command, VDF GC The amount of data recovered by the command, n free is the number of predicted commands, n crit is the command quantity threshold, and c is a constant coefficient.
[0081] Step 40: Detect the life loss of the solid state drive based on the bandwidth ratio.
[0082] Furthermore, the SSD lifespan loss is detected based on the bandwidth ratio. In one embodiment, if the bandwidth ratio is in a first range, the SSD lifespan loss is determined to be low, where the second range is [20, 100]. If the bandwidth ratio is in a second range, the SSD lifespan loss is determined to be medium, where the second range is [5, 20]. If the bandwidth ratio is in a third range, the SSD lifespan loss is determined to be high, where the second range is [1, 5).
[0083] The embodiment of the present invention accurately predicts the number of predicted commands used to evaluate the life loss of the solid-state drive through the target network model and current operating data, further accurately evaluates the bandwidth ratio based on the predicted number of commands, and then detects the life loss of the solid-state drive based on the accurate bandwidth ratio, thereby improving the detection accuracy of the life loss of the solid-state drive.
[0084] In one embodiment, after detecting the life loss of the solid-state drive based on the bandwidth ratio, the method further includes: optimizing the performance of the solid-state drive based on the bandwidth ratio and dynamic optimization rules, wherein the dynamic optimization rules are pre-set rules for adjusting the bandwidth ratio, specifically: determining a preset ratio; determining the relationship between the preset ratio and the bandwidth ratio; adjusting the bandwidth ratio based on the relationship between the preset ratio and the bandwidth ratio and the dynamic optimization rules to obtain a performance optimization result of the solid-state drive.
[0085] Specifically, a preset ratio is determined; wherein the preset ratio is a ratio of a preset write bandwidth expectation to a reclaimed bandwidth expectation; a relationship between the preset ratio and the bandwidth ratio is determined; the bandwidth ratio is adjusted according to the relationship between the preset ratio and the bandwidth ratio and a dynamic optimization rule to determine a performance optimization result; when the bandwidth ratio is less than or equal to the preset ratio, the bandwidth ratio is adjusted according to a first dynamic adjustment rule to determine a performance optimization result; wherein the first dynamic adjustment rule is to lower the write bandwidth expectation and increase the reclaimed bandwidth expectation; when the bandwidth ratio is greater than the preset ratio, the bandwidth ratio is adjusted according to a second dynamic adjustment rule to determine a performance optimization result; wherein the second dynamic adjustment rule is to increase the reclaimed bandwidth expectation and lower the write bandwidth expectation.
[0086] In one embodiment, an adjustment factor related to the number of free super blocks, namely the bandwidth ratio, is added to the bandwidth ratio of the expected host write bandwidth and the expected GC write bandwidth. in, To write bandwidth expectations, To recover bandwidth expectation, VDF WR The amount of data written for the command, VDF GC The amount of data recovered by the command, n free is the number of predicted commands, n crit is the command quantity threshold, and c is a constant coefficient. Furthermore, the master core calculates the bandwidth ratio of the expected host write bandwidth to the expected GC write bandwidth based on the data volume of the GC source data block counted every second. Then, the bandwidth ratio is sent to the slave core. At the beginning of each second, each microcontroller unit (MCU) sets the current time as the starting time and independently counts the GC write bandwidth and host write bandwidth in the next second. For a certain moment in the interval (t0, t0+1s), the host write data volume from t0 to t is The amount of data written by GC is Since bandwidth control will block input / output (IO), if each core arbitrates independently, the different blocking conditions of each core may lead to unexpected deadlock. And by adopting the unified control method of the main core, the bandwidth of each core in the sub-time interval is calculated uniformly. The bandwidth upper limit is a shared variable and is visible to all cores. In the main loop, the main core dynamically adjusts the upper limit in real time based on the current actual ratio of host writes to GC writes. The basic principle is to calculate the expected bandwidth ratio of host writes to GC writes and normalize the ratio to 100,000. After determining If the number of remaining free data blocks is less than the danger threshold, divide the host write ratio by 2 to prevent timeout.
[0087] The embodiment of the present invention determines the bandwidth ratio according to the predicted number of prediction commands. The main core dynamically adjusts the upper limit in real time within the main loop according to the current actual bandwidth ratio of host writes to GC writes, thereby improving the steady-state performance of the solid-state drive.
[0088] In one embodiment, the method for detecting the life loss of a solid-state drive further includes: executing a read operation of the solid-state drive; obtaining the number of read operations of the solid-state drive within each preset time interval and the delay time of each read operation; and generating a performance analysis report of the read operation based on the number of read operations and the delay time.
[0089] The read operation of the solid-state drive can be executed according to the set read operation execution mode, and the read operation can be monitored in real time through the monitoring program. Among them, the monitoring logic can be integrated into the solid-state drive controller to realize real-time monitoring and recording of the read operation.
[0090] The read operation monitoring mechanism captures the start and end times of each read operation in real time, thereby obtaining latency information and providing a reliable basis for accurate latency calculation and performance analysis. A timestamp array can be configured to capture and record the start and end times of each read operation with high precision, providing detailed time data support for performance analysis.
[0091] By setting a counter that matches the preset time interval, it is ensured that the number of read operations within each preset time interval can be accurately recorded.
[0092] The calculated latency times are carefully categorized and statistically analyzed at preset time intervals to generate a performance analysis report for read operations. The frequency and latency distribution characteristics of read operations within each preset time interval are analyzed to reveal system performance bottlenecks and areas for improvement.
[0093] An embodiment of the present invention performs a read operation on a solid-state drive (SSD), obtains the number of read operations performed on the SSD within each preset time interval and the delay time of each read operation, and generates a performance analysis report for the read operation based on the number of read operations and the delay time, thereby achieving statistics and analysis of the delay time and facilitating optimization of SSD performance. In one embodiment, before performing a read operation on the SSD, the method further includes: setting multiple control parameter combinations for a SSD controller; and performing a read operation on the SSD includes: performing the read operation on the SSD under the control of the multiple control parameter combinations.
[0094] Optionally, a solid-state drive controller manages stored data and communicates with computers or other electronic devices. When a system or device needs to read or write data to the solid-state drive, it interacts with the solid-state drive controller. By setting the control parameters of the solid-state drive controller, you can control the read operations of the solid-state drive.
[0095] In an embodiment of the present invention, multiple control parameter combinations are provided for a solid-state drive controller, each control parameter combination being used to control a read operation of the solid-state drive. When executing a read operation on the solid-state drive, the read operation is performed separately under the control of the multiple control parameter combinations, thereby obtaining the number of read operations of the solid-state drive within each preset time interval and the delay time of each read operation under the control of each control parameter combination. Furthermore, a performance analysis report for the read operation generated based on the number of read operations and the delay time includes a performance analysis report for the read operation generated based on the number of read operations and the delay time corresponding to each control parameter combination.
[0096] The embodiment of the present invention sets multiple groups of control parameter combinations for the solid-state hard disk controller, and executes the read operations of the solid-state hard disk respectively under the control of the multiple groups of control parameter combinations, thereby realizing the read operations under the control of the multiple groups of control parameter combinations, thereby obtaining a performance analysis report of the read operations under the control of the multiple groups of control parameter combinations, and providing a basis for the optimization of the control parameters.
[0097] In one embodiment, after generating a performance analysis report of a read operation based on the number of reads and the delay time, the method further includes: in response to the current preset time interval not being a time interval of the preset minimum granularity, performing a first adjustment on the control parameters of the solid-state hard disk controller, reducing the preset time interval, and switching to the processing step of executing the read operation of the solid-state hard disk; wherein the first adjustment on the control parameters of the solid-state hard disk controller includes: screening multiple groups of control parameter combinations according to the performance analysis report, retaining the control parameter combinations that meet the read delay performance requirements corresponding to the current preset time interval; adjusting the value of at least one control parameter in the control parameter combination; and / or adding a new control parameter combination.
[0098] When counting the number of read operations on a solid-state drive and the delay time of each read operation, statistics are collected within the time range corresponding to the preset time interval. If the preset time interval is set to a smaller granularity, such as 10us, the amount of data acquired is large, and computing resources are consumed more. Therefore, in order to balance the optimization of solid-state drive controller parameters and the consumption of computing resources, the embodiment of the present invention sets preset time intervals of different granularities, such as 10us, 100us, and 1ms.
[0099] Different preset time intervals correspond to different read latency performance requirements, which include delay time. If a control parameter combination fails to meet the corresponding read latency performance requirement at a large-granularity preset time interval, it will also fail to meet the corresponding read latency performance requirement at a small-granularity preset time interval. If a control parameter combination meets the corresponding read latency performance requirement at a large-granularity preset time interval, it may or may not meet the corresponding read latency performance requirement at a small-granularity preset time interval.
[0100] Therefore, the preset time interval is changed from large to small. In this way, the control parameters are optimized first under the value of the preset time interval with large granularity. Then, the preset time interval is gradually reduced to achieve the gradual optimization of the control parameters of the solid-state drive controller.
[0101] After generating a performance analysis report of the read operation based on the number of reads and the delay time of the read operation, if the current preset time interval is not the time interval of the preset minimum granularity, a first adjustment is made to the control parameters of the solid-state hard disk controller, and the preset time interval is reduced to the next level according to the setting of the preset time interval, and the processing step of executing the read operation of the solid-state hard disk is performed, and then the number of reads of the read operation of the solid-state hard disk and the delay time of each read operation in each preset time interval are re-obtained, and a performance analysis report of the read operation is generated based on the number of reads and the delay time of the read operation.
[0102] Among them, the first adjustment of the control parameters of the solid-state hard disk controller includes at least one of the following operations: screening multiple groups of control parameter combinations according to the performance analysis report of the read operation, retaining the control parameter combinations that meet the read delay performance requirements corresponding to the current preset time interval, and discarding the control parameter combinations that do not meet the read delay performance requirements corresponding to the current preset time interval; adjusting the value of at least one control parameter in one or more control parameter combinations; adding a new control parameter combination.
[0103] The control parameters may include the maximum wait time during a write operation pause, the maximum number of read operations that can be performed during a write command pause, the maximum ratio of read and write commands, and the maximum time for continuous read execution. Multiple sets of control parameters may have different control parameter compositions or different control parameter values. The order of adjusting the preset time interval and performing the first adjustment of the control parameters of the solid-state drive controller can be performed sequentially or simultaneously, depending on the settings.
[0104] The embodiment of the present invention achieves parameter optimization of the solid-state drive controller and adjustment of the preset time interval by performing a first adjustment on the control parameters of the solid-state drive controller in response to the current preset time interval not being a time interval of the preset minimum granularity, reducing the preset time interval, and switching to the processing step of executing the read operation of the solid-state drive.
[0105] In one embodiment, after generating a performance analysis report of a read operation based on the number of reads and the delay time, the method further includes: in response to the current preset time interval being a time interval of a preset minimum granularity, and knowing according to the performance analysis report that there is at least one control parameter combination in a plurality of control parameter combinations that meets the read delay performance requirement corresponding to the current preset time interval, terminating the execution of the solid-state drive life loss detection method, and recording at least one control parameter combination that meets the read delay performance requirement corresponding to the current preset time interval; in response to the current preset time interval being a time interval of a preset minimum granularity, and knowing according to the performance analysis report that there is no control parameter combination in a plurality of control parameter combinations that meets the read delay performance requirement corresponding to the current preset time interval, performing a second adjustment on the control parameters of the solid-state drive controller, and proceeding to the processing step of executing the read operation of the solid-state drive; wherein, performing a second adjustment on the control parameters of the solid-state drive controller includes: adjusting the value of at least one control parameter in the control parameter combination; and / or, adding a new control parameter combination.
[0106] After generating a performance analysis report for a read operation based on the number of reads and the delay time of the read operation, if the current preset time interval is the time interval of the preset minimum granularity, it means that there is no need to reduce the preset time interval, and if it is known from the performance analysis report of the read operation that there is at least one set of control parameter combinations among the multiple sets of control parameter combinations that meets the read delay performance requirements corresponding to the current preset time interval, it means that the optimized control parameters that can meet the final read delay performance requirements have been found, then the execution of the life loss detection method of the solid-state drive is terminated, and the control parameter combination that meets the read delay performance requirements corresponding to the current preset time interval is recorded.
[0107] After generating a performance analysis report for the read operation based on the number of reads and delay time of the read operation, if the current preset time interval is the time interval with the preset minimum granularity, it means that there is no need to reduce the preset time interval. If it is known from the performance analysis report of the read operation that there is no control parameter combination in the multiple sets of control parameter combinations that meets the read delay performance requirements corresponding to the current preset time interval, it means that the optimized control parameters that can meet the final read delay performance requirements (the read delay performance requirements corresponding to the preset time interval with the smallest granularity) have not yet been found, then a second adjustment is made to the control parameters of the solid-state hard disk controller, and the processing step of executing the read operation of the solid-state hard disk is executed to re-obtain the number of read operations of the solid-state hard disk and the delay time of each read operation within each preset time interval, and a performance analysis report for the read operation is generated based on the number of reads and the delay time of the read operation.
[0108] The second adjustment of the control parameters of the solid-state drive controller includes: adjusting the value of at least one control parameter in one or more control parameter combinations; and / or adding a new control parameter combination.
[0109] In an embodiment of the present invention, in response to the current preset time interval being a time interval of preset minimum granularity and knowing, according to a performance analysis report of a read operation, that there is at least one control parameter combination in a plurality of control parameter combinations that meets the read delay performance requirement corresponding to the current preset time interval, the execution of the life loss detection method of the solid-state hard disk is terminated, and at least one control parameter combination that meets the read delay performance requirement corresponding to the current preset time interval is recorded. In response to the current preset time interval being a time interval of preset minimum granularity and knowing, according to a performance analysis report of a read operation, that there is no control parameter combination in a plurality of control parameter combinations that meets the read delay performance requirement corresponding to the current preset time interval, a second adjustment is made to the control parameters of the solid-state hard disk controller, and the processing step of executing the read operation of the solid-state hard disk is executed, thereby realizing the termination of the program after the control parameter optimization is successful and further optimization and testing of the control parameters when the optimized control parameters that meet the final read delay performance requirement have not been found.
[0110] In one embodiment, the method further includes outputting a performance analysis report and optimized parameter settings in the form of a visual chart or a data file.
[0111] The performance analysis report of the read operation, the optimized parameter settings (the control parameter combination that meets the final SSD latency performance requirements), and the performance improvement are output to the display module or storage module in the form of visual charts or data files for user viewing and subsequent application. Among them, visual charts include histograms, line graphs, etc., which are used to intuitively display latency performance.
[0112] The embodiment of the present invention outputs the performance analysis report of the read operation and the optimized parameter settings in the form of a visual chart or a data file, thereby realizing information transmission of the operation performance analysis report and the optimized parameter settings.
[0113] In one embodiment, performing a read operation on a solid-state drive includes: performing a read operation on the solid-state drive based on a first preset number of read operations within a preset time interval; and / or randomly performing a read operation on the solid-state drive based on a second preset number of read-write mixed operations within a preset time interval.
[0114] When executing a read operation of the solid-state hard disk, the number of read operations of the solid-state hard disk within each preset time interval and the delay time of each read operation are obtained. The read operation can be controlled by setting a read operation mode of a preset time interval. For example, in a scenario where a read operation is simply performed, a first preset number of read operations within a preset time interval can be set, and the read operation of the solid-state hard disk is performed according to the first preset number of read operations within the preset time interval. In a mixed read-write scenario, a second preset number of read operations and write operations within a preset time interval can be set, that is, the sum of the number of read operations and write operations within the preset time interval is the second preset number, and the read operation of the solid-state hard disk is randomly performed according to the second preset number of mixed read-write operations within the preset time interval.
[0115] The embodiments of the present invention control the read operations of the solid-state drive by performing read operations on the solid-state drive according to a first preset number of read operations within a preset time interval, and / or randomly performing read operations on the solid-state drive according to a second preset number of read-write mixed operations within a preset time interval, thereby facilitating the acquisition of read latency performance for a variety of different read operation modes and optimizing parameters of the solid-state drive controller based on the variety of different read operation modes.
[0116] The following describes the life loss detection device for a solid state drive provided by the present invention. The life loss detection device for a solid state drive described below and the life loss detection method for a solid state drive described above can be used for reference. Figure 3 , Figure 3 Schematic diagram of the structure of the life loss detection device for a solid-state hard disk provided by the present invention. The life loss detection device for a solid-state hard disk comprises:
[0117] An acquisition module 310 is used to acquire current operating data of the solid state drive;
[0118] Prediction module 320, configured to input the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; the predicted number of commands is used to assess the life loss of the solid-state drive;
[0119] a determination module 330, configured to determine a bandwidth ratio according to the predicted command quantity and a command quantity threshold;
[0120] The loss detection module 340 is configured to detect the life loss of the solid state drive based on the bandwidth ratio.
[0121] The solid-state hard drive life loss detection device provided by the present invention accurately predicts the number of predicted commands used to evaluate the life loss of the solid-state hard drive through the target network model and current operating data, further accurately evaluates the bandwidth ratio based on the predicted number of commands, and then detects the life loss of the solid-state hard drive based on the accurate bandwidth ratio, thereby improving the detection accuracy of the life loss of the solid-state hard drive.
[0122] See also Figure 4 , Figure 4 Schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, an embodiment of the present invention provides an electronic device 400, including a memory 410, a processor 420, and a computer program 411 stored in the memory 410 and executable on the processor 420. When the processor 420 executes the computer program 411, the following steps are implemented:
[0123] Get the current operating data of the solid state drive;
[0124] Inputting the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to evaluate the life loss of the solid-state drive;
[0125] Determining a bandwidth ratio according to the predicted command quantity and a command quantity threshold;
[0126] The life loss of the solid state drive is detected based on the bandwidth ratio.
[0127] See also Figure 5 , Figure 5 Schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. Figure 5As shown, this embodiment provides a computer-readable storage medium 500 on which a computer program 411 is stored. When the computer program 411 is executed by a processor, the following steps are implemented:
[0128] Get the current operating data of the solid state drive;
[0129] Inputting the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to evaluate the life loss of the solid-state drive;
[0130] Determining a bandwidth ratio according to the predicted command quantity and a command quantity threshold;
[0131] The life loss of the solid state drive is detected based on the bandwidth ratio.
[0132] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0133] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0134] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A method for detecting the life loss of a solid state drive, characterized in that: include: Get the current operating data of the solid state drive; Inputting the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to evaluate the life loss of the solid-state drive; Determining a bandwidth ratio based on the predicted command quantity and the command quantity threshold; the bandwidth ratio represents a ratio of an expected write bandwidth to an expected reclaim bandwidth; detecting life loss of the solid-state drive based on the bandwidth ratio; The determining of the bandwidth ratio according to the predicted number of commands and the command number threshold includes: Get the amount of data written by the command and the amount of data recovered by the command; Obtaining a data volume ratio according to a ratio of the amount of data written by the command to the amount of data recovered by the command; determining a quantity difference according to a difference between the predicted command quantity and a command quantity threshold; Determining the bandwidth ratio according to the data volume ratio and the quantity difference; The specific formula for the bandwidth ratio is: in, To write bandwidth expectations, To recover bandwidth expectation, VDF WR The amount of data written for the command, VDF GC The amount of data recovered by the command, n free is the number of predicted commands, n crit is the command quantity threshold, and c is a constant coefficient.
2. The method for detecting the life loss of a solid-state drive according to claim 1, wherein: The training process of the target network model is as follows: Determine a time series forward arrangement training data set and a time series reverse arrangement training data set according to the training data set; Inputting the time series forward arrangement training data set and the time series reverse arrangement training data set into the long-short term neural network model respectively to obtain a bidirectional learning network model; Training the bidirectional learning network model according to a preset number of training times and error accuracy to obtain an initial network model; The verification data set is input into the initial network model for model optimization to obtain the target network model.
3. The method for detecting the life loss of a solid-state drive according to claim 1, wherein: After detecting the life loss of the solid state drive based on the bandwidth ratio, the method further includes: Determine the preset ratio; Determining a relationship between the preset ratio and the bandwidth ratio; The bandwidth ratio is adjusted according to the relationship between the preset ratio and the bandwidth ratio and a dynamic optimization rule to obtain a performance optimization result of the solid state drive.
4. The method for detecting the life loss of a solid state drive according to any one of claims 1 to 3, wherein: The life loss detection method of the solid state drive further includes: Perform read operations on the solid-state drive; Obtaining the number of read operations of the solid-state drive within each preset time interval and the delay time of each read operation; A performance analysis report of the read operation is generated according to the number of reads and the delay time.
5. The method for detecting the life loss of a solid state drive according to claim 4, wherein: Before executing the read operation of the solid state drive, the method further includes: setting a plurality of control parameter combinations of the solid state drive controller; The performing of the read operation of the solid state hard disk comprises: performing the read operation of the solid state hard disk respectively under the control of the plurality of groups of control parameter combinations; Accordingly, after generating a performance analysis report of a read operation according to the number of reads and the delay time, the method further includes: In response to the current preset time interval not being a time interval with a preset minimum granularity, a first adjustment is made to a control parameter of the solid-state drive controller, and the preset time interval is reduced, and the process proceeds to the step of performing a read operation on the solid-state drive; The first adjustment of the control parameters of the solid-state drive controller includes: The multiple groups of control parameter combinations are screened according to the performance analysis report, and the control parameter combinations that meet the read latency performance requirements corresponding to the current preset time interval are retained; the value of at least one control parameter in the control parameter combination is adjusted; and / or, a new control parameter combination is added.
6. The method for detecting the life loss of a solid state drive according to claim 5, wherein: After generating a performance analysis report of the read operation according to the number of reads and the delay time, the method further includes: In response to the current preset time interval being the time interval of the preset minimum granularity, and knowing, according to the performance analysis report, that at least one of the multiple control parameter combinations satisfies the read latency performance requirement corresponding to the current preset time interval, terminating execution of the solid-state drive life loss detection method, and recording the at least one control parameter combination that satisfies the read latency performance requirement corresponding to the current preset time interval; In response to the current preset time interval being the time interval of the preset minimum granularity, and knowing, according to the performance analysis report, that no control parameter combination that satisfies the read latency performance requirement corresponding to the current preset time interval exists among the multiple groups of control parameter combinations, performing a second adjustment on the control parameters of the solid-state drive controller, and proceeding to the step of executing the read operation on the solid-state drive; The second adjustment of the control parameters of the solid-state drive controller includes: Adjust the value of at least one control parameter in the control parameter combination; and / or add a new control parameter combination.
7. A device for detecting the life loss of a solid state drive, characterized in that: include: The acquisition module is used to obtain the current operating data of the solid state drive; a prediction module, configured to input the current operating data as a test data set into a target network model to obtain a predicted number of commands output by the target network model; wherein the target network model is trained based on a training data set, a validation data set, and a long-short-term neural network model of historical operating data; and the predicted number of commands is used to assess the life loss of the solid-state drive; a determination module, configured to determine a bandwidth ratio according to the predicted command quantity and a command quantity threshold; the bandwidth ratio represents a ratio of an expected write bandwidth to an expected reclaim bandwidth; a loss detection module, configured to detect the life loss of the solid-state drive based on the bandwidth ratio; The determining of the bandwidth ratio according to the predicted number of commands and the command number threshold includes: Get the amount of data written by the command and the amount of data recovered by the command; Obtaining a data volume ratio according to a ratio of the amount of data written by the command to the amount of data recovered by the command; determining a quantity difference according to a difference between the predicted command quantity and a command quantity threshold; Determining the bandwidth ratio according to the data volume ratio and the quantity difference; The specific formula for the bandwidth ratio is: in, To write bandwidth expectations, To recover bandwidth expectation, VDF WR The amount of data written for the command, VDF GC The amount of data recovered by the command, n free is the number of predicted commands, n crit is the command quantity threshold, and c is a constant coefficient.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for detecting life loss of a solid state drive as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting life loss of a solid state drive according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Solid state disk life prediction method and device based on long short-term memory network model, terminal and medium
CN116631487A
Flow control method and device for solid state disk, storage medium and electronic equipment
CN118519591A