Method and device for improving write performance of a redundant array of independent disks (raid) 5

CN116009786BActive Publication Date: 2026-08-18XFUSION DIGITAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211737093.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-08-18
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

[0003]RAID5作为硬盘冗余阵列,使用“奇偶校验”算法来写入数据(读数据相比其他没有差别),在每一次RAID5写操作中,每次RAID5写都使用新数据与其他所有成员盘数据计算新校验数据,导致写入数据的效率较低

Benefits of technology

[0084] This application optimizes and improves the performance of RAID5 by modifying the RAID5 write operation to be direct, and dynamically corrects the parity bit according to the data bit status information of RAID5 and the resources of RAID5 itself, so as to ensure the consistency and reliability of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116009786B_ABST
    Figure CN116009786B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a method and equipment for improving the write performance of a redundant array of independent disks (RAID) 5, and the method comprises the following steps: obtaining a data write request, wherein the data write request carries one or more pieces of to-be-written data and to-be-written hard disk positions corresponding to the to-be-written data; in response to the data write request, writing the one or more pieces of to-be-written data into the to-be-written hard disk positions corresponding to the to-be-written data, and adjusting data bit state information corresponding to the to-be-written hard disk positions. The write performance of the RAID 5 is improved by modifying the action of writing data in the RAID 5 into direct writing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, and in particular to a method and device for improving the write performance of a mirrored redundant disk array (RAID5). Background Technology

[0002] Redundant Array of Independent Disks (RAID 5) is widely used in the information technology field. In business scenarios involving hard drives, RAID 5 combinations are unavoidable. RAID 5 has wide applications in storage, computing, and security backup. A RAID 5 array requires at least three hard drives to balance read and write operations.

[0003] RAID5, as a redundant hard drive array, uses a "parity check" algorithm to write data (reading data is no different from other methods). In each RAID5 write operation, the new data is used to calculate new parity data with the data of all other member disks, resulting in low data writing efficiency. Summary of the Invention

[0004] This application provides a method and device for improving the write performance of a mirrored redundant disk array (RAID5). The write performance of RAID5 is optimized and improved by modifying the RAID5 write operation to a direct write operation.

[0005] In a first aspect, embodiments of this application provide a method for improving the write performance of a mirrored redundant disk array (RAID5), applied to a control unit located in a computing device, the method comprising:

[0006] Obtain a data write request, wherein the data write request carries one or more data to be written and the corresponding hard disk location of each data to be written;

[0007] In response to the data write request, the one or more data to be written are written to the corresponding hard disk location of each data to be written, and the data bit status information corresponding to each hard disk location is adjusted.

[0008] This application embodiment optimizes and improves the write performance of RAID5 by modifying the RAID5 write operation to a direct write.

[0009] Further, the data bit status information includes hard disk status information and marker bit status information; adjusting the data bit status information corresponding to each hard disk location to be written includes:

[0010] After writing one or more pieces of data to be written to the hard disk location corresponding to each piece of data to be written, the number of times data is written to each hard disk location is obtained, and the hard disk status information corresponding to each hard disk location is adjusted. The hard disk status information corresponding to each hard disk location is used to indicate that each hard disk location has been used.

[0011] The hard disk status information and flag bit status information corresponding to each hard disk location to be written are adjusted according to the number of times data is written to each hard disk location to be written. The flag bit status information corresponding to each hard disk location to be written is used to indicate the number of times data is written to each hard disk location to be written.

[0012] Furthermore, the data bit status information includes hard disk status information and marker bit status information. After adjusting the data bit status information corresponding to the hard disk location to be written, the method further includes:

[0013] Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in the RAID5, as well as the marker bit status information of the marker bit corresponding to each hard drive position;

[0014] The parity bits corresponding to each stripe are corrected based on the status information of each hard drive and the status information of each marker bit. The status information of each hard drive is used to indicate that each hard drive position has been used and the data written to that hard drive position. After correcting the parity bits, the status information of the marker bits is cleared.

[0015] Furthermore, the step of correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit includes:

[0016] Based on the status information of each hard disk and the status information of each marker bit, a target correction strategy is determined to correct the parity bit corresponding to each stripe.

[0017] The check bits corresponding to each stripe are corrected according to the target correction strategy.

[0018] Further, the step of determining the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit includes:

[0019] The load rate of the RAID5 is determined based on the status information of each hard drive, and a first correction strategy is determined based on the load rate.

[0020] The count of each flag bit is obtained according to the first preset interval time period, and the second correction strategy is determined according to the obtained count of each flag bit.

[0021] The target correction strategy for correcting the check bits corresponding to each stripe is determined based on the first correction strategy and the second correction strategy.

[0022] Further, determining the first correction strategy based on the load rate includes:

[0023] If the load rate is less than or equal to a preset load threshold, the resource access rate in the RAID5 is determined based on the load rate.

[0024] Based on the resource access rate, the first correction strategy is determined to be to select the idle resources corresponding to the resource access rate in the RAID5 array and correct the parity bits corresponding to each stripe.

[0025] Further, determining the first correction strategy based on the load rate includes:

[0026] If the load rate is greater than a preset load threshold, the first correction strategy is determined to be to correct the parity bit corresponding to each stripe while writing each piece of data to its corresponding hard disk location; or the first correction strategy is determined to use the fixed resources reserved in the RAID5 to correct the parity bit corresponding to each stripe.

[0027] Further, determining the second correction strategy based on the acquired counts of each of the flag bits includes:

[0028] The count change information of each flag bit is determined based on the obtained count of each flag bit;

[0029] The second correction strategy is determined based on the count change information of each of the flag bits.

[0030] Further, determining the second correction strategy based on the count change information of each marker bit includes:

[0031] When one or more stripes of continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to be to use the original correction strategy in RAID5 to correct the parity bit corresponding to each stripe of continuously written data within a preset time. The original correction strategy is to correct the parity bit while writing data.

[0032] Further, determining the second correction strategy based on the count change information of each marker bit includes:

[0033] When one or more stripes of non-continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to correct the check bits corresponding to each stripe of non-continuously written data according to the second preset time interval.

[0034] Further, determining the second correction strategy based on the count change information of each marker bit includes:

[0035] If, based on the count change information of each marker bit, it is determined that the count of data written to each stripe within a preset time range is less than a preset count threshold, the second correction strategy is to correct the check bits corresponding to each stripe when reading data.

[0036] Furthermore, the method also includes:

[0037] If a hard drive failure is confirmed, the status information of the marker bits corresponding to each hard drive position in each stripe is obtained, and the check bits corresponding to the stripes whose marker bit status information is not 0 are corrected.

[0038] Furthermore, the writing module 1502 is also used for:

[0039] If a write error is detected on the hard drive, the hard drive is remapped, and the remapped flag bit data is stored in the corresponding flag bit of the hard drive.

[0040] Furthermore, the writing module 1502 is also used for:

[0041] When correcting each check bit, obtain the count of each flag bit, and obtain the non-zero flag bit based on the count of each flag bit;

[0042] Get the data of all hard disk positions in the stripe containing the hard disk position corresponding to the non-zero marker bit, as well as the check data of the corresponding check bit of that stripe;

[0043] The new parity data is calculated based on the data of all hard disk locations in the stripe and the parity data of the corresponding parity bit in the stripe. The new parity data is then rewritten to the parity bit, and the flag bit count is cleared.

[0044] This application ensures data consistency and reliability by dynamically correcting the parity bits based on the data bit status information and the resources of RAID5 itself. Furthermore, by employing different correction strategies to correct each parity bit under different circumstances, it improves the flexibility of data processing while ensuring data reliability.

[0045] Secondly, embodiments of this application provide an apparatus for improving the write performance of a mirrored redundant disk array (RAID5), comprising:

[0046] The acquisition module is used to acquire data write requests, wherein the data write requests carry one or more data to be written and the hard disk location to be written corresponding to each data to be written;

[0047] The writing module is used to respond to the data writing request, write the one or more data to be written to the hard disk location corresponding to each data to be written, and adjust the data bit status information corresponding to each hard disk location.

[0048] Furthermore, the data bit status information includes hard disk status information and marker bit status information; when the writing module adjusts the data bit status information corresponding to each hard disk location to be written, it is specifically used for:

[0049] After writing one or more pieces of data to be written to the hard disk location corresponding to each piece of data to be written, the number of times data is written to each hard disk location is obtained, and the hard disk status information corresponding to each hard disk location is adjusted. The hard disk status information corresponding to each hard disk location is used to indicate that each hard disk location has been used.

[0050] The hard disk status information and flag bit status information corresponding to each hard disk location to be written are adjusted according to the number of times data is written to each hard disk location to be written. The flag bit status information corresponding to each hard disk location to be written is used to indicate the number of times data is written to each hard disk location to be written.

[0051] Furthermore, the data bit status information includes hard disk status information and marker bit status information. After adjusting the data bit status information corresponding to the hard disk location to be written, the writing module is further used for:

[0052] Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in the RAID5, as well as the marker bit status information of the marker bit corresponding to each hard drive position;

[0053] The parity bits corresponding to each stripe are corrected based on the status information of each hard drive and the status information of each marker bit. The status information of each hard drive is used to indicate that each hard drive position has been used and the data written to that hard drive position. After correcting the parity bits, the status information of the marker bits is cleared.

[0054] Furthermore, when the writing module corrects the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0055] Based on the status information of each hard disk and the status information of each marker bit, a target correction strategy is determined to correct the parity bit corresponding to each stripe.

[0056] The check bits corresponding to each stripe are corrected according to the target correction strategy.

[0057] Furthermore, when the write module determines the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0058] The load rate of the RAID5 is determined based on the status information of each hard drive, and a first correction strategy is determined based on the load rate.

[0059] The count of each flag bit is obtained according to the first preset interval time period, and the second correction strategy is determined according to the obtained count of each flag bit.

[0060] The target correction strategy for correcting the check bits corresponding to each stripe is determined based on the first correction strategy and the second correction strategy.

[0061] Furthermore, when the writing module determines the first correction strategy based on the load rate, it is specifically used for:

[0062] If the load rate is less than or equal to a preset load threshold, the resource access rate in the RAID5 is determined based on the load rate.

[0063] Based on the resource access rate, the first correction strategy is determined to be to select the idle resources corresponding to the resource access rate in the RAID5 array and correct the parity bits corresponding to each stripe.

[0064] Furthermore, when the writing module determines the first correction strategy based on the load rate, it is specifically used for:

[0065] If the load rate is greater than a preset load threshold, the first correction strategy is determined to be to correct the parity bit corresponding to each stripe while writing each piece of data to its corresponding hard disk location; or the first correction strategy is determined to use the fixed resources reserved in the RAID5 to correct the parity bit corresponding to each stripe.

[0066] Furthermore, when the writing module determines the second correction strategy based on the acquired counts of each of the flag bits, it is specifically used for:

[0067] The count change information of each flag bit is determined based on the obtained count of each flag bit;

[0068] The second correction strategy is determined based on the count change information of each of the flag bits.

[0069] Furthermore, when the writing module determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0070] When one or more stripes of real-time written data are determined based on the count change information of each marker bit, the second correction strategy is determined to be to use the original correction strategy in RAID5 to correct the parity bit corresponding to each stripe of real-time written data within a preset time. The original correction strategy is to correct the parity bit while writing data.

[0071] Furthermore, when the writing module determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0072] When one or more stripes of non-continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to correct the check bits corresponding to each stripe of non-continuously written data according to the second preset time interval.

[0073] Furthermore, when the writing module determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0074] If, based on the count change information of each marker bit, it is determined that the count of data written to each stripe within a preset time range is less than a preset count threshold, the second correction strategy is to correct the check bits corresponding to each stripe when reading data.

[0075] Furthermore, the writing module is also used for:

[0076] If a hard drive failure is confirmed, the status information of the marker bits corresponding to each hard drive position in each stripe is obtained, and the check bits corresponding to the stripes whose marker bit status information is not 0 are corrected.

[0077] Furthermore, the writing module is also used for:

[0078] If a write error is detected on the hard drive, the hard drive is remapped, and the remapped flag bit data is stored in the corresponding flag bit of the hard drive.

[0079] Furthermore, the writing module is also used for:

[0080] When correcting each check bit, obtain the count of each flag bit, and obtain the non-zero flag bit based on the count of each flag bit;

[0081] Get the data of all hard disk positions in the stripe containing the hard disk position corresponding to the non-zero marker bit, as well as the check data of the corresponding check bit of that stripe;

[0082] The new parity data is calculated based on the data of all hard disk locations in the stripe and the parity data of the corresponding parity bit in the stripe. The new parity data is then rewritten to the parity bit, and the flag bit count is cleared.

[0083] Thirdly, embodiments of this application provide a computing device including a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the method described in the first aspect.

[0084] This application optimizes and improves the performance of RAID5 by modifying the RAID5 write operation to be direct, and dynamically corrects the parity bit according to the data bit status information of RAID5 and the resources of RAID5 itself, so as to ensure the consistency and reliability of data. Attached Figure Description

[0085] Figure 1 This is a schematic diagram of a RAID5 data writing process provided in an embodiment of this application;

[0086] Figure 2 This is a schematic diagram of another RAID5 data writing processing method provided in the embodiments of this application;

[0087] Figure 3 This is a schematic diagram of another RAID5 data writing processing method provided in the embodiments of this application;

[0088] Figure 4 This is a schematic diagram of RAID5 data writing provided in an embodiment of this application;

[0089] Figure 5 This is a schematic diagram of another RAID5 data writing method proposed in this application embodiment;

[0090] Figure 6 This is a schematic diagram of another RAID5 data writing method proposed in the embodiments of this application;

[0091] Figure 7 This is a schematic diagram of another RAID5 data writing method provided in the embodiments of this application;

[0092] Figure 8 This is a flowchart illustrating a method for improving RAID5 write performance provided in an embodiment of this application;

[0093] Figure 9 This is a flowchart illustrating another method for improving RAID5 write performance provided in an embodiment of this application;

[0094] Figure 10 This is a schematic diagram of a marker bit information provided in an embodiment of this application;

[0095] Figure 11 This is a schematic diagram of a marker bit information provided in an embodiment of this application when writing data non-continuously;

[0096] Figure 12 This is a schematic diagram illustrating a method for reading data as the primary data marker information according to an embodiment of this application.

[0097] Figure 13 This is a schematic diagram of a marker bit information provided in an embodiment of this application for continuously writing data;

[0098] Figure 14 This is a flowchart illustrating another method for improving RAID5 write performance provided in an embodiment of this application;

[0099] Figure 15 This is a schematic diagram of a device for improving the write performance of a mirrored redundant disk array (RAID5) according to an embodiment of this application.

[0100] Figure 16 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0101] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0102] Before describing the technical solution proposed in this application, let's first refer to the appendix. Figure 1 -Appendix Figure 7 This section explains the relevant information about RAID5.

[0103] RAID 5 is a redundant array configured with independent disks for data storage. A RAID 5 array consists of at least three hard drives, each with multiple drive bays. These drive bays define multiple stripes, and each stripe contains one drive bay from each hard drive. Any drive bay within a stripe can serve as a parity bit, storing parity check data (i.e., parity code). The parity bits for all stripes can be from different drive bays on the same hard drive or from different hard drives; there are no specific restrictions. The remaining drive bays are used as data drives for storing data. Using RAID 5 avoids data loss due to hard drive failure when data is stored on a single hard drive. See Table 1 for details.

[0104] Table 1

[0105] Hard drive 1 Hard drive 2 Hard drive 3 D0 D1 D2 Strip 0 D00 D01 D02 Strip 1 D000 D001 D002 Strip 2

[0106] As shown in Table 1, hard drive positions 1 include D0, D00, and D000; hard drive positions 2 include D1, D01, and D001; and hard drive positions 3 include D2, D02, and D002. Hard drive positions D0, D1, and D2 form stripe 0; hard drive positions D00, D01, and D02 form stripe 1; and hard drive positions D000, D001, and D002 form stripe 2. The capacity of each hard drive position within a stripe can be the same. For example, in Table 1, the capacity of each hard drive position (D0, D1, and D2) forming stripe 0 can be 64KB. The capacity of each hard drive position within a stripe can also be different. For example, in Table 1, the capacity of hard drive position D0 forming stripe 0 can be 64KB, the capacity of hard drive position D1 can be 128KB, and the capacity of hard drive position D2 can be 192KB. The capacity of each hard drive position within the same hard drive can be the same or different. For example, in Table 1, in hard disk 1, the capacity of hard disk positions D0 and D000 can both be 64K, while the capacity of hard disk position D00 can be 32K. The capacity of each stripe is the same; for example, the capacity of stripe 0 equals the capacity of stripe 1 equals the capacity of stripe 2, that is, the capacity of D0 + the capacity of D1 + the capacity of D2 = the capacity of D00 + the capacity of D01 + the capacity of D02 = the capacity of D000 + the capacity of D001 + the capacity of D002.

[0107] RAID 5 typically optimizes for three processing modes—lowercase, uppercase, and full-strip write—based on the relationship between the size of the data to be written and the stripe size. These three processing modes are as follows:

[0108] Lowercase: Lowercase is typically used when the amount of data to be written requires less than half the number of stripe units (i.e., less than) the number of member disks (i.e., all hard drives that make up a RAID 5 array). The lowercase handling method is as follows: Figure 1 As shown, the data to be written, D01, is written to the hard disk location D0.

[0109] by Figure 2 For example, Figure 2 The diagram shows eight hard drives, each with a target hard drive location. The last hard drive serves as a parity disk for storing parity data. Assuming the data to be written at the target hard drive location on the fifth hard drive is 1111, the entire RAID 5 write process can be divided into the following steps:

[0110] 1. Read the original data 0110 from the target hard drive location of the fifth hard drive, and then perform an XOR operation with the data to be written 1111: 0110XOR 1111=1001;

[0111] 2. Read the verification disk ( Figure 2 The original check data stored in the check bit corresponding to the target hard drive position of the fifth hard drive in the last hard drive in the middle is 0010;

[0112] 3. Perform another XOR operation between the value calculated in step 1 and the original check data: 0010XOR 1001 = 1011;

[0113] 4. Then, write the data to be written, 1111, to the target hard drive location on the fifth hard drive, and write the new checksum calculated in step 3 to the checksum disk (i.e., Figure 2 The checksum corresponding to the target hard drive position of the fifth hard drive in the last hard drive in the middle.

[0114] Uppercase: When the amount of data to be written requires more than half the number of stripe units in a RAID 5 group, uppercase is typically used, such as... Figure 3 As shown, the data to be written, D01, needs to be written to the target hard disk location D0 of the first hard disk, D11 needs to be written to the target hard disk location D1 of the second hard disk, and D21 needs to be written to the target hard disk location D2 of the third hard disk. At this time, the data in the target hard disk location D3 of the fourth hard disk, which has no data to be rewritten, needs to be read out. The new check data Pnew is calculated using the following formula (1). Then, D01, D11, and D21 are written to their respective target hard disk locations, and Pnew is written to the check disk (used to store check data).

[0115] D01 XOR D11 XOR D21 XOR D3=Pnew(1)

[0116] XOR stands for Exclusive OR operation.

[0117] Full-mark write: In a RAID 5 group, all member disks except the parity disk need to have their data rewritten, such as... Figure 4 As shown, in addition to the verification disk P, the data to be written D01 needs to be written to the target hard disk position D0 of the first hard disk, the data to be written D11 needs to be written to the target hard disk position D1 of the second hard disk, the data to be written D21 needs to be written to the target hard disk position D2 of the third hard disk, and the data to be written D31 needs to be written to the target hard disk position D3 of the fourth hard disk. At this time, it is not necessary to read the old data from the disk. The new verification data Pnew can be calculated directly using the data to be written using the following formula (2). Then, D01, D11, D21 and D31 are written to their respective target hard disk positions, and Pnew is written to the verification disk.

[0118] D01 XOR D11 XOR D21 XOR D31=Pnew(2)

[0119] XOR stands for Exclusive OR operation.

[0120] Because RAID5 has a mechanism for calculating parity bits, it requires four steps: reading data, reading parity bits, writing data, and writing parity bits. Therefore, RAID5 has a write penalty.

[0121] For example, in a 7+1 (i.e., 7 hard drives for data and 1 hard drive for parity data) RAID5 stripe, for uppercase cases, assuming the data to be written, 1101, needs to be written to the first hard drive location D0, the second hard drive location D1, the third hard drive location D2, and the fourth hard drive location D3 respectively, the entire RAID5 write process can be divided into the following steps:

[0122] 1. Read the original data 0110 from the first hard disk location D0, and then perform an XOR operation with the data to be written 1101: 0110XOR 1101=1011;

[0123] 2. Read the original data 1101 from the second hard disk location D1, and then perform an XOR operation with the data to be written 1101: 1101XOR 1101=0000;

[0124] 3. Read the original data 0101 from the third hard disk location D2, and then perform an XOR operation with the data to be written 1101: 0101XOR 1101=1000;

[0125] 4. Read the original data 0010 from the fourth hard disk location D3, and then perform an XOR operation with the data to be written 1101: 0010XOR 1101=1111;

[0126] 5. Read the original check data 0010 from the check disk;

[0127] 6. Perform another XOR operation with the values ​​calculated in steps 1-4 and the original check digit: 0010XOR 1011XOR 0000XOR

[0128] 1000XOR 1111 = 1110;

[0129] 7. Then write the data to be written 1101 to the hard disk locations D0, D1, D2, and D3 respectively, and write the new check data 1110 calculated in step 6 to the check disk.

[0130] As can be seen from the above steps, for any single data write, multiple data reads and multiple data writes are required on the storage side.

[0131] This application optimizes RAID5 data write performance by using a direct write method, which means that data and parity bit read operations are not performed, and the data is written directly to improve write performance. The parity bit is corrected based on the data bit status information.

[0132] When creating a RAID 5 array, this application establishes a mapping relationship between hard drive positions and marker bits within the reserved space of each hard drive in the stripe. Specifically, as shown in Table 2, a RAID 5 array composed of five hard drives (i.e., hard drive 0, hard drive 1, hard drive 2, hard drive 3, and hard drive 4) uses D0, ..., D....n to represent multiple hard drive positions corresponding to hard drive 0, and the other hard drives are similarly represented. Each row in Table 2 corresponds to a stripe. Any hard drive position within each stripe can be selected as the corresponding parity bit for storing parity data. Each hard drive position corresponds to a marker bit, such as D0' as the marker bit for hard drive position D0. When data is successfully written to a hard drive position, the marker bit count for that hard drive position is incremented by 1. If data is written to that hard drive position multiple times, the marker bit count for that hard drive position will continue to accumulate. After correcting the parity bit corresponding to the stripe, the marker bits for each hard drive position in that stripe are cleared to zero.

[0133] For example, if data X is written once to disk position D0 of disk 0, the corresponding marker bit D0' count is incremented by 1. If data is also written to other disks or other disk positions of the same disk 0, the corresponding marker bit will also be incremented. For example, if data Y is written to disk position D00 of disk 0, the corresponding marker bit D00' count is incremented by 1.

[0134] Table 2

[0135] Hard disk 0 Hard drive 1 Hard drive 2 Hard drive 3 Hard drive 4 ……… D0 D1 D2 D3 P0 ……… D00 D01 D02 P1 D04 ……… D000 D001 P2 D003 D004 ……… D0000 P3 D0002 D0003 D0004 ……… P4 D00001 D00002 D00003 D00004 ……… ………… ………… ………… ……… ……… ……… D…………n D…………n D…………n D…………n D…………n ……… D0' D1' D2' D3' D04' ……… D00' D01' D02 D003' D004' ………

[0136] For RAID5 arrays with different numbers of hard drives, the same design scheme is used, with reserved space to create corresponding marker bits. The specific design scheme is summarized in Table 3. Each row in Table 3 forms a stripe, and any hard drive location in each stripe is selected for storing parity data.

[0137] Table 3

[0138]

[0139]

[0140] The data writing process can be categorized into the following situations.

[0141] Scenario 1: In RAID 5, if data is written N times to any hard drive location on any hard drive, the corresponding reserved space mapping flag count will be N. For example, if data is written N times to hard drive location D0 of hard drive 0, and the latest written data is X, then the corresponding reserved space mapping flag count D0' will be N, as shown in Table 4.

[0142] Table 4

[0143]

[0144] Case 2: In RAID 5, data is written to one of the two hard drives at each drive location. For example, if data X is written to drive location D0 of hard drive 0, and D0 is written N times, then the corresponding reserved space mapping marker bit D0' counts as N. If data is written to drive location D1 of hard drive 1 N1 times, and the latest written data is X1, then the corresponding reserved space mapping marker bit D1' counts as N1, as shown in Table 5.

[0145] Table 5

[0146]

[0147]

[0148] Scenario 3: In RAID 5, data is written to any two hard drives, and one hard drive has multiple (two or more) hard drive positions with data being written to, while the other hard drive has one hard drive position with data being written to. For example, if hard drive 0's D0 hard drive position is written to N times, and the latest written data is X, then the corresponding marker bit D0' counts as N. If hard drive 1's D1 hard drive position is written to N1 times, and the latest written data is X1, then the corresponding reserved space mapping marker bit D1' counts as N1. If hard drive 0's D00 hard drive position is written to N2 times, and the latest written data is X2, then the corresponding reserved space mapping marker bit D00' counts as N2 times. See Table 6 for details.

[0149] Table 6

[0150]

[0151] Scenario 4: Data is written to multiple (3 or more) member disks in RAID 5, as shown in Table 7. Data X0 is written to disk 0 at disk position D0, and the number of writes is N0. Data X00 is written to disk position D00, and the number of writes is N1. Data X1 is written to disk position D1, and the number of writes is N2. Data X2 is written to disk position D2, and the number of writes is N3.

[0152] Table 7

[0153]

[0154]

[0155] The above situation illustrates that data can be written to any one or more hard disk locations in any one or more stripes. Therefore, data writing is random. Furthermore, since the parity bit (i.e., parity disk) corresponding to each stripe is determined by XORing the data written in its corresponding stripe with the original parity data, the write-back (correction) of the parity bit can be performed on the parity bits corresponding to some stripes, not necessarily on all stripes, to improve the flexibility of processing.

[0156] While RAID 5 optimizes write performance by using a write-through approach, it introduces a risk of data inconsistency due to outdated parity data. For example, in the event of a hard drive failure or write anomaly, the parity bit may not be updated. When recovering data from the remaining RAID member disks using the parity check algorithm, the outdated parity bit data may prevent complete data recovery. This can occur in several ways, including the following scenarios combined with... Figure 5 , Figure 6 , Figure 7 To explain, among other things, Figure 5 , Figure 6 and Figure 7 Both hard disk 0 and hard disk 1 are used to store the written data. The parity bit corresponding to each stripe is located on hard disk 2. Therefore, hard disk 2 is used as a parity disk to store the parity data.

[0157] 1. Data is written directly without synchronous modification of the checksum data, such as... Figure 5 As shown, the left figure represents the data situation on each hard drive before the data is written, and the right figure represents the data situation on each hard drive after the data is written. The right figure shows that data C is written at the first hard drive position of hard drive 0, which means that the original data A at the first hard drive position of hard drive 0 is modified to C.

[0158] 2. For example Figure 6 As shown, the left figure represents Figure 5 The right-hand diagram shows the data situation of the first hard drive position of hard drive 1 when an anomaly occurred and the parity bit data was not modified. The diagram shows the data situation of each hard drive after the anomaly. The first hard drive position of hard drive 1 is anomaly, indicated by ×. Without modifying the parity bit data in hard drive 2 (which serves as the parity disk), and without rewriting the data at the anomaly point (the first hard drive position of hard drive 1) to the first hard drive position of hard drive 1, the written data would be C XOR AB = ABC. Figure 5 The data normally written to the first hard disk location of hard disk 0 is C. Therefore, the parity data of the stripe corresponding to the first hard disk location of hard disk 0 (i.e., the first hard disk location of hard disk 2) should be changed from AB to CB. Figure 6 In the diagram on the right, the correct data written to the first hard drive location of hard drive 1 should be C XOR CB = B.

[0159] 3. For example Figure 7 As shown, the left figure represents Figure 5 In the right-hand diagram, all hard drive locations of hard drive 1 show abnormalities, indicated by ×. Before these abnormalities occurred in all hard drive locations of hard drive 1... Figure 6 In the data shown in the right figure, if the data at the anomaly point is rewritten to the first hard disk location of hard disk 1, the written data will be C XOR AB = ABC. Since the parity bits of other stripes are not affected (the parity bits are not modified), the data of other stripes will still be the original normal data.

[0160] To address the data consistency and reliability issues caused by the lack of synchronous modification of the parity bit in abnormal situations, this application employs a method of simultaneously recording the write operation of each hard drive location in each stripe using a flag bit during data writing. To ensure data consistency and reliability, the RAID 5 control unit (such as the RAID card controller) can adjust the data consistency check (i.e., the correction of the parity bit) based on the real-time operation of the RAID card. This is achieved by correcting the parity bit based on hard drive status information (such as the number of hard drive writes triggered by data write actions) and flag status information (such as the flag bit count triggered by data write actions). In the event of a hard drive failure, the data parity bit will also be corrected before the drive is kicked to ensure data consistency and reliability.

[0161] The method for improving RAID5 performance proposed in this application can be applied to RAID5 data writing scenarios. In other embodiments, the method proposed in this application can also be applied to RAID6 data writing scenarios. The difference is that RAID6 has an additional parity bit compared to RAID5. When applying the method proposed in this application to RAID6 data writing scenarios, the additional parity bit compared to RAID5 can be corrected at the same time as the parity bit is corrected.

[0162] The method for improving RAID5 performance proposed in this application can be applied to a control unit located in a computing device, including but not limited to a server. The control unit can be a RAID card controller. This application implements a direct write operation for RAID5 through the firmware of the RAID card controller, and after the direct write operation, writes back (i.e. corrects) the parity bits through the data bit status information. In this way, the reliability of data redundancy recovery is guaranteed.

[0163] To better understand the embodiments of this application, the following description is provided in conjunction with the appendix. Figure 8 -Appendix Figure 14 The method for improving RAID5 performance proposed in the embodiments of this application is illustrated.

[0164] Please see details. Figure 8 , Figure 8 This is a flowchart illustrating a method for improving RAID5 write performance according to an embodiment of this application. The method for improving RAID5 performance proposed in this embodiment is applied to a control unit, which is located in a computing device. Specifically, the method in this embodiment includes the following steps.

[0165] S801: Obtain a data write request, which carries one or more data to be written and the corresponding hard disk location of each data to be written.

[0166] In this embodiment, the computing device can obtain a data write request, which carries one or more data to be written and the corresponding hard disk location for each data to be written. A hard disk includes multiple hard disk locations, and the hard disk location to be written includes: one or more hard disk locations of a single hard disk, and / or one or more hard disk locations corresponding to each of the multiple hard disks. The hard disk location to be written includes, but is not limited to, an identifier used to indicate the hard disk location, which includes, but is not limited to, any one or more of text, numbers, and letters.

[0167] S802: In response to the data write request, write one or more data to be written to the corresponding hard disk location of each data to be written, and adjust the data bit status information corresponding to each hard disk location.

[0168] In this embodiment, after receiving a data write request, the computing device can respond to the request by writing one or more pieces of data to the corresponding hard disk location and adjusting the data bit status information corresponding to each hard disk location. The data bit status information includes hard disk status information and flag bit status information. The hard disk status information indicates that each hard disk location has been used and the data written to that location. The flag bit status includes a flag bit count, which is determined based on the number of times data is written to each hard disk location. For example, in Table 2, if data is written N times to hard disk location D0 of hard disk 0, the corresponding flag bit D0' count is N.

[0169] In one embodiment, when adjusting the data bit status information corresponding to each write-to-hard disk location, the computing device can, after writing one or more pieces of data to each write-to-hard disk location, obtain the number of times data is written to each write-to-hard disk location, and adjust the hard disk status information corresponding to each write-to-hard disk location. This hard disk status information indicates that each write-to-hard disk location has been used. The device also adjusts the flag bit status information corresponding to each write-to-hard disk location based on the number of times data is written to each write-to-hard disk location. This flag bit status information indicates the count of the flag bits corresponding to each write-to-hard disk location (i.e., the number of times data is written to each write-to-hard disk location). See Tables 4, 5, 6, and 7 for details. In one example, assuming data X is written to write-to-hard disk location D0, and the number of times data is written to D0 is N, the hard disk status information corresponding to write-to-hard disk location D0 and the flag bit status information of the flag bit D0' corresponding to write-to-hard disk location D0 can be adjusted to N.

[0170] In one embodiment, after adjusting the data bit status information corresponding to the hard disk location to be written, the computing device can obtain the hard disk status information of multiple hard disk locations corresponding to each hard disk in RAID5, as well as the marker bit status information of the marker bits corresponding to each hard disk location; and perform correction processing on the parity bits corresponding to each stripe based on the hard disk status information and the marker bit status information (see details). Figure 9 (As described in the corresponding embodiment), each hard disk status information is used to indicate that each hard disk location has been used and the data written to that hard disk location. After correcting each check bit, the status information of each flag bit is cleared.

[0171] Furthermore, when the computing device obtains the hard drive status information of multiple hard drive positions corresponding to each hard drive in a RAID5 array, as well as the marker bit status information of the marker bits corresponding to each hard drive position, it can obtain the hard drive positions of one or more hard drives in the RAID5 array that have data being written to, and obtain the hard drive status information of each hard drive position that has data being written to, as well as the marker bit status information of the marker bits corresponding to each hard drive position. For example, assuming that each hard drive in the RAID5 array has M hard drive positions, of which N (N less than or equal to M) hard drive positions have data being written to, it can obtain the hard drive status information of the N hard drive positions that have data being written to, as well as the marker bit status information of the marker bits corresponding to each hard drive position.

[0172] This application embodiment optimizes and improves the performance of RAID5 by modifying the RAID5 data writing action to direct write, and further corrects the parity bit according to the hard drive status information of multiple hard drive positions corresponding to each hard drive in RAID5 and the flag bit status information of the flag bit corresponding to each hard drive position, so as to ensure the consistency and reliability of data.

[0173] Please see details. Figure 9 , Figure 9 This is a flowchart illustrating another method for improving RAID5 write performance provided in this application embodiment. The method for improving RAID5 performance proposed in this application embodiment is applied to a control unit, which is located in a computing device. Specifically, this application embodiment mainly describes how to correct the parity bit, and the method includes the following steps.

[0174] S901: Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in RAID5, as well as the flag bit status information of the flag bit corresponding to each hard drive position.

[0175] S902: Correct the parity bits corresponding to each stripe according to the status information of each hard disk and the status information of each marker bit. After correcting the parity bits, clear the status information of the marker bits.

[0176] In this embodiment of the application, the computing device can correct (i.e., write back or rewrite) the parity bit corresponding to each stripe based on the status information of each hard disk and the count of each marker bit.

[0177] When the computing device corrects each parity bit, it can obtain the count of each flag bit, obtain the non-zero flag bit based on the count of each flag bit, determine the stripe in which the hard disk position corresponding to the non-zero flag bit is located, obtain the data of all hard disk positions in the stripe (i.e., the original data before writing and the data written) and the parity data of the corresponding parity bit of the stripe; calculate the new parity data based on the data of all hard disk positions in the stripe and the parity data of the corresponding parity bit of the stripe, rewrite the new parity data to the parity bit, and at the same time clear the flag bit count to zero.

[0178] When a computing device calculates new parity data based on the data from all hard disk locations in a stripe and the parity data of the corresponding parity bit, it can first perform an XOR operation on the original data before writing and the data to be written (i.e., the data to be written) for all hard disk locations in the stripe. Then, it performs an XOR operation on the data obtained from the XOR operation with the parity data of the corresponding parity bit in the stripe to obtain the new parity data. For example, assuming the original data at hard disk location D0 of hard disk 0 is 0110 and the data to be written is 1111, the original data 0110 and the data to be written 1111 can be XORed: 0110 XOR 1111 = 1001; the XORed data 1001 is then XORed with the parity data 0010 of the corresponding parity bit in the stripe to obtain the new parity data: 0010 XOR 1001 = 1011; finally, the new parity data 1011 is written to the parity bit.

[0179] In one embodiment, when the computing device corrects the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it can determine the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit; and correct the parity bits corresponding to each stripe according to the target correction strategy.

[0180] In one embodiment, when the computing device determines the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it can determine the RAID5 load rate based on the status information of each hard disk, determine the first correction strategy based on the load rate; obtain the count of each marker bit according to the first preset time interval, determine the second correction strategy based on the obtained count of each marker bit; and determine the target correction strategy for correcting the parity bits corresponding to each stripe based on the first correction strategy and the second correction strategy.

[0181] Hard drive status information can be used to determine how many resources are spent on parity bit correction in RAID 5. When determining the RAID 5 load rate based on the status information of each hard drive, the computing device can determine the current busy state (i.e., resource utilization) of the RAID 5 based on the number of data writes to each hard drive, and define this busy state as the load rate. This load rate is positively correlated with the number of hard drive locations where data has been written. For example, the load rate can be calculated by summing the counts of each hard drive location where data is being written, X... 和 Divide by the total count of all hard drive locations in the RAID 5 array X 总 The load factor X1 is obtained.

[0182] Let the load rate be recorded as X1, and "1" represent the overall performance load capacity of the RAID card, i.e., the bandwidth performance capacity it can accommodate. Then, 1-X1≥0 (meaning the load rate will not exceed the overall performance load capacity of the RAID card). The larger X1 is, the greater the load bandwidth pressure (load bandwidth pressure is the read and write bandwidth accessed to the hard drive through the RAID card). The impact is that the proportion of resources for parity bit write-back is lower, because the RAID card needs to write back the parity bit, and the read and write operations on the hard drive all require the RAID card's computing resources to complete. The RAID card is used to implement RAID5 functionality.

[0183] The bandwidth capability of a RAID card is generally much greater than the combined bandwidth capability of the hard drives themselves. For example, a RAID 5 configuration with 10 mechanical hard drives in a 12-disk system cannot provide the maximum bandwidth required by the RAID card. This indicates that the RAID card has surplus resources, because higher read / write pressure necessitates greater parity calculation resources in RAID 5, as data writing to the hard drives requires calculations performed on the RAID card, where X1 is less than 1. However, if a 12-disk system is configured with 10 solid-state drives (SSDs), the overall bandwidth capability of the SSDs will approach or equal the bandwidth capability of the RAID card itself, making X1 close to or equal to 1.

[0184] When determining the first correction strategy based on the load rate, if the load rate is less than or equal to a preset load threshold, the computing device can determine the resource utilization rate in the RAID5 array based on the load rate. The first correction strategy based on the resource utilization rate involves selecting idle resources corresponding to the resource utilization rate in the RAID5 array to correct the parity bits corresponding to each stripe. The resource utilization rate indicates the idle and available resources in the RAID5 array.

[0185] For example, assuming the preset load threshold is 95% and the load rate is X1, if X1 is less than or equal to 95%, the computing device can determine the resource access rate in RAID5 as 1-X1 based on the load rate X1, and use the idle resources with a resource access rate of 1-X1 to correct the parity bits corresponding to each stripe.

[0186] When determining the first correction strategy based on the load rate, if the load rate is greater than a preset load threshold, the computing device can determine that the first correction strategy is to correct the parity bit corresponding to each stripe while writing the data to be written to each hard disk location.

[0187] For example, assuming the preset load threshold is 95% and the load rate is X1, if X1 is greater than 95%, the computing device can write the data to be written to each hard disk location while correcting the parity bit corresponding to each stripe.

[0188] Optionally, when the load rate exceeds a preset load threshold, the computing device can determine that the first correction strategy is to use the fixed resources reserved in RAID5 to correct the parity bits corresponding to each stripe. These fixed resources can be pre-defined, such as 10% of the resources. Further, if the computing device detects that there are no resources in RAID5 to correct the parity bits when the load rate exceeds the preset load threshold, it can determine that the first correction strategy is to force the original correction strategy in RAID5 to correct the parity bits corresponding to each stripe within a preset time. This original correction strategy corrects the parity bits corresponding to the stripe at the disk location while writing data to the disk.

[0189] Optionally, if the computing device determines that the first correction strategy is to wait until the load rate is less than or equal to the preset load threshold before starting to correct the check bits corresponding to each stripe, that is, not to correct the check bits corresponding to each stripe before the load rate is less than or equal to the preset load threshold. The preset time can be any custom time such as 24 hours or 72 hours, without specific limitations.

[0190] When the computing device acquires the count of each marker bit according to the first preset time interval, it can continuously monitor the count of each marker bit at the first preset time interval t. According to the duration of time, from t0 to t1, t2...tn, through the duration of this running time, the change information of the count of each marker bit is confirmed and recorded as X2. The check bit corresponding to each strip is corrected by the count change information of each time interval t.

[0191] The first preset interval period t can be 1 second, 2 seconds, or 1 minute, or even a shorter period like 10 milliseconds. However, the length of t will affect the number of write operations counted each time. Taking common mechanical hard drives and SSDs as examples, mechanical hard drives typically count write operations every 20-40 milliseconds, while SSDs count write operations every 2-10 milliseconds. Therefore, when t = 1 second, the cumulative number of write operations counted within this period is quite large. Within each first preset interval period t, the count of the flag bits corresponding to each stripe and the difference in flag bits between two t periods are statistically analyzed. Specifically... Figure 10 Let's take a sample of data from a single strip as an example to illustrate the concept. Figure 10 The example data for a single stripe is illustrated using multiple subplots. Because actual data writing scenarios are random and irregular, the only consistent pattern before the flag count is reset is a continuous accumulation, but the increase in the flag count within each time period t is unpredictable.

[0192] In one embodiment, when determining a second correction strategy based on the acquired counts of each flag bit, the computing device may determine the count change information of each flag bit based on the acquired counts of each flag bit; and determine the second correction strategy based on the count change information of each flag bit. Specifically, when acquiring the counts of each flag bit, the counts of each flag bit that are not zero may be acquired.

[0193] In one implementation, when the computing device determines the second correction strategy based on the count change information of each marker bit, and if it determines one or more stripes of data to be written in real time based on the count change information of each marker bit, the second correction strategy can be determined to be to correct the parity bits corresponding to each stripe using the original correction strategy in RAID5 within a preset time. The preset time can be 24h, 48h, or 72h, and is not specifically limited here. The original correction strategy corrects the parity bits corresponding to the stripe at the hard drive location while writing data to the hard drive location, to ensure data redundancy and reliability.

[0194] In one embodiment, when the computing device determines the second correction strategy based on the count change information of each flag bit, if it determines that each stripe is non-continuously written data (i.e., intermittently written data) based on the count change information of each flag bit, the second correction strategy can be determined to be to correct the check bits corresponding to each stripe according to a second preset interval time period. The second preset interval time period can be determined based on a first preset interval time period. The second preset interval time period can be equal to the first preset interval time period, or it can be a multiple of the first preset interval time period. For example, the second preset interval time period T can be equal to the second preset interval time period t, or it can be a multiple of the second preset interval time period t.

[0195] For situations where data is not continuously written in real time, the second preset interval period is related to the first preset interval period t, meaning that the check bit is written back within a multiple of t. By adjusting the frequency (i.e., the period) of check bit correction, the resource consumption impact on real-time business load can be avoided.

[0196] by Figure 11 Taking non-continuous data writing as an example, the counting of the flag bits in each time period (i.e., the first preset interval time period) is explained. The statistics are as follows, with 100ms as the first preset interval time period. Figure 11 As shown, there are write operations with no count increase (difference is zero) within consecutive time periods of 100ms, 200ms, 300ms, and 500ms, and write operations occur at times t0, t4, t8, t11, and t15.

[0197] This application determines the write-back of the parity bit Y by using the marking status X2 of the marker bit and the current load rate X1 of the RAID card. X1 determines how many resources to spend on the write-back of the parity bit based on the load rate of the RAID card, i.e., 1-X1, that is, all idle RAID card resources are used for the write-back operation of the parity bit. As for which stripe data to operate on, it is necessary to determine which stripe corresponding parity bits to perform the write-back operation based on the status of X2, so as to ensure reliable data consistency.

[0198] In one embodiment, when the computing device determines the second correction strategy based on the count change information of each marker bit, if it determines that the count of data written to each stripe within a preset time range is less than a preset count threshold (i.e., the case where data is mainly read and data is occasionally written), the second correction strategy can be determined to be to correct the parity bit corresponding to each hard disk position of each stripe when reading data.

[0199] by Figure 12The counting of the flag bit in each time period (i.e., the first preset interval time period) is explained when the main task is to read data and occasionally write data. The first preset interval time period is 100ms. The cumulative count is 22 periods, that is, there is no write operation within 2.2s. After the 2.2s interval, the write count increases by 5, and then there is no increase for another 2.2s.

[0200] by Figure 13 The counting of the flag bits during each time period (i.e., the first preset interval time period) during continuous data writing is explained, such as... Figure 13 As shown, there is a continuous writing action at every moment, from Figure 13 As you can see, the write count keeps increasing, and the difference only occasionally reaches zero.

[0201] In one embodiment, when a computing device determines that a hard disk has failed, it can obtain the status information of the marker bits corresponding to each hard disk position in each stripe, and perform correction processing on the check bits corresponding to the stripes where the marker bit status information is not 0.

[0202] In one embodiment, when the computing device determines the target correction strategy for correcting the check bits corresponding to each stripe based on the first correction strategy and the second correction strategy, it may merge the first correction strategy and the second correction strategy to determine the merged correction strategy as the target correction strategy.

[0203] When there is no obvious pattern, the computing device can merge the first and second correction strategies to determine the merged correction strategy as the target correction strategy. Specifically, when merging the first and second correction strategies, any one of the multiple methods in the first correction strategy can be paired with any one of the multiple methods in the second correction strategy to obtain the target correction strategy.

[0204] For example, assuming the determined first correction strategy is to correct the parity bit corresponding to the stripe where each data to be written is located while writing each data to its corresponding disk location, and the second correction strategy is to correct the parity bit corresponding to the stripe of each non-continuous data according to the second preset time interval, then the first correction strategy and the second correction strategy can be combined to obtain the target correction strategy, which is to correct the parity bit corresponding to the stripe where each non-continuous data is located while writing each data to its corresponding disk location.

[0205] When a computing device determines that a write error has occurred on the hard drive, it triggers hard drive remapping, storing the remapped flag data into the corresponding flag bit of the hard drive. Hard drive remapping involves recalculating the data for all hard drive locations experiencing the write error, as well as the count of the flag bits corresponding to each location. The recalculated new write data is then written to each hard drive location experiencing the write error, and the new flag bit count is written to the corresponding flag bit of each location.

[0206] This application optimizes and improves the performance of RAID5 by modifying the RAID5 data writing action to direct write, and further dynamically corrects the parity bit based on the RAID5 data bit status information and RAID5's own resources to ensure data consistency and reliability.

[0207] Please see Figure 14 , Figure 14 This is a flowchart illustrating another method for improving RAID5 write performance provided in this application embodiment. The method for improving RAID5 performance proposed in this application embodiment is applied to a control unit, which is located in a computing device and can be a RAID card controller.

[0208] Specifically, the RAID card controller can obtain the current status information of the RAID card, which is determined based on the status information of each hard drive in the RAID5, and obtain the status information of the marker bits according to the first preset time interval to count the marker bits.

[0209] Optionally, the RAID card controller can correct each parity bit based on the status information, which is the load rate X1. If X1 is less than or equal to a preset load threshold (e.g., 95%), the resource utilization rate of 1-X1 is determined based on X1 and the parity bits of each stripe are written back (i.e., corrected). If X1 is greater than the preset load threshold, each piece of data to be written can be written to its corresponding hard disk location, and the parity bit of the stripe where each hard disk location is located can be corrected. Alternatively, the fixed resources reserved in RAID5 can be used to correct the parity bits of each stripe.

[0210] Optionally, the RAID card controller can correct each parity bit based on the statistical flag bit count. When it is determined from the statistical flag bit count that there is a continuous write operation within the first preset time interval, the original correction strategy in RAID5 can be used to correct the parity bits corresponding to each stripe within the preset time.

[0211] When it is determined from the statistical flag count that the data write operation is an intermittent write operation within the first preset time interval, the check bits corresponding to each stripe can be intermittently corrected according to the second preset time interval. The second preset time interval can be determined from the first preset time interval, and can be equal to or a multiple of the first preset time interval. For example, the second preset time interval T can be equal to or a multiple of the second preset time interval t.

[0212] Based on the statistical count of the flag bits, it is determined that the data writing operation within the first preset time interval is mainly read-based, with occasional write operations. When reading data, the check bit can be corrected.

[0213] Optionally, the RAID card controller can also correct each parity bit based on the current hard drive status information and the flag bit count of each hard drive. When correcting each parity bit based on the current status information and flag bit count of the RAID card, one or more first correction strategies for correcting each parity bit based on the current status information of each hard drive, and one or more second correction strategies for correcting each parity bit based on the flag bit count, can be obtained. The first correction strategies and the second correction strategies are then combined pairwise to correct each parity bit. Furthermore, by combining the first correction strategies and the second correction strategies pairwise, the resulting correction strategy is determined as the target correction strategy. Specifically, when merging the first and second correction strategies, any one of the multiple methods in the first correction strategy can be combined pairwise with any one of the multiple methods in the second correction strategy to obtain the target correction strategy.

[0214] For example, assuming the determined first correction strategy is to correct the parity bit corresponding to the stripe where each data to be written is located while writing each data to its corresponding disk location, and the second correction strategy is to correct the parity bit corresponding to each stripe according to a second preset time interval, then the first and second correction strategies can be combined to obtain the target correction strategy, which is to correct the parity bit corresponding to the stripe where each data to be written is located while writing each data to its corresponding disk location according to a second preset time interval.

[0215] This application improves the flexibility of data processing by using different correction strategies to correct each check bit under different circumstances, thus ensuring data reliability.

[0216] Please see Figure 15 , Figure 15 This is a schematic diagram of a device for improving the write performance of a mirrored redundant disk array (RAID5) according to an embodiment of this application. Specifically, the device includes an acquisition module 1501 and a write module 1502;

[0217] The acquisition module 1501 is used to acquire a data write request, wherein the data write request carries one or more data to be written and the hard disk location to be written corresponding to each data to be written;

[0218] The writing module 1502 is used to respond to the data writing request, write the one or more data to be written to the hard disk location corresponding to each data to be written, and adjust the data bit status information corresponding to each hard disk location.

[0219] Furthermore, the data bit status information includes hard disk status information and marker bit status information; when the writing module 1502 adjusts the data bit status information corresponding to each hard disk location to be written, it is specifically used for:

[0220] After writing one or more pieces of data to be written to the hard disk location corresponding to each piece of data to be written, the number of times data is written to each hard disk location is obtained, and the hard disk status information corresponding to each hard disk location is adjusted. The hard disk status information corresponding to each hard disk location is used to indicate that each hard disk location has been used.

[0221] The hard disk status information and flag bit status information corresponding to each hard disk location to be written are adjusted according to the number of times data is written to each hard disk location to be written. The flag bit status information corresponding to each hard disk location to be written is used to indicate the count of the flag bits corresponding to each hard disk location to be written.

[0222] Furthermore, the data bit status information includes hard disk status information and marker bit status information. After adjusting the data bit status information corresponding to the hard disk location to be written, the writing module 1502 is also used for:

[0223] Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in the RAID5, as well as the marker bit status information of the marker bit corresponding to each hard drive position;

[0224] The parity bits corresponding to each stripe are corrected based on the status information of each hard drive and the status information of each marker bit. The status information of each hard drive is used to indicate that each hard drive position has been used and the data written to that hard drive position. After correcting the parity bits, the status information of the marker bits is cleared.

[0225] Furthermore, when the writing module 1502 corrects the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0226] Based on the status information of each hard disk and the status information of each marker bit, a target correction strategy is determined to correct the parity bit corresponding to each stripe.

[0227] The check bits corresponding to each stripe are corrected according to the target correction strategy.

[0228] Furthermore, when the writing module 1502 determines the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0229] The load rate of the RAID5 is determined based on the status information of each hard drive, and a first correction strategy is determined based on the load rate.

[0230] The count of each flag bit is obtained according to the first preset interval time period, and the second correction strategy is determined according to the obtained count of each flag bit.

[0231] The target correction strategy for correcting the check bits corresponding to each stripe is determined based on the first correction strategy and the second correction strategy.

[0232] Furthermore, when the writing module 1502 determines the first correction strategy based on the load rate, it is specifically used for:

[0233] If the load rate is less than or equal to a preset load threshold, the resource access rate in the RAID5 is determined based on the load rate.

[0234] Based on the resource access rate, the first correction strategy is determined to be to select the idle resources corresponding to the resource access rate in the RAID5 array and correct the parity bits corresponding to each stripe.

[0235] Furthermore, when the writing module 1502 determines the first correction strategy based on the load rate, it is specifically used for:

[0236] If the load rate is greater than a preset load threshold, the first correction strategy is determined to be to correct the parity bit corresponding to the stripe where each data to be written is located while writing each data to its corresponding disk location; or the first correction strategy is determined to be to use the fixed resources reserved in the RAID5 to correct the parity bit corresponding to each stripe.

[0237] Furthermore, when the writing module 1502 determines the second correction strategy based on the acquired counts of each of the flag bits, it is specifically used for:

[0238] The count change information of each flag bit is determined based on the obtained count of each flag bit;

[0239] The second correction strategy is determined based on the count change information of each of the flag bits.

[0240] Furthermore, when the writing module 1502 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0241] When one or more stripes of data to be written in real time are determined based on the count change information of each marker bit, the second correction strategy is determined to be to use the original correction strategy in RAID5 to correct the parity bit corresponding to each stripe within a preset time. The original correction strategy is to correct the parity bit while writing data.

[0242] Furthermore, when the writing module 1502 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0243] When one or more stripes of non-continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to correct the check bits corresponding to each stripe of non-continuously written data according to the second preset time interval.

[0244] Furthermore, when the writing module 1502 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0245] If, based on the count change information of each marker bit, it is determined that the count of data written to each stripe within a preset time range is less than a preset count threshold, the second correction strategy is to correct the check bits corresponding to each stripe when reading data.

[0246] Furthermore, the writing module 1502 is also used for:

[0247] If a hard drive failure is confirmed, the status information of the marker bits corresponding to each hard drive position in each stripe is obtained, and the check bits of the stripes corresponding to the non-zero marker bit status information are corrected.

[0248] Furthermore, the writing module 1502 is also used for:

[0249] If a write error is detected on the hard drive, the hard drive is remapped, and the remapped flag bit data is stored in the corresponding flag bit of the hard drive.

[0250] Furthermore, the writing module 1502 is also used for:

[0251] When correcting each check bit, obtain the count of each flag bit, and obtain the non-zero flag bit based on the count of each flag bit;

[0252] Get the data of all hard disk positions in the stripe containing the hard disk position corresponding to the non-zero marker bit, as well as the check data of the corresponding check bit of that stripe;

[0253] The new parity data is calculated based on the data of all hard disk locations in the stripe and the parity data of the corresponding parity bit in the stripe. The new parity data is then rewritten to the parity bit, and the flag bit count is cleared.

[0254] This application optimizes and improves the performance of RAID5 by modifying the RAID5 data writing action to direct write. It dynamically corrects the parity bit based on the data bit status information of RAID5 and the RAID5's own resources, thus ensuring data consistency and reliability.

[0255] Please see Figure 16 , Figure 16 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Specifically, the computer device includes: a memory 1601 and a processor 1602.

[0256] In one embodiment, the computer device further includes a data interface 1603 for transmitting data information between the computer device and other devices.

[0257] The memory 1601 may include volatile memory; the memory 1601 may also include non-volatile memory; the memory 1601 may also include a combination of the above types of memory. The processor 1602 may be a central processing unit (CPU). The processor 1602 may further include hardware chips. The hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLDs may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or any combination thereof.

[0258] The memory 1601 is used to store programs, and the processor 1602 can call the programs stored in the memory 1601 to perform the following steps:

[0259] Obtain a data write request, wherein the data write request carries one or more data to be written and the corresponding hard disk location of each data to be written;

[0260] In response to the data write request, the one or more data to be written are written to the corresponding hard disk location of each data to be written, and the data bit status information corresponding to each hard disk location is adjusted.

[0261] Furthermore, the data bit status information includes hard disk status information and marker bit status information; when the processor 1602 adjusts the data bit status information corresponding to each hard disk location to be written, it is specifically used for:

[0262] After writing one or more pieces of data to be written to the hard disk location corresponding to each piece of data to be written, the number of times data is written to each hard disk location is obtained, and the hard disk status information corresponding to each hard disk location is adjusted. The hard disk status information corresponding to each hard disk location is used to indicate that each hard disk location has been used.

[0263] The status information of each marker bit is adjusted according to the number of times data is written to each hard disk location to be written. The status information of the marker bit corresponding to each hard disk location to be written is used to indicate the number of times data is written to each hard disk location to be written.

[0264] Furthermore, the data bit status information includes hard disk status information and marker bit status information. After adjusting the data bit status information corresponding to the hard disk location to be written, the processor 1602 is further used for:

[0265] Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in the RAID5, as well as the marker bit status information of the marker bit corresponding to each hard drive position;

[0266] The parity bits corresponding to each stripe are corrected based on the status information of each hard drive and the status information of each marker bit. The status information of each hard drive is used to indicate that each hard drive position has been used and the data written to that hard drive position. After correcting the parity bits, the status information of the marker bits is cleared.

[0267] Furthermore, when the processor 1602 corrects the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0268] Based on the status information of each hard disk and the status information of each marker bit, a target correction strategy is determined to correct the parity bit corresponding to each stripe.

[0269] The check bits corresponding to each stripe are corrected according to the target correction strategy.

[0270] Furthermore, when the processor 1602 determines the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit, it is specifically used for:

[0271] The load rate of the RAID5 is determined based on the status information of each hard drive, and a first correction strategy is determined based on the load rate.

[0272] The count of each flag bit is obtained according to the first preset interval time period, and the second correction strategy is determined according to the obtained count of each flag bit.

[0273] The target correction strategy for correcting the check bits corresponding to each stripe is determined based on the first correction strategy and the second correction strategy.

[0274] Furthermore, when the processor 1602 determines the first correction strategy based on the load rate, it is specifically used for:

[0275] If the load rate is less than or equal to a preset load threshold, the resource access rate in the RAID5 is determined based on the load rate.

[0276] Based on the resource access rate, the first correction strategy is determined to be to select the idle resources corresponding to the resource access rate in the RAID5 array and correct the parity bits corresponding to each stripe.

[0277] Furthermore, when the processor 1602 determines the first correction strategy based on the load rate, it is specifically used for:

[0278] If the load rate is greater than a preset load threshold, the first correction strategy is determined to be to correct the parity bit corresponding to the stripe where each data to be written is located while writing each data to its corresponding disk location; or the first correction strategy is determined to be to use the fixed resources reserved in the RAID5 to correct the parity bit corresponding to each stripe.

[0279] Furthermore, when the processor 1602 determines the second correction strategy based on the acquired counts of each of the flag bits, it is specifically used for:

[0280] The count change information of each flag bit is determined based on the obtained count of each flag bit;

[0281] The second correction strategy is determined based on the count change information of each of the flag bits.

[0282] Furthermore, when the processor 1602 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0283] When one or more stripes of data to be written in real time are determined based on the count change information of each marker bit, the second correction strategy is determined to be to use the original correction strategy in RAID5 to correct the parity bit corresponding to each stripe within a preset time. The original correction strategy is to correct the parity bit while writing data.

[0284] Furthermore, when the processor 1602 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0285] When one or more stripes of non-continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to correct the check bits corresponding to each stripe of non-continuously written data according to the second preset time interval.

[0286] Furthermore, when the processor 1602 determines the second correction strategy based on the count change information of each flag bit, it is specifically used for:

[0287] If, based on the count change information of each marker bit, it is determined that the count of data written to each stripe within a preset time range is less than a preset count threshold, the second correction strategy is to correct the check bits corresponding to each stripe when reading data.

[0288] Furthermore, the processor 1602 is also used for:

[0289] If a hard drive failure is confirmed, the status information of the marker bits corresponding to each hard drive position in each stripe is obtained, and the check bits corresponding to the stripes whose marker bit status information is not 0 are corrected.

[0290] Furthermore, the processor 1602 is also used for:

[0291] If a write error is detected on the hard drive, the hard drive is remapped, and the remapped flag bit data is stored in the corresponding flag bit of the hard drive.

[0292] Furthermore, the processor 1602 is also used for:

[0293] When correcting each check bit, obtain the count of each flag bit, and obtain the non-zero flag bit based on the count of each flag bit;

[0294] Get the data of all hard disk positions in the stripe containing the hard disk position corresponding to the non-zero marker bit, as well as the check data of the corresponding check bit of that stripe;

[0295] The new parity data is calculated based on the data of all hard disk locations in the stripe and the parity data of the corresponding parity bit in the stripe. The new parity data is then rewritten to the parity bit, and the flag bit count is cleared.

[0296] This application optimizes and improves the performance of RAID5 by modifying the RAID5 data writing action to direct write. It dynamically corrects the parity bit based on the data bit status information of RAID5 and the RAID5's own resources, thus ensuring data consistency and reliability.

[0297] Those skilled in the art will also understand that the various illustrative logical blocks and steps listed in the embodiments of this application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functionality using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of this application.

[0298] This application also provides a computer-readable storage medium having a computer program stored thereon, the computer program including program instructions that, when executed by a computer, implement the functions of any of the above method embodiments.

[0299] The aforementioned computer-readable storage media include, but are not limited to, flash memory, hard disk, and solid-state drive.

[0300] This application also provides a computer program product that, when executed by a computer, implements the functions of any of the above method embodiments.

[0301] The solutions described in this application can be implemented in various ways. For example, these technologies can be implemented in hardware, software, or a combination of hardware. For hardware implementation, the processing unit performing the related technologies described above can be implemented in one or more general-purpose processors, digital signal processors (DSPs), digital signal processing devices, application-specific integrated circuits (ASICs), programmable logic devices, field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can also be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented through a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0302] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0303] In this application, the use of singular pronouns to denote "one or more" rather than "one and only one," unless otherwise specified. In this application, unless otherwise specified, "multiple" is intended to denote "two or more."

[0304] In addition, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. A can be singular or plural, and B can be singular or plural.

[0305] The designations in this application (such as designating a time threshold range) can be understood as definitions, pre-definitions, storage, pre-storage, pre-negotiations, pre-configurations, solidification, or pre-burning.

[0306] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the server and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0307] The same or similar parts between the various embodiments in this application can be referred to mutually. In the various embodiments of this application, and in the various implementation methods / methods / implementations within each embodiment, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments and between the various implementation methods / methods / implementations within each embodiment are consistent and can be mutually referenced. The technical features in different embodiments and the various implementation methods / methods / implementations within each embodiment can be combined according to their inherent logical relationships to form new embodiments, implementation methods, methods, or implementation approaches. The above-described embodiments of this application do not constitute a limitation on the scope of protection of this application.

Claims

1. A method for improving the write performance of a mirrored redundant disk array (RAID5), characterized in that, The method includes: Obtain a data write request, wherein the data write request carries one or more data to be written and the corresponding hard disk location of each data to be written; In response to the data write request, the one or more data to be written are written to the hard disk location corresponding to each data to be written, and the data bit status information corresponding to each hard disk location is adjusted. The data bit status information includes hard disk status information and marker bit status information; adjusting the data bit status information corresponding to each hard disk location to be written includes: After writing one or more pieces of data to be written to the corresponding hard disk location, the number of times data is written to each hard disk location is obtained, and the hard disk status information corresponding to each hard disk location is adjusted. The hard disk status information corresponding to each hard disk location is used to indicate that each hard disk location has been used. The status information of the flag bit corresponding to each hard disk location to be written is adjusted according to the number of times data is written to each hard disk location to be written. The status information of the flag bit corresponding to each hard disk location to be written is used to indicate the number of times data is written to each hard disk location to be written.

2. The method according to claim 1, characterized in that, The data bit status information includes hard disk status information and marker bit status information. After adjusting the data bit status information corresponding to the hard disk location to be written, the method further includes: Obtain the hard drive status information of multiple hard drive positions corresponding to each hard drive in the RAID5, as well as the marker bit status information of the marker bit corresponding to each hard drive position; The parity bits corresponding to each stripe are corrected based on the status information of each hard drive and the status information of each marker bit. The status information of each hard drive is used to indicate that each hard drive position has been used and the data written to that hard drive position. After correcting each parity bit, the status information of the marker bit is cleared.

3. The method according to claim 2, characterized in that, The step of correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit includes: Based on the status information of each hard disk and the status information of each marker bit, a target correction strategy is determined to correct the parity bit corresponding to each stripe. The check bits corresponding to each stripe are corrected according to the target correction strategy.

4. The method according to claim 3, characterized in that, The step of determining the target correction strategy for correcting the parity bits corresponding to each stripe based on the status information of each hard disk and the status information of each marker bit includes: The load rate of the RAID5 is determined based on the status information of each hard drive, and a first correction strategy is determined based on the load rate. The count of each flag bit is obtained according to the first preset interval time period, and the second correction strategy is determined according to the obtained count of each flag bit. The target correction strategy for correcting the check bits corresponding to each stripe is determined based on the first correction strategy and the second correction strategy.

5. The method according to claim 4, characterized in that, Determining the first correction strategy based on the load rate includes: If the load rate is less than or equal to a preset load threshold, the resource access rate in the RAID5 is determined based on the load rate. Based on the resource access rate, the first correction strategy is determined to be to select the idle resources corresponding to the resource access rate in the RAID5 array and correct the parity bits corresponding to each stripe.

6. The method according to claim 4, characterized in that, Determining the first correction strategy based on the load rate includes: If the load rate is greater than a preset load threshold, the first correction strategy is determined to be to correct the parity bit corresponding to the stripe where each write-to-write hard disk location is located while writing each write-to-write data to its corresponding write-to-write hard disk location; or the first correction strategy is determined to use the fixed resources reserved in the RAID5 to correct the parity bit corresponding to each stripe where each write-to-write hard disk location is located.

7. The method according to claim 4, characterized in that, The step of determining the second correction strategy based on the acquired counts of each of the flag bits includes: The count change information of each flag bit is determined based on the obtained count of each flag bit; The second correction strategy is determined based on the count change information of each of the flag bits.

8. The method according to claim 7, characterized in that, Determining the second correction strategy based on the count change information of each marker bit includes: When one or more stripes of continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to be to use the original correction strategy in RAID5 to correct the parity bit corresponding to each stripe of continuously written data. The original correction strategy is to correct the parity bit while writing data.

9. The method according to claim 7, characterized in that, Determining the second correction strategy based on the count change information of each marker bit includes: When one or more stripes of non-continuously written data are determined based on the count change information of each marker bit, the second correction strategy is determined to correct the check bits corresponding to each stripe of non-continuously written data according to the second preset time interval.

10. The method according to claim 7, characterized in that, Determining the second correction strategy based on the count change information of each marker bit includes: If, based on the count change information of each marker bit, it is determined that the count of data written to each stripe within a preset time range is less than a preset count threshold, the second correction strategy is to correct the check bits corresponding to each stripe when reading data.

11. The method according to claim 2, characterized in that, The method further includes: If a hard drive failure is confirmed, the status information of the marker bits corresponding to each hard drive position in each stripe is obtained, and the check bits corresponding to the stripes whose marker bit status information is not 0 are corrected.

12. A computing device, characterized in that, include: The device includes a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to perform the method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • RAID function implementation method and related device

    CN111538460A