A RAID degradation migration method and device, electronic equipment and storage medium

By using migration waterlines to divide storage areas during RAID downgrade migration, the problem of reduced data protection levels caused by the reduction of parity disks is solved, thereby improving data security and efficiency during the downgrade process.

CN122152226APending Publication Date: 2026-06-05JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-01-30
Publication Date
2026-06-05

Smart Images

  • Figure CN122152226A_ABST
    Figure CN122152226A_ABST
Patent Text Reader

Abstract

The application discloses a RAID degradation migration method and device, electronic equipment and a storage medium, and relates to the technical field of computers. In the degradation migration process, the migration waterline is divided into a completed area and an unstarted area, the completed area is converted into a target RAID layout while retaining the original RAID level check disk and redundancy protection capability, the RAID protection level is ensured not to be lowered during the degradation process, and the check disk to be removed is removed after all stripe migration is completed. Therefore, the technical problem that the data protection level is instantaneously lowered due to the reduction of the check disk in the degradation migration, resulting in data loss, can be solved, and the safety of the RAID degradation migration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a RAID downgrade migration method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of technology, data storage needs have evolved from simple capacity expansion to a comprehensive pursuit of high performance, high reliability, high security, and scalability. Against this backdrop, Redundant Array of Independent Disks (RAID) technology has emerged as a key solution for storage systems. Depending on different application scenarios and requirements, RAID technology is divided into multiple levels, such as RAID 0, RAID 1, RAID 5, and RAID 6, each with its unique performance and reliability characteristics.

[0003] In related technologies, RAID level migration includes downgrade migration, the core of which lies in reducing the number of parity disks to adjust the RAID level. During execution, the storage layout is gradually transformed, redistributing data from the original RAID level to the target level. However, this process has inherent flaws in downgrade migration: the removal of parity disks causes an immediate decrease in data protection level, and if a hard drive failure occurs during the migration phase, the system cannot maintain its original redundancy, thus leading to the risk of data loss. Summary of the Invention

[0004] This application provides a RAID downgrade migration method, apparatus, electronic device, and storage medium to at least address the problem of reduced security in related technologies during RAID downgrade migration.

[0005] This application provides a RAID downgrade migration method, including:

[0006] Obtain information on RAID downgrade migration requirements; Based on the RAID downgrade migration requirements, the RAID storage area is divided into a completed area and an unstarted area using a migration waterline. The migration waterline is adjacent to the stripe with the smallest current stripe in the unstarted area. The completed area adopts the target RAID layout and retains the protection level of the original RAID level. The unstarted area maintains the original RAID layout. The completed area is empty at the initial state of the migration. The strip with the smallest current stripe in the unstarted region is taken as the current stripe to be migrated. Based on the target RAID layout, migrate the current stripe to be migrated to the completed area; The migration waterline is moved to the completed area, and the process returns to the step of taking the smallest current stripe in the unstarted area as the current stripe to be migrated, until the migration waterline reaches the target position; when the migration waterline reaches the target position, the unstarted area is empty; Remove the parity disk to be removed to switch the protection level of the completed area to the target RAID level.

[0007] This application also provides a RAID downgrade migration device, including: The acquisition module is used to obtain RAID downgrade migration requirement information; The partitioning module is used to divide the RAID storage area into a completed area and an unstarted area based on the RAID downgrade migration requirement information and through the migration waterline. The migration waterline is adjacent to the stripe with the smallest current stripe in the unstarted area. The completed area adopts the target RAID layout and retains the protection level of the original RAID level. The unstarted area maintains the original RAID layout. The completed area is empty at the initial state of the migration. The selection module is used to select the stripe with the smallest current stripe in the non-starting region as the current stripe to be migrated. The migration module is used to migrate the stripe to be migrated to the completed area according to the target RAID layout; The loop module is used to migrate unit strips from the migration waterline to the completed area and return to the step of taking the strip with the smallest current strip in the unstarted area as the current strip to be migrated, until the migration waterline migrates to the target position; wherein, when the migration waterline migrates to the target position, the unstarted area is empty; The downgrade module is used to remove the parity disk to be removed, so that the protection level of the completed area can be switched to the target RAID level.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described RAID downgrade migration methods when executing the computer program.

[0009] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described RAID downgrade migration methods.

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described RAID downgrade migration methods.

[0011] This application addresses the technical problem of data loss caused by a sudden drop in data protection level during RAID downgrade migration by using a migration waterline to divide the completed area into the unstarted area and ensuring that the original RAID level parity disk and redundancy protection capability are retained while the completed area is converted to the target RAID layout. This guarantees that the RAID protection level will not be reduced during the downgrade process. The parity disk to be removed is removed only after all stripes have been migrated. Therefore, this application improves the security of RAID downgrade migration by solving the technical problem of data loss caused by the reduction of parity disks in related technologies. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of a RAID structure provided in an embodiment of this application; Figure 2 A flowchart illustrating the RAID downgrade migration method provided in this application embodiment; Figure 3 An exemplary RAID layout diagram provided for embodiments of this application; Figure 4 An exemplary layout diagram of the completion area provided for an embodiment of this application; Figure 5 This is a schematic diagram illustrating the migration from RAID5 to RAID0 provided in an embodiment of this application. Figure 6 This is a schematic diagram illustrating the migration from RAID6 to RAID5 provided in an embodiment of this application. Figure 7 This is a schematic diagram illustrating the migration from RAID6 to RAID0 provided in an embodiment of this application. Figure 8 An exemplary RAID6 to RAID5 migration diagram provided for embodiments of this application; Figure 9 An exemplary schematic diagram of the completion area data reconstruction provided for embodiments of this application; Figure 10 A schematic diagram illustrating the overall process of an exemplary RAID downgrade migration method provided in this application embodiment; Figure 11 This is a schematic diagram of the RAID access process provided in an embodiment of this application; Figure 12 This is a schematic diagram of the RAID downgrade migration device provided in the embodiments of this application; Figure 13This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely 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 protection scope of this application.

[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] With the rapid development of technology, human society has fully entered the era of data explosion. Massive amounts of data not only require efficient storage and fast retrieval, but have also become the core of information processing. Data storage needs have shifted from simple capacity expansion to a comprehensive pursuit of high performance, high reliability, high security, and scalability. Against this backdrop, RAID technology has emerged and quickly become a key solution in the storage field.

[0017] RAID technology achieves a perfect combination of high performance, high reliability, and fault tolerance through techniques such as data striping, mirroring, and data verification. Depending on different application scenarios and requirements, RAID technology is divided into multiple levels, such as RAID 0, RAID 1, RAID 5, and RAID 6, each with its unique performance and reliability characteristics.

[0018] RAID 0: By striping data across multiple disks, it achieves extremely high read and write performance. However, RAID 0 does not provide any redundancy protection; the failure of any one disk will result in the loss of all data in the RAID group, thus its reliability is low.

[0019] RAID 1: Utilizes mirroring technology to completely replicate data across two disks, achieving extremely high data reliability. If one disk fails, the other can still provide complete data. However, RAID 1's drawbacks include lower storage capacity utilization (only half the total capacity) and write performance limited by the overhead of mirroring operations.

[0020] RAID 5: Provides data redundancy through distributed parity checking, ensuring data security in the event of a single disk failure. RAID 5 achieves a good balance between performance and reliability, making it suitable for scenarios that require a certain level of data security but also want to fully utilize storage capacity.

[0021] RAID 6 adds a second parity check to RAID 5, allowing it to tolerate the simultaneous failure of two disks and further improving data reliability. However, RAID 6's write performance is lower than RAID 5, and it requires more storage space for redundancy.

[0022] Among them, such as Figure 1 The diagram shown is a schematic of a RAID structure provided in an embodiment of this application. RAID level migration refers to converting from one RAID level to another to meet different performance and reliability requirements. The migration process is divided into upgrade migration and downgrade migration. Upgrade migration refers to increasing the number of parity disks, such as upgrading from RAID0 to RAID5, to improve data security; while downgrade migration refers to reducing the number of parity disks, such as downgrading from RAID5 to RAID0, to improve performance. Here, P represents parity data, and each strip includes multiple unit chunks, therefore P is also called a parity unit.

[0023] However, the relevant technologies have significant drawbacks during the downgrade migration process: due to the reduction in the number of parity disks, the security level of the RAID will be greatly reduced. For example, when downgrading from RAID 5 to RAID 0, the failure of disk 1 or disk 2 may cause the migration to fail and result in the loss of data for the entire RAID group, which poses a huge risk to data security during the downgrade migration process.

[0024] To address the aforementioned technical problems, this application provides a RAID downgrade migration method, apparatus, electronic device, and storage medium. Because a migration waterline is used to divide the completed area into a non-started area during the downgrade migration process, and the completed area retains the original RAID level's parity disk and redundancy protection capabilities while being converted to the target RAID layout, the RAID protection level is guaranteed not to decrease during the downgrade process. The parity disk to be removed is only removed after all stripe migrations are completed. Therefore, this solves the technical problem in related technologies where the reduction of parity disks during downgrade migration leads to a sudden drop in data protection level and data loss, thus improving the security of RAID downgrade migration.

[0025] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] This application provides a RAID downgrade migration method for securely downgrading and migrating RAID. The execution subject of this application embodiment is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices that can be used for RAID downgrade migration.

[0027] like Figure 2 The diagram shown is a flowchart illustrating a RAID downgrade migration method provided in an embodiment of this application. The method includes: Step 201: Obtain RAID downgrade migration requirement information.

[0028] The RAID downgrade migration requirement information includes key information such as the original RAID level identifier, the target RAID level specification, and the identifier of the parity disk to be removed.

[0029] Step 202: Based on the RAID downgrade migration requirement information, the RAID storage area is divided into a completed area and an unstarted area through the migration waterline.

[0030] The migration waterline is adjacent to the stripe with the smallest current stripe in the unstarted area. The completed area adopts the target RAID layout and retains the protection level of the original RAID level. The unstarted area maintains the original RAID layout. The completed area is empty in the initial state of migration.

[0031] Specifically, the migration waterline is essentially a virtual boundary for the migration. Its initial position is adjacent to the smallest stripe index within the unstarted area, dividing the storage space into two logical regions. The completed area adopts the target RAID layout but maintains the original protection level by retaining a parity disk, while the unstarted area completely preserves the original RAID data distribution structure. This partitioning design allows the RAID to maintain two layouts simultaneously during the migration process, providing a foundation for a secure degradation transition.

[0032] Step 203: Select the strip with the smallest current stripe in the unstarted region as the current stripe to be migrated.

[0033] For example, such as Figure 3 As shown, this is an exemplary RAID layout diagram provided in an embodiment of this application. The stripe with the smallest current stripe in the non-starting area is the stripe below the migration waterline. RAID downgrade migration is generally carried out in stripe units, that is, one stripe at a time.

[0034] Step 204: Based on the target RAID layout, migrate the current stripe to be migrated to the completed area.

[0035] Specifically, based on the layout rules of the target RAID level, the physical locations of data units and parity units in the current stripe to be migrated can be recalculated and written into the corresponding locations in the completion area. This allows the completion area to have new layout features while maintaining the original level of redundancy protection capabilities, achieving a balance between security and structural upgrades.

[0036] Step 205: Move the migration waterline to the completed area and return to the step of taking the smallest current stripe in the unstarted area as the current stripe to be migrated, until the migration waterline is migrated to the target position.

[0037] When the migration waterline migrates to the target location, the unstarted area is empty.

[0038] Specifically, the migration waterline moves one strip unit towards the completion area to update the boundary between the two areas.

[0039] Step 206: Remove the parity disk to be removed to switch the protection level of the completed area to the target RAID level.

[0040] Specifically, once the migration waterline reaches the target location, it is confirmed that all stripes in the RAID to be migrated have completed the migration, such as... Figure 4 The diagram shown is an exemplary layout of the completion area provided in an embodiment of this application. Therefore, the parity disk to be removed can be safely removed, allowing the completion area to switch to the protection level of the target RAID level. For example, if the original RAID level has two parity disks and the target RAID level has one parity disk, removing the parity disk to be removed will switch the protection level of the completion area to the target RAID level.

[0041] For example, such as Figure 5 The diagram shown is a schematic of migrating from RAID5 to RAID0 according to an embodiment of this application. Figure 6 The diagram shown is a schematic of migrating from RAID6 to RAID5 according to an embodiment of this application. Figure 7 The diagram shown is a schematic of migrating from RAID6 to RAID0 according to an embodiment of this application.

[0042] Based on the above embodiments, as an implementable approach, in one embodiment, before selecting the stripe with the smallest current stripe in the unstarted region as the current stripe to be migrated, the method further includes: Step 301: Obtain the number of bad disks in the unstarted area; Step 302: If the number of bad disks does not exceed the protection range of the original RAID level, then execute the step of taking the stripe with the smallest current stripe in the unstarted area as the current stripe to be migrated.

[0043] Specifically, the number of failed disks measured can be compared with the theoretical fault tolerance (protection range) of the original RAID level. For example, RAID6 can tolerate two disk failures. If the number of failed disks is ≤2, it is determined that the migration conditions are met, and therefore the stripe migration step is executed. This judgment mechanism ensures that the unstarted area has data reconstruction capabilities, preventing forced migration when redundancy is insufficient and thus avoiding data integrity damage and mitigating the risk of data loss due to disk failure during the migration process.

[0044] Based on the above embodiments, as one implementable approach, in one embodiment, the current stripe to be migrated includes data units, verification units to be migrated, and verification units to be removed. According to the target RAID layout, migrating the current stripe to be migrated to the completion area includes: Step 2041: Determine whether the verification unit to be removed is currently on the verification disk to be removed; Step 2042: If the verification unit to be removed is not currently on the verification disk to be removed, determine the target data disk number based on the logical address information of the data unit, the unit size, and the total number of data disks. Step 2043: For the verification units to be migrated in the current stripe to be migrated, determine the target verification disk number based on the total number of data disks, the stripe size of the current stripe to be migrated, and the total number of disks; Step 2044: Migrate the data unit to the corresponding target data disk according to the target data disk number; Step 2045: Based on the target verification disk number, migrate the verification unit to be migrated to the corresponding target verification disk; Step 2046: Migrate the verification unit to be removed to the verification disk to be removed.

[0045] Specifically, the target data disk number (dd_idx) can be calculated based on the logical address information of the data unit (LBA or lba), the stripe unit size (chunk), and the total number of data disks (data_disks). The formula dd_idx = (LBA / chunk) % data_disks is used, but the parity disk is not considered during the initial calculation; the calculation is then corrected based on the parity disk location (target parity disk number).

[0046] Furthermore, for the parity units (parity data to be retained) in the current stripe to be migrated, the target parity disk number (pd_idx) can be calculated based on the total number of data disks, the current stripe size, and the total number of disks (raid_disks). Considering the change in the total number of disks after downgrading (raid_disks-1), the parity disk index is calculated using pd_idx = data_disks - stripe % raid_disks. The data units and the parity units to be migrated are migrated according to the target data disk number and the target parity disk number, respectively. Finally, the parity units to be migrated are written to the corresponding parity disks to be removed, ensuring that the completed area can maintain the original RAID level redundancy protection capability during the downgrading transition period.

[0047] Specifically, in one embodiment, it can be determined whether there is a sequence number conflict between the target data disk serial number and the determined target verification disk serial number; if there is no sequence number conflict, the data unit is migrated to the corresponding target data disk according to the target data disk serial number; if there is a sequence number conflict, the target data disk serial number is corrected, and the data unit is migrated to the target data disk corresponding to the corrected target data disk serial number according to the corrected target data disk serial number.

[0048] Among them, serial number conflict means that two serial numbers are the same. Since the target verification disk needs to maintain a left-handed arrangement, when there is a conflict, the serial number of the target data disk is corrected, such as by adding one to the serial number of the target data disk.

[0049] For example, to help those skilled in the art better understand the embodiments of this application, such as Figure 8 The diagram shown is an exemplary RAID6 to RAID5 migration diagram provided in this application embodiment. Taking the RAID6 to RAID5 migration as an example, both RAID5 and RAID6 are left-handed misaligned structures. Assume that RAID6 contains 4 disks (raid_disks=4), including 2 data disks (data_disks=2) and 2 parity disks, with a stripe size of 16 (chunk=16) and a stripe size of 32 (stripe=32). RAID6 needs to be downgraded to RAID5, requiring the removal of a third disk (the parity disk to be removed). During the migration process, two disks (disk 1 and disk 2) fail. The original RAID layout calculation formula for the unstarted area provided in this application embodiment is as follows: Without considering the parity disk, the physical disk (data disk)'s sequence number (dd_idx) in the entire column group: dd_idx = (lba / chunk) % data_disks Calculate the indexes (pd_idx, qd_idx) of disks P and Q in the entire column group, where disk P is the target parity disk and disk Q is the parity disk to be removed: pd_idx=raid_disks-1-stripe%raid_disks qd_idx=pd_idx+1 Correct the target physical disk's sequence number (dd_idx) in the entire column: if pd_idx=raid_disks-1 dd_idx = dd_idx + 1 qd_idx=0 else if dd_idx>=pd_idx dd_idx = dd_idx + 2 Accordingly, the layout calculation formula for the completed area is as follows: Due to the downgrade migration, the completed area has one less raid_disks: raid_disks=raid_disks 1 Without considering the parity disk, the physical disk's index (dd_idx) in the entire column group: dd_idx = (lba / chunk) % data_disks Calculate the indexes (pd_idx, qd_idx) of disks P and Q in the entire column group: pd_idx=data_disks – stripe%raid_disks qd_idx = The sequence number of the disk to be removed in the entire column (the verification disk to be removed). Correct the target physical disk's sequence number (dd_idx) in the entire column: if dd_idx>=pd_idx dd_idx = dd_idx + 1 if dd_idx>=qd_idx dd_idx = dd_idx + 1 if pd_idx>=qd_idx qd_idx = qd_idx + 1 Accordingly, in one embodiment, when the verification unit to be removed is currently on the verification disk to be removed, the data unit, the verification unit to be migrated, and the verification unit to be removed are migrated to the corresponding disk according to the current disk information of the data unit, the verification unit to be migrated, and the verification unit to be removed.

[0050] Specifically, if the parity unit to be removed is currently on the parity disk to be removed, it indicates that the current layout of the stripe to be migrated conforms to the target RAID layout, so it can be migrated directly without recalculating the target data disk number and the target parity disk number.

[0051] Based on the above embodiments, as an implementable approach, in one embodiment, before removing the parity disk to be removed to switch the protection level of the completed area to the target RAID level, the method further includes: Step 501: Obtain the number of bad disks in the completed area; Step 502: If the number of bad disks does not exceed the protection range of the target RAID level, perform the step of removing the parity disk to be removed in order to switch the protection level of the completed area to the target RAID level. Step 503: If the number of bad disks exceeds the protection range of the target RAID level, perform data reconstruction on the newly added disk based on the parity disk to be removed. After the data reconstruction is completed, remove the parity disk to be removed to switch the protection level of the completed area to the target RAID level.

[0052] For example, such as Figure 9 The diagram shown illustrates an exemplary data reconstruction of the completed area according to an embodiment of this application. During RAID migration, when the migration waterline reaches the migration target location, the entire RAID array transforms into a completed area. In this state, even if a hard drive fails within the completed area, such as disk 1 and disk 2 failing simultaneously, the area can still maintain redundant protection for the two failed disks. This is because the RAID layout design adopted in this embodiment allows sufficient data redundancy to be maintained within the completed area during the migration process.

[0053] Specifically, upon detecting a faulty disk, immediate action can be taken to insert two new hard drives to replace the damaged disks 1 and 2. The system will then use the data on the remaining healthy hard drives (such as disks 3 and 4) to reconstruct the data on the newly inserted disks (the added disks). This reconstruction process restores the full redundancy of the RAID array, ensuring data integrity and availability. After the data reconstruction is complete, disk 3 is removed, completing the final step of the migration and downgrade process. At this point, the RAID group is downgraded from RAID 6 to RAID 5.

[0054] For example, such as Figure 10The diagram illustrates the overall flow of an exemplary RAID downgrade migration method provided in this application. First, the migration waterline is initialized to 0. Then, it is determined whether the number of bad disks is less than the protection range of the unstarted area and the target RAID. If so, the stripe to be migrated is migrated according to the process provided in the above embodiment; otherwise, the migration fails, and the migration process ends. To prevent data modification of the stripe to be migrated during the migration process, stripe locking can be used to mutually exclude the migration task (the stripe to be migrated) and host I / O (RAID access requests) before migration. This prevents stripe inconsistency caused by host I / O simultaneously writing to disks within the current stripe while the current stripe is being modified. Figure 10 The process shown is as follows Figure 2 The illustrated process is an exemplary implementation, and the two implementations are based on the same principle, so they will not be described again.

[0055] Based on the above embodiments, as an implementable approach, in one embodiment, the method further includes: Step 401: Obtain RAID access request; Step 402: Determine the stripe to be accessed based on the RAID access request; Step 403: If the stripe to be accessed belongs to the completed area, respond to the RAID access request according to the target RAID layout; Step 404: If the stripe to be accessed is in an unstarted area, respond to the RAID access request according to the original RAID layout.

[0056] Specifically, such as Figure 11 The diagram illustrates the RAID access process provided in this embodiment. First, an IO request (RAID access request) from the host is received. This request includes the SLBA (Start Logical Block Address) and NLB (Number of Logical Blocks). The stripe to be accessed is determined by calculating the start logical address. Then, it is determined whether the stripe to be accessed is greater than or equal to the migration waterline. If not, the stripe is determined to be in the completed area, and the data write-to-disk location is calculated based on the target RAID layout to respond to the RAID access request. If the stripe is in the unstarted area, the data write-to-disk location is calculated based on the original RAID layout. After processing the current request, the logical address is incremented, and the process is repeated until all blocks of the IO request have been processed (SLBA > SLBA + NLB). This ensures normal response to IO requests from different areas during the downgrade migration process, guaranteeing the continuity of service access.

[0057] Specifically, in one embodiment, during the migration process, the host I / O access patterns can be monitored and analyzed in real time. By statistically analyzing the access frequency of different logical block address ranges, hot data areas and cold data areas can be identified. Since the read and write response speed of the downgraded RAID level is faster, the stripes of hot data areas can be migrated first to improve the host I / O response speed.

[0058] The RAID downgrade migration method provided in this application uses a migration waterline to divide the completed area and the unstarted area during the downgrade migration process. The completed area retains the original RAID level parity disk and redundancy protection capabilities while being converted to the target RAID layout, ensuring that the RAID protection level does not decrease during the downgrade process. The parity disk to be removed is removed only after all stripes have been migrated. Therefore, it can solve the technical problem in related technologies where the data protection level drops instantaneously due to the reduction of parity disks during downgrade migration, resulting in data loss, and improves the security of RAID downgrade migration.

[0059] Furthermore, even in the event of a hard drive failure during migration, data remains protected and will not be lost, significantly enhancing data security. Utilizing migration waterlines and striped locking mechanisms, concurrent execution of data migration and I / O operations is achieved. This approach greatly reduces system maintenance time and improves system availability, ensuring service continuity and stability. Moreover, it allows for data relocation without requiring additional RAID checksum calculations. This optimization reduces computational overhead during migration, significantly improving migration efficiency and shortening migration time, thus enabling faster response to business needs.

[0060] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0061] The embodiments of this application also provide a RAID downgrade migration apparatus for performing the RAID downgrade migration method provided in the above embodiments.

[0062] like Figure 12 The diagram shown is a structural schematic of the RAID downgrade migration device provided in an embodiment of this application. The RAID downgrade migration device 120 includes: an acquisition module 1201, a partitioning module 1202, a selection module 1203, a migration module 1204, a loop module 1205, and a downgrade module 1206.

[0063] The system comprises the following modules: an acquisition module for obtaining RAID downgrade migration requirement information; a partitioning module for dividing the RAID storage area into a completed zone and an unstarted zone based on the RAID downgrade migration requirement information using a migration waterline; wherein the migration waterline is adjacent to the stripe with the smallest current stripe size in the unstarted zone, the completed zone adopts the target RAID layout and retains the original RAID level protection level, the unstarted zone maintains the original RAID layout, and the completed zone is empty at the initial migration state; a selection module for selecting the stripe with the smallest current stripe size in the unstarted zone as the current stripe to be migrated; a migration module for migrating the current stripe to be migrated to the completed zone according to the target RAID layout; a looping module for migrating unit stripes from the migration waterline to the completed zone and returning to the step of selecting the stripe with the smallest current stripe size in the unstarted zone as the current stripe to be migrated, until the migration waterline reaches the target position; wherein the unstarted zone is empty when the migration waterline reaches the target position; and a downgrade module for removing the parity disk to be removed to switch the protection level of the completed zone to the target RAID level.

[0064] For a description of the features in the embodiment corresponding to the RAID downgrade migration device, please refer to the relevant description of the embodiment corresponding to the RAID downgrade migration method, which will not be repeated here.

[0065] Embodiments of this application also provide an electronic device, such as... Figure 13 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described RAID downgrade migration method embodiments.

[0066] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described RAID downgrade migration method embodiments when running.

[0067] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0068] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the RAID downgrade migration method embodiments described above.

[0069] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described RAID downgrade migration method embodiments.

[0070] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0071] The foregoing has provided a detailed description of a RAID downgrade migration method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A RAID downgrade migration method, characterized in that, include: Obtain information on RAID downgrade migration requirements; Based on the RAID downgrade migration requirement information, the RAID storage area is divided into a completed area and an unstarted area through a migration waterline; wherein, the migration waterline is adjacent to the stripe with the smallest current stripe in the unstarted area, the completed area adopts the target RAID layout and retains the protection level of the original RAID level, the unstarted area maintains the original RAID layout, and the completed area is empty in the initial state of migration; The strip with the smallest current stripe in the unstarted region is taken as the current stripe to be migrated. Based on the target RAID layout, the current stripe to be migrated is migrated to the completed area; The migration waterline is migrated to the completed area, and the process returns to the step of taking the smallest current stripe in the unstarted area as the current stripe to be migrated, until the migration waterline migrates to the target position; wherein, when the migration waterline migrates to the target position, the unstarted area is empty; Remove the parity disk to be removed to switch the protection level of the completed area to the target RAID level.

2. The RAID downgrade migration method according to claim 1, characterized in that, Before selecting the stripe with the smallest current stripe in the unstarted region as the current stripe to be migrated, the method further includes: Obtain the number of bad disks in the unstarted area; If the number of bad disks does not exceed the protection range of the original RAID level, then the step of taking the stripe with the smallest current stripe in the unstarted area as the current stripe to be migrated is executed.

3. The RAID downgrade migration method according to claim 1, characterized in that, The current stripe to be migrated includes data units, verification units to be migrated, and verification units to be removed. The step of migrating the current stripe to be migrated to the completed area according to the target RAID layout includes: Determine whether the verification unit to be removed is currently on the verification disk to be removed; If the verification unit to be removed is not currently on the verification disk to be removed, the target data disk number is determined based on the logical address information of the data unit, the unit size, and the total number of data disks. For the verification units to be migrated in the current stripe to be migrated, the target verification disk number is determined based on the total number of data disks, the stripe size of the current stripe to be migrated, and the total number of disks. According to the target data disk serial number, the data unit is migrated to the corresponding target data disk; According to the target verification disk number, the verification unit to be migrated is migrated to the corresponding target verification disk; The verification unit to be removed is migrated to the verification disk to be removed.

4. The RAID downgrade migration method according to claim 3, characterized in that, The step of migrating the data unit to the corresponding target data disk according to the target data disk serial number includes: Determine whether there is a sequence number conflict between the target data disk serial number and the determined target verification disk serial number; In the absence of serial number conflicts, the data unit is migrated to the corresponding target data disk according to the target data disk serial number; In the event of a serial number conflict, the serial number of the target data disk is corrected, and the data unit is migrated to the target data disk corresponding to the corrected serial number.

5. The RAID downgrade migration method according to claim 3, characterized in that, The method further includes: If the verification unit to be removed is currently located on the verification disk to be removed, the data unit, the verification unit to be migrated, and the verification unit to be removed are migrated to the corresponding disks according to the current disk information of the data unit, the verification unit to be migrated, and the verification unit to be removed.

6. The RAID downgrade migration method according to claim 1, characterized in that, The method further includes: Obtain RAID access requests; Based on the RAID access request, determine the stripe to be accessed; If the stripe to be accessed belongs to a completed area, respond to the RAID access request according to the target RAID layout; If the stripe to be accessed is in an unstarted area, the RAID access request is responded to according to the original RAID layout.

7. The RAID downgrade migration method according to claim 1, characterized in that, Before removing the parity disk to be removed to switch the protection level of the completed area to the target RAID level, the method further includes: Obtain the number of bad disks in the completed area; If the number of bad disks does not exceed the protection range of the target RAID level, perform the step of removing the parity disk to be removed to switch the protection level of the completed area to the target RAID level; If the number of faulty disks exceeds the protection range of the target RAID level, the data of the newly added disk is reconstructed based on the parity disk to be removed. After the data reconstruction is completed, the step of removing the parity disk to be removed is executed to switch the protection level of the completed area to the target RAID level.

8. A RAID downgrade migration device, characterized in that, include: The acquisition module is used to obtain RAID downgrade migration requirement information; The partitioning module is used to divide the RAID storage area into a completed area and an unstarted area according to the RAID downgrade migration requirement information through a migration waterline; wherein, the migration waterline is adjacent to the stripe with the smallest current stripe in the unstarted area, the completed area adopts the target RAID layout and retains the protection level of the original RAID level, the unstarted area maintains the original RAID layout, and the completed area is empty in the initial state of migration; The selection module is used to select the stripe with the smallest current stripe in the unstarted region as the current stripe to be migrated. A migration module is used to migrate the current stripe to be migrated to the completed area according to the target RAID layout; The loop module is used to migrate the migration waterline to the completed area and return to the step of taking the smallest current stripe in the unstarted area as the current stripe to be migrated, until the migration waterline migrates to the target position; wherein, when the migration waterline migrates to the target position, the unstarted area is empty; The downgrade module is used to remove the parity disk to be removed, so as to switch the protection level of the completed area to the target RAID level.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the RAID downgrade migration method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the RAID downgrade migration method as described in any one of claims 1 to 7.