A method for automatically adjusting the number of hard disks in a RAID array card array
By introducing idle status monitor, capacity occupancy calculator and hard disk allocation calculator into the RAID control card, the number of hard disks is automatically adjusted, which solves the problem of inconvenient redistribution of hard disks of RAID control card and improves operation convenience.
Patent Information
- Application Number
- CN202211493416.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-25
AI Technical Summary
Existing RAID control cards cost a lot when reallocating the number of hard disks between different arrays, resulting in inconvenient operation.
Add an idle status monitor, capacity occupancy calculator, hard disk allocation calculator and data migration to the RAID control card. By automatically detecting and calculating the capacity occupancy ratio, the number of hard disks can be automatically adjusted, including the data migration process.
It realizes automatic adjustment of the number of multi-array hard disks on the RAID control card, avoiding the operation process of manually saving data and re-adjusting the array, and improving the convenience of use.
Smart Images

Figure CN115756332B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of storage, and in particular relates to a method for automatically adjusting the number of hard disks in a RAID array card array. Background Art
[0002] RAID array cards can organize multiple hard drives into a complete storage space, called an array. Arrays can be RAID0, RAID1, RAID5, or RAID6. Different levels of arrays have different data protection functions and access speeds, and the way data is stored and accessed on the hard drives is also different. RAID array cards can form multiple arrays to facilitate different levels of protection for different data. The basic architecture is as follows: Figure 1 As shown, Figure 1 The RAID array card manages two arrays, one at RAID 6 level and one at RAID 0 level.
[0003] Currently, RAID controller cards manage multiple arrays by simply determining the number of hard drives in an array when creating it, thereby locking in the array's maximum capacity. However, in daily use, it's common for arrays to be created without properly estimating their capacity, resulting in a smaller number of hard drives being allocated. When the array capacity becomes insufficient to store data, it becomes necessary to back up the data at considerable expense and then reallocate the hard drives between arrays to ensure that each array has a reasonable number of hard drives. Summary of the Invention
[0004] (1) Technical issues to be solved
[0005] The technical problem to be solved by the present invention is how to provide a method for automatically adjusting the number of hard disks in a RAID array card, so as to solve the problem that it is costly to reallocate the number of hard disks between different arrays by the current RAID control card.
[0006] (2) Technical solution
[0007] In order to solve the above technical problems, the present invention proposes a method for automatically adjusting the number of hard disks in a RAID array card array, the method comprising the following steps:
[0008] S101: When the RAID controller card is powered on, the idle state monitor detects the current operation status of the RAID controller card. If there is no data read or write task, a capacity calculation command is sent to the capacity occupancy calculator. If there is a data read or write task, the idle state monitor continues to query the status.
[0009] S102: After receiving the capacity calculation command, the capacity occupancy calculator starts to query the RAID array information currently managed by the RAID control card and calculates the capacity occupancy ratio of all arrays;
[0010] S103: If the capacity occupancy ratios of all arrays are within reasonable values, no operation is performed;
[0011] S104: If the capacity occupancy ratio of any array exceeds a reasonable value, the capacity occupancy calculator sends the capacity occupancy ratio of each array to the hard disk allocation calculator and sends a command to start the operation;
[0012] S105: After receiving the start command, the hard disk allocation calculator performs hard disk allocation calculation based on the capacity usage ratio of each array, the RAID level of each array, and the capacity and number of hard disks in each array, and attempts to adjust the number of hard disks in each array.
[0013] S106: If the hard disk allocation calculator fails to calculate a new hard disk allocation plan, the capacity occupancy ratio of each array is sent to the host computer management software;
[0014] S107, the host computer management software reminds the operator that the array capacity occupancy ratio exceeds the reasonable value;
[0015] S108: If the hard disk allocation calculator obtains a new hard disk allocation plan, the new allocation plan is fed back to the host computer management software;
[0016] S109, the upper computer management software displays the new allocation plan and waits for the RAID control card operator to determine whether to proceed with the new allocation plan;
[0017] S110, if the RAID control card operator rejects the new allocation plan, the host computer interface displays the capacity occupancy rate of the array to remind the operator to pay attention to the capacity;
[0018] S111. If the RAID controller card operator approves the new allocation plan, the host computer sends a command to the data migrator. After receiving the command, the data migrator adjusts the number of hard disks in the array and then starts to query the idle status monitor. If the idle status monitor shows that the RAID controller card is working, the data migrator stops working; if the idle status monitor shows that the RAID controller card is idle, the data migrator migrates the array data to the new array until all data migration is completed and the process ends.
[0019] Furthermore, the RAID control card architecture includes: an idle state monitor, a capacity occupancy calculator, a hard disk allocation calculator and a data migrator, and transmits the automatic adjustment result to the RAID controller management software of the host computer for display.
[0020] Furthermore, the RAID control card is connected to the host computer via a PCIE interface and is connected to the RAID array via a SATA interface.
[0021] Furthermore, the step S101 specifically includes: when the RAID controller card is powered on, the idle state monitor starts timing when the host issues a new command. When the host does not issue a new command during the N-second countdown, the idle state monitor regards the current state as the idle state and sends a calculation capacity command to the capacity occupancy calculator. If the host sends a new command operation within N seconds, the idle state monitor restarts the N-second countdown.
[0022] Furthermore, N=3.
[0023] Furthermore, the calculation of the capacity occupancy ratio of all arrays in step S102 specifically includes: reading the array information stored in each array to obtain the current data occupancy, then calculating the maximum capacity of each array, and dividing the calculated data occupancy by the maximum capacity to obtain the capacity occupancy ratio of each array.
[0024] Furthermore, a reasonable value is 90%.
[0025] Furthermore, the step S105 specifically includes the following steps:
[0026] S1051: Select the array with the lowest capacity utilization rate to perform capacity utilization analysis. Analyze the number of hard disks in the array based on the RAID level of the array to determine whether the number of hard disks in the array can still be used to form an array of the same RAID level if one hard disk is removed.
[0027] S1052: If not, proceed to the analysis and calculation of the next array;
[0028] S1053: If yes, calculate whether the capacity utilization rate of the array is still below 90% when one hard disk is removed;
[0029] S1054: If the result is above 90%, the analysis and calculation of the next array is performed;
[0030] S1055: If it is still below 90%, the array can be used as a hard disk donation array;
[0031] S1056: After obtaining the hard disk donation array, a new hard disk allocation plan for the hard disk donation array and the hard disk receiving array can be obtained, completing the calculation process of the hard disk allocation calculator.
[0032] Furthermore, the step S107 specifically includes: the upper computer management software reminds the RAID control card operator through a pop-up window on the display interface that the array capacity occupancy rate exceeds 90%, and displays the capacity occupancy rate of each array.
[0033] Furthermore, the step S111 specifically includes: if the RAID control card operator approves the new allocation plan, the host computer sends a command to the data migrator, and the data migrator executes the following steps after receiving the command:
[0034] S1111. Subtract 1 from the number of hard disks in the hard disk donation array and add 1 to the number of hard disks in the hard disk receiving array. S1112. Query the idle status monitor. If the idle status monitor indicates that the RAID controller card is working, the data migrator stops working and rechecks the status of the idle status monitor.
[0035] S1113. If the idle status monitor indicates that the RAID controller card is idle, the data migrator migrates the data of the hard disk donation array by reading the original data from the hard disk donation array with the original number of hard disks and then writing the data to the hard disk donation array with the number of hard disks minus 1.
[0036] S1114: After the data migration of the hard disk donating array is completed, the data migration of the hard disk receiving array is started;
[0037] S1115, reading the data from the original hard disk receiving array, and then writing the data into the hard disk receiving array after the number of hard disks is increased by 1;
[0038] S1116: The process ends when all data is migrated.
[0039] (3) Beneficial effects
[0040] The present invention provides a method for automatically adjusting the number of hard disks in a RAID array card array. The method adds an idle status monitor, a capacity occupancy calculator, an array hard disk allocation calculator, and a data migrator, and transmits the automatic adjustment results to RAID controller management software for display. This method realizes a function that can automatically adjust the number of hard disks in multiple arrays on a RAID controller card, avoids the manual data saving and array readjustment process caused by excessive array data storage on a traditional RAID array card, and improves the ease of use of the RAID array card. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is the basic architecture of RAID array card in the existing technology;
[0042] Figure 2 This is a schematic diagram of a method for automatically adjusting the number of hard disks in a RAID array card according to the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.
[0044] RAID (Redundant Array of Independent Disks) technology, also known as redundant array of independent hard drives, was originally designed to replace expensive, large-capacity hard drives by combining multiple hard drives. This technology also ensures that data integrity is preserved even if a single drive fails, thus ensuring data security. Through continuous development, RAID technology has become a comprehensive storage solution, increasing both capacity and speed, making data more secure and easier to manage. Precisely because of its high data reliability and fault tolerance, RAID technology is widely used in military storage systems.
[0045] The present invention proposes a RAID control card architecture and algorithm for automatically adjusting the number of hard disks in the array. The architecture can automatically adjust the number of hard disks in the RAID array by observing the space occupancy of the data in the RAID array, thereby solving the above problem.
[0046] The present invention adds an idle status monitor, a capacity usage calculator, a hard disk allocation calculator, and a data migrator to the traditional RAID controller card architecture. The automated adjustment results are transmitted to the RAID controller management software on the host computer for display. The RAID controller card connects to the host computer via a PCIE interface and to the RAID array via a SATA interface.
[0047] The architecture of the present invention is as follows Figure 2 As shown, the specific algorithm flow is as follows:
[0048] S101: When the RAID controller card is powered on, the idle state monitor detects the current operation status of the RAID controller card. If there is no data read or write task, a capacity calculation command is sent to the capacity occupancy calculator. If there is a data read or write task, the idle state monitor continues to query the status.
[0049] S102: After receiving the capacity calculation command, the capacity occupancy calculator starts to query the RAID array information currently managed by the RAID control card and calculates the capacity occupancy ratio of all arrays;
[0050] S103: If the capacity occupancy ratios of all arrays are within reasonable values, no operation is performed;
[0051] S104: If the capacity occupancy ratio of an array exceeds a reasonable value, the capacity occupancy calculator sends the capacity occupancy ratio of each array to the hard disk allocation calculator and sends a command to start the work;
[0052] S105: After receiving the start command, the hard disk allocation calculator performs hard disk allocation calculation based on the capacity usage ratio of each array, the RAID level of each array, and the capacity and number of hard disks in each array, and attempts to adjust the number of hard disks in each array.
[0053] S106: If the hard disk allocation calculator fails to calculate a new hard disk allocation plan, the capacity occupancy ratio of each array is sent to the host computer management software;
[0054] S107, the host computer management software reminds the operator that the array capacity occupancy ratio exceeds the reasonable value;
[0055] S108: If the hard disk allocation calculator obtains a new hard disk allocation plan, the new allocation plan is fed back to the host computer management software;
[0056] S109, the upper computer management software displays the new allocation plan and waits for the RAID control card operator to determine whether to proceed with the new allocation plan;
[0057] S110, if the RAID control card operator rejects the new allocation plan, the host computer interface displays the capacity occupancy rate of the array to remind the operator to pay attention to the capacity;
[0058] S111. If the RAID controller card operator approves the new allocation plan, the host computer sends a command to the data migrator. After receiving the command, the data migrator adjusts the number of hard disks in the array and then starts to query the idle status monitor. If the idle status monitor shows that the RAID controller card is working, the data migrator stops working; if the idle status monitor shows that the RAID controller card is idle, the data migrator migrates the array data to the new array until all data migration is completed and the process ends.
[0059] Example 1:
[0060] (1) When the RAID controller card is powered on, the idle state monitor starts counting when the host sends a new command. When the host does not send a new command during the 3-second countdown, the idle state monitor regards the current state as the idle state and sends a calculation capacity command to the capacity occupancy calculator. If the host sends a new command within 3 seconds, the idle state monitor restarts the 3-second countdown.
[0061] (2) After receiving the capacity calculation command, the capacity occupancy calculator starts to query the RAID array information currently managed by the RAID controller card, obtains the current data occupancy by reading the array information stored in each array, and then calculates the maximum capacity of each array. By dividing the calculated data occupancy by the maximum capacity, the capacity occupancy ratio of each array is obtained;
[0062] (3) If the capacity occupancy ratio of all arrays is within 90%, no operation is performed;
[0063] (4) If the capacity occupancy ratio of an array exceeds 90%, the capacity occupancy calculator sends the capacity occupancy ratio of each array to the hard disk allocation calculator and sends a command to start working;
[0064] (5) After receiving the start-up command, the hard disk allocation calculator selects the array with the lowest capacity occupancy rate to perform capacity occupancy rate analysis: a. Analyze the reduction of the number of hard disks in the array for the RAID level of this array. If one hard disk is reduced, can the number of hard disks in this array still form an array of this RAID level? b. If not, perform analysis and calculation for the next array. c. If so, calculate whether the capacity occupancy rate of this array is still below 90% when one hard disk is reduced. d. If it is above 90%, perform analysis and calculation for the next array. e. If it is still below 90%, this array can be used as a hard disk donation array. f. After obtaining the hard disk donation array, a new hard disk allocation plan for the hard disk donation array and the hard disk receiving array can be obtained, completing the calculation process of the hard disk allocation calculator.
[0065] (6) If the hard disk allocation calculator fails to calculate a new hard disk allocation plan, the capacity occupancy ratio of each array is sent to the host computer management software;
[0066] (7) The host computer management software will remind the RAID controller card operator through a pop-up window on the display interface that the array capacity occupancy rate exceeds 90%, and will also display the capacity occupancy rate of each array;
[0067] (8) If the hard disk allocation calculator obtains a new hard disk allocation plan, the new allocation plan is fed back to the host computer management software;
[0068] (9) The upper computer management software displays the new hard disk quantity allocation plan in a pop-up window on the display interface, waiting for the RAID control card operator to confirm whether to proceed with the new allocation plan;
[0069] (10) If the RAID controller card operator rejects the new allocation plan, the host computer interface will display the array capacity occupancy rate to remind the operator to pay attention to the capacity;
[0070] (11) If the RAID control card operator approves the new allocation plan, the host computer sends a command to the data migrator. After receiving the command, the data migrator: a. subtracts 1 from the number of hard disks in the hard disk donation array and adds 1 to the number of hard disks in the hard disk receiving array; b. queries the idle status monitor. If the idle status monitor shows that the RAID control card is working, the data migrator stops working and re-checks the status of the idle status monitor; c. If the idle status monitor shows that the RAID control card is idle, the data migrator migrates the data of the hard disk donation array, reads the original data from the hard disk donation array with the original number of hard disks, and then writes it to the hard disk donation array with the number of hard disks subtracted by 1; d. After the data migration of the hard disk donation array is completed, the data migration of the hard disk receiving array will begin; e. reads the data from the original hard disk receiving array and then writes it to the hard disk receiving array with the number of hard disks plus 1; d. The process ends until all data is migrated.
[0071] The present invention adds an idle status monitor, a capacity occupancy calculator, an array hard disk allocation calculator, and a data migrator, and transmits the automatic adjustment results to the RAID controller management software for display. This realizes a function that can automatically adjust the number of hard disks in multiple arrays on a RAID controller card, avoids the manual data saving and array readjustment operations caused by excessive array data storage on traditional RAID array cards, and improves the convenience of using the RAID array card.
[0072] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for automatically adjusting the number of hard disks in a RAID array card array, characterized in that: The method comprises the following steps: S101: When the RAID controller card is powered on, the idle state monitor detects the current operation status of the RAID controller card. If there is no data read or write task, a capacity calculation command is sent to the capacity occupancy calculator. If there is a data read or write task, the idle state monitor continues to query the status. S102: After receiving the capacity calculation command, the capacity occupancy calculator starts to query the RAID array information currently managed by the RAID control card and calculates the capacity occupancy ratio of all arrays; S103: If the capacity occupancy ratios of all arrays are within reasonable values, no operation is performed; S104: If the capacity occupancy ratio of any array exceeds a reasonable value, the capacity occupancy calculator sends the capacity occupancy ratio of each array to the hard disk allocation calculator and sends a command to start the operation; S105: After receiving the start command, the hard disk allocation calculator performs hard disk allocation calculation based on the capacity usage ratio of each array, the RAID level of each array, and the capacity and number of hard disks in each array, and attempts to adjust the number of hard disks in each array. S106: If the hard disk allocation calculator fails to calculate a new hard disk allocation plan, the capacity occupancy ratio of each array is sent to the host computer management software; S107, the host computer management software reminds the operator that the array capacity occupancy ratio exceeds the reasonable value; S108: If the hard disk allocation calculator obtains a new hard disk allocation plan, the new allocation plan is fed back to the host computer management software; S109, the upper computer management software displays the new allocation plan and waits for the RAID control card operator to determine whether to proceed with the new allocation plan; S110, if the RAID control card operator rejects the new allocation plan, the host computer interface displays the capacity occupancy rate of the array to remind the operator to pay attention to the capacity; S111. If the RAID controller card operator approves the new allocation plan, the host computer sends a command to the data migrator. After receiving the command, the data migrator adjusts the number of hard disks in the array and then starts to query the idle status monitor. If the idle status monitor shows that the RAID controller card is working, the data migrator stops working. If the idle status monitor shows that the RAID controller card is idle, the data migrator migrates the array data to the new array until all data migration is completed, and the process ends. in, The step S105 specifically includes the following steps: S1051: Select the array with the lowest capacity utilization rate to perform capacity utilization analysis. Analyze the number of hard disks in the array based on the RAID level of the array to determine whether the number of hard disks in the array can still be used to form an array of the same RAID level if one hard disk is removed. S1052: If not, proceed to the analysis and calculation of the next array; S1053: If yes, calculate whether the capacity utilization rate of the array is still below 90% when one hard disk is removed; S1054: If the result is above 90%, the analysis and calculation of the next array is performed; S1055: If it is still below 90%, the array can be used as a hard drive donation array. S1056: After obtaining the hard disk donation array, a new hard disk allocation plan for the hard disk donation array and the hard disk receiving array can be obtained, completing the calculation process of the hard disk allocation calculator.
2. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 1, wherein: The RAID control card architecture includes: an idle state monitor, a capacity occupancy calculator, a hard disk allocation calculator and a data migrator, and transmits the automatic adjustment result to the RAID controller management software of the host computer for display.
3. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 2, wherein: The RAID controller card is connected to the host computer through the PCIE interface and connected to the RAID array through the SATA interface.
4. The method for automatically adjusting the number of hard disks in a RAID array card according to any one of claims 1 to 3, wherein: The step S101 specifically includes: when the RAID controller card is powered on, the idle state monitor starts counting when the host issues a new command. When the host does not issue a new command during the N-second countdown, the idle state monitor regards the current state as the idle state and sends a calculation capacity command to the capacity occupancy calculator. If the host sends a new command within N seconds, the idle state monitor restarts the N-second countdown.
5. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 4, wherein: N=3。 6. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 4, wherein: Calculating the capacity occupancy ratio of all arrays in step S102 specifically includes: reading array information stored in each array to obtain the current data occupancy, then calculating the maximum capacity of each array, and dividing the calculated data occupancy by the maximum capacity to obtain the capacity occupancy ratio of each array.
7. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 6, wherein: A reasonable value is 90%.
8. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 6, wherein: The step S107 specifically includes: the upper computer management software reminds the RAID control card operator through a pop-up window on the display interface that the array capacity occupancy rate exceeds 90%, and displays the capacity occupancy rate of each array.
9. The method for automatically adjusting the number of hard disks in a RAID array card according to claim 6, wherein: The step S111 specifically includes: if the RAID control card operator approves the new allocation plan, the host computer sends a command to the data migrator, and the data migrator executes the following steps after receiving the command: S1111. Subtract 1 from the number of hard disks in the hard disk donation array and add 1 to the number of hard disks in the hard disk receiving array. S1112. Query the idle status monitor. If the idle status monitor indicates that the RAID controller card is working, the data migrator stops working and rechecks the status of the idle status monitor. S1113. If the idle status monitor indicates that the RAID controller card is idle, the data migrator migrates the data of the hard disk donation array by reading the original data from the hard disk donation array with the original number of hard disks and then writing the data to the hard disk donation array with the number of hard disks minus 1. S1114: After the data migration of the hard disk donating array is completed, the data migration of the hard disk receiving array is started; S1115, reading the data from the original hard disk receiving array, and then writing the data into the hard disk receiving array after the number of hard disks is increased by 1; S1116: The process ends when all data is migrated.
Citation Information
Patent Citations
Storage module and capacity pool free capacity adjustment method
CN101236480A
RAID-5 Full Flash Disk Array and Method for Increasing the Overall Life of the Array
CN109062506A