Disk data processing method and device, equipment and storage medium

By dividing the disk into multiple logical partitions in a distributed storage system and grouping the disks, and using the backup logical partitions for data repair, the problem of excessive read and write pressure on the disk where the backup data is located during data recovery is solved, and the business processing efficiency of the storage system is improved.

CN119883099AActive Publication Date: 2025-04-25CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311396745.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2025-04-25
Estimated Expiration
2043-10-25

AI Technical Summary

Technical Problem

In a distributed storage system, the read and write pressure on the disk where the backup data is located during data recovery is too high, which affects the normal business processing of the storage system.

Method used

By dividing each disk into multiple logical partitions and grouping disks according to multiple logical partitions of multiple disks, the backup partitions of each logical partition of each disk are distributed as much as possible on other disks, when there are disks that need to be repaired in the disk grouping, the backup logical partition is used for data repair.

Benefits of technology

It improves the concurrent processing efficiency during disk repair, reduces the read and write pressure of the disk where each backup partition is located, and ensures the normal service processing response speed of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883099A_ABST
    Figure CN119883099A_ABST
Patent Text Reader

Abstract

The invention provides a disk data processing method and device, equipment and a storage medium. The electronic equipment comprises M disks, each disk comprises at least two logic partitions, the M disks comprise N disk groups, each disk group comprises logic partitions from at least two disks, at least one backup partition exists in the disk group, and the backup partitions are distributed in the N disk groups. The backup partition is used for backing up data of other logic partitions in the disk group. The method comprises the following steps: determining whether to carry out data recovery on a first logic partition of a first disk in the M disks; if yes, obtaining a first disk group where the first logic partition is located; determining a first backup logic partition of the first logic partition from the first disk group; and repairing the data of the first logic partition through the backup data stored in the first backup logic partition. According to the method, the concurrent processing efficiency during disk repair is improved, and the read-write pressure of the disk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Distributed storage achieves high data reliability and fault tolerance by redundantly storing data on multiple disks. When one or more disks fail, the backup data of other healthy disks must be used for recovery so that the distributed storage system can still provide business services normally without downtime. However, when using other disks to recover data from a failed disk, the read and write pressure of the other disks will increase due to the need to read and write all the data on the other disks, affecting the normal business processing of the other disks and, in turn, the normal business processing of the storage system.

[0003] Therefore, how to reduce the read and write pressure of the disk where the backup data is located during data recovery and ensure the normal business processing of the storage system is an urgent problem to be solved. Summary of the invention

[0004] The present application provides a disk data processing method, device, equipment and storage medium to solve the technical problem of how to reduce the read and write pressure of the disk where the backup data is located during data recovery and ensure the normal business processing of the storage system.

[0005] In a first aspect, the present application provides a disk data processing method, wherein an electronic device includes M disks, each of the disks includes at least two logical partitions, the M disks include N disk groups, each of the disk groups includes logical partitions from at least two disks, wherein at least one backup partition exists in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group; the method includes:

[0006] Determine whether to perform data repair on a first logical partition of a first disk among the M disks;

[0007] If yes, obtaining the first disk group where the first logical partition is located;

[0008] Determine a first backup logical partition of the first logical partition from the first disk group;

[0009] The data of the first logical partition is repaired by using the backup data stored in the first backup logical partition.

[0010] Optionally, the repairing the data of the first logical partition by using the backup data stored in the first backup logical partition includes:

[0011] Acquiring original data of the first logical partition according to the backup data stored in the first backup logical partition;

[0012] When the first disk is damaged and the electronic device has a backup disk, the logical partition of the backup disk is added to the first disk group, and the original data is written into the logical partition of the backup disk.

[0013] Optionally, before determining whether to perform data repair on a target logical partition of a target disk among the M disks, the method further includes:

[0014] When there is a need to construct a new disk group, at least one second logical partition is determined from the M disks according to the disk groups to which each disk has been added;

[0015] A new disk group is constructed using the at least one second logical partition.

[0016] Optionally, each of the disks is recorded with a disk grouping array, each element in the disk grouping array corresponds to a disk other than the disk, and when the element is a first value, it is used to indicate that the logical partitions of other disks in the disk that have a logical partition corresponding to the element are added to the same disk group; when the element is a second value, it is used to indicate that the logical partitions of other disks in the disk that have no logical partition corresponding to the element are added to the same disk group;

[0017] The step of determining at least one second logical partition from the M disks according to the disk grouping to which each disk has been added comprises:

[0018] The M disks are sorted according to the disk group array of each disk and a sorting rule; the sorting rule includes: a first sub-sorting rule that disks with fewer added disk groups are sorted higher, and a second sub-sorting rule that disks with the same number of added disk groups are sorted according to the order of identification;

[0019] Removing disks without free logical partitions from the sorted M disks to obtain the candidate disk list;

[0020] Determine a second logical partition from the candidate disk list, and remove the disk to which the determined second logical partition belongs from the candidate disk list;

[0021] Another second logical partition is determined according to the updated candidate disk list until the number of the determined second logical partitions meets the number required for constructing a new disk group.

[0022] Optionally, after constructing a new disk group using the at least one second logical partition, the method further includes:

[0023] According to the constructed new disk group, the disk group array of the disk is updated.

[0024] Optionally, the method further includes:

[0025] If a new disk is added to the electronic device, traverse the existing disk groups to see whether there is a target disk group with insufficient number of logical partitions;

[0026] If it exists, then add the logical partition of the new disk to the target disk group, and update the disk group array of the new disk and the disk group arrays of the M disks;

[0027] If it does not exist, all elements in the disk grouping array of the new disk are set to the second value, and the disk grouping arrays of the M disks are updated.

[0028] Optionally, determining a second logical partition from the candidate disk list includes:

[0029] A second logical partition is determined from the free logical partitions of the first candidate disk in the candidate disk list.

[0030] In a second aspect, the present application provides a disk data processing device, wherein an electronic device includes M disks, each of the disks includes at least two logical partitions, the M disks include N disk groups, each of the disk groups includes logical partitions from at least two disks, wherein at least one backup partition exists in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group; the device includes:

[0031] A determination module, used to determine whether to perform data repair on a first logical partition of a first disk among the M disks;

[0032] an acquisition module, configured to acquire the first disk group where the first logical partition is located;

[0033] A processing module, configured to determine a first backup logical partition of the first logical partition from the first disk group;

[0034] The control module is used to repair the data of the first logical partition by using the backup data stored in the first backup logical partition.

[0035] In a third aspect, a processor and a memory; the processor is communicatively connected with the memory;

[0036] The memory stores computer-executable instructions;

[0037] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the disk data processing method as described in any one of the first aspects.

[0039] In a fifth aspect, the present application provides a computer program product, which, when executed by a processor, is used to implement the disk data processing method as described in any one of the first aspects.

[0040] The disk data processing method, apparatus, device and storage medium provided by the present application divide each disk in the electronic device into multiple logical partitions, and group the disks according to the multiple logical partitions of the multiple disks, and distribute the backup partitions of each logical partition of each disk on as many other disks as possible. When there is a first disk in the disk grouping that needs to repair data, the first disk grouping corresponding to the first logical partition that needs to repair data is determined, and the first backup logical partition is selected from the first disk group to repair the data of the first logical partition, thereby improving the concurrent processing efficiency when performing disk repair, reducing the read and write pressure of the disk where each backup partition is located, and ensuring the normal business processing response speed of the disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] Figure 1 A schematic diagram of a scenario of repairing data on a failed disk provided in this application;

[0043] Figure 2 A schematic diagram of a disk data processing scenario provided in an embodiment of the present application;

[0044] Figure 3 A flowchart of a disk data processing method provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a flow chart of another disk data processing method provided in an embodiment of the present application;

[0046] Figure 5 A flowchart of another disk data processing method provided in an embodiment of the present application;

[0047] Figure 6 A flowchart of another disk data processing method provided in an embodiment of the present application;

[0048] Figure 7 A flowchart of another disk data processing method provided in an embodiment of the present application;

[0049] Figure 8 A schematic diagram of the structure of a disk data processing device provided in an embodiment of the present application;

[0050] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0053] 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, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0054] To facilitate understanding, the application scenarios involved in this application are first described.

[0055] Figure 1 A schematic diagram of a scenario for repairing data from a failed disk provided by this application. Figure 1 As shown, the scenario includes: Disk 1, Disk 2, Disk 3, Disk 4, Disk 5.

[0056] Among them, disks 1 to 5 are disks in the same distributed storage system, and disks 1, 2, and 3 are disks in the same disk group. Assume that disk 1 is a failed disk, and disks 2 and 3 have backup data of the data on disk 1. The backup data may be, for example, copy backup data, or backup data that uses erasure coding to achieve data redundancy. When the backup data uses erasure coding to achieve data redundancy, the erasure coding divides the original data into multiple coded segments and stores them in a distributed manner in disks 1, 2, and 3. When disk 1 needs to recover data, the lost data segments can be reconstructed from disks 2 and 3 according to the erasure coding algorithm without directly copying the data.

[0057] When disk 1 fails, the distributed storage system needs to read the entire disk data of disk 2 and disk 3, determine the backup data in disk 2 and disk 3 used to repair the data in disk 1, and obtain the original data in disk 1 based on the backup data, and repair the backup data to disk 1 to repair the function of the distributed storage system.

[0058] However, currently, when a disk failure occurs in a distributed storage system, only the full disk data of other disks in the disk group where the failed disk is located can be read to obtain backup data to restore the original data in the failed disk. The concurrent processing level is low, resulting in low efficiency of disk recovery. In addition, for each disk with backup data, its full disk data needs to be read and written during failure recovery, resulting in a large read and write pressure on the disk with backup data, affecting the normal business processing response speed of the disk, and further affecting the normal business processing response speed of the storage system.

[0059] In view of this, the present application provides a disk data processing method, which divides each disk in an electronic device into multiple logical partitions, and groups the disks according to the multiple logical partitions of the multiple disks, and distributes the backup partitions of each logical partition of each disk on as many other disks as possible, so as to increase the number of disks where the backup partitions of each logical partition are located, thereby improving the concurrent processing efficiency when performing disk repair, and reducing the read and write pressure of the disk where each backup partition is located, thereby ensuring the normal business processing response speed of the disk.

[0060] Figure 2 A schematic diagram of a disk data processing scenario provided in an embodiment of the present application. The scenario includes: M disks in an electronic device.

[0061] The electronic device may be, for example, a computer, a laptop, a server, or other devices. The M disks are disks that create disk groups, and the present application does not limit whether the electronic device includes disks other than the M disks. Each of the M disks includes at least two logical partitions, and the M disks include N disk groups, each of which includes logical partitions from at least two disks. There is at least one backup partition in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group.

[0062] For example, Figure 2 As shown, M is 6 for introduction. The M disks include disk A, disk B, disk C, disk D, disk E, and disk F. Each disk is divided into 4 logical partitions. Taking disk A as an example, the four logical partitions are A0, A1, A2, and A3 respectively.

[0063] In this example, take one disk group among N disk groups as an example, the disk group includes logical partitions A0, B1, C0, D0, E2, and F1. The disk group can adopt the copy backup method, with any disk as the master disk and other disks as slave disks. The corresponding logical partitions of the slave disks store backup data. When the master disk fails, the backup data in the corresponding logical partitions of the slave disks can be read to repair the corresponding logical partitions of the master disk. If the disk group adopts the erasure code backup method, when any disk in the disk group fails, the backup data of the corresponding logical partitions of other disks can be read to obtain the original data of the logical partition of the failed disk data and the disk group to repair the disk group.

[0064] It should be understood that different logical partitions of each disk may be divided into different disk groups, and the division of the logical partitions may also be determined according to actual needs.

[0065] Below Figure 2 Taking the scenario as an example, the electronic device where the M disks are located is used as the execution subject, and the technical solution of the present application and how the technical solution of the present application solves the above technical problems are described in detail through specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0066] Figure 3 A flowchart of a disk data processing method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the method includes:

[0067] S301: Determine whether to perform data repair on a first logical partition of a first disk among M disks.

[0068] The first disk may be any disk among the M disks. The electronic device may determine whether it is necessary to perform data repair on the first logical partition of the first disk by detecting a fault on the first disk. For example, if a fault on the first disk is detected, or a fault on the first logical partition of the first disk is detected, data repair on the first logical partition of the first disk is required. Alternatively, the electronic device may determine whether it is necessary to perform data repair on the first logical partition of the first disk by determining the read and write operations on the first disk or the first logical partition. When the read and write operations are abnormal, such as the read and write operations cannot be performed, or the speed of the read and write operations is lower than a preset speed threshold, or the read data is damaged or abnormal, data repair on the first logical partition of the first disk is required.

[0069] S302: If yes, obtain the first disk group where the first logical partition is located.

[0070] If data repair is required for the first logical partition of the first disk among the M disks, the first disk group where the first logical partition is located can be obtained based on the disk group record. The disk group record can be recorded in a database, or in a disk log. If recorded in a disk log, the disk log can be recorded in other storage locations outside the M disks, such as other disks, or other devices connected to the electronic device.

[0071] The electronic device can also determine the first disk group where the first logical partition is located based on the operation record of the disk grouping. For example, when performing disk grouping, the relevant content of each disk grouping operation is recorded, and the relevant content includes the disk and logical partition of the disk grouping operation, as well as the result of the disk grouping operation.

[0072] S303: Determine a first backup logical partition of the first logical partition from the first disk group.

[0073] Among them, the first backup logical partition can be part or all of the logical partitions in the first disk group. For example, if it is a copy backup method, the first backup logical partition can be any logical partition in the first disk group that has the copy backup data of the first logical partition. The logical partition can be any logical partition in the first disk group; if it is an erasure code backup method, the logical partition can be any one, any multiple, or all logical partitions in the first disk group, etc.

[0074] The determination logic of the first backup logical partition can be determined according to actual needs, and this application does not impose any restrictions on this.

[0075] S304: Repair data of the first logical partition using the backup data stored in the first backup logical partition.

[0076] The method of repairing the data of the first logical partition can be to copy the backup data as the data of the first logical partition, or to calculate the data of the first logical partition based on the backup data stored in the first backup logical partition and the association between the backup data and the data of the first logical partition.

[0077] In a possible implementation, the data of the first logical partition is repaired to the first logical partition of the first disk by using the backup data stored in the first backup logical partition. This implementation can be used when the first disk only has data errors or data loss, but the hardware of the first disk is not faulty, so the repaired data can be used to overwrite the data in the first logical partition to achieve the effect of repairing the data.

[0078] Another possible implementation is to repair the data of the first logical partition to a backup disk using the backup data stored in the first backup logical partition, so that the backup disk replaces the first disk. This implementation can be used when the hardware of the first disk fails and the first disk can no longer provide data storage function. Therefore, the repaired data can be written to the backup disk to achieve the effect of repairing the data. The logical partition of the backup disk is the same as the logical partition of the first disk, and the corresponding logical partition of the backup disk has been added to the first disk group.

[0079] The method provided in the embodiment of the present application divides each disk in the electronic device into multiple logical partitions, and groups the disks according to the multiple logical partitions of the multiple disks, and distributes the backup partitions of each logical partition of each disk on as many other disks as possible. When there is a first disk in the disk grouping that needs to repair data, the first disk grouping corresponding to the first logical partition that needs to repair data is determined, and the first backup logical partition is selected from the first disk group to repair the data of the first logical partition, thereby improving the concurrent processing efficiency when performing disk repair, reducing the read and write pressure of the disk where each backup partition is located, and ensuring the normal business processing response speed of the disk.

[0080] Next, how to repair the data of the first logical partition by using the backup data stored in the first backup logical partition in the aforementioned step S304 is described by repairing the data of the first logical partition to the backup disk by using the backup data stored in the first backup logical partition. Figure 4 A flowchart of another disk data processing method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the aforementioned step S304 may include:

[0081] S401. Acquire original data of a first logical partition according to backup data stored in the first backup logical partition.

[0082] The original data may be obtained through a data connection between the backup data stored in the first backup logical partition and the original data, for example, the original data may be obtained through the backup data stored in at least one first backup logical partition and a function of obtaining the original data by calculating the backup data. Alternatively, the original data may be obtained through an erasure code algorithm and the backup data.

[0083] Exemplarily, taking the example of obtaining original data through an erasure code algorithm and backup data, the erasure code algorithm may be, for example, a Reed-Solomon (RS) algorithm, a Cauchy Reed-Solomon (Cauchy RS) algorithm, an exclusive OR (XOR) algorithm, etc. The backup data is a redundant block or a remaining data block of the original data, and the backup data is operated and decoded through the above-mentioned erasure code algorithm to obtain the original data. Among them, the specific type of erasure code algorithm used can be determined according to actual needs, and this application does not limit this.

[0084] S402: When the first disk is damaged and the electronic device has a backup disk, the logical partition of the backup disk is added to the first disk group, and the original data is written into the logical partition of the backup disk.

[0085] If the first disk is hardware damaged, the restored original data cannot be restored to the first disk, and the first disk needs to be replaced by a disk other than the M disks, that is, the disk other than the M disks is called a backup disk. The backup disk may be originally set in the electronic device, or it may be set in the electronic device after the electronic device outputs a prompt that a new backup disk is needed after detecting that the first disk is damaged.

[0086] Before using the backup disk to restore the original data, the backup disk needs to be logically partitioned. For example, the backup disk can be divided according to the logical partitions of the first disk to reduce the impact on the storage function of the electronic device after the backup disk is replaced. The first logical partition of the first disk is deleted from the first disk group, and the free logical partition of the backup disk is added to the first disk group to replace the first logical partition.

[0087] Next, how to group the logical partitions in the M disks before determining whether to perform data repair on the target logical partition of the target disk in the M disks is described in detail.

[0088] Figure 5 A flowchart of another disk data processing method provided in an embodiment of the present application is shown as follows: Figure 5As shown, before determining whether to perform data repair on the target logical partition of the target disk among the M disks, the method may further include:

[0089] S501. When there is a need to construct a new disk group, at least one second logical partition is determined from M disks according to the disk groups to which each disk has been added.

[0090] The disk groupings to which each disk has been added may include the number of disk groups to which the disk has been added, the number of disk groups existing between the disk and any other disk, the number of other disks that have disk grouping relationships with the disk, etc.

[0091] In a possible implementation, an idle logical partition in a disk with a smaller number of disk groups that have been added is used as the second logical partition.

[0092] Another possible implementation manner is to use an idle logical partition in a disk that has a smaller number of disk groups with any other disk as the second logical partition.

[0093] In another possible implementation, the number of other disks that have a disk grouping relationship with each disk is determined, and the idle logical partitions in the disks with a smaller number are used as the second logical partition.

[0094] Optionally, the above three implementation methods may be combined, and a part of the second logical partitions may be determined according to any one method, and then the remaining second logical partitions may be determined according to other methods, etc.

[0095] S502: Use at least one second logical partition to construct a new disk group.

[0096] The number of second logical partitions included in the new disk group can be determined according to actual needs, and this application does not limit this. After the multiple second logical partitions are constructed into a new disk group, the logical partitions included in the disk group can be used for data backup, data recovery, etc.

[0097] exist Figure 5 In the implementation method shown, in order to improve the concurrency of data when restoring backup data, thereby improving the recovery efficiency and reducing the read and write pressure of each disk when restoring backup data, the data can be backed up to as many disks as possible through the method in step S501 to achieve the above effect.

[0098] In order to achieve the above effect, a detailed description is given below by taking each disk as an example in which a disk group array is recorded. Each element in the disk group array corresponds to a disk other than the disk. When the element is a first value, it is used to indicate that the logical partitions of other disks corresponding to the element in the disk are added to the same disk group. When the element is a second value, it is used to indicate that the logical partitions of other disks corresponding to the element in the disk are added to the same disk group. Continue to refer to the above Figure 2 , taking the disk group array including A(1,1,1,1,0), B(1,1,0,0,0), C(1,1,0,0,0), D(1,0,0,1,0), E(1,0,0,1,0), F(0,0,0,0,0) as an example, how the aforementioned step S501 determines at least one second logical partition from the M disks according to the disk groups to which each disk has been added is described. Among them, taking disk A as an example, it has one logical partition in the same disk group as disks B, C, D, and E respectively.

[0099] Figure 6 A flowchart of another disk data processing method provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the aforementioned step S501 may also include:

[0100] S601. Sort M disks according to the disk grouping array of each disk and a sorting rule.

[0101] The sorting rule includes: a first sub-sorting rule that disks with fewer added disk groups are sorted higher, and a second sub-sorting rule that disks with the same number of added disk groups are sorted according to the identification order.

[0102] Under this sorting rule, according to the disk grouping array of each disk, the number of disk groups between each disk and other disks is determined. According to the first sub-sorting rule, these disks are sorted, and the sorting can be determined as F, B, C, D, E, A. Since B, C, D, E only have disk grouping relationships with two other disks, and the number of added disk groups is only two, their sorting levels are the same under the first sub-sorting rule. Then, according to the second sub-sorting rule, according to the preset identification order (for example, it can be A, B, C, D, E, F), the disks with the same sorting level under the first sub-sorting rule (i.e., B, C, D, E) are sorted according to the identification order. That is, it can be determined that the order of the M disks is F, B, C, D, E, A.

[0103] Optionally, the first sorting can be performed by the minimum value in each disk grouping array, that is, sorting can be performed based on whether the disk has a value of 0, and then further sorting can be performed based on the number of minimum values ​​of each disk, and finally sorting can be performed based on the identification order to determine the sorting of the M disks.

[0104] S602: Remove disks without free logical partitions from the sorted M disks to obtain the candidate disk list.

[0105] The candidate disk list can be determined according to the number of disks required for the new disk grouping. For example, if the new disk grouping requires three disks, the first three disks are selected as the candidate disk list according to the sorting of the M disks. However, since the disks added to the new disk grouping need to be free logical partitions that are not added to the disk grouping among the M disks (i.e., each logical partition can only be added to one disk grouping), it is also necessary to remove the disks without free logical partitions from the M disks after sorting to ensure that the second logical partition with free logical partitions can be selected to add to the new disk grouping.

[0106] Optionally, the step of removing disks without free logical partitions from the M disks may also be performed before sorting, and this application does not impose any limitation on this.

[0107] S603: Determine a second logical partition from the candidate disk list, and remove the disk to which the determined second logical partition belongs from the candidate disk list.

[0108] In a possible implementation, a second logical partition is determined from the free logical partitions of the first candidate disk in the candidate disk list. For example, any free logical partition that is not included in any disk group can be selected from the aforementioned disk F as the second logical partition.

[0109] Another possible implementation is to determine a second logical partition from a free logical partition of any candidate disk in the candidate disk list. For example, any free logical partition that is not included in any disk group can be selected from the aforementioned disks B, C, D, and E as the second logical partition.

[0110] S604: Determine another second logical partition according to the updated candidate disk list, until the number of determined second logical partitions meets the number required for constructing a new disk group.

[0111] In a possible implementation, in the updated candidate disk list, the number of disk grouping relationships between each disk and the disk to which the first determined second logical partition belongs is determined, and the free logical partition of the disk in the updated candidate disk list that has the smallest number of disk grouping relationships with the disk to which the second logical partition belongs is used as the next second logical partition. If there are multiple disks in the updated candidate disk list that have the smallest number of disk grouping relationships with the disk to which the second logical partition belongs, further sorting can be performed according to the method in the aforementioned step S601 to finally determine the disk to which the next second logical partition belongs, which will not be repeated here.

[0112] Another possible implementation is to select a free logical partition of any disk in the updated candidate disk list as the next second logical partition, for example, the first disk in the updated candidate disk list, or any other disk.

[0113] The method provided in the embodiment of the present application sorts M disks through the disk grouping array of each disk and the sorting rules, and gradually determines the logical partitions included in the new disk grouping according to the disk list obtained by the sorting, so that the disks with a smaller number of disk groupings can be preferentially allocated to the new disk grouping, and by selecting the number of disk grouping relationships between the disks of the second logical partition and other remaining disks each time, the disks with a smaller number of disk groupings with the last selected disk are given priority as the disks for selecting the next second logical partition, thereby reducing the correlation between the disks, improving the balance of creating new disk groups, and thereby improving the security of the storage system.

[0114] In the above Figure 6 In the method shown, since the method mainly relies on the disk grouping array to construct a new disk grouping, after using at least one second logical partition to construct a new disk grouping, the method may also include updating the disk grouping array of each disk according to the constructed new disk grouping. The disk grouping array may be recorded in the operation log of the electronic device, or in a database for storing the disk grouping array. The disk grouping array of each disk is updated for use in constructing a new disk grouping next time.

[0115] Optionally, in a possible implementation, if a new disk is added to the electronic device, the new disk can also be used to optimize the existing logical partitions in the electronic device. Figure 7 A flowchart of another disk data processing method provided in an embodiment of the present application is shown as follows: Figure 7 As shown, the method may also include:

[0116] S701, traverse the existing disk groups to see if there is a target disk group with insufficient logical partitions. If so, it indicates that the target disk group needs to add the free logical partition of the new disk, and execute step S702; if not, it indicates that the disk group does not need to add free logical partitions at present, and execute step S703.

[0117] The target disk grouping with insufficient logical partitions may be caused by insufficient free logical partitions of the disk when the target disk grouping was previously constructed, or may be caused by a disk failure, resulting in some logical partitions included in the target disk grouping being unusable.

[0118] If the cause is insufficient free logical partitions of the disk, the target disk grouping can be determined based on the historical failure information of insufficient logical partitions when the target disk grouping is constructed. Alternatively, the target logical partition number and the actual logical partition number of each disk grouping can be recorded, and the target logical partition number and the actual logical partition number of each disk grouping can be read when a new disk is added to determine the target disk grouping.

[0119] If it is caused by a disk failure, the target disk group can be determined based on the disk failure information and all disk groups corresponding to the disk.

[0120] S702: Add the logical partition of the new disk to the target disk group, and update the disk group array of the new disk and the disk group arrays of the M disks.

[0121] Any free logical partition in the new disk is added to the target disk group, and according to the disks included in the target disk group, the disk group array of the new disk and the disk group array of the disks included in the target disk group are updated.

[0122] Since a new disk is added, the disk grouping array of the original M disks needs to have one bit added to indicate the relationship of the disk grouping created with the new disk. Therefore, the disk grouping array of the M disks also needs to be updated.

[0123] S703: Set all elements in the disk grouping array of the new disk to the second value, and update the disk grouping arrays of the M disks.

[0124] For example, if the new disk is disk G, the disk grouping array of the disk is G(0,0,0,0,0,0).

[0125] Figure 8A schematic diagram of a disk data processing device provided in an embodiment of the present application. The electronic device includes M disks, each disk includes at least two logical partitions, the M disks include N disk groups, each disk group includes logical partitions from at least two disks, wherein there is at least one backup partition in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group. Figure 8 As shown, the disk data processing device may include: a determination module 11, an acquisition module 12, a processing module 13, and a control module 14.

[0126] The determination module 11 is used to determine whether to perform data repair on the first logical partition of the first disk among the M disks.

[0127] The acquisition module 12 is configured to acquire the first disk group where the first logical partition is located.

[0128] The processing module 13 is used to determine a first backup logical partition of the first logical partition from the first disk group.

[0129] The control module 14 is configured to repair the data of the first logical partition by using the backup data stored in the first backup logical partition.

[0130] In a possible implementation, the acquisition module 12 is specifically configured to acquire the original data of the first logical partition according to the backup data stored in the first backup logical partition. The control module 14 is specifically configured to add the logical partition of the backup disk to the first disk group when the first disk is damaged and the electronic device has a backup disk, and write the original data into the logical partition of the backup disk.

[0131] In any of the above implementations, the processing module 13 is further configured to determine at least one second logical partition from the M disks according to the disk groups to which each disk has been added when there is a need to construct a new disk group before the determining module 11 determines whether to perform data repair on the target logical partition of the target disk among the M disks. The control module 14 is further configured to construct a new disk group using the at least one second logical partition.

[0132] In this implementation, optionally, if each disk records a disk grouping array, each element in the disk grouping array corresponds to a disk other than the disk, when the element is a first value, it is used to characterize that the logical partitions of other disks corresponding to the element in the disk are added to the same disk group, and when the element is a second value, it is used to characterize that the logical partitions of other disks corresponding to the element in the disk are added to the same disk group. The processing module 13 is specifically used to sort the M disks according to the disk grouping array of each disk and the sorting rule. Disks without free logical partitions are removed from the sorted M disks to obtain a candidate disk list. A second logical partition is determined from the candidate disk list, and the disk to which the determined second logical partition belongs is removed from the candidate disk list. Another second logical partition is determined according to the updated candidate disk list until the number of determined second logical partitions meets the number required to construct a new disk group. Among them, the sorting rule includes: a first sub-sorting rule that disks with fewer added disk groups are sorted higher, and a second sub-sorting rule that disks with the same number of added disk groups are sorted according to the identification order.

[0133] Optionally, the processing module 13 is specifically configured to determine a second logical partition from the free logical partitions of the first candidate disk in the candidate disk list.

[0134] Optionally, after constructing a new disk group using at least one second logical partition, the control module 14 is further configured to update the disk group array of the disk according to the constructed new disk group.

[0135] Optionally, if a new disk is added to the electronic device, the processing module 13 is further used to traverse whether there is a target disk group with insufficient number of logical partitions in the current existing disk group. If so, the control module 14 is further used to add the logical partition of the new disk to the target disk group, and update the disk group array of the new disk, as well as the disk group array of the M disks. If not, the control module 14 is further used to set all elements in the disk group array of the new disk to the second value, and update the disk group array of the M disks.

[0136] The disk data processing device provided in the embodiment of the present application can execute the disk data processing method in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0137] Fig. 9 The structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. The electronic device is used to execute the disk data processing method described above, and may be, for example, the electronic device described in the method embodiment described above. Fig. 9As shown, the electronic device 900 may include: at least one processor 901 and a memory 902 .

[0138] The memory 902 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.

[0139] The memory 902 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0140] The processor 901 is used to execute the computer-executable instructions stored in the memory 902 to implement the method described in the above method embodiment. The processor 901 may be a CPU, or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0141] In a specific implementation, if the memory 902 and the processor 901 are implemented independently, the memory 902 and the processor 901 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0142] Optionally, in a specific implementation, if the memory 902 and the processor 901 are integrated on a chip, the memory 902 and the processor 901 can communicate through an internal interface.

[0143] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores program instructions, and the program instructions are used for the methods in the above embodiments.

[0144] The present application also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of a computing device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the computing device implements the above disk data processing method.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A disk data processing method, characterized in that: The electronic device includes M disks, each of which includes at least two logical partitions, and the M disks include N disk groups, each of which includes logical partitions from at least two disks, wherein at least one backup partition exists in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group; the method includes: Determine whether to perform data repair on a first logical partition of a first disk among the M disks; If yes, obtaining the first disk group where the first logical partition is located; Determine a first backup logical partition of the first logical partition from the first disk group; The data of the first logical partition is repaired by using the backup data stored in the first backup logical partition.

2. The method according to claim 1, characterized in that The repairing of the data of the first logical partition by using the backup data stored in the first backup logical partition includes: Acquiring original data of the first logical partition according to the backup data stored in the first backup logical partition; When the first disk is damaged and the electronic device has a backup disk, the logical partition of the backup disk is added to the first disk group, and the original data is written into the logical partition of the backup disk.

3. The method according to claim 1 or 2, characterized in that: Before determining whether to perform data repair on the target logical partition of the target disk among the M disks, the method further includes: When there is a need to construct a new disk group, at least one second logical partition is determined from the M disks according to the disk groups to which each disk has been added; A new disk group is constructed using the at least one second logical partition.

4. The method according to claim 3, characterized in that Each of the disks is recorded with a disk grouping array, each element in the disk grouping array corresponds to a disk other than the disk, when the element is a first value, it is used to indicate that the logical partitions of other disks corresponding to the element in the disk are added to the same disk group, when the element is a second value, it is used to indicate that the logical partitions of other disks corresponding to the element in the disk are not added to the same disk group; The step of determining at least one second logical partition from the M disks according to the disk grouping to which each disk has been added comprises: The M disks are sorted according to the disk group array of each disk and a sorting rule; the sorting rule includes: a first sub-sorting rule that disks with fewer added disk groups are sorted higher, and a second sub-sorting rule that disks with the same number of added disk groups are sorted according to the identification order; Removing disks without free logical partitions from the sorted M disks to obtain the candidate disk list; Determine a second logical partition from the candidate disk list, and remove the disk to which the determined second logical partition belongs from the candidate disk list; Another second logical partition is determined according to the updated candidate disk list until the number of the determined second logical partitions meets the number required for constructing a new disk group.

5. The method according to claim 4, characterized in that After constructing a new disk group using the at least one second logical partition, the method further includes: According to the constructed new disk group, the disk group array of the disk is updated.

6. The method according to claim 4, characterized in that The method further comprises: If a new disk is added to the electronic device, traverse the existing disk groups to see whether there is a target disk group with insufficient number of logical partitions; If it exists, then add the logical partition of the new disk to the target disk group, and update the disk group array of the new disk and the disk group arrays of the M disks; If it does not exist, all elements in the disk grouping array of the new disk are set to the second value, and the disk grouping arrays of the M disks are updated.

7. The method according to claim 4, characterized in that Determining a second logical partition from the candidate disk list includes: A second logical partition is determined from the free logical partitions of the first candidate disk in the candidate disk list.

8. A disk data processing device, characterized in that: The electronic device includes M disks, each of which includes at least two logical partitions, and the M disks include N disk groups, each of which includes logical partitions from at least two disks, wherein at least one backup partition exists in the disk group, and the backup partition is used to back up data of other logical partitions in the disk group; the device includes: A determination module, used to determine whether to perform data repair on a first logical partition of a first disk among the M disks; an acquisition module, configured to acquire the first disk group where the first logical partition is located; A processing module, configured to determine a first backup logical partition of the first logical partition from the first disk group; The control module is used to repair the data of the first logical partition by using the backup data stored in the first backup logical partition.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Backup management for a plurality of logical partitions

    CN104252319A

  • Management method and device of distributed cluster

    CN109189326A

  • Method for quickly repairing system based on disk block copy

    CN114356657A

  • Method, device and terminal for detecting and recovering data damage of high-security partition

    CN114518977A