Hard disk performance analysis method and device, electronic equipment and storage medium
By acquiring and analyzing SSD read and write commands and time points, time distribution data is generated, solving the problem of difficulty in locating SSD performance issues in existing technologies, improving SSD performance and stability, and providing real-time maintenance methods.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-02-15
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies make it difficult to quickly and accurately pinpoint performance issues in solid-state drives (SSDs), resulting in poor performance and frequent stuttering.
By acquiring the hard drive's read/write commands, read/write speeds, and time points, these are broken down into sub-commands, generating time distribution data, and performing data analysis to obtain performance information to locate sub-commands with high latency and characterize hard drive performance.
It enables rapid identification of SSD performance issues, improves SSD performance, avoids stuttering, and provides service quality parameters and predicted latency values for easier maintenance.
Smart Images

Figure CN116382986B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hard disk data processing technology, and in particular to a hard disk performance analysis method, a hard disk performance analysis device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the continuous development of Internet technology, solid-state drives (SSDs), also known as solid-state drives, are hard drives made of solid-state electronic storage chip arrays. SSDs include flash memory that does not lose data when power is off, and RAM (Random Access Memory), SRAM (Static Random-Access Memory), or DRAM (Dynamic Random Access Memory) that loses data when power is off. As a new generation of storage devices, SSDs are widely used in many fields such as automotive, industrial control, video surveillance, network monitoring, and network terminals.
[0003] In real-world business environments, SSDs may experience performance issues such as high IO (read / write command) latency or poor stability as indicated by QoS (Quality of Service). Existing performance testing technologies struggle to quickly and accurately pinpoint the location of SSD performance problems, preventing technical personnel from resolving these issues in a timely manner. Consequently, SSDs may exhibit poor performance and become prone to stuttering. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and computer-readable storage medium for hard disk performance analysis, to solve or partially solve the problem that existing technologies cannot quickly and accurately locate the location of performance problems in SSDs, resulting in poor SSD performance and frequent stuttering.
[0005] This invention discloses a hard disk performance analysis method, the method comprising:
[0006] Obtain at least one read / write command from the hard drive, the read / write speed of the read / write command, and the read / write time point;
[0007] The read and write commands are split according to the read and write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation;
[0008] The time distribution data for the read / write command is generated using the sub-command information, the read / write time point, the request time point, and the operation time point.
[0009] The time distribution data is analyzed and processed to obtain the performance information corresponding to the read and write commands. The performance information includes at least a reminder message for locating subcommands in a high-latency state and a quality of service parameter for characterizing the performance of the hard drive.
[0010] Optionally, the read / write time points include read time points and write time points, and obtaining at least one read / write command from the hard disk, the read / write speed of the read / write command, and the read / write time points includes:
[0011] The read / write commands and their read / write speeds are obtained from the command queue of the hard disk.
[0012] The time point at which the read / write command is read from the command queue is taken as the read time point, and the time point at which the read / write command is returned to the command queue is taken as the write time point.
[0013] Optionally, the step of splitting the read / write command according to the read / write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation includes:
[0014] Divide the read / write speed by the preset speed value to obtain the corresponding number of commands;
[0015] The read / write command is divided into several sub-commands according to the number of commands, and the request time point, sub-command information, and operation time point corresponding to the splitting operation are obtained for each sub-command.
[0016] The request time point is the time point at which flash memory resources are requested from the memory allocation cache, and the operation time point is the time point at which the split operation is performed.
[0017] Optionally, the sub-command information includes at least the location information and attribute information of each sub-command, and the step of generating time distribution data for the read / write command using the sub-command information, the read / write time point, the request time point, and the operation time point includes:
[0018] The read / write time points, request time points, and operation time points are added to the same timeline in chronological order, and the location and attribute information of each sub-command are displayed on the timeline to generate time distribution data for the read / write commands.
[0019] Optionally, the step of performing data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands includes:
[0020] The latency data of each sub-command is obtained from the time distribution data;
[0021] Subcommands whose latency data exceeds a preset latency threshold are marked as high latency states, and reminder messages are generated for the high latency states;
[0022] Obtain the service quality data of the hard drive, perform consistency calculation on the service quality data, and obtain the corresponding service quality parameters.
[0023] Optionally, the performance information further includes predicted latency values, and the step of performing data analysis and processing on the time distribution data to obtain the performance information corresponding to the read / write command includes:
[0024] During the current lifecycle of the hard drive, a moving weighted average algorithm is used to perform latency statistics on the latency data to obtain a predicted latency value for the next lifecycle.
[0025] Optionally, the method further includes:
[0026] In response to a custom interface command, the performance information is uploaded to the user terminal, so that the user terminal can use a parsing tool to parse and process the performance information to obtain the performance parameters of the hard drive.
[0027] The present invention also discloses a hard disk performance analysis device, the device comprising:
[0028] The read / write command acquisition module is used to acquire at least one read / write command from the hard disk, the read / write speed of the read / write command, and the read / write time point.
[0029] The time point acquisition module is used to split the read and write commands according to the read and write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation;
[0030] The time distribution data generation module is used to generate time distribution data for the read and write command using the sub-command information, the read and write time points, the request time points, and the operation time points.
[0031] The performance information analysis module is used to perform data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands. The performance information includes at least the reminder information for locating sub-commands in a high-latency state and the quality of service parameters for characterizing the performance of the hard drive.
[0032] Optionally, the read / write time points include read time points and write time points, and the read / write command acquisition module is specifically used for:
[0033] The read / write commands and their read / write speeds are obtained from the command queue of the hard disk.
[0034] The time point at which the read / write command is read from the command queue is taken as the read time point, and the time point at which the read / write command is returned to the command queue is taken as the write time point.
[0035] Optionally, the time point acquisition module is specifically used for:
[0036] Divide the read / write speed by the preset speed value to obtain the corresponding number of commands;
[0037] The read / write command is divided into several sub-commands according to the number of commands, and the request time point, sub-command information, and operation time point corresponding to the splitting operation are obtained for each sub-command.
[0038] The request time point is the time point at which flash memory resources are requested from the memory allocation cache, and the operation time point is the time point at which the split operation is performed.
[0039] Optionally, the sub-command information includes at least the location information and attribute information of each sub-command, and the time distribution data generation module is specifically used for:
[0040] The read / write time points, request time points, and operation time points are added to the same timeline in chronological order, and the location and attribute information of each sub-command are displayed on the timeline to generate time distribution data for the read / write commands.
[0041] Optionally, the performance information analysis module is specifically used for:
[0042] The latency data of each sub-command is obtained from the time distribution data;
[0043] Subcommands whose latency data exceeds a preset latency threshold are marked as high latency states, and reminder messages are generated for the high latency states;
[0044] Obtain the service quality data of the hard drive, perform consistency calculation on the service quality data, and obtain the corresponding service quality parameters.
[0045] Optionally, the performance information further includes a predicted latency value, and the performance information analysis module is specifically used for:
[0046] During the current lifecycle of the hard drive, a moving weighted average algorithm is used to perform latency statistics on the latency data to obtain a predicted latency value for the next lifecycle.
[0047] Optionally, the device further includes:
[0048] The performance information upload module is used to upload the performance information to the user terminal in response to a custom interface command, so that the user terminal can use a parsing tool to parse and process the performance information to obtain the performance parameters of the hard drive.
[0049] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0050] The memory is used to store computer programs;
[0051] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.
[0052] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.
[0053] The embodiments of the present invention have the following advantages:
[0054] In this embodiment of the invention, at least one read / write command of the hard drive, the read / write speed of the read / write command, and the read / write time point are obtained. The read / write command is then split according to the read / write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation. Time distribution data for the read / write command is generated using the sub-command information, read / write time points, request time points, and operation time points. Data analysis and processing are performed on the time distribution data to obtain performance information corresponding to the read / write command. The performance information includes at least a reminder message for locating sub-commands in a high-latency state and service quality parameters for characterizing hard drive performance. This is achieved by obtaining the read / write time points of the read / write command, the read / write speed of each sub-command, and the operation time points corresponding to the splitting operation. By analyzing the request time of each sub-command and the operation time of the splitting operation, the system can quickly locate the corresponding command when SSD performance issues occur. Furthermore, by using sub-command information, read / write time points, request time points, and operation time points, it generates time distribution data for read / write commands, categorizing scattered data for easier subsequent data analysis. This allows for the generation of alerts to sub-commands experiencing high latency and service quality parameters characterizing hard drive performance. This provides a clear understanding of specific SSD performance problems and enables timely SSD maintenance, significantly improving SSD performance and preventing stuttering. Attached Figure Description
[0055] Figure 1 This is a flowchart of the steps of a hard disk performance analysis method provided in an embodiment of the present invention;
[0056] Figure 2 This is a structural block diagram of a hard disk performance analysis device provided in an embodiment of the present invention;
[0057] Figure 3 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0058] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] As an example, SSDs serve two main purposes. First, as the lowest level in a data center, they bear the critical task of storing data. Under normal circumstances, performance metrics are crucial in SSD selection and actual business processes. However, in real-world business environments, SSDs are prone to performance issues such as high IO latency and poor QoS (Quality of Service), making it difficult for technical personnel to pinpoint the location of these performance problems. Second, as a low-level component, the currently accepted SSD standard protocols do not provide statistical or data processing methods for performance, such as latency and QoS information. Furthermore, most SSD algorithms lack specific designs for addressing performance issues and cannot accurately pinpoint the details of QoS anomalies or high-latency IO.
[0060] One of the core inventive points of this invention is to obtain at least one read / write command from the hard drive, the read / write speed of the read / write command, and the read / write time point. Based on the read / write speed, the read / write command is split into several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation. Time distribution data for the read / write command is generated using the sub-command information, read / write time points, request time points, and operation time points. Data analysis and processing are performed on the time distribution data to obtain performance information corresponding to the read / write command. The performance information includes at least a reminder message for locating sub-commands in a high-latency state and service quality parameters for characterizing hard drive performance. This is achieved by obtaining the read / write speed of the read / write command. By using time points, request times of each sub-command, and operation times during the splitting operation, the system can quickly locate the corresponding command when SSD performance issues occur. On the other hand, by using sub-command information, read / write time points, request times, and operation times to generate time distribution data for read / write commands, the system can categorize scattered data, facilitating subsequent data analysis and processing. This allows for the generation of alerts to sub-commands in high-latency states and service quality parameters characterizing hard drive performance. Consequently, the system provides a clear understanding of specific SSD performance issues and enables timely SSD maintenance, significantly improving SSD performance and preventing stuttering.
[0061] Reference Figure 1 The diagram illustrates a flowchart of a hard disk performance analysis method provided in an embodiment of the present invention, which may specifically include the following steps:
[0062] Step 101: Obtain at least one read / write command from the hard drive, the read / write speed of the read / write command, and the read / write time point;
[0063] In this invention, the hard disk can be a solid state disk (SSD), the read and write commands can be I / O commands, which include write commands and read commands, the read and write speeds can be the read speed and write speed of the I / O commands, such as 128K. Files of 128KB and above are generally considered large files, and the read and write timestamps can be the read timetamps from the command queue of the hard disk and the write timetamps.
[0064] Optionally, read / write commands and their read / write speeds can be obtained from the command queue of the hard disk. The time point when the read / write command is read from the command queue can be used as the read time point, and the time point when the read / write command is returned to the command queue can be used as the write time point.
[0065] Step 102: Perform a split operation on the read and write command according to the read and write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the split operation;
[0066] In this embodiment of the invention, read and write commands can be split according to read and write speed to obtain several sub-commands, the request time point and sub-command information of each sub-command, and the operation time point corresponding to the splitting operation.
[0067] Optionally, a subcommand can be a series of microcommands derived from a read / write command. A read / write command can include multiple subcommands. The request time point can be the time point at which flash memory resources are requested from the memory allocation cache, such as one microsecond, two microseconds, ten microseconds, etc. In the flash memory of a solid-state drive, data storage is generally stored in pages (e.g., 4KB) as the smallest unit, and 128 pages make up a block. Data can be read and written in 4KB pages. The operation time point is the time point at which the splitting operation is performed.
[0068] In the specific implementation, the read / write speed is divided by the preset speed value to obtain the corresponding number of commands; the read / write commands are split into several sub-commands according to the number of commands, and the request time point, sub-command information, and operation time point corresponding to the splitting operation of each sub-command are obtained, so that the corresponding command position can be quickly located according to different time points.
[0069] Specifically, the preset speed value can be the read / write speed set in advance by relevant technical personnel according to actual needs or testing experience, such as 4K. The number of commands can be the number of subcommands. The number of commands is determined by the actual read / write speed of the read / write command and the preset speed value. For example, if the read / write command is 128K and the preset speed value is 4K, then the number of commands should be 32.
[0070] Step 103: Generate time distribution data for the read / write command using the sub-command information, the read / write time point, the request time point, and the operation time point;
[0071] In this embodiment of the invention, a background performance statistics module can be set up inside the SSD to generate time distribution data for read and write commands using sub-command information, read and write time points, request time points, and operation time points.
[0072] Optionally, the background performance statistics module can periodically collect the data structure (time distribution data) of all subcommands. The subcommand information includes detailed information about the subcommands, such as the location information, attribute information, and read / write speed of each subcommand. The time distribution data can be data that records the subcommand information, current time distribution, and historical time distribution of each subcommand.
[0073] As an example, time distribution data can be visualized to generate data structure diagrams for each sub-command. These diagrams can be categorized according to read / write time points, request time points, and operation time points to generate corresponding time sequence diagrams. The diagrams can then display the sub-command information of each sub-command, allowing users or relevant technical personnel to intuitively understand the specific process of the read / write command and quickly identify any abnormalities.
[0074] In practical implementation, read / write time points, request time points, and operation time points can be added to the same timeline in chronological order, and the position and attribute information of each sub-command can be displayed on the timeline to generate time distribution data for read / write commands.
[0075] Step 104: Perform data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands. The performance information includes at least a reminder message for locating subcommands in a high-latency state and a quality of service parameter for characterizing the performance of the hard drive.
[0076] In this embodiment of the invention, after obtaining the time distribution data, it is necessary to perform data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands. The performance information includes at least the reminder information for locating the sub-command in a high latency state and the quality of service parameters for characterizing the hard disk performance.
[0077] Optionally, the performance information can be specific to the SSD. It can not only use quality of service parameters to characterize the performance of the SSD, but also use reminders to alert users or relevant technicians that there are high latency issues in the read and write commands of the SSD, requiring timely maintenance of the SSD.
[0078] In the specific implementation, the latency data of each subcommand is obtained from the time distribution data. Subcommands with latency data greater than the preset latency threshold are marked as high latency states, and reminder information for high latency states is generated. Service quality data of the hard disk is obtained, consistency calculation is performed on the service quality data, and the corresponding service quality parameters are obtained.
[0079] In one example, the latency data can be the time it takes for the current subcommand to perform a read operation, typically in the microsecond range, such as one microsecond, two microseconds, ten microseconds, or ten milliseconds. The preset latency threshold can be a threshold set in advance by relevant technical personnel, such as ten microseconds. If the latency data is greater than the preset latency threshold, it indicates that the subcommand is in a high-latency state, which may cause lag. If the latency data is less than or equal to the preset latency threshold, it indicates that the subcommand is in a low-latency state and is working normally.
[0080] As another example, Quality of Service (QoS) data, under limited bandwidth resources, allocates bandwidth to various services, providing end-to-end service quality guarantees. For example, voice, video, and critical data applications in network devices can be prioritized for service through QoS configuration. Specific QoS parameters can be obtained by performing consistency calculations on QoS data. These parameters can be QoS metrics, such as bandwidth, latency, jitter, and packet loss rate. QoS parameters reflect the reliability and stability of SSDs. Consistency calculation refers to aggregating unstable data to obtain a relatively fixed parameter value. For example, if an SSD is pre-set to have a performance of 100 Mbps under a default load, but in actual operation, due to jitter, the performance becomes 110 Mbps, then according to probability theory, a script tool can aggregate a metric parameter based on the actual value.
[0081] Specifically, performance information also includes predicted latency values. A moving weighted average algorithm is used to perform latency statistics on latency data during the current lifespan of the hard drive to obtain predicted latency values for the next lifespan.
[0082] As an example, the weighted moving average assigns different weights to each variable value within a fixed time span. The specific prediction principle is that the impact of historical data on the demand in the future period is different. Therefore, in addition to the need for periodic changes with a period of n, it is also necessary to reduce the influence of variable values far from the target period, so they should be given lower weights, while the influence of variable values close to the target period should be increased, so they should be given higher weights. The specific calculation formula of the weighted moving average method is as follows: (Ft=w1At-1+w2At-2+w3At-3+……+wnAt-n), where w1 is the weight of the IO scenario in period t-1, w2 is the weight of the IO scenario in period t-2, wn is the weight of the IO scenario in period tn, and n is the number of periods to be predicted, and w1+w2+…+wn=1.
[0083] In one embodiment of the present invention, performance information can also be uploaded to the user terminal in response to a custom interface command, so that the user terminal can use a parsing tool to parse and process the performance information to obtain the performance parameters of the hard drive. The analysis results of the performance statistics module can be reported to the user terminal through the NVMe custom interface command, so that users and SSD maintenance personnel can quickly identify the root cause of the problem.
[0084] Optionally, the parsing tool can be an NVMe (Nonvolatile memory express) tool. NVMe can support SSDs using different types of nonvolatile memory. The main advantages of NVMe-based PCIe (Peripheral Component Interconnect express) SSDs are reduced host software stack latency, increased input / output operations per second (IOPS), and reduced power consumption. Performance parameters can be those characterizing the current performance of the SSD, mainly including IOPS (Input Output Operations Per Second, reflecting random read / write performance), throughput (in MB / s, reflecting sequential read / write performance), Response Time / Latency (in ms or μs), predicted latency, high latency locations, average latency, maximum latency, minimum latency, consistency parameters, and other data related to each IO command.
[0085] To enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, an example is provided below for illustrative purposes. Based on object-oriented design principles, a data structure is designed for each IO command (such as read, write, trim, etc.) received by the SSD, which serves as the temporal attribute of the IO command throughout the entire lifecycle of the SSD:
[0086] S1's data structure design is divided into two main parts. One part is based on the base command. Taking the default 128K write command as an example, the data structure records the time point from when the command is taken out of the queue to when it is returned to the queue, as well as the time point when the base command is broken down and aggregated into each 4K sub-command. The other part is based on the 4K sub-commands. The sub-commands are the basic operation objects of the write operation in the SSD algorithm and the backend. They record the time points of the algorithm from allocating cache and requesting NAND resources.
[0087] Similarly, the read command also uses a similarly designed data structure attribute to record information about key time nodes of the base command and sub-commands.
[0088] S2, the background performance statistics module will periodically collect the data structure of all commands. The performance statistics module can achieve three functions: 1. Real-time latency statistics through moving weighted average algorithm, predict and warn of continuous high latency; 2. Statistics on disk QoS data, and real-time calculation of performance data consistency; 3. Record the detailed process and latency details of abnormal IO, so that developers can directly locate the root cause.
[0089] S3, within the NVMe protocol, designs a custom presentation interface to send information from the performance statistics module to the server, and uses dedicated NVMe tools to parse the statistical distribution and obtain real-time performance-related information.
[0090] It should be noted that the embodiments of the present invention include, but are not limited to, the examples described above. It is understood that, under the guidance of the ideas in the embodiments of the present invention, those skilled in the art can make settings according to actual circumstances, and the present invention does not limit such settings.
[0091] In this embodiment of the invention, at least one read / write command of the hard drive, the read / write speed of the read / write command, and the read / write time point are obtained. The read / write command is then split according to the read / write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation. Time distribution data for the read / write command is generated using the sub-command information, read / write time points, request time points, and operation time points. Data analysis and processing are performed on the time distribution data to obtain performance information corresponding to the read / write command. The performance information includes at least a reminder message for locating sub-commands in a high-latency state and service quality parameters for characterizing hard drive performance. This is achieved by obtaining the read / write time points of the read / write command, the read / write speed of each sub-command, and the operation time points corresponding to the splitting operation. By analyzing the request time of each sub-command and the operation time of the splitting operation, the system can quickly locate the corresponding command when SSD performance issues occur. Furthermore, by using sub-command information, read / write time points, request time points, and operation time points, it generates time distribution data for read / write commands, categorizing scattered data for easier subsequent data analysis. This allows for the generation of alerts to sub-commands experiencing high latency and service quality parameters characterizing hard drive performance. This provides a clear understanding of specific SSD performance problems and enables timely SSD maintenance, significantly improving SSD performance and preventing stuttering.
[0092] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0093] Reference Figure 2 The diagram illustrates a structural block diagram of a hard disk performance analysis device provided in an embodiment of the present invention, which may specifically include the following modules:
[0094] The read / write command acquisition module 201 is used to acquire at least one read / write command of the hard disk, the read / write speed of the read / write command, and the read / write time point;
[0095] The time point acquisition module 202 is used to split the read and write commands according to the read and write speed to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the split operation;
[0096] The time distribution data generation module 203 is used to generate time distribution data for the read and write command using the sub-command information, the read and write time points, the request time points, and the operation time points.
[0097] The performance information analysis module 204 is used to perform data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands. The performance information includes at least the reminder information for locating the sub-command in a high latency state and the quality of service parameters for characterizing the performance of the hard drive.
[0098] In one optional embodiment, the read / write time points include read time points and write time points, and the read / write command acquisition module 201 is specifically used for:
[0099] The read / write commands and their read / write speeds are obtained from the command queue of the hard disk.
[0100] The time point at which the read / write command is read from the command queue is taken as the read time point, and the time point at which the read / write command is returned to the command queue is taken as the write time point.
[0101] In one optional embodiment, the time point acquisition module 202 is specifically used for:
[0102] Divide the read / write speed by the preset speed value to obtain the corresponding number of commands;
[0103] The read / write command is divided into several sub-commands according to the number of commands, and the request time point, sub-command information, and operation time point corresponding to the splitting operation are obtained for each sub-command.
[0104] The request time point is the time point at which flash memory resources are requested from the memory allocation cache, and the operation time point is the time point at which the split operation is performed.
[0105] In one optional embodiment, the sub-command information includes at least the location information and attribute information of each sub-command, and the time distribution data generation module 203 is specifically used for:
[0106] The read / write time points, request time points, and operation time points are added to the same timeline in chronological order, and the location and attribute information of each sub-command are displayed on the timeline to generate time distribution data for the read / write commands.
[0107] In one optional embodiment, the performance information analysis module 204 is specifically used for:
[0108] The latency data of each sub-command is obtained from the time distribution data;
[0109] Subcommands whose latency data exceeds a preset latency threshold are marked as high latency states, and reminder messages are generated for the high latency states;
[0110] Obtain the service quality data of the hard drive, perform consistency calculation on the service quality data, and obtain the corresponding service quality parameters.
[0111] In an optional embodiment, the performance information further includes a predicted latency value, and the performance information analysis module 204 is specifically used for:
[0112] During the current lifecycle of the hard drive, a moving weighted average algorithm is used to perform latency statistics on the latency data to obtain a predicted latency value for the next lifecycle.
[0113] In one alternative embodiment, the device further includes:
[0114] The performance information upload module is used to upload the performance information to the user terminal in response to a custom interface command, so that the user terminal can use a parsing tool to parse and process the performance information to obtain the performance parameters of the hard drive.
[0115] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0116] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described hard disk performance analysis method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0117] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the aforementioned hard disk performance analysis method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0118] Figure 3 A structural block diagram of an electronic device for implementing various embodiments of the present invention.
[0119] The electronic device 300 includes, but is not limited to, components such as: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311. Those skilled in the art will understand that... Figure 3 The electronic device structures shown are not intended to limit the electronic device. An electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In embodiments of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.
[0120] It should be understood that, in this embodiment of the invention, the radio frequency unit 301 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 310; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 301 can also communicate with networks and other devices through a wireless communication system.
[0121] The electronic device provides users with wireless broadband internet access through network module 302, such as helping users send and receive emails, browse web pages, and access streaming media.
[0122] The audio output unit 303 can convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into audio signals and output them as sound. Furthermore, the audio output unit 303 can also provide audio output related to specific functions performed by the electronic device 300 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, and a receiver, etc.
[0123] Input unit 304 is used to receive audio or video signals. Input unit 304 may include a graphics processing unit (GPU) 3041 and a microphone 3042. The GPU 3041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 306. The image frames processed by GPU 3041 can be stored in memory 309 (or other storage media) or transmitted via radio frequency unit 301 or network module 302. Microphone 3042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 301 in telephone call mode.
[0124] The electronic device 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 3061 according to the ambient light level, and the proximity sensor can turn off the display panel 3061 and / or backlight when the electronic device 300 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 305 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.
[0125] The display unit 306 is used to display information input by the user or information provided to the user. The display unit 306 may include a display panel 3061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0126] User input unit 307 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 307 includes a touch panel 3071 and other input devices 3072. Touch panel 3071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 3071). Touch panel 3071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 310, which receives and executes commands from the processor 310. In addition, touch panel 3071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to touch panel 3071, user input unit 307 may also include other input devices 3072. Specifically, other input devices 3072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0127] Furthermore, the touch panel 3071 can cover the display panel 3061. When the touch panel 3071 detects a touch operation on or near it, it transmits the information to the processor 310 to determine the type of touch event. Subsequently, the processor 310 provides corresponding visual output on the display panel 3061 based on the type of touch event. Although in Figure 3 In this embodiment, the touch panel 3071 and the display panel 3061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.
[0128] Interface unit 308 serves as an interface for connecting external devices to electronic device 300. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 308 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 300, or it can be used to transmit data between electronic device 300 and external devices.
[0129] The memory 309 can be used to store software programs and various data. The memory 309 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 309 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0130] The processor 310 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 309, and by calling data stored in the memory 309, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 310.
[0131] The electronic device 300 may also include a power supply 311 (such as a battery) for supplying power to various components. Preferably, the power supply 311 can be logically connected to the processor 310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.
[0132] In addition, the electronic device 300 includes some functional modules not shown, which will not be described in detail here.
[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0135] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0136] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0137] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0138] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0141] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0142] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for analyzing the performance of a hard disk, characterized in that, The method includes: Obtain at least one read / write command from the hard drive, the data size of the read / write command, and the read / write time point; The read and write commands are split according to their data size to obtain several sub-commands, the request time of each sub-command, sub-command information, and the operation time corresponding to the splitting operation. The time distribution data for the read / write command is generated using the sub-command information, the read / write time point, the request time point, and the operation time point. The time distribution data is analyzed and processed to obtain the performance information corresponding to the read and write commands. The performance information includes at least a reminder message for locating subcommands in a high-latency state and a quality of service parameter for characterizing the performance of the hard drive.
2. The method according to claim 1, characterized in that, The read / write time points include read time points and write time points. Acquiring at least one read / write command from the hard drive, the data size of the read / write command, and the read / write time points includes: Retrieve the read / write command and the data size of the read / write command from the command queue of the hard disk; The time point at which the read / write command is read from the command queue is taken as the read time point, and the time point at which the read / write command is returned to the command queue is taken as the write time point.
3. The method according to claim 1, characterized in that, The step of splitting the read / write command according to its data size to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation includes: Divide the data size of the read / write command by the preset data size to obtain the corresponding number of commands; The read / write command is divided into several sub-commands according to the number of commands, and the request time point, sub-command information, and operation time point corresponding to the splitting operation are obtained for each sub-command. The request time point is the time point at which flash memory resources are requested from the memory allocation cache, and the operation time point is the time point at which the split operation is performed.
4. The method according to claim 1, characterized in that, The sub-command information includes at least the location information and attribute information of each sub-command. Generating time distribution data for the read / write command using the sub-command information, the read / write time point, the request time point, and the operation time point includes: The read / write time points, request time points, and operation time points are added to the same timeline in chronological order, and the location and attribute information of each sub-command are displayed on the timeline to generate time distribution data for the read / write commands.
5. The method according to claim 1, characterized in that, The step of performing data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands includes: The latency data of each sub-command is obtained from the time distribution data; Subcommands whose latency data exceeds a preset latency threshold are marked as high latency states, and reminder messages are generated for the high latency states; Obtain the service quality data of the hard drive, perform consistency calculation on the service quality data, and obtain the corresponding service quality parameters.
6. The method according to claim 5, characterized in that, The performance information also includes predicted latency values. The process of analyzing and processing the time distribution data to obtain the performance information corresponding to the read / write commands includes: During the current lifecycle of the hard drive, a moving weighted average algorithm is used to perform latency statistics on the latency data to obtain a predicted latency value for the next lifecycle.
7. The method according to claim 1, characterized in that, The method further includes: In response to a custom interface command, the performance information is uploaded to the user terminal, so that the user terminal can use a parsing tool to parse and process the performance information to obtain the performance parameters of the hard drive.
8. A hard disk performance analysis device, characterized in that, The device includes: The read / write command acquisition module is used to acquire at least one read / write command from the hard disk, the data size of the read / write command, and the read / write time point; The time point acquisition module is used to split the read and write command according to the data size of the read and write command to obtain several sub-commands, the request time point of each sub-command, sub-command information, and the operation time point corresponding to the splitting operation; The time distribution data generation module is used to generate time distribution data for the read and write command using the sub-command information, the read and write time points, the request time points, and the operation time points. The performance information analysis module is used to perform data analysis and processing on the time distribution data to obtain the performance information corresponding to the read and write commands. The performance information includes at least the reminder information for locating sub-commands in a high-latency state and the quality of service parameters for characterizing the performance of the hard drive.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-7.