A data migration method, device, equipment and medium are provided

By receiving data migration instructions, identifying the number of target blocks, and adjusting the increase or decrease of data blocks, the problem of data migration after adjusting hot standby strategies and RAID levels for user businesses is solved. This enables fast and flexible data migration, improves efficiency, and reduces the impact on front-end services.

CN119937923BActive Publication Date: 2025-12-16SUGON INFORMATION IND +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411998034.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-12-16
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In existing technologies, there is a lack of effective solutions for migrating stored data to comply with the new storage methods after users adjust their hot standby strategies and RAID levels.

Method used

By receiving data migration instructions, the number of target blocks is identified, the total number of adjusted check blocks and hot spare blocks is determined, and the increase or decrease of data blocks is determined based on the quantity relationship. The data is then migrated to the corresponding stripes to achieve flexible data migration.

Benefits of technology

It enables rapid and flexible data migration when adjusting hot standby strategies and RAID levels to conform to the new storage method, avoiding expansion operations, improving efficiency and reducing the impact on front-end business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937923B_ABST
    Figure CN119937923B_ABST
Patent Text Reader

Abstract

The application provides a storage data migration method and device, equipment and medium, which are used for quickly and flexibly migrating storage data. In the method, when a data migration instruction is received, a first total quantity of adjusted check blocks and hot standby blocks in a strip is determined; if the first total quantity is greater than a second total quantity of check blocks and hot standby blocks before adjustment, a second quantity of data blocks reduced in the strip is determined, and data in the second quantity of data blocks in each first strip where data has been written is migrated to data blocks in a second strip where data has not been written; if the first total quantity is less than the second total quantity, a third quantity of data blocks increased in the strip is determined, a third strip of data to be migrated in each strip where data has been written and a fourth strip to receive data are determined, and data of the data blocks in the third strip is migrated to the third quantity of data blocks in the corresponding fourth strip. Based on this, the storage data can be quickly and flexibly migrated to meet a new storage mode.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a storage data migration method and device, equipment and medium. BACKGROUND

[0002] The hot standby strategy refers to that data on a disk about to be damaged can be moved to a hot standby block (also referred to as a hot standby block) for data protection, so as to ensure the safety of data and the reliability of a system. Different hot standby strategies can correspond to different numbers of hot standby blocks. The check block refers to a block in a stripe used for storing check data, and different RAID levels can correspond to different numbers of check blocks, that is, different RAID levels correspond to different degrees of data redundancy.

[0003] The demand of user business on the hot standby strategy and the RAID level can be different in different stages, and therefore, the hot standby strategy and the RAID level are usually adjusted in use. After the hot standby strategy and the RAID level are adjusted, new data generated by the user business can be stored in a new storage mode, however, for the data (old data) already stored in the stripe, how to migrate the data to conform to the new storage mode, there is no good solution at present. SUMMARY

[0004] The present application provides a storage data migration method, device, equipment and medium, which are used for quickly and flexibly migrating storage data.

[0005] In a first aspect, the present application provides a storage data migration method, which comprises:

[0006] receiving a data migration instruction, wherein the data migration instruction carries a first number of target blocks in a stripe of a disk group (DG), and the target blocks comprise at least one of a check block and a hot standby block; determining a first total number of the adjusted check blocks and the hot standby blocks in the stripe according to the first number;

[0007] if the first total number is greater than a second total number of the hot standby blocks and the check blocks before adjustment, determining a second number of data blocks reduced in the stripe of the DG, and migrating data in the second number of data blocks in each first stripe having written data to data blocks in a second stripe not having written data;

[0008] if the first total number is less than the second total number, determining a third number of data blocks increased in the stripe of the DG, determining a third stripe of data to be migrated and a fourth stripe of data to be received in each stripe having written data, and migrating data in the data blocks in the third stripe to the third number of data blocks in the corresponding fourth stripe.

[0009] In the above manner, when the data migration instruction is received, the first total quantity of the adjusted check blocks and the hot backup blocks in the DG strip can be determined; if the first total quantity is greater than a second total quantity of the check blocks and the hot backup blocks in the strip before adjustment, a second quantity of data blocks reduced in the strip can be determined, and the data in the second quantity of data blocks in each first strip in which data has been written is migrated to the data blocks of a second strip in which data has not been written; if the first total quantity is less than the second total quantity, a third quantity of data blocks increased in the strip can be determined, a third strip in which data to be migrated and a fourth strip in which data to be received in each strip in which data has been written can be determined, the data of the data blocks in the third strip is migrated to the third quantity of data blocks in the corresponding fourth strip, based on which, when the hot backup strategy and the RAID level need to be adjusted, the stored data can be quickly and flexibly migrated to conform to the new storage mode.

[0010] In a possible implementation, the process of determining the strip in which data has been written includes:

[0011] identifying a reference number of the strip in which the latest data is currently written when the data migration instruction is received;

[0012] if the data is written in the order of the strip number from small to large, the strip with a number not greater than the reference number is determined as the strip in which data has been written;

[0013] if the data is written in the order of the strip number from large to small, the strip with a number not less than the reference number is determined as the strip in which data has been written.

[0014] In the above manner, since the reference number of the strip in which the latest data is currently written when the data migration instruction is received can be identified, the old data written (stored) in the strip before the data migration instruction is received can be quickly identified based on the size relationship between the reference number and the number of the strip, so that the old data to be migrated can be determined.

[0015] In a possible implementation, after the second quantity of data blocks reduced in the strip of the DG is determined, before the data in the second quantity of data blocks in each first strip in which data has been written is migrated to the data blocks of a second strip in which data has not been written, the method further includes:

[0016] determining whether the quantity of the adjusted data blocks in the strip is greater than 0; if yes, the subsequent step of migrating the data in the second quantity of data blocks in each first strip in which data has been written to the data blocks of a second strip in which data has not been written is performed.

[0017] By the above manner, after the second quantity of the data blocks in the stripe is determined to be reduced, it is judged whether the quantity of the adjusted data blocks in the stripe is greater than 0, and if greater than 0, the subsequent data migration process is performed, so that the user data can be safely, effectively and reliably stored to the maximum extent.

[0018] In a possible implementation, the method further includes:

[0019] If the quantity of the adjusted data blocks in the stripe of the DG is not greater than 0, the set error prompt information is output.

[0020] By the above manner, when the quantity of the adjusted data blocks in the stripe is identified to be not greater than 0, the set error prompt information is output, so that the case that the user data cannot be safely, effectively and reliably stored due to no data blocks configured in the stripe can be avoided to the maximum extent.

[0021] In a possible implementation, the determining the second quantity of the data blocks in the stripe of the DG includes:

[0022] The difference between the first total quantity and the second total quantity is determined as the second quantity.

[0023] By the above manner, when the hot backup strategy and the RAID level need to be adjusted, and the first total quantity of the check blocks and the hot backup blocks after the adjustment is greater than the second total quantity of the check blocks and the hot backup blocks before the adjustment, the difference between the first total quantity and the second total quantity is directly determined as the second quantity of the data blocks in the stripe that are reduced, so that the sum of the quantities of the data blocks, the check blocks and the hot backup blocks remains unchanged before and after the adjustment, the occupied data blocks, check blocks and hot backup blocks in the disk group are maximally utilized to support the adjustment of the hot backup strategy and the RAID level, and the adjustment of the hot backup strategy and the RAID level is supported by using new disks (i.e. expanding the disks in the disk group), so that the efficiency can be improved.

[0024] In a possible implementation, the determining the third quantity of the data blocks in the stripe of the DG includes:

[0025] The difference between the second total quantity and the first total quantity is determined as the third quantity.

[0026] By the above manner, when the hot backup strategy and the RAID level need to be adjusted, and the first total quantity of the adjusted check blocks and the hot backup blocks is less than the second total quantity of the check blocks and the hot backup blocks before the adjustment, the difference between the second total quantity and the first total quantity is directly determined as the third quantity of the increased data blocks in the stripe, so that the sum of the quantities of the data blocks, the check blocks and the hot backup blocks before and after the adjustment remains unchanged, the occupied data blocks, check blocks and hot backup blocks in the disk group are maximally utilized to support the adjustment of the hot backup strategy and the RAID level, and the adjustment of the hot backup strategy and the RAID level is supported by utilizing new disks (namely, expanding the disks in the disk group), so that the efficiency can be improved.

[0027] In a second aspect, the present application provides a storage data migration device having the functions of implementing the behaviors of the electronic device in the method embodiments of the first aspect, and the beneficial effects can be referred to the description of the first aspect and will not be repeated here. The storage data migration device comprises:

[0028] a receiving module configured to receive a data migration instruction, wherein the data migration instruction carries a first quantity of target blocks in a stripe of a disk group DG, the target blocks comprising at least one of check blocks and hot backup blocks, and determine a first total quantity of the adjusted check blocks and the hot backup blocks in the stripe according to the first quantity;

[0029] a first migration module configured to, if the first total quantity is greater than a second total quantity of the check blocks and the hot backup blocks before the adjustment, determine a second quantity of data blocks to be reduced in the stripe of the DG, and migrate the data in the second quantity of data blocks in each first stripe where data has been written to data blocks in a second stripe where data has not been written;

[0030] a second migration module configured to, if the first total quantity is less than the second total quantity, determine a third quantity of data blocks to be increased in the stripe of the DG, determine a third stripe of data to be migrated and a fourth stripe of data to be received in each stripe where data has been written, and migrate the data in the data blocks in the third stripe to the third quantity of data blocks in the corresponding fourth stripe.

[0031] In a possible implementation, the receiving module is further configured to:

[0032] identify a reference number of the stripe where the latest data is currently written when the data migration instruction is received;

[0033] if the data is written in the order of the stripe number from small to large when the data is written, determine the stripe with a number not greater than the reference number as the stripe where the data has been written;

[0034] If the data is written in the order from large to small according to the stripe number, the stripe with a number not less than the reference number is determined as the stripe with written data.

[0035] In a possible implementation, the first migration module is further configured to:

[0036] determine whether the number of adjusted data blocks in the stripe is greater than 0; if yes, perform the subsequent step of migrating the data in the second number of data blocks in each first stripe with written data to the data blocks in the second stripe without written data.

[0037] In a possible implementation, the apparatus further includes:

[0038] a prompt module configured to output a set error prompt information if the number of adjusted data blocks in the stripe of the DG is not greater than 0.

[0039] In a possible implementation, the first migration module is specifically configured to:

[0040] determine the difference between the first total number and the second total number as the second number.

[0041] In a possible implementation, the second migration module is specifically configured to:

[0042] determine the difference between the second total number and the first total number as the third number.

[0043] In a third aspect, the present application further provides an electronic device, including at least a processor and a memory, the processor being configured to execute the steps of the storage data migration method according to any one of the first aspect.

[0044] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program including program instructions, the program instructions causing the computer to execute the steps of the storage data migration method according to any one of the first aspect when the computer program is executed by the computer.

[0045] In a fifth aspect, the present application provides a computer program product, the computer program product including computer program code, the computer program code causing the computer to execute the steps of the storage data migration method according to any one of the first aspect when the computer program code is executed by the computer. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the implementation manners in the related art, the following will briefly introduce the drawings needed to be used in the embodiments or related art description. Obviously, the drawings described in the following are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.

[0047] Figure 1 A strip schematic diagram provided for the embodiments of the present application;

[0048] Figure 2 A storage data migration process schematic diagram provided for the embodiments of the present application;

[0049] Figure 3A Another storage data migration process schematic diagram provided for the embodiments of the present application;

[0050] Figure 3B Still another storage data migration process schematic diagram provided for the embodiments of the present application;

[0051] Figure 4A Still another storage data migration process schematic diagram provided for the embodiments of the present application;

[0052] Figure 4B Still another storage data migration process schematic diagram provided for the embodiments of the present application;

[0053] Figure 5 Still another storage data migration process schematic diagram provided for the embodiments of the present application;

[0054] Figure 6 A storage data migration device structure schematic diagram provided for the embodiments of the present application;

[0055] Figure 7 An electronic device structure schematic diagram provided for the embodiments of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose and implementation manners of the present application more clear, the following will combine the drawings in the exemplary embodiments of the present application to clearly and completely describe the exemplary implementation manners of the present application. Obviously, the described exemplary embodiments are only some embodiments of the present application, but not all the embodiments.

[0057] It should be noted that the brief description of the terms in the present application is only for the convenience of understanding the implementation manners described next, but is not intended to limit the implementation manners of the present application. Unless otherwise specified, these terms should be understood according to their ordinary and general meanings.

[0058] The terms "first", "second", "third", and the like in the description and in the claims of the present application and above-described drawings are used for distinguishing between similar or identical objects and entities, and do not necessarily indicate a specific order or sequence, unless otherwise specified. It is to be understood that the terms so used are interchangeable under appropriate circumstances.

[0059] The terms "comprise", "comprising", "include", "including", "have", "having", "contain", "containing", "characterized by" and the like are used broadly and mean "including at least" so that the term "comprising", "comprises" or "comprised of", for example, specifies the presence of stated features or components, but do not preclude the presence or addition of one or more other features, components, or steps.

[0060] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software codes that can perform the function related to the element.

[0061] It should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still make modifications to the technical solutions recorded in the foregoing embodiments, or equivalently replace some or all of the technical features thereof; the modifications or replacement do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0062] For the convenience of explanation, the above description has been made in combination with specific embodiments. However, the above exemplary discussion is not intended to exhaust or limit the embodiments to the specific forms disclosed above. Various modifications and variations can be derived according to the above teachings. The selection and description of the above embodiments are for better explanation of the principles and practical applications, so that those skilled in the art can better use the embodiments and various different modified embodiments suitable for specific use considerations.

[0063] The following first explains some terms in the embodiments of the present application, so as to facilitate the understanding of those skilled in the art.

[0064] Chunk: A partition is divided into multiple equal-sized, address-adjacent blocks, which are called chunks. It is an element that constitutes a stripe.

[0065] Stripe: Chunks of the same "position" (or the same number) on multiple disk drives in the same disk array. Please refer to Figure 1 , Figure 1 A stripe diagram provided by the embodiments of the present application, the chunks of the same "position" on the disk 0, the disk 1, the disk 2 and the disk 3 can constitute a stripe.

[0066] Data block: also known as data disk or data column, refers to the block in the stripe used to store user data.

[0067] Check block: also known as check disk or check column, refers to the block in the stripe used to store check data.

[0068] Disk group (DG): refers to a collection composed of multiple disks of the same type. For example, Figure 1 The disks 0, 1, 2, 3 and 5 (not shown in the figure) in the figure form a disk group.

[0069] Hot spare block: also known as hot spare disk, refers to the backup device provided in the disk group for storing data in the system, mainly used to provide data protection in the redundant array of independent disks (RAID) system. When a hard disk (disk) in the RAID system fails, the hot spare disk can immediately take over the work of the failed hard disk, ensuring the continuous operation of the system and the safety of the data.

[0070] Among them, for each stripe in any DG, the sum of the number of data blocks, the number of check blocks and the number of hot spare blocks in the stripe is not greater than the total number of disks contained in the DG. The process of data migration for storing data in each DG is the same, for the sake of understanding, the process of data migration is explained below with any DG as an example.

[0071] The embodiment of the application provides a kind of storage data migration method, device, equipment and medium, in which, when receiving data migration instruction, the first quantity of target block adjusted in the stripe of DG carried in the data migration instruction can be identified, wherein the target block can include at least one of check block and hot spare block, the first total quantity of adjusted check block and hot spare block in any stripe can be determined according to the first quantity of target block;If the first total quantity is greater than the second total quantity of check block and hot spare block in any stripe before adjustment, the second quantity of data block reduced in each stripe can be determined, and the data in the second quantity of data block in each first stripe that has been written into data is migrated to the data block of second stripe that has not been written into data;If the first total quantity is less than the second total quantity, the third quantity of data block increased in each stripe can be determined, the third stripe of data to be migrated in each stripe that has been written into data and the fourth stripe to be received data can be determined, the data of data block in the third stripe is migrated to the third quantity of data block in the corresponding fourth stripe, based on this, the purpose of quickly and flexibly migrating storage data when needing to adjust hot spare strategy and RAID level can be achieved.

[0072] Embodiment 1

[0073] Figure 2 A storage data migration process diagram is provided for the embodiments of the present application, and the process includes the following steps.

[0074] S201: receiving a data migration instruction, wherein the data migration instruction carries a first quantity of target blocks in a stripe of a disk group (Disk Groups, DG), and the target blocks include at least one of a check block and a hot spare block; and determining a first total quantity of the adjusted check blocks and the hot spare blocks in the stripe according to the first quantity.

[0075] The storage data migration method provided by the embodiments of the present application is applied to an electronic device, which can be, for example, a personal computer (PC), a mobile terminal, a server, etc., and the present application does not make a specific limitation on this.

[0076] In a possible implementation, when the RAID level needs to be adjusted, the user can input the quantity of the adjusted check blocks in the stripe, and similarly, when the hot spare strategy needs to be adjusted, the user can also input the quantity of the adjusted hot spare blocks. That is, the user can input the quantity of the adjusted check blocks in the stripe and the quantity of the adjusted hot spare blocks at the same time, or can only input the quantity of the adjusted check blocks or the quantity of the adjusted hot spare blocks. After the input is completed, the user can trigger the data migration instruction by clicking a "confirm adjustment" button or the like.

[0077] After receiving the data migration instruction, the electronic device can identify the first quantity of the target blocks in the stripe carried in the data migration instruction, wherein, for ease of description, the check blocks and / or the hot spare blocks whose quantity is adjusted in the data migration instruction are referred to as target blocks, that is, the target blocks can include at least one of the check blocks and the hot spare blocks. The first quantity of the target blocks in the stripe carried in the data migration instruction can include at least one of a first sub-quantity of the adjusted check blocks and a second sub-quantity of the adjusted hot spare blocks. The total quantity of the adjusted check blocks and the hot spare blocks in the stripe (referred to as the first total quantity for ease of description) can be determined according to the first quantity.

[0078] In the embodiments of the present application, the specific values of the first quantity and the first sub-quantity and the second sub-quantity included in the first quantity are not limited, for example, the first sub-quantity can be a value that is increased compared with that before the adjustment, or can be a value that is decreased compared with that before the adjustment. Similarly, the second sub-quantity can be a value that is increased compared with that before the adjustment, or can be a value that is decreased compared with that before the adjustment, and can be flexibly set according to requirements.

[0079] When the first quantity only contains the first sub-quantity of adjusted check blocks, it can be considered that only the quantity of check blocks is adjusted, and the quantity of hot spare blocks is not adjusted. The sum of the quantity of adjusted check blocks (the first sub-quantity) and the quantity of currently used hot spare blocks can be determined as the first total quantity of adjusted check blocks and hot spare blocks in the stripe.

[0080] When the first quantity only contains the second sub-quantity of adjusted hot spare blocks, it can be considered that only the quantity of hot spare blocks is adjusted, and the quantity of check blocks is not adjusted. The sum of the quantity of adjusted hot spare blocks (the second sub-quantity) and the quantity of currently used check blocks can be determined as the first total quantity of adjusted check blocks and hot spare blocks in the stripe.

[0081] When the first quantity contains both the first sub-quantity of adjusted check blocks and the second sub-quantity of adjusted hot spare blocks, it can be considered that the quantities of check blocks and hot spare blocks need to be adjusted simultaneously. The sum of the quantity of adjusted check blocks (the first sub-quantity) and the quantity of adjusted hot spare blocks (the second sub-quantity) can be determined as the first total quantity of adjusted check blocks and hot spare blocks in the stripe.

[0082] In a possible implementation, when the RAID level needs to be adjusted, in addition to inputting the quantity of adjusted check blocks in the stripe of the DG, the user can also input the adjusted RAID level (such as RAID5 or RAID6). After receiving the data migration instruction, the electronic device can determine the quantity of adjusted check blocks (the first sub-quantity) in the stripe according to the pre-stored correspondence between the RAID level and the quantity of check blocks in the stripe. For example, when the adjusted RAID level is RAID6, it can be considered that the quantity of check blocks in the stripe needs to be adjusted to 2. When the adjusted RAID level is RAID5, it can be considered that the quantity of check blocks in the stripe needs to be adjusted to 1. Details are not described herein again.

[0083] S202: If the first total quantity is greater than the second total quantity of the hot spare blocks and the check blocks before adjustment, determining a second quantity of data blocks that are reduced in the stripe of the DG, and migrating data in the second quantity of data blocks in each first stripe in which data has been written to data blocks in a second stripe in which data has not been written.

[0084] After obtaining the first total quantity of adjusted check blocks and hot spare blocks in the stripe, the quantity of data blocks in the stripe can be adjusted according to the size relationship between the first total quantity of adjusted check blocks and hot spare blocks in the stripe and the total quantity of check blocks and hot spare blocks in the stripe before adjustment (referred to as the second total quantity for ease of description).

[0085] In a possible implementation, when the first total quantity of the check blocks and the hot spare blocks in the adjusted stripe is greater than the second total quantity of the check blocks and the hot spare blocks in the unadjusted stripe, it can be considered that the total quantity of the check blocks and the hot spare blocks in the stripe needs to be increased. In order to maximize the use of the occupied data blocks, check blocks and hot spare blocks in the disk group to support the adjustment of the hot spare strategy and the RAID level, avoid supporting the adjustment of the hot spare strategy and the RAID level by using new disks (i.e., expanding the disks in the disk group), and improve efficiency, the quantity of the data blocks in each stripe can be correspondingly reduced. Specifically, the quantity of the data blocks in each stripe that is reduced can be determined according to the difference between the first total quantity and the second total quantity. For example, the difference between the first total quantity and the second total quantity can be determined as the quantity of the data blocks in each stripe that is reduced (referred to as the second quantity for ease of description). For example, when the quantity of the hot spare blocks after adjustment is 2, the quantity of the check blocks after adjustment is 3, that is, the first total quantity is 5; the quantity of the hot spare blocks before adjustment is 1, and the quantity of the check blocks before adjustment is 2, that is, the second total quantity is 3, at this time, 2 data blocks in each stripe can be reduced.

[0086] The present application can directly determine the difference between the first total quantity and the second total quantity as the second quantity of the data blocks in the stripe that is reduced when the first total quantity of the check blocks and the hot spare blocks after adjustment is greater than the second total quantity of the check blocks and the hot spare blocks before adjustment, so that the sum of the quantities of the data blocks, the check blocks and the hot spare blocks before and after adjustment remains unchanged, the occupied data blocks, check blocks and hot spare blocks in the disk group are maximally used to support the adjustment of the hot spare strategy and the RAID level, the use of new disks (i.e., expanding the disks in the disk group) to support the adjustment of the hot spare strategy and the RAID level is avoided, and efficiency can be improved.

[0087] In a possible implementation, considering that user data is mainly stored in data blocks, the quantity of the data blocks in the stripe usually cannot be 0. In order to ensure that the user data can be effectively stored, when it is necessary to reduce the data blocks in the stripe, after the second quantity of the data blocks in the stripe that is reduced is determined, the quantity of the adjusted data blocks in the stripe can be obtained, and it can be judged whether the quantity of the adjusted data blocks in the stripe is greater than 0. If yes, the subsequent data migration process can be performed. If the quantity of the adjusted data blocks in the stripe is not greater than (less than or equal to) 0, it can be considered that the user data cannot be effectively stored at this time, and a set error prompt information can be output to prompt the user to re-modify the hot spare strategy, without performing the data migration process.

[0088] Since the application can determine the second quantity of data blocks reduced in the stripe, judge whether the quantity of adjusted data blocks in the stripe is greater than 0, if greater than 0, then perform the subsequent data migration process, thereby the user data can be stored safely, effectively and reliably to the greatest extent.

[0089] In addition, the application can also output the set error prompt information when it is identified that the quantity of adjusted data blocks in the stripe is not greater than 0, thereby the situation that the user data cannot be stored safely, effectively and reliably due to no data blocks configured in the stripe can be avoided to the greatest extent.

[0090] In a possible implementation, after the second quantity of data blocks reduced in the stripe is determined, the data migration process of the stored data can be performed. Specifically, the data in the second quantity of data blocks in each stripe (referred to as the first stripe for convenience of description) in which the data has been written in the DG can be migrated to the data blocks of a second stripe in which the data has not been written in the DG.

[0091] For example, it is assumed that before the hot standby strategy is adjusted, each stripe in the DG contains 5 data blocks, 2 check blocks, and the quantity of hot standby blocks is 1, that is, the composition of data blocks + check blocks + hot standby blocks is 5+2+1. It is assumed that after the hot standby strategy is adjusted, the quantity of hot standby blocks needs to be increased from 1 to 2, then the quantity of data blocks in each stripe can be reduced from 5 to 4, at this time the quantity of check blocks remains unchanged, and the composition of data blocks + check blocks + hot standby blocks is changed from 5+2+1 to 4+2+2. Please refer to Figure 3A , Figure 3A Another storage data migration process schematic diagram provided by the embodiment of the application is provided. When the stored data (old data) in the stripe is migrated, since the quantity of data blocks in each stripe is reduced by one, the data in the last data block, such as d15, d25, d35, d45, in each first stripe in which the data has been written (stored), such as stripe 1 (seg1), stripe 2 (seg2), stripe 3 (seg3) and stripe 4 (seg4) in the figure, can be migrated to a new stripe in which the data has not been written, such as stripe 5 (seg5) in the figure.

[0092] For another example, assume that before adjusting the hot spare strategy, each stripe in the DG contains 5 data blocks, 2 check blocks, and the number of hot spare blocks is 1, that is, the composition of data blocks + check blocks + hot spare blocks is 5 + 2 + 1. Assume that the number of hot spare blocks in the DG needs to be increased from 1 to 2, and the number of check blocks in each stripe needs to be increased from 2 to 3, and the composition of data blocks + check blocks + hot spare blocks can be changed from 5 + 2 + 1 to 3 + 3 + 2. At this time, the sum of the number of data blocks, the number of check blocks, and the number of hot spare blocks in each stripe remains unchanged before and after adjustment.

[0093] In a possible implementation, when only the number of check blocks needs to be adjusted, and the hot spare strategy does not need to be adjusted, the data migration instruction can only carry the adjusted number of check blocks (the first sub-number) in each stripe. For example, refer to Figure 3B , Figure 3B For another storage data migration process provided by an embodiment of the present application, assume that before adjusting the RAID level, each stripe in the DG contains 5 data blocks, 2 check blocks, and the number of hot spare blocks is 1, that is, the composition of data blocks + check blocks + hot spare blocks is 5 + 2 + 1. Assume that the number of check blocks needs to be adjusted, and the number of check blocks in each stripe needs to be increased from 2 to 3, and the number of hot spare blocks remains unchanged, and the composition of data blocks + check blocks + hot spare blocks can be changed from 5 + 2 + 1 to 4 + 3 + 1. It can be seen that the sum of the number of data blocks, the number of check blocks, and the number of hot spare blocks in the stripe remains unchanged before and after adjustment. When migrating the stored data (old data) in the stripe, refer to Figure 3B For example, when the number of data blocks in each stripe is reduced by one, the data in the last data block d15, d25, d35, and d45 in the stripe 1 (seg1), the stripe 2 (seg2), the stripe 3 (seg3), and the stripe 4 (seg4) can be migrated to a new stripe 5 (seg5) that has not yet written data. At the same time, in each stripe, the number of check blocks is increased by one, and the data in the check block in each stripe (stripe 1, stripe 2, stripe 3, stripe 4, and stripe 5) that has written data can be determined according to 3 check blocks in each stripe based on the EC algorithm. Figure 3A and Figure 3B In the embodiments shown in

[0094] In a possible implementation, the data in the check blocks in each stripe in which data is written can be determined according to the number of adjusted check blocks (first sub-number) in each stripe carried in the data migration instruction and the EC algorithm, which will not be repeated here.

[0095] S203: If the first total number is less than the second total number, determining a third number of data blocks added in the stripe of the DG, determining a third stripe in which data is to be migrated and a fourth stripe in which data is to be received in each stripe in which data is written, and migrating the data of the data blocks in the third stripe to the third number of data blocks in the corresponding fourth stripe.

[0096] In a possible implementation, when the total number of adjusted check blocks and hot spare blocks (first total number) is less than the total number of check blocks and hot spare blocks before adjustment (second total number), it can be considered that the total number of check blocks and hot spare blocks needs to be reduced at this time, and at this time, the number of data blocks in each stripe can be correspondingly increased. Specifically, the number of data blocks added in each stripe can be determined according to the difference between the second total number and the first total number. For example, the difference between the second total number and the first total number can be determined as the number of data blocks added in each stripe (referred to as a third number for ease of description). For example, when the number of adjusted hot spare blocks is 1, the number of hot spare blocks before adjustment is 2, and the number of check blocks does not need to be adjusted, it can be considered that one hot spare block needs to be reduced, and at this time, one data block can be added in each stripe.

[0097] The present application can directly determine the difference between the second total number and the first total number as the third number of data blocks added in the stripe when the first total number of adjusted check blocks and hot spare blocks is less than the second total number of check blocks and hot spare blocks before adjustment, which can keep the sum of the number of data blocks, check blocks and hot spare blocks unchanged before and after adjustment, maximize the use of the occupied data blocks, check blocks and hot spare blocks in the disk group to support adjustment of the hot spare strategy and the RAID level, and avoid supporting adjustment of the hot spare strategy and the RAID level by using new disks (i.e., expanding the disks in the disk group), which can improve efficiency.

[0098] In a possible implementation, after the third number of data blocks added in each stripe is determined, the migration process of the stored data can be performed. Specifically, the data blocks in one or more stripes in which data is written (referred to as a third stripe for ease of description) can be disassembled and migrated to other stripes in which data is written (referred to as a fourth stripe for ease of description) to meet the new requirement for the number of data blocks in the stripe. For example, a third stripe in which data is to be migrated and a fourth stripe in which data is to be received in each stripe in which data is written can be determined, and the data of the data blocks in the third stripe can be migrated to the third number of data blocks in the corresponding fourth stripe.

[0099] For example, assume that before adjusting the hot spare strategy, each stripe in the DG contains 4 data blocks, 3 parity blocks, and the number of hot spare blocks is 2, that is, the composition of data blocks + parity blocks + hot spare blocks is 4 + 3 + 2. Assume that after adjusting the hot spare strategy, the number of hot spare blocks needs to be reduced from 2 to 1, and at this time the number of parity blocks remains unchanged, then the number of data blocks in each stripe can be increased from 4 to 5, that is, the composition of data blocks + parity blocks + hot spare blocks changes from 4 + 3 + 2 to 5 + 3 + 1. Please refer to Figure 4A , Figure 4A Another storage data migration process diagram provided by the embodiment of the present application is shown in the figure. When migrating the stored data (old data) in the stripe, since the number of data blocks in each stripe is increased by one, the data in the four data blocks d51, d52, d53, and d54 in the stripe 5 (the third stripe, which can also be referred to as the scattered stripe) in the figure can be migrated to one newly added data block in the four fourth stripes (stripe 1, stripe 2, stripe 3, and stripe 4), and one data block is added to each of the stripe 1, the stripe 2, the stripe 3, and the stripe 4.

[0100] For example, assume that before adjusting the hot spare strategy, each stripe in the DG contains 4 data blocks, 3 parity blocks, and the number of hot spare blocks is 1, that is, the composition of data blocks + parity blocks + hot spare blocks is 4 + 3 + 1. Assume that the number of parity blocks (RAID redundancy) needs to be adjusted, and the number of hot spare blocks does not need to be adjusted, and the number of parity blocks in each stripe needs to be reduced from 3 to 2, then the number of data blocks in each stripe can be increased from 4 to 5, that is, the composition of data blocks + parity blocks + hot spare blocks changes from 4 + 3 + 1 to 5 + 2 + 1. Please refer to Figure 4B , Figure 4B Another storage data migration process diagram provided by the embodiment of the present application is shown in the figure. When migrating the stored data (old data) in the stripe, since the number of data blocks in each stripe is increased by one, the data in the four data blocks d51, d52, d53, and d54 in the stripe 5 (the third stripe) in the figure can be migrated to one newly added data block in the four fourth stripes (stripe 1, stripe 2, stripe 3, and stripe 4), and one data block is added to each of the stripe 1, the stripe 2, the stripe 3, and the stripe 4. At the same time, in each stripe, the number of parity blocks is reduced by one, and the data in the parity blocks in each stripe (stripe 1, stripe 2, stripe 3, and stripe 4) that has data can be determined based on the EC algorithm according to 2 parity blocks in each stripe, which will not be described here. In the embodiments shown in Figure 4A and Figure 4B Since the number of data blocks in each stripe is increased, it can be considered that the user space is increased after adjustment than before adjustment, and the storage rate of effective data is also increased accordingly. ​​​​​​

[0101] In a possible implementation, considering that the sum of the number of data blocks, the number of check blocks and the number of hot spare blocks in a stripe cannot exceed the total number of disks contained in the corresponding DG, in order to ensure the accuracy of data migration, after the number of data blocks in the adjusted stripe and the first total number of check blocks and hot spare blocks are determined, the sum of the number of data blocks and the first total number can be calculated, and it is determined whether the sum exceeds (is greater than or equal to) the number of disks contained in the DG. If not, the above data migration process can be normally performed. If the sum of the three numbers exceeds the number of disks contained in the DG, a set error prompt message can be output to prompt the user to modify the RAID level and the like, and the corresponding data migration process is not performed, thereby avoiding the case that no data block, check block or hot spare block configured in the stripe meets the user's requirements to the greatest extent, and ensuring the accuracy of data migration and storage.

[0102] In the embodiments of the present application, when the data migration instruction is received, the first number of target blocks in the stripe carried in the data migration instruction can be identified, wherein the target blocks include at least one of the check blocks and the hot spare blocks. The first total number of the adjusted check blocks and the hot spare blocks in the stripe can be determined according to the first number. If the first total number is greater than the second total number of the check blocks and the hot spare blocks in the stripe before adjustment, the second number of data blocks reduced in the stripe can be determined, and the data in the second number of data blocks in each first stripe where data has been written is migrated to the data blocks in the second stripe where data has not been written. If the first total number is less than the second total number, the third number of data blocks increased in the stripe can be determined, the third stripe of data to be migrated in each stripe where data has been written and the fourth stripe to receive data can be determined, and the data of the data blocks in the third stripe is migrated to the third number of data blocks in the corresponding fourth stripe. Based on this, when the hot spare strategy and the RAID level need to be adjusted, the stored data can be quickly and flexibly migrated to meet the new storage mode.

[0103] In addition, the present application can support simultaneous adjustment of the hot spare strategy and the RAID level. Compared with the independent and step-by-step operation of adjusting the hot spare strategy and the RAID level, one data migration process is needed when the hot spare strategy is adjusted, and another data migration process is needed when the RAID level is adjusted. The long-time data migration process in the background not only has a complicated and redundant operation process, but also may affect the front-end business input / output (Input / Output, IO). In the present application, the hot spare strategy and the RAID level are adjusted at the same time, which can effectively reduce the number of repeated disk reading and visiting, improve the migration efficiency, and minimize the impact on the front-end business IO.

[0104] In addition, after the hot backup strategy and the RAID level are adjusted, the new data generated can be stored based on a new storage mode, and the migration process of the old data is implemented asynchronously in the background without the need to specially migrate the old data by suspending the system or stopping the system, so that the continuity of the business is not affected, data loss is avoided, time is saved, and efficiency is improved.

[0105] In addition, compared with the hot backup strategy being fixed in the related art, which causes insufficient hot backup resources during a business peak period and waste of hot backup resources during a business valley period, the hot backup strategy can be adjusted by quickly and flexibly adjusting the number of hot backup blocks and data blocks in the application, so that the flexibility of hot backup resource utilization is improved, and the resource utilization rate is improved.

[0106] Embodiment 2

[0107] In order to quickly identify the old data that has been written (stored) in the stripe before the data migration instruction is received, and facilitate determination of the old data to be migrated, on the basis of the above embodiment, in the embodiment of the application, the process of determining the stripe in which data has been written includes:

[0108] identifying a reference number of a stripe in which the latest data is currently written when the data migration instruction is received;

[0109] If the data is written in the order of stripe numbers from small to large, the stripe with a number not greater than the reference number is determined as the stripe in which data has been written.

[0110] If the data is written in the order of stripe numbers from large to small, the stripe with a number not less than the reference number is determined as the stripe in which data has been written.

[0111] In a possible implementation, in order to quickly identify the old data that has been written (stored) in the stripe before the data migration instruction is received, the stripes can be numbered, and the data can be written in the stripes in sequence in the order of stripe numbers from large to small or from small to large. When the data migration instruction is received, the number (for the sake of description, referred to as a reference number) of the stripe in which the latest data is currently written can be identified. If the data is written in the stripe in the order of stripe numbers from small to large (monotonically increasing), the stripe with a number not greater than (less than or equal to) the reference number can be determined as the stripe in which data has been written. If the data is written in the stripe in the order of stripe numbers from large to small (monotonically decreasing), the stripe with a number not less than (greater than or equal to) the reference number can be determined as the stripe in which data has been written.

[0112] Since the application can identify the reference number of the stripe in which the latest written data is received when the data migration instruction is received, and based on the size relationship between the reference number and the number of the stripe, the old data written (stored) in the stripe before the data migration instruction is received is quickly identified, so as to facilitate the determination of the old data to be migrated.

[0113] Embodiment 3:

[0114] For the sake of understanding, the storage data migration process provided by the application is explained and described below through a specific embodiment. Referring to Figure 5 , Figure 5 Another storage data migration process provided by the embodiment of the application is shown in the figure, which includes the following steps:

[0115] S501: receiving a data migration instruction, identifying the first number of target blocks carried in the DG stripe in the data migration instruction, wherein the target blocks can include at least one of the check blocks and the hot standby blocks; determining the first total number of the adjusted check blocks and the hot standby blocks in the stripe according to the first number of the target blocks. In addition, the reference number of the stripe in which the latest written data is received at the time of receiving the data migration instruction can be identified; if the data is written in the order of the stripe number from small to large, the stripe with a number not greater than the reference number is determined as the stripe in which the data has been written; if the data is written in the order of the stripe number from large to small, the stripe with a number not less than the reference number is determined as the stripe in which the data has been written. If the first total number of the check blocks and the hot standby blocks in the adjusted stripe is greater than the second total number of the check blocks and the hot standby blocks in the adjusted stripe, S502 is performed; if the first total number of the check blocks and the hot standby blocks in the adjusted stripe is less than the second total number of the check blocks and the hot standby blocks in the adjusted stripe, S504 is performed.

[0116] S502: if the first total number is greater than the second total number, the difference between the first total number and the second total number is determined as the second number of the data blocks reduced in the stripe. If the number of the adjusted data blocks in the stripe is greater than 0, S503 is performed; otherwise, if the number of the adjusted data blocks in the stripe is not greater than 0, a set error prompt information is output.

[0117] S503: migrating the data in the second number of data blocks in each first stripe in which the data has been written to the data blocks in the second stripe which has not been written.

[0118] S504: if the first total number is less than the second total number, the difference between the second total number and the first total number is determined as the third number of the data blocks added in the stripe. The third stripe in which the data to be migrated is determined in each stripe in which the data has been written, and the fourth stripe in which the data is to be received, and the data in the data blocks in the third stripe is migrated to the third number of data blocks in the corresponding fourth stripe.

[0119] Embodiment 4:

[0120] Based on the same technical concept, on the basis of the above embodiments, the application provides a storage data migration device, Figure 6 A storage data migration device structure schematic diagram provided by the embodiment of the application is shown in the figure, which comprises: Figure 6

[0121] The receiving module 601 receives a data migration instruction, wherein the data migration instruction carries a first number of target blocks in a strip of a disk group DG, wherein the target blocks comprise at least one of a check block and a hot spare block; according to the first number, a first total number of adjusted check blocks and hot spare blocks in the strip is determined;

[0122] The first migration module 602 is configured to determine a second number of data blocks reduced in the strip of the DG if the first total number is greater than a second total number of the hot spare blocks and the check blocks before adjustment, and migrate data in the second number of data blocks in each first strip in which data has been written to data blocks in a second strip in which data has not been written.

[0123] The second migration module 603 is configured to determine a third number of data blocks increased in the strip of the DG if the first total number is less than the second total number, determine a third strip of data to be migrated and a fourth strip of data to be received in each strip in which data has been written, and migrate data in data blocks in the third strip to data blocks in the third number in the corresponding fourth strip.

[0124] In a possible implementation, the receiving module 601 is further configured to:

[0125] identify a reference number of a strip in which the latest data is currently written when the data migration instruction is received;

[0126] if data is written in the order of strip numbers from small to large, then the strip with a number not greater than the reference number is determined as the strip in which data has been written;

[0127] if data is written in the order of strip numbers from large to small, then the strip with a number not less than the reference number is determined as the strip in which data has been written.

[0128] In a possible implementation, the first migration module 602 is further configured to:

[0129] determine whether the number of adjusted data blocks in the strip is greater than 0; if yes, then the subsequent step of migrating data in the second number of data blocks in each first strip in which data has been written to data blocks in a second strip in which data has not been written is performed.​

[0130] In a possible implementation, the apparatus further includes:

[0131] The prompt module 604 is configured to output the set error prompt information if the number of the adjusted data blocks in the strip of the DG is not greater than 0.

[0132] In a possible implementation, the first migration module 602 is specifically configured to:

[0133] The difference between the first total number and the second total number is determined as the second number.

[0134] In a possible implementation, the second migration module 603 is specifically configured to:

[0135] The difference between the second total number and the first total number is determined as the third number.

[0136] Embodiment 5:

[0137] Based on the same technical concept, the present application also provides an electronic device, Figure 7 A structural schematic diagram of an electronic device provided by the present application is shown in Figure 7 As shown in the figure, the electronic device includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704.

[0138] The memory 703 stores a computer program, and when the program is executed by the processor 701, the processor 701 is caused to execute the program to implement any of the above embodiments. Since the principle of the electronic device to solve the problem is similar to the data migration method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be described here.

[0139] The communication bus mentioned above can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or only one type of bus.

[0140] The communication interface 702 is used for communication between the electronic device and other devices.

[0141] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0142] The aforementioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc., and can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, etc.

[0143] Embodiment 6:

[0144] Based on the same technical concept, the embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device is caused to execute the above-mentioned any embodiment. Since the principle of the computer readable storage medium for solving the problem is similar to the data migration method, the implementation of the computer readable storage medium can be referred to the implementation of the method, and the repeated parts will not be repeated.

[0145] The aforementioned computer readable storage medium can be any available medium or data storage device accessible by the processor in the electronic device, including but not limited to a magnetic memory such as a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc., an optical memory such as a CD, a DVD, a BD, a HVD, etc., and a semiconductor memory such as a ROM, an EPROM, an EEPROM, a non-volatile memory (NAND FLASH), a solid state disk (SSD), etc.

[0146] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which comprises computer program code, when the computer program code runs on the computer, the computer executes any of the above-mentioned embodiments. Since the principle of the above-mentioned computer program product for solving the problem is similar to the data migration method, the implementation of the above-mentioned computer program product can be referred to the implementation of the method, and the repeated parts will not be repeated.

[0147] Those skilled in the art will appreciate that embodiments of the present application can be devised for a variety of applications. FIG. 1 illustrates an example of a system 100 that can employ an embodiment of the present application. As shown in FIG. 1, system 100 can include a host computer 110 that is configured to communicate via one or more wired or wireless communication links 120 with one or more client devices 130. Host computer 110 can include a processor 112, a storage 114, and a communications interface 116. Processor 112 can include one or more processors, such as one or more general purpose processors (e.g., as described below in connection with FIG. 2). Storage 114 can include one or more non-transitory computer-readable storage medium, such as one or more hard disk drives, flash memories, or the like. Storage 114 can store instructions 118 that are executable by processor 112 to implement a method, such as the method described below in connection with FIG. 3. Communications interface 116 can include one or more communications interfaces, such as an Ethernet interface, a Bluetooth interface, a Wi-Fi interface, or the like. Communications interface 116 can be configured to communicate with one or more client devices 130 via one or more wired or wireless communication links 120, such as one or more Ethernet links, one or more Bluetooth links, one or more Wi-Fi links, or the like.

[0148] The present application is described below in reference to flowcharts and / or block diagrams that illustrate the method, apparatus (system), and computer program product according to the present application. It will be understood that each block of the flowchart and / or block diagrams, and combinations of blocks in the flowchart and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, create means for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0149] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0151] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method for migrating stored data, characterized in that, The method includes: Receive a data migration instruction, the data migration instruction carrying a first number of adjusted target blocks in the stripe of disk group DG, wherein the target blocks include parity blocks and hot spare blocks; determine a first total number of adjusted parity blocks and hot spare blocks in the stripe based on the first number; If the first total number is greater than the second total number of hot spare blocks and check blocks before adjustment, then the second number of data blocks in the stripe of the DG is reduced, and the data in the second number of data blocks in each first stripe that has been written to data is migrated to the data blocks in the second stripe that has not yet been written to data. If the first total quantity is less than the second total quantity, then a third quantity of data blocks is added to the stripe of the DG; the third stripe of data to be migrated and the fourth stripe of data to be received are determined in each stripe of data that has been written; and the data of the data blocks in the third stripe are migrated to the third quantity of data blocks in the corresponding fourth stripe. Before and after the adjustment, the total number of data blocks, check blocks, and hot spare blocks remains unchanged.

2. The method according to claim 1, characterized in that, The process of determining the stripes of data that have been written includes: Identify the reference number of the stripe containing the most recently written data when the data migration instruction is received; If data is written in ascending order of stripe number, then stripes with numbers no greater than the reference number are identified as stripes with written data. If data is written in descending order of stripe number, then the stripes with numbers not less than the reference number are identified as stripes with written data.

3. The method according to claim 1, characterized in that, After determining the second number of data blocks reduced in the stripe of the DG, and before migrating the data in the second number of data blocks in each first stripe that has already been written to data blocks in the second stripe that has not yet been written to data, the method further includes: Determine whether the number of adjusted data blocks in the strip is greater than 0; if so, proceed to the next step of migrating the data in the second number of data blocks in each first strip where data has been written to the data blocks in the second strip where data has not yet been written.

4. The method according to claim 3, characterized in that, The method further includes: If the number of adjusted data blocks in the DG stripe is not greater than 0, then the set error message will be output.

5. The method according to claim 1, characterized in that, The determination of the second number of data blocks reduced in the stripe of the DG includes: The difference between the first total quantity and the second total quantity is determined as the second quantity.

6. The method according to claim 1, characterized in that, The determination of the third number of data blocks added in the stripe of the DG includes: The difference between the second total quantity and the first total quantity is determined as the third quantity.

7. A storage data migration device, characterized in that, The device includes: A receiving module is configured to receive a data migration instruction, the data migration instruction carrying a first number of adjusted target blocks in a stripe of a disk group (DG), wherein the target blocks include parity blocks and hot spare blocks; and to determine a first total number of adjusted parity blocks and hot spare blocks in the stripe based on the first number. The first migration module is used to determine the second number of data blocks reduced in the stripe of the DG if the first total number is greater than the second total number of hot spare blocks and check blocks before adjustment, and to migrate the data in the second number of data blocks in each first stripe that has been written to data blocks to the data blocks in the second stripe that has not yet been written to data. The second migration module is used to determine a third number of data blocks to be added to the stripe of the DG if the first total number is less than the second total number; determine the third stripe of data to be migrated and the fourth stripe of data to be received in each stripe of data that has been written; and migrate the data of the data blocks in the third stripe to the third number of data blocks in the corresponding fourth stripe. Before and after the adjustment, the total number of data blocks, check blocks, and hot spare blocks remains unchanged.

8. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, the processor being configured to implement the steps of the method as described in any one of claims 1-6 when executing a computer program stored in the memory.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Data migration systems and methods for independent storage device expansion and adaptation

    US20080195808A1