A method, device, equipment and medium for improving performance of storage device

Through real-time monitoring and dynamic adjustment of the sector efficiency of the storage device, the problem of bad disk areas affecting hard disk performance is solved, flexible adjustment between access performance modes of different sector sectors is realized, and the access of the overall storage device is improved. performance.

CN118963678BActive Publication Date: 2025-01-21ZHEJIANG HUAQI INTELLIGENT TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411442263.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-21
Estimated Expiration
2044-10-16

AI Technical Summary

Technical Problem

In the case of bad disk areas in the hard disk or disk, the prior art cannot effectively improve the performance of the hard disk, and there is a problem of write error amplification, increasing the risk of data loss.

Method used

Through real-time monitoring of the processing status of service requests by multiple sector sections of the storage device, it is detected that sector sections that do not meet the preset standards will adjust their working efficiency to low performance mode, and sector sections that meet the preset standards will be adjusted to High performance mode.

Benefits of technology

It realizes working in high-performance mode when accessing normal sector sectors and working in low-performance mode when accessing bad sector sectors, thereby improving the access performance of the overall storage device and reducing the risk of data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963678B_ABST
    Figure CN118963678B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, device and medium for improving the performance of a storage device. The method includes: initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode; obtaining the processing status of multiple sector segments of the target storage device for service requests in real time; when it is detected that the processing status of the first sector segment in the sector segment does not meet the preset standard, adjusting the working efficiency of the first sector segment to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segment meets the preset standard, adjusting the working efficiency of the second sector segment to the first performance mode, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode. The use of this method can enable the storage device to operate at a higher efficiency when there are bad sector segments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a method, apparatus, device and medium for improving the performance of a storage device. Background Art

[0002] The NCQ function is a new technology supported by the SATA2.0 / SATA3.0 protocol. It is a method that optimizes the execution order of workloads inside the hard disk and improves the performance of mechanical hard disks by reordering the commands in the internal queue. In the prior art, in order to improve the performance of mechanical hard disks, the above-mentioned NCQ function is also often used, or by optimizing the scheduling IO algorithm, merging small IOs, and using continuous large IOs as much as possible. However, for the above-mentioned prior art, when faced with a scenario where there is a bad disk area in the hard disk or magnetic disk itself, there is a disadvantage of amplifying write errors. In this case, not only can the hard disk performance not be improved, but there is also a risk of more data loss.

[0003] Currently, no effective solution has been proposed for the problem in the prior art that the performance of storage medium devices is greatly affected by bad disks. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, equipment and medium for improving the performance of a storage device in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for improving the performance of a storage device. The method comprises:

[0006] Initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0007] Obtaining in real time the processing status of multiple sector segments of the target storage device for service requests;

[0008] When it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode.

[0009] In one embodiment, initializing the acquired initial storage device to obtain the target storage device includes:

[0010] Detecting the working status information of the initial storage device to obtain the number of abnormal sections in the initial storage device;

[0011] When it is detected that the number of abnormal segments is greater than or equal to a preset abnormal number threshold, all sector segments in the initial storage device are initialized to the second performance mode;

[0012] When it is detected that the number of abnormal sectors is less than the abnormal number threshold, all sector sectors in the initial storage device are initialized to the first performance mode.

[0013] In one of the embodiments, when it is detected that the processing state of a first sector segment in the sector segments does not meet a preset standard, adjusting the working efficiency of the first sector segment to a second performance mode includes:

[0014] When a service request timeout error is detected in the first sector segment, switching the working efficiency of the first sector segment to a second performance mode; and / or,

[0015] When it is detected that the number of service request errors of the first sector segment is greater than a preset error threshold within a preset time range, the working efficiency of the first sector segment is switched to the second performance mode.

[0016] In one of the embodiments, when it is detected that the processing state of a second sector segment in the sector segments meets a preset standard, adjusting the working efficiency of the second sector segment to a first performance mode includes:

[0017] When it is detected that the normal number of service requests of the second sector segment is greater than a preset request threshold within a preset time range, the working efficiency of the second sector segment is switched to the first performance mode.

[0018] In one of the embodiments, the value of the request threshold is positively correlated with the number of abnormal sectors of the corresponding initial storage device.

[0019] In one of the embodiments, when it is detected that the processing state of a second sector segment in the sector segments meets a preset standard, switching the working efficiency of the second sector segment to the first performance mode includes:

[0020] When it is detected that the normal number of service requests of the second sector segment is greater than a preset first threshold within a preset time range, the working efficiency of the second sector segment is adjusted to at least one preset intermediate performance mode, and the service requests of the second sector segment are continuously detected, wherein the working efficiency of the intermediate performance mode is higher than the second performance mode, and the working efficiency of the intermediate performance mode is lower than the first performance mode;

[0021] Repeat the above steps, and based on the increase in the normal number of service requests of the second sector segment, gradually improve the working efficiency of the second sector segment until the working efficiency of the second sector segment is adjusted to the first performance mode.

[0022] In one of the embodiments, the depth of the service request queue of the first performance mode is greater than the depth of the service request queue of the second performance mode.

[0023] In a second aspect, the present application also provides a device for improving the performance of a storage device. The device comprises:

[0024] The detection module performs initialization settings on the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0025] An acquisition module, used for acquiring in real time the processing status of multiple sector segments of a target storage device for a service request;

[0026] An adjustment module is used to adjust the working efficiency of the first sector segment to the second performance mode when it is detected that the processing status of the first sector segment in the sector segment does not meet the preset standard; and / or, when it is detected that the processing status of the second sector segment in the sector segment meets the preset standard, adjust the working efficiency of the second sector segment to the first performance mode.

[0027] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0028] Initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0029] Obtaining in real time the processing status of multiple sector segments of the target storage device for service requests;

[0030] When it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0032] Initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0033] Obtaining in real time the processing status of multiple sector segments of the target storage device for service requests;

[0034] When it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode.

[0035] The performance improvement method, apparatus, device and medium of the above-mentioned storage device monitor the business request processing status of multiple sector segments of the storage device, and when it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode. Through the method in the present application, the working efficiency of each sector segment in the storage device can be set independently, and the performance of each sector segment can be dynamically adjusted according to the actual working conditions of the sector segment, so as to achieve high-performance mode when accessing normal sector segments and low-performance mode when accessing bad sector segments, so as to achieve the best overall access performance of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 An application environment diagram of a performance improvement method in an embodiment;

[0037] Figure 2 is a flow chart of a performance improvement method in one embodiment;

[0038] Figure 3 A schematic diagram of a process for initializing and setting an initial storage device in one embodiment;

[0039] Figure 4 This is a method for a controller to access a SATA hard disk in the prior art;

[0040] Figure 5 is a structural block diagram of a performance improvement device in one embodiment;

[0041] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] A method for improving the performance of a storage device provided in an embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The initial storage device obtained is initialized and set to obtain the target storage device, and then the processing status of multiple sector segments of the target storage device for the service request is obtained in real time. When it is detected that the processing status of the first sector segment in the sector segment does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode. When it is detected that the processing status of the second sector segment in the sector segment meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0044] In one embodiment, Figure 2 As shown, a method for improving the performance of a storage device is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0045] Step S210, initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode.

[0046] Among them, the acquired initial storage device needs to be initialized and set to a preset performance mode for the working efficiency of each sector segment in the initial storage device, so as to facilitate the initial storage device to start working. In actual applications, the above preset performance mode can be set in advance by relevant technical personnel, such as setting a corresponding performance mode for the working efficiency of each sector segment according to the historical working parameter information of different sector segments; the performance mode of each sector segment can also be set according to the preset setting rules. If it is detected that the number of bad sector segments in the initial storage device is too large, all sector segments in the initial storage device are set to run in low performance mode. Similarly, if it is detected that the number of bad sector segments in the initial storage device is small, all sector segments in the initial storage device are set to run in high performance mode, and so on.

[0047] Step S220, obtaining in real time the processing status of multiple sector segments of the target storage device for the service request.

[0048] Among them, the processing status of each sector segment for the service request is detected in real time. The content of the service request processing status includes but is not limited to detecting the completion time of the sector segment for the service request, detecting the number of errors when processing multiple service requests fed back by the sector segment within a certain time range, etc. In this embodiment, the processing status of each sector segment for the service request is monitored and recorded in real time.

[0049] Step S230, when it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode.

[0050] In the working process of each sector segment, the working efficiency of each sector segment can be dynamically adjusted according to the processing status of the service request. When it is detected that the processing status of the first sector segment in the sector segment does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode, that is, the second performance mode is used when accessing the first sector segment, wherein the preset standard is an assessment standard set corresponding to the service request processing status, such as the standard for the service request completion time (in actual applications, the setting of the time standard is preferably set to 3s); the standard for the number of service request errors (in actual applications, the standard for the number of errors can be set to 3 times), etc. Similarly, if it is detected that the processing status of the second sector segment in the sector segment meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode, that is, the first performance mode is used when accessing the second sector segment, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode. In this embodiment, the method for adjusting the working efficiency includes but is not limited to setting the service request queue depth of the first performance mode to be greater than the service request queue depth of the second performance mode.

[0051] Through step S210 to step S230, the working efficiency of each sector segment can be dynamically adjusted according to the service request processing status of different sector segments when they are actually working, so as to achieve working in high-performance mode when accessing normal sector segments and working in low-performance mode when accessing bad sector segments. For bad sector segments, the efficiency of working in low-performance mode is substantially higher than the efficiency of working in high-performance mode. Through the solution of the present application, even if there are bad sector segments in the storage device, the storage device can work as efficiently as possible to achieve the best overall access performance of the storage device.

[0052] In some embodiments, the method further comprises:

[0053] Detecting the working status information of the initial storage device to obtain the number of abnormal sections in the initial storage device;

[0054] When it is detected that the number of abnormal segments is greater than or equal to a preset abnormal number threshold, all sector segments in the initial storage device are initialized to the second performance mode;

[0055] When it is detected that the number of abnormal sectors is less than the abnormal number threshold, all sector sectors in the initial storage device are initialized to the first performance mode.

[0056] Specifically, Figure 3 The figure is a flow chart of initializing the initial storage device in one embodiment. The above working status information is used to reflect the health status of each sector segment of the initial storage device, which is the status information of the current initial storage device, that is, the information statistics from the time when the initial storage device was used since it left the factory, such as how many bad sector segments the storage device currently has, how many bad sector segments the current storage device has repaired, how many hours the current storage device has been used, etc. In some preferred embodiments, the initial storage device may be a SATA hard disk (SerialATA, serial port hard disk), and accordingly, the above working status information is smart information.

[0057] This embodiment includes step S310 of acquiring an initial storage device, wherein the initial storage device includes but is not limited to a SATA hard disk, including other storage medium devices such as SATA and SSD (Solid State Disk).

[0058] Step S320, detect whether the number of abnormal segments is greater than the abnormal number threshold, where the abnormal number threshold can be set to 10 or 20, etc. If it is detected that the number of abnormal segments is greater than the abnormal number threshold, jump to step S330. Similarly, if it is detected that the number of abnormal segments is not greater than the abnormal number threshold, jump to step S340.

[0059] Step S330: Initialize the sector segment to the second performance mode. The second performance mode can be set to a service queue depth of 1, that is, the next service request can be sent only after the current service is completed.

[0060] Step S340, initialize the sector segment to the first performance mode. The first performance mode can be set to a service queue depth of 32, that is, a maximum of 32 service requests can be sent to the storage device at one time, and the storage device can automatically optimize the service requests and then execute them accordingly. Through this application, the initial storage device can be initialized according to the number of bad sector segments, so that the initial storage device starts to execute the corresponding service request with the result after initialization, thereby facilitating the subsequent steps.

[0061] In some embodiments, the method further comprises:

[0062] When a service request timeout error is detected in the first sector segment, switching the working efficiency of the first sector segment to a second performance mode; and / or,

[0063] When it is detected that the number of service request errors of the first sector segment is greater than a preset error threshold within a preset time range, the working efficiency of the first sector segment is switched to the second performance mode.

[0064] Specifically, this embodiment includes two adjustment bases for adjusting the working efficiency of the sector segment to the second performance mode with low performance. In this embodiment, the sector segment accessed by the service request can be queried through the kernel / controller, timer mechanism, etc. When a service request timeout error is detected in the first sector segment, the working efficiency of the sector segment needs to be switched to the second performance mode. It can be understood that if the working efficiency of the sector segment is not switched to the second performance mode, it is easy to appear that if the sector segments accessed by the first few service requests are bad sector segments, resulting in access timeout, and the sector segments accessed by the remaining service requests are normal sector segments, but because the previous service requests take a long time, the remaining service requests are all judged as access timeouts, and then the execution is terminated, resulting in data loss. In summary, when a timeout error is detected in the access to the service request of the first sector segment, the working efficiency of the first sector segment needs to be switched to the second performance mode with low performance.

[0065] Furthermore, if it is detected that the number of service request errors of the first sector segment is greater than the preset error threshold within the preset time range, the working efficiency of the first sector segment is switched to the second performance mode, wherein the time range can be set to 10s, 30s, etc. The time range can be set according to actual needs. If the sensitivity is high, the time range can be set to a smaller value, and the error threshold can be set to 10 times, 20 times, etc. The service request errors include but are not limited to service request timeouts, bad sector errors, unaligned access errors, etc. Through this embodiment, the bad sector segments of the storage device that are likely to be accessed frequently in the current or future period of time can be accurately identified, so that the working efficiency of the bad sector segments is adjusted to the second performance mode of low performance, thereby reducing the number of service request errors and reducing the risk of data loss.

[0066] In some embodiments, the method further comprises:

[0067] When it is detected that the normal number of service requests of the second sector segment is greater than a preset request threshold within a preset time range, the working efficiency of the second sector segment is switched to the first performance mode.

[0068] Specifically, if it is detected that the normal number of business requests for the second sector segment is greater than the request threshold within a preset time range, the working efficiency of the second sector segment is switched to the first performance mode, wherein the preset request threshold can be set by relevant technical personnel according to actual needs. Similarly, it can also be set that if the storage device can execute business requests normally within a certain time range, that is, there are no abnormalities or errors, the working efficiency of the second sector area can be switched to the first performance mode. Through this application, it can be accurately determined that the business requests for access to the storage device currently and in the future are most likely access requests for normal sector segments. At this time, in order to improve the working efficiency of the storage device, the working efficiency of the second sector segment is adjusted to the first performance mode.

[0069] In some of the embodiments, the value of the request threshold is positively correlated with the number of abnormal sectors of the corresponding initial storage device.

[0070] Specifically, in this embodiment, the value of the request threshold can be set according to the number of abnormal segments of the initial storage device. If it is known that the number of bad sector segments in the storage device is large, a higher threshold value can be set, so that the working efficiency of the sector segment can be adjusted more conservatively, and it is less likely to enter the high-performance mode. Similarly, if it is known that the number of bad sector segments in the storage device is small, a lower threshold value can be set, so that it is easier to enter the high-performance mode. Through this application, the value of the request threshold can be set according to the number of abnormal segments, so that it can adapt to different storage devices, while improving the working efficiency of the storage device and reducing the risk of error reporting as much as possible.

[0071] In some embodiments, the method further comprises:

[0072] When it is detected that the normal number of service requests of the second sector segment is greater than a preset first threshold within a preset time range, the working efficiency of the second sector segment is adjusted to at least one preset intermediate performance mode, and the service requests of the second sector segment are continuously detected, wherein the working efficiency of the intermediate performance mode is higher than the second performance mode, and the working efficiency of the intermediate performance mode is lower than the first performance mode;

[0073] Repeat the above steps, and based on the increase in the normal number of service requests of the second sector segment, gradually improve the working efficiency of the second sector segment until the working efficiency of the second sector segment is adjusted to the first performance mode.

[0074] Specifically, when it is detected that the normal number of service requests of the second sector segment is greater than the preset first threshold, the working efficiency of the second sector segment can be adjusted to the intermediate performance mode. In this embodiment, multiple intermediate performance modes with different working efficiencies can be included, and each intermediate performance mode is arranged in order of working efficiency. For example, the multiple intermediate performance modes can be set to have service request queue depths of 4, 8, 16, etc. The working efficiency of all intermediate performance modes is higher than the working efficiency of the second performance mode, and the working efficiency of all intermediate performance modes is lower than the working efficiency of the first performance mode.

[0075] In this embodiment, the second sector segment is taken as an example that it originally works in the second performance mode, and the second performance mode is set to a service request queue depth of 1. When it is detected that the number of normal service requests of the second sector segment is greater than the first threshold within a preset time range, the working efficiency of the second sector segment can be adjusted to an intermediate performance mode with a service request queue depth of 4, and the service requests of the second sector segment are continuously monitored. Similarly, if it is detected that the second sector segment works in the intermediate performance mode with a service request queue depth of 4, and the number of normal service requests of the second sector segment is still greater than the first threshold, the working efficiency of the second sector segment can be gradually improved, such as improving the working efficiency of the second sector segment to a service request queue depth of 8. Repeat the above steps, when the second sector segment works normally in this performance mode for a period of time / a certain amount of data, it can enter the next higher performance mode step by step, until the working efficiency of the second sector segment is gradually adjusted to the first performance mode. It is understandable that if an error occurs in the second sector segment or a service request access exception occurs during the step-by-step improvement process, the system returns to the previous slower performance mode, or directly returns to the second performance mode with the lowest working efficiency. The present application can gradually improve the working efficiency of the sector segment, thereby achieving more stable working of the sector segment and effectively improving working efficiency.

[0076] In some of these embodiments, the depth of the service request queue in the first performance mode is greater than the depth of the service request queue in the second performance mode.

[0077] Specifically, the depth of the service request queue refers to the number of service requests sent by the kernel / controller to the storage device at one time. Under normal circumstances, the more service requests are sent at one time, the higher the access efficiency. When the service request queue depth is 1, it means that there is only one service request sent to the storage device each time, and the next service request will not be sent until this service request is processed. Similarly, when the service request queue depth is 32, it means that a maximum of 32 service requests can be sent to the storage device at one time, and the storage device can automatically optimize the order of service requests and then execute the corresponding request tasks. In the present application, the service request queue depth of the first performance mode is 32, and the service request depth of the second performance mode is 1. Through this embodiment, the service request of the storage device can be implemented in high-performance mode when accessing normal sector segments, and in low-performance mode when accessing bad sector segments, so as to achieve the best overall access performance of the storage device.

[0078] This embodiment also provides a preferred embodiment of a method for improving the performance of a storage device, taking the application of the performance improvement method in this application to a SATA hard disk as an example.

[0079] Figure 4 The controller accesses the SATA hard disk in the prior art. Figure 4 It can be seen that when both the SATA controller and the SATA hard disk support the NCQ (Native Command Queuing, full-speed command queuing) function and are enabled, the SATA controller can send up to 32 service requests, i.e. IO requests, to the SATA hard disk for processing at one time. After receiving these 32 IO requests, the SATA hard disk internally organizes and sorts these 32 IO requests to optimize them so that they can be executed in the access order that satisfies the optimal mechanical hard disk, thereby improving the hard disk performance. However, if there are bad sector segments in the SATA hard disk, it will appear that, for example, the first 10 IO requests are all accessing the bad sector segments of the hard disk, and the access speed is slow, which causes the subsequent 22 normal IO requests to be considered as IO timeouts, and then terminated, resulting in data loss.

[0080] To solve the above problems, the present application proposes a method for improving the performance of storage devices. First, for the newly identified initial storage device, which is the newly identified SATA hard disk in this embodiment, the health status of the SATA hard disk can be judged according to the smart information to obtain the number of physical bad sector segments. If the number of bad sector segments exceeds the preset abnormal number threshold, such as the number of bad sectors exceeds 1024, or the number of bad sectors accounts for more than one ten-thousandth of the total sectors of the hard disk, all sector segments in the SATA hard disk are initialized to low performance mode, that is, all sector segments are set to work in the second performance mode, preferably, the service request queue depth of the second performance mode can be set to 1; similarly, if the number of bad sector segments does not exceed the abnormal number threshold, all sector segments are set to work in the first performance mode, preferably, the service request queue depth of the first performance mode can be set to 32.

[0081] After the SATA hard disk is initialized, each sector segment of the SATA hard disk is continuously monitored, and each sector segment can be switched between the low performance mode and the high performance mode according to a certain strategy.

[0082] When a timeout error is detected in an IO task of a SATA hard disk through the kernel / controller mechanism, it indicates that the IO task of the disk is likely to frequently access the physical bad sector segment in the current or future period, so the sector segment corresponding to the IO task can be set to low performance mode; further, if the number of business request errors detected in a sector segment within a certain time range is greater than a preset error threshold, the sector segment can be set to low performance mode. In summary, the above is the basis for adjusting the sector segment to low performance mode.

[0083] The adjustment strategies for adjusting the sector segment to the high performance mode include but are not limited to:

[0084] 1. Set a certain time threshold. If all IO tasks are normal within the preset time range, that is, no IO errors occur, the high-performance mode will be entered. The preset time range can be set from the low-performance mode to the current time.

[0085] 2. Set a certain IO request threshold. If it is detected that the number of normal IO executions or the number of IO normal access sectors exceeds the preset request threshold within the preset time range, enter the high-performance mode.

[0086] 3. Different request thresholds can be set according to the value of the hard disk's smart id (i.e., the number of bad sector segments). That is, if the number of known bad sector segments is large, the value of the request threshold can be set larger, that is, the adjustment strategy is more conservative and less likely to enter the high-performance mode; similarly, if the number of known bad sector segments is small, the value of the request threshold can be set smaller, that is, the adjustment strategy is more aggressive and easier to enter the high-performance mode.

[0087] 4. When adjusting from slow mode to high performance mode, it can be adjusted step by step. For example, the service request queue depth can be set to 1, 4, 8, 16, and 32 in sequence. These five intermediate performance mode levels can only be entered when the IO works normally for a certain period of time / a certain amount of data at this level, otherwise it will enter the slow mode again.

[0088] In summary, it can be understood that for business access to bad sector segments, the slow mode is more efficient than the high-performance mode. For the low-performance mode, each time an IO task is sent, if an IO request timeout occurs, or the IO request duration is too long, it indicates that the sector segment being accessed is abnormal, but it will not affect other normal IO requests, and will not cause data loss for other IO requests, while the high-performance mode will have the risk of data loss. When processing abnormal IO requests, only this one abnormal IO request needs to be processed, while the high-performance mode needs to process up to 32 abnormal IO requests. It can be seen that the low-performance mode can significantly reduce the processing time of abnormal IO and reduce the time of blocking normal IO requests, thereby improving the overall IO performance of the SATA hard disk.

[0089] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0090] Based on the same inventive concept, the embodiment of the present application also provides a storage device performance improvement device for implementing the storage device performance improvement method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the performance improvement device for one or more storage devices provided below can refer to the limitations of the storage device performance improvement method above, and will not be repeated here.

[0091] In one embodiment, Figure 5 As shown, a device for improving the performance of a storage device is provided, comprising: a detection module 51, an acquisition module 52 and an adjustment module 53, wherein:

[0092] The detection module 51 performs initialization settings on the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0093] The acquisition module 52 is used to acquire the processing status of the multiple sector segments of the target storage device for the service request in real time;

[0094] The adjustment module 53 is used to adjust the working efficiency of the first sector segment to the second performance mode when it is detected that the processing status of the first sector segment in the sector segment does not meet the preset standard; and / or, when it is detected that the processing status of the second sector segment in the sector segment meets the preset standard, adjust the working efficiency of the second sector segment to the first performance mode.

[0095] Specifically, the detection module 51 initializes the acquired initial storage device to obtain the target storage device; then the acquisition module 52 acquires the processing status of the target storage device's multiple sector segments for the service request in real time, and sends the processing status result to the adjustment module 53. When the adjustment module 53 detects that the processing status of the first sector segment in the sector segment does not meet the preset standard, it adjusts the working efficiency of the first sector segment to the second performance mode, and / or, when the adjustment module 53 detects that the processing status of the second sector segment in the sector segment meets the preset standard, it adjusts the working efficiency of the second sector segment to the first performance mode. Through this embodiment, when there are bad sector segments, the overall access performance of the storage device can still be optimized.

[0096] Each module in the above-mentioned storage device performance improvement device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0097] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store performance improvement related data of the storage device. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for improving the performance of a storage device is implemented.

[0098] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0099] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0100] Initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode;

[0101] Obtaining in real time the processing status of multiple sector segments of the target storage device for service requests;

[0102] When it is detected that the processing status of the first sector segment in the sector segments does not meet the preset standard, the working efficiency of the first sector segment is adjusted to the second performance mode; and / or, when it is detected that the processing status of the second sector segment in the sector segments meets the preset standard, the working efficiency of the second sector segment is adjusted to the first performance mode, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode.

[0103] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0104] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0105] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0106] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for improving the performance of a storage device, characterized in that: The method comprises: Initializing the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode; Acquire in real time the processing status of the multiple sector segments of the target storage device for the service request; When it is detected that the processing state of a first sector segment in the sector segments does not meet a preset standard, adjusting the working efficiency of the first sector segment to a second performance mode; when it is detected that the processing state of a second sector segment in the sector segments meets the preset standard, adjusting the working efficiency of the second sector segment to a first performance mode, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode; when it is detected that the processing state of the second sector segment in the sector segments meets the preset standard, adjusting the working efficiency of the second sector segment to the first performance mode, comprises: When it is detected that the normal number of service requests of the second sector segment is greater than a preset first threshold within a preset time range, the working efficiency of the second sector segment is adjusted to at least one preset intermediate performance mode, and the service requests of the second sector segment are continuously detected, wherein the working efficiency of the intermediate performance mode is higher than the second performance mode, and the working efficiency of the intermediate performance mode is lower than the first performance mode; repeat the above steps, and based on the increase in the normal number of service requests of the second sector segment, gradually improve the working efficiency of the second sector segment until the working efficiency of the second sector segment is adjusted to the first performance mode.

2. The method according to claim 1, characterized in that The initializing and setting the acquired initial storage device to obtain the target storage device includes: Detecting the working status information of the initial storage device to obtain the number of abnormal sections in the initial storage device; When it is detected that the number of the abnormal segments is greater than or equal to a preset abnormal number threshold, all sector segments in the initial storage device are initialized to the second performance mode; When it is detected that the number of the abnormal sectors is less than the abnormal number threshold, all the sector sectors in the initial storage device are initialized to the first performance mode.

3. The method according to claim 1, characterized in that When detecting that the processing state of a first sector segment in the sector segments does not meet a preset standard, adjusting the working efficiency of the first sector segment to the second performance mode includes: When a service request timeout error is detected in the first sector segment, switching the working efficiency of the first sector segment to the second performance mode; and / or, When it is detected that the number of service request errors of the first sector segment is greater than a preset error threshold within a preset time range, the working efficiency of the first sector segment is switched to the second performance mode.

4. The method according to claim 1, characterized in that: When detecting that the processing state of a second sector segment in the sector segments meets the preset standard, adjusting the working efficiency of the second sector segment to the first performance mode includes: When it is detected that the normal number of service requests of the second sector segment is greater than a preset request threshold within a preset time range, the working efficiency of the second sector segment is switched to the first performance mode.

5. The method according to claim 4, characterized in that The value of the request threshold is positively correlated with the number of abnormal sections of the corresponding initial storage device.

6. The method according to any one of claims 1 to 5, characterized in that: The depth of the service request queue of the first performance mode is greater than the depth of the service request queue of the second performance mode.

7. A device for improving the performance of a storage device, characterized in that: The device comprises: A detection module performs initialization settings on the acquired initial storage device to obtain a target storage device, wherein the target storage device operates in a preset performance mode; An acquisition module, used for acquiring in real time the processing status of the multiple sector segments of the target storage device for the service request; An adjustment module, configured to adjust the working efficiency of a first sector segment in the sector segments to a second performance mode when it is detected that the processing state of the first sector segment in the sector segments does not meet a preset standard; and adjust the working efficiency of a second sector segment in the sector segments to a first performance mode when it is detected that the processing state of the second sector segment in the sector segments meets the preset standard, wherein the working efficiency of the first performance mode is higher than the working efficiency of the second performance mode; and adjusting the working efficiency of the second sector segment in the sector segments to the first performance mode when it is detected that the processing state of the second sector segment in the sector segments meets the preset standard, comprising: When it is detected that the normal number of service requests of the second sector segment is greater than a preset first threshold within a preset time range, the working efficiency of the second sector segment is adjusted to at least one preset intermediate performance mode, and the service requests of the second sector segment are continuously detected, wherein the working efficiency of the intermediate performance mode is higher than the second performance mode, and the working efficiency of the intermediate performance mode is lower than the first performance mode; repeat the above steps, and based on the increase in the normal number of service requests of the second sector segment, gradually improve the working efficiency of the second sector segment until the working efficiency of the second sector segment is adjusted to the first performance mode.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method for improving reliability of solid state disk and solid state disk of method

    CN102982836A

  • Overload protection method and device of storage system, electronic equipment and medium

    CN115599303A