Disk detection method and device
By obtaining the disk model and timing sequence, calculating the confidence interval upper bound sequence and comparing the delay sequence, the problem of inaccurate slow disk detection in the prior art is solved, and the accurate identification of slow disks is achieved, and the performance of cloud storage systems is improved.
Patent Information
- Application Number
- CN202110350771.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-03-31
AI Technical Summary
Due to inaccurate judgment conditions in the prior art, the slow disk cannot be accurately detected, which affects the stability and delay performance of the cloud storage system.
By obtaining the disk model of the disk to be tested, the corresponding disk pressure timing sequence and delay timing sequence are obtained within the preset detection time, the confidence interval upper bound sequence of the disk pressure timing sequence is calculated, and by comparing the upper bound sequence and the delay sequence, it is necessary to determine whether the disk to be tested is a slow disk.
It realizes accurate identification of slow disks, reduces the missed and false alarm rates, and improves the performance and service level agreement (SLA) level of cloud storage systems.
Smart Images

Figure CN113312218B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a disk detection method and device. Background Art
[0002] With the rapid development of the cloud computing industry, the stability of the storage system is not only becoming more and more important, but also the core competitiveness of cloud computing success. The distributed architecture has done a lot of fault tolerance processing for various software and hardware errors, achieving high availability. Unlike a bad disk, a slow disk can still provide services, but the service time is much slower than a normal disk. Distributed storage requires writing multiple copies of a piece of data. If a copy is slow, the entire write will be slow. If there is a queue on the disk, the subsequent requests will also be slow, amplifying the impact of the slow disk. Although backup read / write strategies are used in related technologies to eliminate the long tail, the threshold for switching to backup reads is not easy to set, and in many cases, although the threshold is not triggered, the average request delay has been slowed down.
[0003] Cloud storage must not only provide high availability, but also provide a high latency guarantee. Today, when non-volatile memory express (NVM Express, NVMe) has become the mainstream storage medium, microsecond latency makes slow disks have an increasing impact on request service-level agreements (SLA). Therefore, accurately detecting and isolating slow disks is an essential part of improving the stability of storage systems.
[0004] With regard to the above-mentioned problem that the existing technology cannot accurately detect the slow disk due to inaccurate judgment conditions, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for detecting a magnetic disk, so as to at least solve the technical problem that the detection of a slow magnetic disk in the prior art cannot be accurately performed due to inaccurate determination conditions.
[0006] According to one aspect of an embodiment of the present invention, a disk detection method is provided, including: obtaining the disk model of the disk to be tested; obtaining a corresponding disk pressure timing sequence and delay timing sequence according to the disk model within a preset detection time; performing calculations based on the disk pressure timing sequence to obtain an upper bound sequence of a confidence interval corresponding to the disk pressure timing sequence; and determining whether the disk to be tested is a target disk based on a comparison result between the upper bound sequence and the delay sequence.
[0007] Optionally, before obtaining the disk model of the disk to be tested, the method further includes: performing offline modeling based on the models and historical data of various types of disks to obtain a regression equation of the corresponding model.
[0008] Optionally, offline modeling is performed based on the models and historical data of various types of disks to obtain the regression equation of the corresponding model, including: obtaining historical data corresponding to the model within a preset historical period, wherein the historical data includes: delay data, bandwidth data and the number of reads and writes per second; generating a sample matrix based on the delay data, bandwidth data and the number of reads and writes per second; obtaining a training set and a test set based on the sample matrix; calculating the correlation between the delay data, bandwidth data and the number of reads and writes per second based on the training set to obtain a correlation coefficient matrix; and calculating the regression equation corresponding to the model based on the correlation coefficient matrix.
[0009] Further, optionally, calculating the regression equation corresponding to the model based on the correlation coefficient matrix includes: obtaining the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second based on the correlation coefficient matrix; selecting parameters that satisfy the target linear correlation based on the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second; and obtaining the regression equation based on the linear relationship between the parameters and the delay data.
[0010] Optionally, the method also includes: calculating the regression results of the training set, the scatter distribution of the independent variables and the residuals according to the regression equation; calculating the regression results of the test set, the scatter distribution of the independent variables and the residuals according to the regression equation; correcting the regression equation based on the regression results of the training set, the scatter distribution of the independent variables and the residuals and the regression results of the test set, the scatter distribution of the independent variables and the residuals to obtain a corrected regression equation.
[0011] Further, optionally, calculations are performed based on the disk pressure timing sequence to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure timing sequence, including: taking the disk pressure timing sequence corresponding to the model as an input parameter, inputting the regression equation corresponding to the model, and calculating the confidence interval; obtaining the upper bound sequence of the confidence interval.
[0012] Optionally, determining whether the disk to be tested is a target disk based on a comparison result between the upper bound sequence and the delay sequence includes: comparing the delay sequence with the upper bound sequence; if the delay sequence is continuously higher than the upper bound sequence, determining that the disk to be tested is a target disk, wherein the target disk is a slow disk.
[0013] According to another aspect of an embodiment of the present invention, a disk detection device is also provided, including: an acquisition module for acquiring the disk model of the disk to be tested; a sequence acquisition module for acquiring the corresponding disk pressure timing sequence and delay timing sequence according to the disk model within a preset detection time; a calculation module for performing calculations based on the disk pressure timing sequence to obtain an upper bound sequence of the confidence interval of the corresponding disk pressure timing sequence; and a detection module for determining whether the disk to be tested is a target disk based on a comparison result of the upper bound sequence and the delay sequence.
[0014] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is further provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above method.
[0015] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the above method is executed when the program is run.
[0016] In an embodiment of the present invention, the disk model of the disk to be tested is obtained; within a preset detection time, the corresponding disk pressure timing sequence and delay timing sequence are obtained according to the disk model; calculation is performed according to the disk pressure timing sequence to obtain the upper bound sequence of the confidence interval of the corresponding disk pressure timing sequence; based on the comparison result of the upper bound sequence and the delay sequence, it is determined whether the disk to be tested is the target disk, thereby achieving the purpose of timely discovering and isolating the slow disk and improving the performance of the cloud storage system, thereby achieving the technical effect of accurately identifying the slow disk with low missed reporting rate and false alarm rate, and further solving the technical problem that the existing technology cannot accurately detect the slow disk due to inaccurate judgment conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal of a disk detection method according to an embodiment of the present invention;
[0019] Figure 2a is a flow chart of a method for detecting a disk according to a first embodiment of the present invention;
[0020] Figure 2b A schematic diagram of the delay and pressure timing of disk A in the disk detection method according to the first embodiment of the present invention;
[0021] Figure 2c and 2dis a schematic diagram of two-dimensional scatter points of delay and IOPS and delay and bandwidth in a disk detection method according to Embodiment 1 of the present invention;
[0022] Figure 2e is a schematic diagram of a confidence interval in a disk detection method according to Embodiment 1 of the present invention;
[0023] Figure 2f is a schematic diagram of the prediction result of the regression equation on the test set in the disk detection method according to the first embodiment of the present invention;
[0024] Figure 2g is a schematic diagram of the prediction result of the regression equation on the test set in the disk detection method according to the first embodiment of the present invention;
[0025] Figure 3a is a timing diagram of normalized disk delay and pressure in a disk detection method according to Embodiment 1 of the present invention;
[0026] Figure 3b is a scatter plot of disk latency and IOPS in the disk detection method according to the first embodiment of the present invention;
[0027] Figure 3c is a scatter plot of disk latency and bandwidth in the disk detection method according to the first embodiment of the present invention;
[0028] Figure 3d is a schematic diagram of an OLS regression prediction value and a 99.9% confidence interval in a disk detection method according to Embodiment 1 of the present invention;
[0029] Figure 3e is an OLS residual scatter plot in the disk detection method according to the first embodiment of the present invention;
[0030] Figure 3f is a schematic diagram of the regression result of WLS on the training set in the disk detection method according to the first embodiment of the present invention;
[0031] Figure 3g is a schematic diagram of the regression result of WLS on the prediction set in the disk detection method according to the first embodiment of the present invention;
[0032] Figure 4 2 is a schematic diagram of a magnetic disk detection device according to a second embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Technical terms involved in this application:
[0036] Slow disk: A disk with significantly higher latency than normal. Example 1
[0037] According to an embodiment of the present invention, an embodiment of a disk detection method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal of a disk detection method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal 10 may include one or more (only one is shown in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0039] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the disk detection method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the disk detection method of the above-mentioned application program is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0040] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0041] Under the above operating environment, this application provides Figure 2a The detection method of the disk shown. Figure 2a 1 is a flow chart of a method for detecting a disk according to Embodiment 1 of the present invention. The method for detecting a disk involved in the embodiment of the present application is specifically as follows:
[0042] Step S202, obtaining the disk model of the disk to be tested;
[0043] In the above step S202 of the present application, the disk detection method provided in the embodiment of the present application is different from the disk detection scheme made based on industry experience in the related art. The present application obtains the disk type through the disk signal, and determines the detection scheme based on the association between the disk type and the processing pressure, wherein the pressure includes bandwidth and IOPS (Input / Output Operations Per Second, the number of read and write operations per second); specifically as follows:
[0044] Optionally, before obtaining the disk model of the disk to be tested in step S202, the disk detection method involved in the embodiment of the present application also includes: performing offline modeling based on the models and historical data of various types of disks to obtain a regression equation for the corresponding model.
[0045] Optionally, offline modeling is performed based on the models and historical data of various types of disks to obtain the regression equation of the corresponding model, including: obtaining historical data corresponding to the model within a preset historical period, wherein the historical data includes: delay data, bandwidth data and the number of reads and writes per second; generating a sample matrix based on the delay data, bandwidth data and the number of reads and writes per second; obtaining a training set and a test set based on the sample matrix; calculating the correlation between the delay data, bandwidth data and the number of reads and writes per second based on the training set to obtain a correlation coefficient matrix; and calculating the regression equation corresponding to the model based on the correlation coefficient matrix.
[0046] Further, optionally, calculating the regression equation corresponding to the model based on the correlation coefficient matrix includes: obtaining the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second based on the correlation coefficient matrix; selecting parameters that satisfy the target linear correlation based on the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second; and obtaining the regression equation based on the linear relationship between the parameters and the delay data.
[0047] Optionally, the disk detection method involved in the embodiment of the present application also includes: calculating the regression results of the training set, the scatter distribution of the independent variables and the residuals according to the regression equation; calculating the regression results of the test set, the scatter distribution of the independent variables and the residuals according to the regression equation; correcting the regression equation based on the regression results of the training set, the scatter distribution of the independent variables and the residuals and the regression results of the test set, the scatter distribution of the independent variables and the residuals to obtain a corrected regression equation.
[0048] Specifically, the following examples are used as examples to illustrate the present application:
[0049] Select models A and B and build regression models for them respectively;
[0050] Taking disk model A as an example, the latency, bandwidth, and IOPS data of cluster C from 2020-05-18 00:00:00 to 2020-05-24 12:00:00 are obtained to obtain a sample matrix, which is randomly divided into training and test sets, each with 19080 sample points. Figure 2b FIG. 1 is a schematic diagram of the delay and pressure sequence of disk A in the disk detection method according to the first embodiment of the present invention. Figure 2b As shown in the figure, the black solid curve is latency, the dashed curve is bandwidth, and the discontinuous double-dot curve is IOPS. It can be seen that latency is positively correlated with bandwidth and IOPS.
[0051] The correlation coefficient matrix is calculated, and further, the regression equation is obtained based on the positive correlation between latency, IOPS and bandwidth.
[0052] Among them, the correlation coefficient matrix is shown in Table 1.
[0053] Table 1
[0054] index Delay bandwidth IOPS Delay 1 0.804 0.474 bandwidth 0.804 1 0.885 IOPS 0.474 0.885 1
[0055] Furthermore, by plotting the two-dimensional scatter plots of latency, IOPS, and bandwidth, we can see that latency is positively correlated with pressure. Figure 2c and 2d As shown, Figure 2c and 2d 1 is a schematic diagram of two-dimensional scatter plots of latency and IOPS and latency and bandwidth in a disk detection method according to Embodiment 1 of the present invention. Figure 2c The horizontal axis is IOPS, and the vertical axis is latency; Figure 2d The horizontal axis is bandwidth and the vertical axis is delay.
[0056] From Table 1, we can see that the correlation coefficient between bandwidth and IOPS is 0.885, which means there is a strong linear correlation. Therefore, bandwidth is selected as the independent variable to predict latency. Figure 2d , the effect of bandwidth on latency grows linearly, using simple linear regression (Ordinary Least Square Regression, OLS). Remember latency = y, bandwidth = x, and get the regression equation:
[0057] .
[0058] Figure 2e is a schematic diagram of a confidence interval in a disk detection method according to Embodiment 1 of the present invention, Figure 2f is a schematic diagram of the prediction results of the regression equation on the test set in the disk detection method according to the first embodiment of the present invention, wherein, Figure 2e The figure shows the regression prediction value and its 99.9% confidence interval. The dashed line is the upper limit of the confidence interval, and the discontinuous double-dotted line is the lower limit of the confidence interval. The probability of being outside the confidence interval is less than 0.001. The black solid curve is the prediction value. Figure 2f 3 is a scatter plot of independent variables and residuals in the disk detection method according to the first embodiment of the present invention, and it is observed that there is no heteroscedasticity in the random disturbance. Figure 2g Schematic diagram of the prediction result of the regression equation on the test set in the disk detection method according to the first embodiment of the present invention. Mean square error = 4.942. Among them, Figure 2e The horizontal axis is bandwidth and the vertical axis is delay.
[0059] Taking the B-type disk as an example, the latency, bandwidth, and IOPS data of cluster D from 2020-05-17 00:00:00 to 2020-05-23 12:00:00 are obtained to form a sample matrix, which is randomly divided into a training set and a test set, each with 19019 samples. Figure 3a This is a timing diagram of normalized disk latency and pressure in the disk detection method according to the first embodiment of the present invention. The black solid curve is latency, the dashed curve is bandwidth, and the intermittent double-dot curve is IOPS. It can be seen that there is a certain correlation between disk latency and bandwidth and IOPS.
[0060] Calculate the correlation coefficient matrix, as shown in Table 2.
[0061] Table 2 Delay pressure correlation coefficient matrix of disk B
[0062] index Delay bandwidth IOPS Delay 1 0.917 0.884 bandwidth 0.917 1 0.976 IOPS 0.884 0.976 1
[0063] Furthermore, we plot the two-dimensional scatter plots of latency, bandwidth, and IOPS. Figure 3b , 3c It can be seen that there is a positive correlation between latency, bandwidth and IOPS.
[0064] As shown in Table 2, bandwidth and IOPS have a high linear correlation, with a correlation coefficient of 0.976. If bandwidth and IOPS are used as independent variables to build a regression model, the equation will have serious multicollinearity. Therefore, only one indicator is used as an independent variable. Figure 3b and Figure 3c Although both have heteroscedasticity, the heteroscedasticity of bandwidth is smaller, so bandwidth is selected as the independent variable to predict latency. Figure 3c As the delay increases, the bandwidth increases nonlinearly, so polynomial regression is used instead of OLS. Considering the order of magnitude of the delay in , directly using polynomial regression will result in the problem of too large power value, which will affect the calculation accuracy. Therefore, the delay is processed. . Using the stepwise regression method, we get the regression equation:
[0065] .
[0066] Figure 3d The OLS regression predictions and 99.9% confidence intervals. The dashed line is the upper limit of the confidence interval, and the discontinuous double-dot dashed line is the lower limit of the confidence interval. The black line is the prediction. Figure 3e This is the OLS regression residual scatter plot. It is easy to observe that the random disturbance has heteroscedasticity. As the independent variable increases, the variance increases. Therefore, the weighted least squares (WLS) is used for fitting.
[0067] The WLS regression equation is obtained:
[0068] .
[0069] Draw the fitting curve and 99.9% confidence interval, such as Figure 3f The probability of a point falling outside the upper and lower bounds is less than 0.1%. Make predictions on the test set, such as Figure 3g , mean square error = 179.598.
[0070] Step S204, obtaining a corresponding disk pressure timing sequence and a delay timing sequence according to the disk model within a preset detection time;
[0071] In the above step S204 of the present application, within a given detection window of 10 minutes (i.e., the preset detection time in the embodiment of the present application), a disk pressure timing sequence (i.e., the disk pressure timing sequence in the embodiment of the present application) and a delay timing sequence are obtained within each detection cycle, which are respectively recorded as disk pressure timing sequence A and delay timing sequence B.
[0072] Step S206, performing calculations based on the disk pressure time series to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure time series;
[0073] Further, optionally, calculations are performed based on the disk pressure timing sequence to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure timing sequence, including: taking the disk pressure timing sequence corresponding to the model as an input parameter, inputting the regression equation corresponding to the model, and calculating the confidence interval; obtaining the upper bound sequence of the confidence interval.
[0074] Based on the offline model obtained before step S202, the corresponding offline model is input into the disk model to obtain a regression equation, and the disk pressure time series sequence A in step S204 is used as an input parameter, and the confidence interval is input into the regression equation; and the upper bound sequence C of the confidence interval is obtained.
[0075] Step S208: Determine whether the disk to be tested is a target disk based on the comparison result between the upper bound sequence and the delay sequence.
[0076] Optionally, determining whether the disk to be tested is a target disk based on a comparison result between the upper bound sequence and the delay sequence includes: comparing the delay sequence with the upper bound sequence; if the delay sequence is continuously higher than the upper bound sequence, determining that the disk to be tested is a target disk, wherein the target disk is a slow disk.
[0077] Specifically, if the delay sequences are all higher than the confidence interval upper bound sequence, the disk is considered a slow disk, and if it is a slow disk, it is the target disk finally detected.
[0078] The disk detection method provided in the embodiment of the present application takes into account the influence of pressure and disk type; and provides real-time delay prediction values and confidence intervals. The parameters are derived by regression method and do not need to be given manually, which has sufficient theoretical support. The false positive rate and false positive rate are low. In addition, the disk detection method provided in the embodiment of the present application accurately identifies slow disks with low false positive rate and false positive rate; provides users with prediction values and tolerable confidence interval references, has strong interpretability, and users can easily understand why the disk is judged to be a slow disk; timely detects and isolates slow disks, improves the performance of cloud storage systems, and ensures the level of service level agreement (Service Level Agreement, SLA)
[0079] In an embodiment of the present invention, the disk model of the disk to be tested is obtained; within a preset detection time, the corresponding disk pressure timing sequence and delay timing sequence are obtained according to the disk model; calculation is performed according to the disk pressure timing sequence to obtain the upper bound sequence of the confidence interval of the corresponding disk pressure timing sequence; based on the comparison result of the upper bound sequence and the delay sequence, it is determined whether the disk to be tested is the target disk, thereby achieving the purpose of timely discovering and isolating the slow disk and improving the performance of the cloud storage system, thereby achieving the technical effect of accurately identifying the slow disk with low missed reporting rate and false alarm rate, and further solving the technical problem that the existing technology cannot accurately detect the slow disk due to inaccurate judgment conditions.
[0080] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the disk detection method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention. Example 2
[0082] According to an embodiment of the present invention, a device for implementing the above disk detection method is also provided. Figure 4is a schematic diagram of a magnetic disk detection device according to a second embodiment of the present invention, Figure 4 As shown, the disk detection device provided in the embodiment of the present application includes: an acquisition module 42, used to obtain the disk model of the disk to be tested; a sequence acquisition module 44, used to obtain the corresponding disk pressure timing sequence and delay timing sequence according to the disk model within a preset detection time; a calculation module 46, used to calculate according to the disk pressure timing sequence to obtain the upper limit sequence of the confidence interval of the corresponding disk pressure timing sequence; a detection module 48, used to determine whether the disk to be tested is a target disk based on the comparison result of the upper limit sequence and the delay sequence. Example 3
[0083] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is further provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above method. Example 4
[0084] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the above method is executed when the program is run. Example 5
[0085] The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the disk detection method provided in the first embodiment.
[0086] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0087] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining the disk model of the disk to be tested; obtaining the corresponding disk pressure timing sequence and delay timing sequence according to the disk model within a preset detection time; performing calculations based on the disk pressure timing sequence to obtain an upper bound sequence of the confidence interval of the corresponding disk pressure timing sequence; and determining whether the disk to be tested is a target disk based on a comparison result of the upper bound sequence and the delay sequence.
[0088] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: before obtaining the disk model of the disk to be tested, offline modeling is performed based on the models and historical data of various types of disks to obtain a regression equation for the corresponding model.
[0089] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: performing offline modeling based on the models and historical data of various types of disks to obtain a regression equation for the corresponding model, including: obtaining historical data corresponding to the model within a preset historical period, wherein the historical data includes: delay data, bandwidth data, and the number of reads and writes per second; generating a sample matrix based on the delay data, bandwidth data, and the number of reads and writes per second; obtaining a training set and a test set based on the sample matrix; calculating the correlation between the delay data, bandwidth data, and the number of reads and writes per second based on the training set to obtain a correlation coefficient matrix; and calculating the regression equation corresponding to the model based on the correlation coefficient matrix.
[0090] Further, optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: calculating the regression equation corresponding to the model based on the correlation coefficient matrix includes: obtaining the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second based on the correlation coefficient matrix; selecting parameters that satisfy the target linear correlation based on the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second; and obtaining the regression equation based on the linear relationship between the parameters and the delay data.
[0091] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: calculating the regression results, scatter distribution of independent variables and residuals of the training set according to the regression equation; calculating the regression results, scatter distribution of independent variables and residuals of the test set according to the regression equation; correcting the regression equation according to the regression results, scatter distribution of independent variables and residuals of the training set and the regression results, scatter distribution of independent variables and residuals of the test set to obtain a corrected regression equation.
[0092] Further, optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: performing calculations based on the disk pressure timing sequence to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure timing sequence, including: taking the disk pressure timing sequence corresponding to the model as an input parameter, inputting the regression equation corresponding to the model, and calculating the confidence interval; obtaining the upper bound sequence of the confidence interval.
[0093] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: determining whether the disk to be tested is a target disk based on a comparison result between an upper bound sequence and a delay sequence, including: comparing the delay sequence with the upper bound sequence; if the delay sequence is continuously higher than the upper bound sequence, determining that the disk to be tested is a target disk, wherein the target disk is a slow disk.
[0094] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0095] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0096] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0097] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0100] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting a disk, comprising: Get the disk model of the disk to be tested; Within a preset detection time, obtaining a corresponding disk pressure timing sequence and a delay timing sequence according to the disk model; Calculating according to the disk pressure time series sequence to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure time series sequence; Determining whether the disk to be tested is a target disk according to a comparison result between the upper bound sequence and the delay sequence; Before obtaining the disk model of the disk to be tested, the method further includes: obtaining historical data corresponding to the model within a preset historical period, wherein the historical data includes: delay data, bandwidth data and the number of reads and writes per second; calculating the correlation between the delay data, the bandwidth data and the number of reads and writes per second to obtain a correlation coefficient matrix; and calculating a regression equation corresponding to the model based on the correlation coefficient matrix, wherein the regression equation is used to determine the upper bound sequence.
2. The method according to claim 1, wherein: Calculating the correlation between the delay data, the bandwidth data and the number of reads and writes per second includes: Generate a sample matrix according to the delay data, the bandwidth data and the number of reads and writes per second; Obtaining a training set and a test set according to the sample matrix; The correlation between the delay data, the bandwidth data and the number of reads and writes per second is calculated based on the training set to obtain a correlation coefficient matrix.
3. The method according to claim 1, wherein: The step of calculating the regression equation corresponding to the model according to the correlation coefficient matrix includes: Acquire the delay data, the correlation coefficient between the bandwidth data and the number of reads and writes per second according to the correlation coefficient matrix; Selecting parameters that satisfy a target linear correlation according to the correlation coefficient between the delay data, the bandwidth data and the number of reads and writes per second; The regression equation is obtained according to the linear relationship between the parameter and the delay data.
4. The method according to claim 2, wherein: The method further comprises: Calculating the regression results of the training set, the scatter distribution of independent variables and residuals according to the regression equation; Calculating the regression results of the test set, the scatter distribution of the independent variables and the residuals according to the regression equation; The regression equation is corrected according to the regression results of the training set, the scatter distribution of the independent variables and the residuals and the regression results of the test set, the scatter distribution of the independent variables and the residuals to obtain the corrected regression equation.
5. The method according to claim 3, wherein: The calculation based on the disk pressure time series sequence to obtain the upper bound sequence of the confidence interval corresponding to the disk pressure time series sequence includes: Taking the disk pressure time series corresponding to the model as input parameters, inputting the regression equation corresponding to the model, and calculating the confidence interval; Get the sequence of upper bounds of the confidence intervals.
6. The method according to claim 5, wherein: Determining whether the disk to be tested is a target disk according to the comparison result between the upper bound sequence and the delay sequence includes: comparing the delay sequence with the upper bound sequence; If the delay sequence is continuously higher than the upper limit sequence, it is determined that the disk to be tested is a target disk, wherein the target disk is a slow disk.
7. A magnetic disk detection device, comprising: An acquisition module is used to obtain the disk model of the disk to be tested; A sequence acquisition module, used to acquire a corresponding disk pressure timing sequence and a delay timing sequence according to the disk model within a preset detection time; A calculation module, used for performing calculation according to the disk pressure time series to obtain an upper bound sequence of the confidence interval corresponding to the disk pressure time series; A detection module is used to determine whether the disk to be tested is a target disk based on the comparison result of the upper bound sequence and the delay sequence. The disk detection device is also used for: before obtaining the disk model of the disk to be tested, obtaining historical data corresponding to the model within a preset historical period, wherein the historical data includes: delay data, bandwidth data and the number of reads and writes per second; calculating the correlation between the delay data, the bandwidth data and the number of reads and writes per second to obtain a correlation coefficient matrix; and calculating the regression equation corresponding to the model based on the correlation coefficient matrix, wherein the regression equation is used to determine the upper bound sequence.
8. A non-volatile storage medium, wherein: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method of claim 1.
9. A processor, wherein: The processor is used to run a program, wherein the method of claim 1 is executed when the program is run.
Citation Information
Patent Citations
Hard disk delay detection method and device and computer readable storage medium
CN112530505A