Disk management method, device, equipment and storage medium

By maintaining the number of abnormal accesses for disk partitions and marking them as isolated when the threshold is exceeded, the negative impact of full disk isolation on the storage system is resolved, enabling more granular disk management and improving system reliability and efficiency.

CN114625579BActive Publication Date: 2025-12-19CHONGQING UNISINSIGHT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210292320.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2025-12-19
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

In existing technologies, isolating an entire disk as a slow disk can significantly impact the storage system's business operations, performance, and capacity. Furthermore, the spare space is easily exhausted, leading to slower system I/O response times or data loss.

Method used

By maintaining the partition status for each disk partition in the target disk and recording the number of abnormal accesses, the target partition is marked as isolated when the number of abnormal accesses exceeds a threshold, thus avoiding the isolation of the entire disk.

Benefits of technology

It enables more refined disk management, avoids disk isolation due to partial disk partition damage, improves the reliability and efficiency of the storage system, and reduces the waste of spare space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625579B_ABST
    Figure CN114625579B_ABST
Patent Text Reader

Abstract

The application provides a disk management method, device and equipment and a storage medium, and is applied to the field of data storage. In the method, a storage device maintains a partition state for each disk partition in a target disk, wherein the abnormal access number of the corresponding disk partition is recorded in each partition state, and when the abnormal access number of a target partition exceeds a number threshold, the target partition is marked as an isolation state in the partition state of the target partition; thus, more refined management of the target disk is realized, and the entire disk is prevented from being isolated due to damage of part of the disk partitions.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data storage, in particular to a disk management method and device, equipment and storage medium. BACKGROUND

[0002] In the use of the disk, the motor bearing wear, disk magnetic medium performance decline or environmental reasons, will cause the read-write I / O execution time increases, will be this read-write I / O execution time increases the disk is called slow disk. The existence of slow disk will make the read-write business of storage system slow down, performance decline and even lead to business interruption, therefore, the real-time monitoring, isolation, data backup and other measures of slow disk have important significance for the reliability of storage system.

[0003] In the related art, the entire disk is taken as an analysis object, when the access time of the disk exceeds the pre-set time, the disk is determined as a slow disk, and the slow disk is isolated. However, research has found that taking the entire disk as an analysis object and isolating the entire disk determined as a slow disk has a great impact on the business, performance and capacity of the system. SUMMARY

[0004] In order to overcome at least one deficiency in the prior art, the present application provides a disk management method, device, equipment and storage medium for more fine management of the disk, comprising:

[0005] In a first aspect, the present application provides a disk management method applied to a storage device, wherein the storage device maintains a partition state for each of a plurality of disk partitions in a target disk, and the method comprises:

[0006] receiving an access request of a target partition, wherein the target partition belongs to one of the plurality of disk partitions;

[0007] statistically recording a response time of responding to the access request;

[0008] if the response time exceeds a time threshold, accumulating an abnormal access number of the target partition in the partition state of the target partition;

[0009] obtaining the abnormal access number of the target partition from the partition state of the target partition;

[0010] if the abnormal access number exceeds a number threshold, marking the target partition as an isolated state in the partition state of the target partition.

[0011] In a second aspect, the present application provides a disk management device applied to a storage device, wherein the storage device maintains a partition state for each of a plurality of disk partitions in a target disk, and the disk management device comprises:

[0012] a partition detection module configured to receive an access request of a target partition, wherein the target partition belongs to one of the plurality of disk partitions;

[0013] The partition detection module is further configured to count a response time length of the access request;

[0014] The partition detection module is further configured to, if the response time length exceeds a time length threshold, accumulate an abnormal access number of the target partition in a partition state of the target partition;

[0015] a partition isolation module configured to obtain the abnormal access number of the target partition from the partition state of the target partition;

[0016] The partition isolation module is further configured to, if the abnormal access number exceeds a number threshold, mark the target partition as an isolation state in the partition state of the target partition.

[0017] In a third aspect, the present application provides a storage device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the disk management method.

[0018] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the disk management method.

[0019] Compared with the prior art, the present application has the following beneficial effects:

[0020] The embodiment provides a disk management method, device, equipment and storage medium applied to the field of data storage, wherein the storage device maintains a partition state for each of a plurality of disk partitions in a target disk, each partition state records an abnormal access number of the corresponding disk partition, and when the abnormal access number of one of the target partitions exceeds a number threshold, the target partition is marked as an isolation state in the partition state of the target partition; thus, more refined management of the target disk is achieved, and the entire disk is prevented from being isolated due to damage of part of the disk partitions. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0022] Figure 1 A hardware structure diagram of a storage device provided by an embodiment of the present application is shown in FIG. 1.

[0023] Figure 2 A flow chart of a disk management method provided by an embodiment of the present application is shown in FIG. 2.

[0024] Figure 3 A physical structure diagram of a target disk provided by an embodiment of the present application is shown in FIG. 3.

[0025] Figure 4 A principle diagram of a file storage process provided by an embodiment of the present application is shown in FIG. 4.

[0026] Figure 5 An organization structure of a target disk provided by an embodiment of the present application is shown in FIG. 5.

[0027] Figure 6 A partition state structure diagram provided by an embodiment of the present application is shown in FIG. 6.

[0028] Figure 7 A principle diagram of data migration provided by an embodiment of the present application is shown in FIG. 7.

[0029] Figure 8 A principle diagram of data migration provided by an embodiment of the present application is shown in FIG. 8.

[0030] Figure 9 A structure diagram of a disk management device provided by an embodiment of the present application is shown in FIG. 9.

[0031] Icon: 120 - memory; 130 - processor; 140 - communication unit; 201 - partition detection module; 202 - partition isolation module. DETAILED DESCRIPTION

[0032] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0033] Therefore, the detailed description of the embodiments of the present application provided below in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art without creative labor based on the embodiments in the present application are within the scope of protection of the present application.

[0034] It should be noted that like reference numerals and characters refer to like items throughout the attached drawings and alternative embodiments thereof, noting that when a part or element is referred to as being "on" another part or element, it can be directly on the other part or element or intervening parts or elements can also be present. In contrast, when an element is referred to as being "directly on" another element, there are no intervening elements present. It will be understood that various teachings herein can be used in a variety of applications other than the application described herein.

[0035] Since slow disks will slow down the read and write business of the storage system, performance will decrease and even cause business interruption, therefore, real-time monitoring, isolation, data backup and other measures of slow disks are of great significance to the reliability of the storage system. However, taking the entire disk as the analysis object and isolating the entire disk determined as the slow disk will cause great impact on the business, performance and capacity of the system.

[0036] For example, if part of the disk partitions in the disk are damaged, and a read and write process of the disk needs to access the damaged disk partition, resulting in that the access time exceeds the pre-set time. At this time, if the disk is taken as the analysis object, the entire disk will be determined as the full disk and isolated. However, a disk partition corresponds to a continuous space of the disk, although part of the area in the disk is damaged (for example, bad track), it may cause the abnormality of one or more disk partitions, but generally will not cause the entire disk to be unavailable.

[0037] In addition, in the storage system, the redundant space or hot standby disk is limited. If the same batch of disks have problems, or a large number of disks in the cluster are close to the service life, a large number of slow disks will be detected in a short time, therefore, if the entire disk is isolated only because part of the disk partitions are damaged, the standby space or disk will be easily exhausted, and after the standby disk is exhausted, the system IO response time will be seriously slowed down, the business request will be blocked, and even data will be lost.

[0038] In view of this, the embodiment provides a disk management method applied to a storage device. In the method, the storage device maintains a partition state for each disk partition in a target disk. Each partition state records the number of abnormal accesses of the corresponding disk partition, and when the number of abnormal accesses of the corresponding disk partition exceeds a threshold, the target disk partition is marked as an isolation state in the partition state of the target disk partition; thereby realizing more refined management of the target disk and avoiding isolation of the entire disk due to damage of part of the disk partitions.

[0039] The storage device can be, but is not limited to, a mobile terminal, a personal computer, a server, etc. with storage function. In some embodiments, the server can be a storage server or a management server for communication connection with multiple disk cabinets. In addition, the server can be a single server or a server group. The server group can be centralized or distributed (for example, the server can be a distributed system). In some embodiments, the server can be local or remote relative to the user terminal. In some embodiments, the server can be implemented on a cloud platform; for example, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof. It should be noted that the number of disks managed by the storage device can be one or more, and the target disk in the embodiment represents any one of the one or more disks.

[0040] To make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the following will first combine the technical solutions with the working principles of the embodiments of the present application to clearly and completely explain the technical solutions of the embodiments of the present application. Figure 1 The hardware structure of the storage device will be described in detail. As shown in the figure, the storage device includes a memory 120, a processor 130, and a communication unit 140. The memory 120, the processor 130, and the communication unit 140 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. Figure 1 The memory 120 can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.

[0041]

[0042] ​The communication unit 140 is configured to transceive data over a network. The network can include a wired network, a wireless network, a fiber optic network, a telecommunications network, an intranet, the Internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a Bluetooth network, a ZigBee network, or a Near Field Communication (NFC) network, etc., or any combination thereof. In some embodiments, the network can include one or more network access points. For example, the network can include wired or wireless network access points, such as base stations and / or network switching nodes, through which one or more components of the service request processing system can connect to the network to exchange data and / or information.

[0043] The processor 130 can be an integrated circuit chip with processing capability and can include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor can include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC), or a microprocessor, etc., or any combination thereof.

[0044] Based on the above relevant reception, the following is combined Figure 2The steps of the disk management method provided in the embodiment are described in detail. As shown in Figure 2 The method comprises the following steps.

[0045] S101, receiving an access request of a target partition.

[0046] Before use, the target disk is formatted to divide the storage space of the target disk into a plurality of disk partitions of a preset size, and index information and a partition state of each disk partition are maintained. The target partition in the embodiment belongs to one of the plurality of disk partitions, that is, the storage device manages each disk partition in the same way; the partition state of the target partition is used to record the number of abnormal accesses of the target partition and whether the partition is isolated.

[0047] For example, for ease of description, the outermost track in the target disk is taken as an example. As shown in Figure 3 It is assumed that the tracks are evenly divided into 8 regions, each region including at least one continuous sector. Therefore, Figure 3 Each region in the above table corresponds to a disk partition in the embodiment. Of course, the above example is only for ease of description, and the number of partitions in an actual disk is not limited thereto, and can be adjusted as needed by those skilled in the art.

[0048] S102, counting the response time of the response access request.

[0049] S103, if the response time exceeds the time threshold, the number of abnormal accesses of the target partition is accumulated in the partition state of the target partition.

[0050] The access request includes read and write operations on the target partition, so when read / write IO operations are needed on the target partition, the delay of the IO operation is counted; when the response time of the IO operation is too long, it means that the track of the target partition may be damaged.

[0051] However, considering that factors affecting the response time are not limited to track damage, but also related to the current CPU, memory, and other IO operations of the storage device, therefore, in the embodiment, when the response time exceeds the time threshold, the situation is determined as an abnormal access, and then the number of abnormal accesses of the target partition is accumulated in the partition state of the target partition.

[0052] S104, obtaining the number of abnormal accesses of the target partition from the partition state of the target partition.

[0053] S105, if the number of abnormal accesses exceeds the threshold, marking the target partition as isolated in the partition state of the target partition.

[0054] That is, when the target partition has abnormal accesses for multiple times, the unexpected situation can be excluded to avoid misjudgment of isolation.

[0055] Therefore, by maintaining a partition state for each disk partition in the target disk, for any target partition, the number of abnormal accesses of the target partition and whether the target partition is isolated are recorded in the partition state of the target partition; and after the number of abnormal accesses reaches the threshold, the target partition is marked as isolated, so that more refined management of the disk is realized, and the entire disk is prevented from being isolated due to abnormality of part of the disk partitions.

[0056] To facilitate related technical personnel to implement the present scheme, the above embodiments are described in detail below with a storage device pre-configured with erasure redundancy conditions as an example. For the storage device pre-configured with erasure redundancy conditions, when a user requests the storage device to create a file, the file is not created directly on the disk through the file system, but needs to be transformed according to the erasure redundancy conditions.

[0057] It needs to be understood that if the file is created with the erasure code "N+M", the file is composed of multiple object files; wherein one object file is composed of N+M same size Blocks, that is, not only storage space needs to be provided for source data, but also storage space needs to be provided for check data generated according to the source file, therefore, the mathematical relationship between the actual size of the file and the size of the created file is:

[0058] File actual size = created file size * (N+M) / N

[0059] For easy calculation, one Block occupies one disk partition. For example, a user creates a 1GB file, named File1, and assumes that the erasure redundancy condition is 8+1, and one Block occupies 64MB of storage space. Therefore, according to the data relationship between the actual size of the file and the size of the created file, the actual size of File1 File1_Size is:

[0060] File1_Size = 1024MB * (8+1) / 8 = 1152MB

[0061] Therefore, the size of one object file Obj_Size is:

[0062] Obj_Size = (8+1) * 64MB = 576MB

[0063] Therefore, the number of object files occupied by creating the file is Obj_Num:

[0064] Obj_Num=(File1_Size / Obj_Size)

[0065] After rounding up, Obj_Num=2.

[0066] The correspondence between the Block and the disk partition can be as shown in Figure 4 However, it should be noted that Figure 4 all the serial numbers in the above table are irrelevant to the actual distribution position and order of the disk and the disk partition, and are only used for distinguishing different serial numbers for the convenience of explanation, and the Block / Disk / disk partition with the same serial number have a corresponding relationship, and the object identified by Disk in the figure is a disk.

[0067] As shown in Figure 4 , File1 includes 2 object files, and each object file includes 8+1 Blocks. Block 5 in the above table is allocated by the storage device to Disk 5 as the target disk and to disk partition 5 as the target disk partition.

[0068] Continuing to refer to Figure 4 , it is assumed that a bad track appears in Disk 7, and the bad track causes a certain impact on the response time of disk partition 7 in Disk 7. When the user writes the file File1, it is detected that the response time of disk partition 7 in Disk 7 is greater than the time threshold, and the number of abnormal accesses of disk partition 7 is increased by 1.

[0069] In the embodiment, it is considered that the factors affecting the response time are not limited to track damage, but also related to the current CPU, memory, and other IO operations of the storage device, and other factors; and these factors often last for a period of time, so when the response time of reading and writing data in disk partition 7 in Disk 7 again is greater than the time threshold, and the interval between the two access times is less than the pre-set interval time, the number of abnormal accesses this time is ignored.

[0070] Thereafter, the user continues to read and write disk partition 7 in Disk 7, and after a period of time, if the cumulative number of abnormal accesses of disk partition 7 in Disk 7 exceeds the number threshold, disk partition 7 in Disk 7 is marked as an isolated state.

[0071] In the embodiment, in order to ensure that the partition state of each disk partition of the target disk is not lost under abnormal conditions such as restart of the storage device, the partition state of each disk partition is persisted. That is, a storage space for storing the partition state is specified for each disk partition in the target disk.

[0072] For example, the target disk can be configured according to... Figure 5 Organize as shown. Figure 5 As shown, the target disk is divided into a 4M reserved area, two 4Kb superblocks, and multiple block groups of (1M+256G+1M).

[0073] Specifically, for each block group, the 1M space at the beginning of the block group is used as the primary index area; the 1M space at the end of the block group is used as the backup index area; and the 256G space is divided into multiple storage partitions of 64M each.

[0074] The 1MB main index area can be further divided into multiple sub-index units, each 16KB in size. Each sub-index unit includes a 4KB log area, a 4KB directory index unit, and an 8KB file index unit. The directory and file index units can then be further divided into directory and file indexes, each 128 bytes in size.

[0075] In other words, each sub-index unit includes 64 file indexes, which correspond to 64 disk partitions. Therefore, the partition status of each disk partition can be recorded in the corresponding file index area.

[0076] like Figure 6 As shown, the directory index unit and file index record index information including directory information and file information, respectively. Taking the file index area of ​​one of the target partitions as an example, this file index area records the basic information of the target partition, the partition status (Flag), and the number of abnormal accesses (ErrCount). Among them, the partition status (Flag) can be specified by enumeration, for example, 0 indicates that the target partition is in a normal state, 1 indicates that the target partition is in a migration state, and 2 indicates that the target partition is in an isolated state.

[0077] In this embodiment, when the target partition is marked as isolated, it means that the data in the target partition needs to be migrated to the backup partition of the backup disk. At this time, the partition status (Flag) can be specified as 1 to indicate that the target partition is currently undergoing data migration. Therefore, the disk management method also includes:

[0078] S106, If the target partition is marked as isolated, then migrate the data in the target partition to the backup disk.

[0079] For example, see [link to example]. Figure 4After the disk partition 7 in the Disk 7 is marked as isolated, the Disk 10 can be used as a backup disk, the disk partition 10 in the Disk 10 is used as a backup partition, and then the data in the disk partition 7 in the Disk 7 is migrated to the disk partition 10 in the Disk 10. After the migration is completed, the data written in the disk partition 7 in the Disk 7 in the past is written into the disk partition 10 in the Disk 10.

[0080] It is also found that if the data migration to the target partition is prohibited, the normal operation of the business will be seriously affected. In view of this, the target partition is kept readable and writable during the data migration. It is also found that if only the data is allowed to be written into the target partition during the data migration, the data migrated to the backup partition will be overwritten, resulting in the difference between the data in the target partition and the data in the same storage location of the backup partition, so that the storage device repeatedly migrates the data between the target partition and the backup partition.

[0081] In view of this, step S106 can migrate the data in the target partition to the backup partition of the backup disk by the following implementation:

[0082] S106-1, determining the backup partition from the backup disk.

[0083] The backup partition is used to migrate the data in the target partition.

[0084] S106-2, if a write operation occurs to the target partition during the data migration, obtaining the current write position of the target partition and the current first offset position of the backup partition.

[0085] S106-3, if the write position is greater than the first offset position, writing the to-be-written data into the target partition, and after the to-be-written data is written, taking the first offset position as the starting migration position of the target partition, and continuing to migrate the data to the backup partition.

[0086] For example, as shown in the target partition and the backup partition, Figure 7 wherein p1 marks the current write position of the target partition, q1 marks the current first offset position of the backup partition, and it is assumed that p1 is greater than q1.

[0087] Since data migration is underway between the target partition and the backup partition, the current first offset position q1 in the backup partition indicates that the data to the right of address q1 in the target partition has not yet been migrated, while the data to the left of address q1 has been migrated. Since p1 is greater than q1, it means that the data to be written will only overwrite the data that has not yet been migrated. Therefore, after the data to be written is written, the first offset position q1 is used as the starting migration position of the target partition, and the data migration to the backup partition continues.

[0088] S106-4, if the write position is less than or equal to the first offset position, this embodiment will synchronously write the data to be written to the target partition and the backup partition. Therefore, step S106 further includes:

[0089] S106-5, if the write position is less than or equal to the first offset position, the data to be written is synchronously written to the target partition and the backup partition, and after the data to be written is written, the second offset position after the data to be written is obtained.

[0090] S106-6, determine the target offset position with the largest offset from the first offset position and the second offset position.

[0091] S106-7, use the target offset position as the starting migration position of the target partition, and continue to migrate data to the backup partition.

[0092] For example, such as Figure 8 The target partition and backup partition are shown. The position marked by p1 is the current write position of the target partition, and the position marked by q1 is the current first offset position of the backup partition. It is assumed that p1 is less than q1.

[0093] Since data migration is in progress between the target partition and the backup partition, the current first offset position q1 of the backup partition indicates that the data to the right of address q1 in the target partition has not yet been migrated, while the data to the left of address q1 has been migrated. Therefore, when p1 is less than q1, it means that the data to be written will overwrite the data that has been migrated. Therefore, in order to avoid migrating the data to be written from the target partition to the backup partition again, the storage device will synchronously write the data to be written to both the target partition and the backup partition, and synchronously overwrite the migrated data.

[0094] It should be understood that, since the data to be written is synchronously written to both the target partition and the backup partition, there are two possible scenarios after the data writing is complete:

[0095] Case 1: The second offset position p2 after the data to be written is greater than the first offset position q1.

[0096] Case 2: The second offset position p2 after the data to be written is less than or equal to the first offset position q1.

[0097] If the second offset position p2 after the data to be written is greater than the first offset position q1, it means that the data to be written not only overwrites the migrated data, but also overwrites the unmigrated data. Therefore, the second offset position p2 is taken as the starting migration position of the target partition, and the data migration to the backup partition continues.

[0098] If the second offset position p2 is less than the first offset position q1, it means that the data to be written only covers part of the migrated data. Therefore, the first offset position q1 is used as the starting migration position of the target partition, and the data migration to the backup partition continues.

[0099] Thus, the above design not only improves data migration efficiency but also avoids impacting normal business operations during the data migration process.

[0100] The study also found that the location of disk partitions marked as isolated in the target disk affects the access efficiency of adjacent partitions. Adjacent partitions refer to disk partitions that are adjacent to disk partitions marked as isolated in the disk space but are not marked as isolated.

[0101] For example, to facilitate the description from the perspective of disk space, we will continue with... Figure 3 Take the disk partition shown as an example. Assume... Figure 3 The disk partitions indicated by DP1 and DP2 are marked as isolated, while the disk partition DP3 located between DP1 and DP2 is not marked as isolated. In this case, if data is written to the disk partition corresponding to DP3, and the storage space of that disk partition is insufficient, the write operation needs to be interrupted during the data writing process, and the process jumps to other disk partitions that are not marked as isolated to continue writing data. Therefore, the existence of the disk partitions corresponding to DP1 and DP2 reduces the read / write efficiency of the disk partition marked by DP3. In view of this, the disk management method provided in this embodiment further includes:

[0102] S107, from all disk partitions marked as isolated, identify the first and second partitions that are adjacent in position.

[0103] S108, obtain the number of partitions to be processed, where the partitions to be processed are located between the first partition and the second partition.

[0104] S109, if the number of partitions to be processed is less than the first quantity threshold, then the partitions to be processed are marked as isolated.

[0105] Wherein, the first quantity threshold value can be adjusted according to the needs of the scheme real-time scene. Assuming that the first quantity threshold value is 3, then Figure 3 The number of disk partitions DP3 between DP1 and DP2 is 1, which is less than the first quantity threshold value 3, therefore, even if the disk partition corresponding to DP3 does not detect abnormal access times, the disk partition corresponding to DP3 is also marked as an isolated state, thereby improving the overall access efficiency of the target disk.

[0106] In this way, through the above implementation, not only the target disk is more finely managed, but also the access efficiency of the target disk is avoided.

[0107] Research has also found that although the disk partitions in the target disk are more finely managed, the entire disk can be isolated when the number of disk partitions marked as an isolated state reaches a certain extent, which means that the target disk no longer has the value of continued use. Therefore, the disk management method provided in this embodiment also includes:

[0108] S110, obtaining the number of partitions corresponding to all disk partitions marked as an isolated state.

[0109] S111, if the number of partitions is greater than a second quantity threshold value, marking the target disk as an isolated state.

[0110] Wherein, the second quantity threshold value is related to the number of disk partitions in the target disk, and this embodiment takes 50% of the number of disk partitions in the target disk as the second quantity threshold value. Of course, the second quantity threshold value can be adjusted according to the implementation scene of the scheme.

[0111] Further research has found that in some cases, although the number of disk partitions marked as an isolated state in the target disk exceeds the second quantity threshold value, these disk partitions marked as an isolated state are distributed more concentratedly in the target disk, so that the head in the target disk does not often jump between disk partitions when reading and writing data, that is, even if the number of disk partitions marked as an isolated state in the target disk exceeds the second quantity threshold value, it does not cause too much impact on the access efficiency of the target disk. In view of this, step S111 can include the following implementation:

[0112] S111-1, if the number of partitions is greater than the second quantity threshold value, obtaining the space distribution information of all disk partitions marked as an isolated state.

[0113] S111-2, if the space distribution information satisfies a preset discrete condition, marking the target disk as an isolated state.

[0114] In this embodiment, in order to quantify the space distribution information corresponding to all disk partitions marked as isolated state, the disk partitions belonging to the same track are sorted in a preset order, so as to assign a unique sequence number to each disk partition of the same track.

[0115] For example, continuing to refer to Figure 3 The outermost track in the middle of the disk is divided into 8 disk partitions, and the 8 partitions can be numbered in a preset order, with sequence numbers 1, 2, 3, 4, 5, 6, 7, and 8.

[0116] Then, for the disk partitions marked as isolated state in the same track, the sequence number difference between any two adjacent disk partitions is calculated, and finally the average of all sequence number differences is obtained. If the average is greater than the set isolation threshold, it means that the space distribution information corresponding to all disk partitions marked as isolated state meets the preset dispersion condition, and therefore the target disk needs to be isolated. Otherwise, isolation is not needed.

[0117] For example, if the two disk partitions marked as isolated state are relatively close in space, and assuming that one of them has a sequence number of 10 and the other has a sequence number of 11, the sequence number difference between them is 1, meaning that the two disk partitions are adjacent to each other in the disk.

[0118] If the two disk partitions marked as isolated state are relatively dispersed in space, and assuming that one of them has a sequence number of 10 and the other has a sequence number of 18, the sequence number difference between them is 8, meaning that the two disk partitions are separated by 7 disk partitions in the disk.

[0119] Therefore, if the average of all sequence number differences is greater than the isolation threshold, it means that all disk partitions marked as isolated state in the target disk are distributed relatively dispersedly, which will seriously affect the read-write efficiency of the target disk and the target disk needs to be isolated. Otherwise, it means that all disk partitions marked as isolated state in the target disk are distributed relatively concentratedly, although the number of partitions is greater than the second number threshold, but it will not have a significant impact on the read-write efficiency of the target disk, and the target disk does not need to be isolated.

[0120] Based on the same inventive concept as the above disk management method, the present embodiment also provides a device related thereto, comprising:

[0121] The present embodiment also provides a disk management device applied to a storage device, which maintains a partition state for each of a plurality of disk partitions in a target disk. It should be understood that the disk management device includes at least one functional module stored in the memory in software form. For example, Figure 9As shown, the disk management apparatus can include, in terms of functions,

[0122] The partition detection module 201 is configured to receive an access request of a target partition, wherein the target partition belongs to one of a plurality of disk partitions.

[0123] The partition detection module 201 is further configured to count a response duration of the access request.

[0124] The partition detection module 201 is further configured to, if the response duration exceeds a duration threshold, accumulate an abnormal access number of the target partition in a partition state of the target partition.

[0125] In this embodiment, the partition detection module 201 is configured to implement steps S101-S103 in Figure 2 The detailed description of the partition detection module 201 can be found in the detailed description of steps S101-S103.

[0126] The partition isolation module 202 is configured to obtain the abnormal access number of the target partition from the partition state of the target partition.

[0127] The partition isolation module 202 is further configured to, if the abnormal access number exceeds a number threshold, mark the target partition as an isolated state in the partition state of the target partition.

[0128] In this embodiment, the partition isolation module 202 is configured to implement steps S104-S105 in Figure 2 The detailed description of the partition isolation module 202 can be found in the detailed description of steps S104-S105.

[0129] The embodiment further provides a storage device, which includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the disk management method is implemented.

[0130] The embodiment further provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the disk management method is implemented. The storage medium includes a U disk, a mobile disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium capable of storing program codes.

[0131] It should be noted that the terms "first", "second", "third", and the like, are used merely to distinguish descriptions and do not indicate or imply a relative importance. In addition, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0132] It should also be understood that the disclosed apparatus and methods of the embodiments can also be implemented in other ways. The apparatus embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the drawings show the possible implementation architecture, function and operation of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, program segment or a part of code containing one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than those noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0133] In addition, the functional modules in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0134] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0135] The above merely provides the various embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or replacements within the technical scope disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A disk management method characterized by comprising: The method is applied to a storage device, the storage device maintains a partition state for each of a plurality of disk partitions in a target disk, and the method comprises: receiving an access request for a target partition, wherein the target partition belongs to one of the plurality of disk partitions; counting a response time for responding to the access request; if the response time exceeds a time threshold, accumulating an abnormal access number of the target partition in the partition state of the target partition; obtaining the abnormal access number of the target partition from the partition state of the target partition; if the abnormal access number exceeds a number threshold, marking the target partition as an isolated state in the partition state of the target partition; if the target partition is marked as an isolated state, migrating data in the target partition to a backup disk, comprising: determining a backup partition from the backup disk, wherein the backup partition is used to migrate data in the target partition; if a write operation occurs in the target partition during data migration, obtaining a current write position of the target partition and a first offset position of the backup partition; if the write position is greater than the first offset position, writing to-be-written data to the target partition, and after the to-be-written data is written, taking the first offset position as a starting migration position of the target partition and continuing to migrate data to the backup partition.

2. The disk management method of claim 1, wherein, The method further comprises: if the write position is less than or equal to the first offset position, synchronously writing the to-be-written data to the target partition and the backup partition, and after the to-be-written data is written, obtaining a second offset position of the to-be-written data in the target partition; determining a target offset position with a maximum offset from the first offset position and the second offset position; taking the target offset position as the starting migration position of the target partition and continuing to migrate data to the backup partition.

3. The disk management method of claim 1, wherein, The method further comprises: determining a first partition and a second partition that are adjacent in position from all disk partitions that are marked as an isolated state; obtaining a number of to-be-processed partitions, wherein the to-be-processed partitions are located between the first partition and the second partition; if the number of to-be-processed partitions is less than a first number threshold, marking the to-be-processed partitions as an isolated state.

4. The disk management method of claim 1, wherein, The method further comprises: obtaining a number of disk partitions corresponding to all disk partitions that are marked as an isolated state; if the number of partitions is greater than a second number threshold, marking the target disk as an isolated state.

5. The disk management method of claim 4, wherein, If the number of partitions is greater than a second number threshold, marking the target disk as an isolated state, comprising: if the number of partitions is greater than a second number threshold, obtaining space distribution information corresponding to all disk partitions that are marked as an isolated state; if the space distribution information satisfies a preset discrete condition, marking the target disk as an isolated state.

6. A disk management apparatus characterized by comprising: The disk management device is applied to a storage device, the storage device maintains a partition state for each of a plurality of disk partitions in a target disk, and the disk management device comprises: The partition detection module is configured to receive an access request of a target partition, wherein the target partition belongs to one of the plurality of disk partitions; The partition detection module is further configured to count a response time length of the access request; The partition detection module is further configured to, if the response time length exceeds a time length threshold, accumulate an abnormal access number of the target partition in a partition state of the target partition; The partition isolation module is configured to obtain the abnormal access number of the target partition from the partition state of the target partition; The partition isolation module is further configured to, if the abnormal access number exceeds a number threshold, mark the target partition as an isolated state in the partition state of the target partition; The disk management apparatus is further configured to, if the target partition is marked as the isolated state, migrate data in the target partition to a backup disk, including: determining a backup partition from the backup disk, wherein the backup partition is used to migrate the data in the target partition; if a write operation occurs during the data migration of the target partition, obtaining a current write position of the target partition and a first offset position of the backup partition; if the write position is greater than the first offset position, writing to-be-written data to the target partition, and after the to-be-written data is written, taking the first offset position as a starting migration position of the target partition, and continuing to migrate data to the backup partition.

7. A storage device, comprising: The storage device includes a processor and a memory, and the memory stores a computer program, and the computer program is executed by the processor to implement the disk management method in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the disk management method in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for processing bad sectors of disk and computer storage medium

    CN108536548A

  • Data processing method, system and equipment for slow disk and medium

    CN113849123A