Data protection method in disk array capacity expansion state, terminal and storage medium
By calculating the overlap area size before and after disk array expansion and reserving a backup area, the problem of data loss during disk array expansion is solved, data security and stability are achieved, and storage resource utilization and hardware complexity are reduced.
Patent Information
- Application Number
- CN202411344492.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing technologies pose a risk of data loss during disk array expansion, especially in the initial stages, and hardware-based data protection solutions increase hardware design complexity and cost.
By calculating the size of the overlapping area before and after disk array expansion, a backup area of the corresponding size is reserved, and the data in the overlapping area is backed up to the backup area before expansion to ensure data security.
It ensures data security and stability during disk array expansion, reduces the storage resource utilization of the backup area, improves expansion efficiency, and simplifies hardware design.
Smart Images

Figure CN119292525A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of storage technology, and in particular relates to a data protection method, a terminal and a storage medium in a disk array expansion state. Background Art
[0002] From the perspective of data protection, the disk array expansion process is generally divided into the start-up phase and the ongoing phase. The characteristics of the start-up phase are that the "deformation areas" of the stripes before and after the expansion overlap in the physical space of the hard disk, which results in the newly generated data after the expansion in the overlapping area overwriting the original old data before the expansion. If an abnormality occurs during the expansion at this time, the old data is lost and cannot be restored. Therefore, special operations are required in the expansion start-up phase to achieve data protection. For the ongoing phase, since the RAID array expansion is to increase the disk capacity, the new and old deformation areas will "gradually move away". When the two deformation areas do not overlap, the expansion enters the ongoing phase. The characteristics of the ongoing phase are that the "deformation areas" before and after the expansion do not overlap in the physical space of the hard disk, and the newly generated data will not overwrite the old data. In this way, abnormalities during the expansion will not cause data loss, and no special processing is required.
[0003] Currently, in order to avoid data loss when expanding the RAID array, the industry generally adopts hardware methods (such as using supercapacitors). When an abnormality occurs, the data is saved to non-volatile memory through hardware logic. This implementation will increase the complexity of hardware logic design, increase product costs and complicate system logic. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a data protection method, a terminal and a storage medium in a disk array expansion state to solve the above-mentioned technical problems.
[0005] In a first aspect, the present invention provides a method for protecting data in a disk array expansion state, comprising: Calculating the size of the overlapping area of the disk based on the expansion information of the disk array, wherein the overlapping area is the data overlapping area before and after the expansion; Create a backup area on the disk that is no smaller than the overlap area; Before executing the capacity expansion, the original data in the overlapping area is backed up to the backup area.
[0006] By calculating the size of the overlapping area, a backup area of corresponding size is reserved, and by backing up the data in the overlapping area on the disk, the data security of the overlapping area is ensured.
[0007] In an optional implementation, calculating the size of the overlapping area of the disk based on the expansion information of the disk array includes: Acquire capacity expansion information of the disk array, wherein the capacity expansion information includes the number of data disks before and after the capacity expansion; Set the number of data disks before expansion to the number of stripes in the deformation area after expansion, and set the number of data disks after expansion to the number of stripes in the deformation area before expansion; The product of the number of strips in the deformation zone after expansion and the number of strips in the deformation zone before expansion is set as the number of strips in the overlapping zone.
[0008] This method can accurately calculate the size of the overlapping area, ensuring that the calculated overlapping area covers all actual overlapping areas, avoiding area omissions and ensuring data security.
[0009] In an optional implementation, creating a backup area on the disk that is no smaller than the overlap area includes: Obtaining basic information of the disk array to be created, the basic information including the number of disks in the disk array; Based on the basic information, historical expansion information is obtained from a database, where the historical expansion information includes the number of disks before and after the disk array is expanded; Extract the maximum number of disks after expansion from the corresponding historical expansion information, and calculate the maximum backup area based on the maximum number of disks after expansion; Based on the maximum backup area, a backup area of corresponding size is reserved when creating a disk array.
[0010] By pre-building the backup area, there is no need to perform the steps of building the backup area again when expanding the capacity, which improves the efficiency of disk array expansion.
[0011] In an optional implementation, creating a backup area on the disk that is no smaller than the overlap area includes: Based on the number of stripes corresponding to the disk overlap area, the front corresponding number of stripes are located as the disk overlap area, and the effective data volume of the original data in the disk overlap area is obtained; Calculating required storage resources based on the effective data volume; Based on the required storage resources, a backup area of corresponding size is divided on the disk.
[0012] Using this method to build a backup area can create a backup area of corresponding size according to backup needs, reducing the storage resource occupancy rate of the backup area.
[0013] In an optional embodiment, the method further comprises: Confirm that the original data in the overlapping area has been backed up and then perform capacity expansion; Get the expansion progress; The expansion of the overlapping area is confirmed to be complete based on the expansion progress, the backup data is cleared and the backup area is released.
[0014] In an optional implementation, obtaining the capacity expansion progress includes: Use the progress view command of the disk array card to obtain the status and expansion progress of the disk array.
[0015] In an optional implementation, confirming that the expansion of the overlapping area is complete based on the expansion progress includes: Set the target ratio of the overlapped area based on the ratio of the overlapped area to the total disk storage space; The progress percentage of the disk is obtained from the expansion progress, and it is determined whether the progress percentage reaches the target percentage. If the progress percentage reaches the target percentage, it is confirmed that the expansion of the overlapping area of the disk is completed.
[0016] In an optional embodiment, the method further comprises: If the expansion progress stagnates, the expansion progress confirms the location of the target deformation zone where there is an abnormality; If the target deformation area is within the overlapping area, restoring the data of the target deformation area based on the corresponding backup data in the backup area; If the target deformation area is not within the overlapping area, data recovery is not performed.
[0017] In a second aspect, the present invention provides a data protection system in a disk array expansion state, comprising: An overlap calculation module, used to calculate the size of the overlap area of the disk based on the expansion information of the disk array, wherein the overlap area is the data overlap area before and after the expansion; A backup setting module, used for creating a backup area on the disk that is not smaller than the overlap area; The backup execution module is used to back up the original data of the overlapping area to the backup area before executing the capacity expansion.
[0018] In a third aspect, a terminal is provided, including: processor, memory, wherein: The memory is used to store computer programs. The processor is used to call and run the computer program from the memory, so that the terminal executes the above-mentioned terminal method.
[0019] According to a fourth aspect, a computer storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the methods described in the above aspects.
[0020] The beneficial effect of the present invention lies in that the data protection method, terminal and storage medium provided by the present invention in the disk array expansion state, by constructing a backup area of corresponding size for the overlapping area, uses the backup area to back up the data in the overlapping area before performing the expansion, thereby ensuring the data security and stability of the disk array expansion process at the minimum cost.
[0021] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.
[0024] Figure 2 The figure is a schematic flow chart of the capacity expansion process of a method according to an embodiment of the present invention.
[0025] Figure 3 It is a schematic diagram of a backup area of a method according to an embodiment of the present invention.
[0026] Figure 4 FIG. 4 is a schematic diagram of an overlapping region of a method according to an embodiment of the present invention.
[0027] Figure 5 It is a schematic diagram of a deformation region of a method according to an embodiment of the present invention.
[0028] Figure 6 It is a schematic diagram of deformation and expansion of the overlapping area of a method according to an embodiment of the present invention.
[0029] Figure 7 It is a schematic diagram of deformation and expansion of non-overlapping areas of a method according to an embodiment of the present invention.
[0030] Figure 8 The present invention is a schematic flowchart of a method for processing capacity expansion exceptions according to an embodiment of the present invention.
[0031] Fig. 9 is a schematic block diagram of a system according to an embodiment of the present invention.
[0032] Fig.10 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0035] The key terms appearing in the present invention are explained below.
[0036] RAID: Redundant Array of Independent Disks A redundant array of independent disks, composed of many independent disks, combined into a disk group with huge capacity, using the additive effect of individual disks providing data to improve the performance of the entire disk system. Using this technology, data is cut into many segments and stored on each hard disk.
[0037] Chunk: refers to a block of data written to a physical disk at a time.
[0038] Stripe: Also known as a stripe, it is a collection of position-related chunks on different partitions of the array and is the unit for organizing blocks on different partitions.
[0039] Stripe width: The number of chunks that can be written in parallel, which is equal to the number of disks in the disk array, excluding the parity disk.
[0040] Stripe size: the size of the entire stripe, Stripe size=Chunk size*Stripewidth.
[0041] Transformation zone: Several continuous stripes that are being expanded (RAID array expansion is based on the transformation zone granularity).
[0042] The data protection method in the disk array expansion state provided by the embodiment of the present invention is executed by a computer device. Accordingly, the data protection system in the disk array expansion state runs in the computer device.
[0043] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention. Figure 1 The execution subject may be a data protection system in a disk array expansion state. According to different requirements, the order of the steps in the flow chart may be changed, and some may be omitted.
[0044] like Figure 1 As shown, the method includes: Step 110, calculating the size of the overlapping area of the disk based on the expansion information of the disk array, wherein the overlapping area is the data overlapping area before and after the expansion; Sub-step 111: First, clarify the disk array configuration before and after the expansion, including key information such as the number of disks, capacity, and RAID level.
[0045] Sub-step 112: Based on the configuration differences before and after the expansion, identify which disks or data blocks will directly participate in the expansion process, and determine which parts of these areas belong to the overlapping areas under the new and old configurations, that is, the overlapping areas.
[0046] Sub-step 113: Use disk array management software or professional tools to accurately calculate the total size of the overlapping area. Considering the data redundancy characteristics of the RAID level, it may be necessary to additionally calculate the space requirements for check data or parity bits.
[0047] Sub-step 114: Record the specific location, size and disk numbers of the overlapping area to prepare for subsequent operations.
[0048] Step 120, creating a backup area on the disk that is no smaller than the overlap area; Sub-step 121: Evaluate the available space of the existing disk array to ensure that there is enough space to create the backup area. If the space is insufficient, you may need to consider adding new disks or optimizing the existing storage layout.
[0049] Sub-step 122: According to the size of the overlapped area, sufficient space is planned and allocated in the disk array as a backup area. The size of the backup area should not be less than the total size of the overlapped area, and a certain amount of redundant space should be considered to cope with unexpected situations.
[0050] Sub-step 123: Use disk array management software to configure the backup area and ensure that its performance is equivalent to that of the overlapped area to ensure the efficiency of data backup and recovery.
[0051] Sub-step 124: Verify whether the backup area is created successfully and confirm that its status is available.
[0052] Step 130: before executing the capacity expansion, back up the original data in the overlapping area to the backup area.
[0053] Sub-step 131: Start the data backup process within the planned maintenance window. Ensure that the system load is low at this time to reduce the impact on the business.
[0054] Sub-step 132: Use an efficient data migration tool or script to copy all data (including user data and system metadata) in the overlapping area to the previously created backup area.
[0055] Sub-step 133: During the data migration process, a strict data verification mechanism is implemented to ensure the integrity and accuracy of the backup data.
[0056] Sub-step 134: After completing the data migration, a final data consistency check is performed to confirm that the data in the backup area is completely consistent with the original data in the overlap area.
[0057] Sub-step 135: Record detailed information of the backup operation, including time, data volume, operator, etc., to provide a basis for subsequent data recovery or auditing.
[0058] To facilitate understanding of the present invention, the data protection method in the disk array expansion state provided by the present invention is further described below based on the principle of the data protection method in the disk array expansion state of the present invention and the process of managing data protection in the disk array expansion state in the embodiment.
[0059] For details, please refer to Figure 2 , the data protection methods for disk array expansion include: S1. Create a backup area.
[0060] The basic information of the disk array to be created is obtained, wherein the basic information includes the number of disks of the disk array; based on the basic information, historical expansion information is obtained from a database, wherein the historical expansion information includes the number of disks before and after the expansion of the disk array; the maximum number of disks after expansion is extracted from the corresponding historical expansion information, and a maximum backup area is calculated based on the maximum number of disks after expansion; based on the maximum backup area, a backup area of corresponding size is reserved when creating the disk array.
[0061] Specifically, the following steps are included: Determine the project or task requirements and clarify the specific specifications and purpose of the disk array to be created.
[0062] The basic information of the disk array to be created is collected through configuration files, user input or system interface, including but not limited to: the disk array model planned to be deployed, the expected initial number of disks, the RAID level, etc.
[0063] Establish a connection to the database that stores historical expansion information to ensure that relevant data tables can be accessed.
[0064] According to the basic information of the disk array to be created (such as model, initial number of disks, etc.), construct query conditions to retrieve similar historical expansion records from the database.
[0065] Execute the query operation to retrieve all historical expansion information that meets the conditions from the database. This information should include the number of disks before and after the expansion, the expansion time, the operation results, etc.
[0066] Traverse the retrieved historical expansion information and extract the number of disks after expansion in each record.
[0067] Compare all extracted disk quantities after expansion and find the maximum value. This maximum value is the maximum disk quantity after expansion that can be achieved based on historical experience.
[0068] Based on the maximum number of disks after expansion, combined with the RAID level and data redundancy requirements of the current disk array, calculate the maximum data backup area size that may be required after maximum expansion.
[0069] Considering the redundancy and scalability of the backup area, it may be necessary to appropriately adjust the calculated maximum backup area size or increase a certain amount of buffer space.
[0070] In the initial configuration stage of the disk array, according to the maximum backup area size calculated in step 4, an area of corresponding size is reserved in the physical or logical space of the disk array as a backup area.
[0071] Configure the backup area's related parameters, such as RAID level and access rights, to ensure the security and reliability of the backup area.
[0072] Verify whether the backup area is created and configured successfully to ensure that the backup area is ready to receive backup data from the overlap area before the disk array is put into use.
[0073] For example, to create a 4-disk RAID 5, chunk=16K, when creating the RAID, reserve the expansion backup area according to the maximum value of the backup area required for expansion, and reserve 256M of expansion backup area for each disk. Figure 3 shown.
[0074] S2. Obtain expansion information.
[0075] For example, the number of stripes in the deformation zone before and after the expansion is determined. The number of stripes in the deformation zone before the expansion is 4, and the number of stripes in the deformation zone after the expansion is 3.
[0076] S3. Calculate the size of the overlapping area.
[0077] Acquire the expansion information of the disk array, wherein the expansion information includes the number of data disks before expansion and the number of data disks after expansion; set the number of data disks before expansion as the number of stripes in the deformation area after expansion, and set the number of data disks after expansion as the number of stripes in the deformation area before expansion; set the product of the number of stripes in the deformation area after expansion and the number of stripes in the deformation area before expansion as the number of stripes in the overlapping area.
[0078] This method can accurately calculate the size of the overlapping area, ensuring that the calculated overlapping area covers all actual overlapping areas, avoiding area omissions and ensuring data security.
[0079] Overlapping area Figure 4As shown in the figure, the "deformation area" of the stripes before and after the expansion overlaps in the physical space of the hard disk. In the overlapping area, the newly generated data after the expansion will overwrite the original old data before the expansion. If an exception occurs during the expansion at this time, the old data will be lost and cannot be recovered.
[0080] Methods for determining the size of the overlap area according to the RAID array expansion information include: Extract from the expansion information: the number of data disks before expansion: disk_num_x; the number of data disks after expansion: disk_num_y; Setting: Number of stripes in the overlapping area before expansion: stripe_num_x; Number of stripes in the overlapping area after expansion: stripe_num_y; Set the number of deformation zone strips before and after expansion: transform_stripe_num_x =disk_num_y; transform_stripe_num_y =disk_num_x; Determine the number of overlapping strips: stripe_num_x=transform_stripe_num_y*transform_stripe_num_x=disk_num_x*disk_num_y; The number of strips in the overlapping area meets this condition, and no overlap occurs in the deformation area after the overlapping area.
[0081] For example: RAID54 disks are expanded to 7 disks, transform_stripe_num_x=3, transform_stripe_num_y=6, stripe_num_x=3*6=18 (RAID5 includes 1 check disk); RAID65 disks are expanded to 9 disks, transform_stripe_num_x = 3, transform_stripe_num_y = 7, stripe_num_x = 3*7 = 21 (RAID6 includes 2 parity disks); When the RAID array is expanded, the number of stripes in the overlapping area meets the above conditions. After the RAID array expansion completes the initial stage, during the expansion phase, the front and rear deformation areas will never intersect.
[0082] Methods to prove that the deformation zone after expansion is below the deformation zone before expansion and does not intersect include: Stripe width before expansion: stripe_width_x=disk_num_x*chunk; Stripe width after expansion: stripe_width_y=disk_num_y*chunk; Number of chunks in the overlapping area before expansion: chunk_num_x=stripe_num_x*stripe_width_x; = disk_num_y*chunk*stripe_num_y; stripe_num_y=disk_num*disk_num; The stripe_id_x of the next stripe in the RAID overlap area before expansion is stripe_num_y+1; After the expansion, the stripe_id_y of the last stripe in the next transformation area of the RAID overlap area is equal to stripe_num_y + transform_stripe_num_y; Please refer to Figure 5 The deformation zone distribution in the expansion is that the strips of old and new are getting farther and farther away, so as long as the next deformation zone of the overlapping area does not intersect, the subsequent strips will never intersect.
[0083] Just verify: stripe_id_y>stripe_id_x; Get disk_num_x*(disk_num_y-disk_num_x+1)+1>0; The above inequality holds.
[0084] This indicates that the number of stripes in the overlapping area before expansion satisfies stripe_num_x=disk_num_x*disk_num_y, and the number of stripes in the transformed area before expansion satisfies transform_stripe_num_x=disk_num_y. When the RAID array is expanded, the stripes after the overlapping area will not overwrite the old data, so only the old data in the overlapping area needs to be saved. This ensures the data security of users when the RAID array is expanded.
[0085] For example, to determine the size of the overlapping area, the number of data disks before expansion is 3, the number of data disks after expansion is 4, and the number of overlapping area stripes before expansion is 12.
[0086] S4. Start capacity expansion.
[0087] (1) Confirm that the backup of the original data in the overlapping area is complete and perform capacity expansion; (2) Obtaining the expansion progress; Use the progress view command of the disk array card to obtain the status and expansion progress of the disk array. Specifically, the following steps are included: Enter the ADVANCE management interface, select the corresponding RAID card, and then enter the main menu→virtualdriver manager interface.
[0088] On the virtual driver manager interface, select the VD that is being expanded (for example, V239, RAID5).
[0089] Select the reconfigure virtual drives option in operation, then click GO.
[0090] In the next interface, select ADD DRIVES, change the hard disk status to enable, and apply the changes.
[0091] After confirming the changes, choose Start Operation.
[0092] Switch back to the virtual driver manager interface and view the rebuild status, which will reflect the expansion progress.
[0093] Use a command such as Storcli64 / c0 / v239 show to view the status of the RAID array. This will display the percentage of reconstruction, so you can understand the progress of the expansion.
[0094] (3) Confirming that the expansion of the overlapping area is complete based on the expansion progress, clearing the backup data and releasing the backup area.
[0095] A target proportion of the overlapping area is set based on the ratio of the overlapping area to the total storage space of the disk; the progress percentage of the disk is obtained from the expansion progress, and it is determined whether the progress percentage reaches the target proportion; if the progress percentage reaches the target proportion, it is confirmed that the expansion of the overlapping area of the disk is completed.
[0096] Specifically, the following steps are included: 1. Define the overlap target ratio and strategy Calculate the target ratio: First, the algorithm calculates the target ratio of the overlap area based on the total storage space of the disk, the current overlap area size, and the expected application requirements. This ratio can be a fixed value or dynamically adjusted based on disk usage and performance requirements.
[0097] Set the expansion policy: determine the trigger conditions for expansion (such as disk usage reaching a certain threshold), the priority of expansion (whether it takes precedence over other disk operations), and the step size or increment size of the expansion.
[0098] 2. Monitor and detect expansion progress Real-time monitoring: Use system monitoring tools or custom scripts to obtain the current status of the disk in real time, including the used space, free space, and the current size of the overlap area.
[0099] Progress calculation: Calculate the expansion progress percentage based on the current size of the overlap area and the expansion target. The progress percentage can be obtained by comparing the ratio of the current overlap area size to the target size.
[0100] The expansion of the overlap area is as follows Figure 6 After the overlap area is expanded, the original backed-up data can be deleted.
[0101] After that, the expansion of the non-overlapping area is performed normally, such as Figure 7 As shown in the figure, the non-overlapping area is expanded without backup until the entire RAID array is expanded.
[0102] S5. Exception handling.
[0103] If the expansion progress stagnates, the expansion progress confirms the location of the abnormal target deformation area; if the target deformation area is in the overlapping area, the data of the target deformation area is restored based on the corresponding backup data in the backup area; if the target deformation area is not in the overlapping area, data recovery is not performed.
[0104] For details, please refer to Figure 8 , including the following steps: After power-on, the software gets the expansion progress.
[0105] Through the expansion progress, we can find out in which deformation zone the abnormality occurred during the last expansion.
[0106] If the deformation area is in the overlapping area, the data in the deformation area in the RAID array is unreliable. The corresponding backup data is found in the expansion backup and the user data is successfully restored.
[0107] If the deformation area is outside the overlapping area, the data in the deformation area of the RAID array is reliable and does not need to be restored. In another embodiment of the present invention, the following steps are included: S1. Calculate the size of the overlapping area of the disk based on the expansion information of the disk array, where the overlapping area is the data overlapping area before and after the expansion.
[0108] Acquire the expansion information of the disk array, wherein the expansion information includes the number of data disks before expansion and the number of data disks after expansion; set the number of data disks before expansion as the number of stripes in the deformation area after expansion, and set the number of data disks after expansion as the number of stripes in the deformation area before expansion; set the product of the number of stripes in the deformation area after expansion and the number of stripes in the deformation area before expansion as the number of stripes in the overlapping area.
[0109] Specifically, the following steps are included: Collect expansion information: First, obtain detailed expansion information from the disk array management system. This information includes but is not limited to the number of data disks before expansion (N_before), the number of data disks after expansion (N_after), the capacity of each data disk, and the RAID level.
[0110] Understand the concept of overlap: The overlap refers to the overlap of data before and after expansion due to data migration and reorganization during the expansion process. This part of data needs to be specially processed to ensure data consistency and integrity.
[0111] Calculate the number of deformation zone stripes: The "number of deformation zone stripes" here directly uses the number of data disks as an indicator of striping.
[0112] Error handling: Check the validity of N_before and N_after to ensure that they are both positive integers and N_after>N_before.
[0113] Based on the calculation results, determine the size of the overlap area (in units of the number of stripes or actual storage capacity).
[0114] S2. Create a backup area on the disk that is no smaller than the overlap area.
[0115] Based on the number of stripes corresponding to the disk overlap area, the front corresponding number of stripes are positioned as the disk overlap area, and the effective data volume of the original data in the disk overlap area is obtained; the required storage resources are calculated based on the effective data volume; and a backup area of corresponding size is divided on the disk based on the required storage resources.
[0116] Using this method to build a backup area can create a backup area of corresponding size according to backup needs, reducing the storage resource occupancy rate of the backup area.
[0117] Specifically, the following steps are included: Locate the overlap area: Based on the current disk layout and expansion plan, accurately locate the overlap area in the disk array.
[0118] Evaluate the amount of valid data: Scan the overlapped area and evaluate the total amount of valid data (i.e., data that needs to be retained). This involves reading the data, checking the checksum, and identifying deleted or invalid data blocks.
[0119] Calculate required storage resources: Based on the amount of valid data, plus a certain amount of redundant space (for error recovery, future growth, etc.), calculate the minimum storage capacity required for the backup area.
[0120] Create a backup area: In the appropriate location of the disk array (usually the reserved unused space or the newly added disk), divide a sufficient area as the backup area. Make sure the size of the backup area is not less than the calculated required storage resources.
[0121] Optimize storage efficiency: Consider using storage optimization technologies such as compression and deduplication to reduce the actual space occupied by the backup area.
[0122] S3. Before executing the capacity expansion, back up the original data in the overlapping area to the backup area.
[0123] Prepare for backup operation: Confirm that the backup area has been created correctly and is available, and prepare to perform data backup operations.
[0124] Perform data migration: Migrate valid data in the overlap area to the backup area. Suspend or limit access to the overlap area to ensure data consistency and integrity.
[0125] Verify backup data: After the backup is complete, verify the integrity and accuracy of the backup data. This can be done by comparing checksums, performing recovery tests, etc.
[0126] Record backup information: Record detailed information of the backup operation, including backup time, backup location, backup data volume, etc., for future recovery or audit use.
[0127] Continue capacity expansion: After confirming that the backup is successful, continue to expand the disk array. This may include adding new data disks, reconfiguring RAID levels, and rebalancing data.
[0128] In some embodiments, the data protection system in the disk array expansion state may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the data protection system in the disk array expansion state may be stored in the memory of the computer device and executed by at least one processor to execute (see Figure 1 Description) Data protection function when the disk array is expanded.
[0129] In this embodiment, the data protection system in the disk array expansion state can be divided into multiple functional modules according to the functions it performs, such as Fig. 9 As shown. The functional modules of the system 900 may include: an overlap calculation module 910, a backup setting module 920 and a backup execution module 930. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0130] An overlap calculation module, used to calculate the size of the overlap area of the disk based on the expansion information of the disk array, wherein the overlap area is the data overlap area before and after the expansion; A backup setting module, used for creating a backup area on the disk that is not smaller than the overlap area; The backup execution module is used to back up the original data of the overlapping area to the backup area before executing the capacity expansion.
[0131] Optionally, as an embodiment of the present invention, calculating the size of the overlapping area of the disk based on the expansion information of the disk array includes: Acquire capacity expansion information of the disk array, wherein the capacity expansion information includes the number of data disks before and after the capacity expansion; Set the number of data disks before expansion to the number of stripes in the deformation area after expansion, and set the number of data disks after expansion to the number of stripes in the deformation area before expansion; The product of the number of strips in the deformation zone after expansion and the number of strips in the deformation zone before expansion is set as the number of strips in the overlapping zone.
[0132] Optionally, as an embodiment of the present invention, creating a backup area on the disk that is not smaller than the overlap area includes: Obtaining basic information of the disk array to be created, the basic information including the number of disks in the disk array; Based on the basic information, historical expansion information is obtained from a database, where the historical expansion information includes the number of disks before and after the disk array is expanded; Extract the maximum number of disks after expansion from the corresponding historical expansion information, and calculate the maximum backup area based on the maximum number of disks after expansion; Based on the maximum backup area, a backup area of corresponding size is reserved when creating a disk array.
[0133] Optionally, as an embodiment of the present invention, creating a backup area on the disk that is not smaller than the overlap area includes: Based on the number of stripes corresponding to the disk overlap area, the front corresponding number of stripes are located as the disk overlap area, and the effective data volume of the original data in the disk overlap area is obtained; Calculating required storage resources based on the effective data volume; Based on the required storage resources, a backup area of corresponding size is divided on the disk.
[0134] Optionally, as an embodiment of the present invention, it further includes: Confirm that the original data in the overlapping area has been backed up and then perform capacity expansion; Get the expansion progress; The expansion of the overlapping area is confirmed to be complete based on the expansion progress, the backup data is cleared and the backup area is released.
[0135] Optionally, as an embodiment of the present invention, obtaining the capacity expansion progress includes: Use the progress view command of the disk array card to obtain the status and expansion progress of the disk array.
[0136] Optionally, as an embodiment of the present invention, confirming that the expansion of the overlapping area is completed based on the expansion progress includes: Set the target ratio of the overlapped area based on the ratio of the overlapped area to the total disk storage space; The progress percentage of the disk is obtained from the expansion progress, and it is determined whether the progress percentage reaches the target percentage. If the progress percentage reaches the target percentage, it is confirmed that the expansion of the overlapping area of the disk is completed.
[0137] Optionally, as an embodiment of the present invention, it further includes: If the expansion progress stagnates, the expansion progress confirms the location of the target deformation zone where there is an abnormality; If the target deformation area is within the overlapping area, restoring the data of the target deformation area based on the corresponding backup data in the backup area; If the target deformation area is not within the overlapping area, data recovery is not performed.
[0138] Fig.10 The present invention provides a schematic diagram of the structure of a terminal 1000 provided in an embodiment of the present invention. The terminal 1000 can be used to execute the data protection method in the disk array expansion state provided in an embodiment of the present invention.
[0139] The terminal 1000 may include: a processor 1010, a memory 1020 and a communication unit 1030. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0140] The memory 1020 can be used to store the execution instructions of the processor 1010, and the memory 1020 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 1020 are executed by the processor 1010, the terminal 1000 can perform some or all of the steps in the following method embodiments.
[0141] The processor 1010 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 1020, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 1010 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0142] The communication unit 1030 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.
[0143] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0144] Therefore, the present invention constructs a backup area of corresponding size for the overlapping area, and uses the backup area to back up the data in the overlapping area before performing the expansion, thereby ensuring the data security and stability of the disk array expansion process at the lowest cost. The technical effects that can be achieved by this embodiment can be found in the description above and will not be repeated here.
[0145] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0146] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0147] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.
[0148] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0150] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.
Claims
1. A method for protecting data in a disk array expansion state, characterized in that: include: Calculating the size of the overlapping area of the disk based on the expansion information of the disk array, wherein the overlapping area is the data overlapping area before and after the expansion; Create a backup area on the disk that is no smaller than the overlap area; Before executing the capacity expansion, the original data in the overlapping area is backed up to the backup area.
2. The method according to claim 1, characterized in that The size of the disk overlap area is calculated based on the disk array expansion information, including: Acquire capacity expansion information of the disk array, wherein the capacity expansion information includes the number of data disks before and after the capacity expansion; Set the number of data disks before expansion to the number of stripes in the deformation area after expansion, and set the number of data disks after expansion to the number of stripes in the deformation area before expansion; The product of the number of strips in the deformation zone after expansion and the number of strips in the deformation zone before expansion is set as the number of strips in the overlapping zone.
3. The method according to claim 1, characterized in that Create a backup area on the disk that is no smaller than the overlap area, including: Obtaining basic information of the disk array to be created, the basic information including the number of disks in the disk array; Based on the basic information, historical expansion information is obtained from a database, where the historical expansion information includes the number of disks before and after the disk array is expanded; Extract the maximum number of disks after expansion from the corresponding historical expansion information, and calculate the maximum backup area based on the maximum number of disks after expansion; Based on the maximum backup area, a backup area of corresponding size is reserved when creating a disk array.
4. The method according to claim 2, characterized in that: Create a backup area on the disk that is no smaller than the overlap area, including: Based on the number of stripes corresponding to the disk overlap area, the front corresponding number of stripes are located as the disk overlap area, and the effective data volume of the original data in the disk overlap area is obtained; Calculating required storage resources based on the effective data volume; Based on the required storage resources, a backup area of corresponding size is divided on the disk.
5. The method according to claim 1, characterized in that The method further comprises: Confirm that the original data in the overlapping area has been backed up and then perform capacity expansion; Get the expansion progress; The expansion of the overlapping area is confirmed to be complete based on the expansion progress, the backup data is cleared and the backup area is released.
6. The method according to claim 5, characterized in that Get the expansion progress, including: Use the progress view command of the disk array card to obtain the status and expansion progress of the disk array.
7. The method according to claim 6, characterized in that Confirming the completion of the overlapping area expansion based on the expansion progress includes: Set the target ratio of the overlapped area based on the ratio of the overlapped area to the total disk storage space; The progress percentage of the disk is obtained from the expansion progress, and it is determined whether the progress percentage reaches the target percentage. If the progress percentage reaches the target percentage, it is confirmed that the expansion of the overlapping area of the disk is completed.
8. The method according to claim 5, characterized in that The method further comprises: If the expansion progress stagnates, the expansion progress confirms the location of the target deformation zone where there is an abnormality; If the target deformation area is within the overlapping area, restoring the data of the target deformation area based on the corresponding backup data in the backup area; If the target deformation area is not within the overlapping area, data recovery is not performed.
9. A terminal, characterized in that: include: A memory, used for storing a data protection program in a disk array expansion state; A processor is used to implement the steps of the data protection method in the disk array capacity expansion state as claimed in any one of claims 1 to 8 when executing the data protection program in the disk array capacity expansion state.
10. A computer-readable storage medium storing a computer program, characterized in that: The readable storage medium stores a data protection program in a disk array expansion state, and when the data protection program in the disk array expansion state is executed by the processor, the steps of the data protection method in a disk array expansion state as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Disk array capacity expansion method and system
CN102043589A
Storage system hard disk expansion realization method
CN107562377A
Disk array capacity expansion method and device
CN113849124A
Method for managing logical volume in order to support dynamic online resizing and software raid
US20030023811A1
Disk array device, method of extending storage capacity and computer program
US20050063217A1