A data storage method and a data storage system
By dividing data blocks into different types of hard drives for storage, the load balancing problem is solved, and the storage system achieves high efficiency and reliability, especially in the event of hard drive failure, data can still be recovered.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2023-03-17
- Publication Date
- 2026-06-23
Smart Images

Figure CN116501247B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data storage method and a data storage system. Background Technology
[0002] With the continuous development of network technology, more and more data needs to be stored in various application scenarios. This necessitates significant expansion of existing distributed clusters as they age, requiring hard drives to possess high storage and read performance to meet the needs of different tasks. Consequently, more and more storage systems incorporate multiple types of hard drives. However, in scenarios involving both single-arm and dual-arm hard drives, how to achieve load balancing and rationally distribute data streams to the appropriate hard drives becomes crucial for data storage. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a data storage method and system that can improve the reliability and efficiency of data storage.
[0004] To solve the above-mentioned technical problems, one technical solution adopted in this application is: providing a data storage method, wherein the data storage method is applied to a storage system, the storage system including a first number of multi-arm hard disks and a second number of single-arm hard disks, the data storage method comprising: obtaining a plurality of data blocks corresponding to data to be stored; determining a third number of first data blocks and a fourth number of second data blocks from the plurality of data blocks based on the first number and the second number; wherein different first data blocks are used to store in different multi-arm hard disks, and different second data blocks are used to store in different single-arm hard disks; determining the target hard disk corresponding to each first data block and each second data block based on the hard disk status of each multi-arm hard disk and each single-arm hard disk; wherein the hard disks
[0005] The status is at least related to the utilization of the hard disk; the first data block and the second data block are stored to the corresponding target hard disk.
[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a data storage system, including a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method as described in any one of the above technical solutions.
[0007] The beneficial effects of this application are as follows: Unlike the prior art, this application proposes a data storage method that compiles the data to be stored into multiple data blocks, and divides the multiple data blocks into multiple first data blocks and multiple second data blocks according to the number of multi-arm hard drives and single-arm hard drives in the storage system. The first data blocks are used to store the data on the multi-arm hard drives, and the second data blocks are used to store the data on the single-arm hard drives, so that the data stream can be evenly stored on each hard drive in the storage system. At the same time, when some hard drives in the storage system are damaged, the data to be stored can still be restored using the data blocks in the undamaged hard drives, thereby improving the reliability and efficiency of data storage. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0009] Figure 1 This is a flowchart illustrating one embodiment of the data storage method of this application;
[0010] Figure 2 This is a schematic diagram of an embodiment preceding step S103;
[0011] Figure 3 yes Figure 1 The flowchart of step S103 corresponds to another embodiment;
[0012] Figure 4 This is a schematic diagram of step S203 corresponding to one embodiment;
[0013] Figure 5 This is a schematic diagram of one embodiment of the data storage device of this application;
[0014] Figure 6 This is a schematic diagram of one embodiment of the data storage system of this application. Detailed Implementation
[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0016] Please see Figure 1 , Figure 1This is a flowchart illustrating one embodiment of the data storage method of this application. In this embodiment, the data storage method is applied to a storage system, which includes a first number of multi-arm hard disks and a second number of single-arm hard disks. The multi-arm hard disks can be dual-arm, triple-arm, or quad-arm hard disks, etc. Specifically, the data storage method includes:
[0017] S101: Obtain multiple data blocks corresponding to the data to be stored.
[0018] In one embodiment, step S101 includes: obtaining the data to be stored in the storage system, and processing the data to generate multiple corresponding data blocks. The complete data to be stored can be restored from portions of the multiple data blocks to improve the reliability of data storage.
[0019] Specifically, erasure coding technology is used to divide the data to be stored into multiple data blocks, and by storing multiple data blocks on different hard drives, the loss of the entire data to be stored can be prevented due to the failure of some hard drives.
[0020] S102: Based on the first quantity and the second quantity, determine a third quantity of first data blocks and a fourth quantity of second data blocks from the multiple data blocks. Different first data blocks are used to store data in different multi-arm hard disks, and different second data blocks are used to store data in different single-arm hard disks.
[0021] In one embodiment, in response to the storage system including a first number of multi-arm hard disks and a second number of single-arm hard disks, a first sum of the first number and the second number is used as a first reference value. The ratio of the first number to the first reference value is used as a first weight, and the ratio of the second number to the first reference value is used as a second weight.
[0022] In response to a first quantity of n1 and a second quantity of n2, the formulas for calculating the first weight and the second weight are as follows:
[0023]
[0024] Where Q1 represents the first weight mentioned above, and Q2 represents the second weight mentioned above.
[0025] Furthermore, based on the product of the number of multiple data blocks and the first weight and the second weight, the multiple data blocks are divided into a third number of first data blocks and a fourth number of second data blocks. Each first data block is used to store in a multi-arm hard disk, and each second data block is used to store in a single-arm hard disk, and the hard disks used to store different data blocks are not the same.
[0026] Specifically, a first value is obtained by multiplying the total number of data blocks corresponding to the data to be stored by a first weight, and a second value is obtained by multiplying the total number of data blocks corresponding to the data to be stored by the first weight. Where both the first and second values are integers, the first value is used as the third quantity and the second value as the fourth quantity; where both the first and second values contain decimal parts, the rounded first value is used as the third quantity and the rounded second value as the fourth quantity. By dividing the data to be stored into multiple first data blocks and multiple second data blocks, the data stream can be evenly distributed across the hard drives in the storage system, thereby improving the efficiency of the storage system in storing data.
[0027] For example, if a storage system contains five multi-arm hard drives and four single-arm hard drives, and the data to be stored is compiled into five data blocks, then based on the above method, the first weight corresponding to the multi-arm hard drives is 5 / 9. Following the rounding principle, three data blocks are designated as the first data block. The remaining two data blocks are designated as the second data block.
[0028] S103: Based on the hard drive status of each multi-arm hard drive and each single-arm hard drive, determine the target hard drive corresponding to each first data block and each second data block. The hard drive status is at least related to the hard drive utilization rate.
[0029] In one embodiment, before step S103, the method includes determining a plurality of first candidate hard disk sets corresponding to all multi-arm hard disks, and determining a second candidate hard disk set corresponding to all single-arm hard disks.
[0030] Each multi-arm hard disk includes multiple single disks, and any first candidate hard disk set includes one single disk from each multi-arm hard disk. The number of first candidate hard disk sets is positively correlated with the number of arms of the multi-arm hard disk, and multiple first candidate hard disk sets are connected end to end. Each single-arm hard disk is set in a second candidate hard disk set.
[0031] Specifically, the number of individual disks in each multi-arm hard drive is the same as the number of arms in the corresponding multi-arm hard drive. For example, when a multi-arm hard drive is a dual-arm hard drive, it has two arms, which can simultaneously perform at least one of the storage and read operations on two different individual disks. Therefore, a dual-arm hard drive can be identified as two individual disks.
[0032] In response to the storage system containing a first number of multi-arm hard disks, each multi-arm hard disk comprising multiple individual disks, one individual disk is randomly selected from each multi-arm hard disk to form a first candidate hard disk set. Then, one more individual disk is randomly selected from the remaining individual disks in each multi-arm hard disk to form another first candidate hard disk set. This process is repeated until no individual disks remain in the multi-arm hard disks, resulting in multiple first candidate hard disk sets corresponding to the multiple multi-arm hard disks. The more arms a multi-arm hard disk has, the more first candidate hard disk sets it contains.
[0033] If one disk in a multi-arm hard disk (MAD) fails, the other disks in that MAD will also be damaged. Therefore, this embodiment divides the multiple MADs into multiple first candidate disk sets, ensuring that the disks in each first candidate disk set belong to different MADs. This avoids storing different data blocks simultaneously on multiple disks of the MAD. In other words, this embodiment improves the reliability of data storage.
[0034] Furthermore, the obtained multiple first candidate hard disk sets are arranged in a contiguous manner. For example, when four first candidate hard disk sets A, B, C, and D are obtained corresponding to multiple multi-arm hard disks, these four first candidate hard disk sets are arranged in the order "ABCDAB..." so that different first candidate hard disk sets are selected when storing different data to be stored, thereby promoting the even storage of multiple data to be stored on different disks of multiple multi-arm hard disks and improving the storage capacity of the storage system.
[0035] It should be noted that the steps of determining multiple first candidate hard disk sets and determining second candidate hard disk sets only need to be performed once before the storage system starts working.
[0036] In addition, in this embodiment, when the storage system is working, the first candidate hard disk in the first candidate hard disk set that is executing a preset instruction is moved to the third candidate hard disk set in advance; and the second candidate hard disk in the second candidate hard disk set that is executing a preset instruction is moved to the third candidate hard disk set in advance.
[0037] The aforementioned preset instructions include at least one of storage and retrieval. After completing the preset instructions, the hard disks in the third candidate hard disk set move from the third candidate hard disk set to the tail position of the corresponding first candidate hard disk set or second candidate hard disk set.
[0038] For example, please see Figure 2 , Figure 2 This is a schematic diagram corresponding to an embodiment prior to step S103. For example... Figure 2As shown in Figure a, when vdisk1-1, vdisk2-1, and vdisk3-1 in the first candidate hard disk set, and vdisk6 and vdisk7 in the second candidate hard disk set, are executing preset instructions, they are moved to the third candidate hard disk set. The moved first, second, and third candidate hard disk sets are as follows. Figure 2 As shown in b. After vdisk1-1, vdisk2-1, vdisk3-1, vdisk6, and vdisk7 complete their preset instructions, they are moved to the end of the corresponding candidate hard disk set. See reference [link / reference] for details. Figure 2 c. It should be noted that in practical applications, the corresponding hard drives can be added to the end of the corresponding candidate hard drive set according to the completion time of the preset instructions.
[0039] Further, step S103 includes: when storing the data to be stored, selecting one first candidate hard disk set from multiple first candidate hard disk sets as the current first candidate hard disk set.
[0040] Furthermore, based at least on the free hard drives in the first candidate hard drive set and the second candidate hard drive set, the target hard drives corresponding to each first data block and each second data block are determined. The free hard drives include those distinct from those in the third candidate hard drive set.
[0041] Specifically, the free hard drive refers to the hard drive in the current first candidate hard drive set and the second candidate hard drive set that does not execute the aforementioned preset instruction. For each first data block, a free hard drive is selected from the current first candidate hard drive set as the corresponding target hard drive; and for each second data block, a free hard drive is selected from the second candidate hard drive set as the corresponding target hard drive. By using free hard drives as the target hard drives for the first or second data blocks, storage efficiency can be improved.
[0042] S104: Store the first data block and the second data block to the corresponding target hard disk.
[0043] In one embodiment, step S104 includes: in response to obtaining the target hard disks corresponding to each first data block and each second data block through the above steps, storing the first data block to the corresponding target hard disk and storing the second data block to the corresponding target hard disk, so as to complete the storage of the data to be stored.
[0044] The data storage method proposed in this application compiles the data to be stored into multiple data blocks, and divides these data blocks into multiple first data blocks and multiple second data blocks according to the number of multi-arm hard drives and single-arm hard drives in the storage system. The first data blocks are used to store the data on the multi-arm hard drives, and the second data blocks are used to store the data on the single-arm hard drives, so that the data stream can be evenly distributed across the hard drives in the storage system. At the same time, when some hard drives in the storage system fail, the data to be stored can still be restored using the data blocks on the undamaged hard drives, thereby improving the reliability and efficiency of data storage.
[0045] In another embodiment, in response to the multiple candidate hard disk sets corresponding to multiple multi-arm hard disks being linked end-to-end, when the storage system is storing the currently pending data, or has completed storing the currently pending data, and is about to store the next pending data, the first candidate hard disk set after the current first candidate hard disk set is updated to the current first candidate hard disk set. For example, when multiple multi-arm hard disks correspond to four first candidate hard disk sets A, B, C, and D, and the current first candidate hard disk set is D, then when storing the next pending data, the first candidate hard disk set A is used as the current first candidate hard disk set.
[0046] Further, return to the step of obtaining multiple data blocks corresponding to the data to be stored, and execute them sequentially. Figure 1 The corresponding steps.
[0047] Please see Figure 3 , Figure 3 for Figure 1 The flowchart of another embodiment corresponds to step S103. Step S103 specifically includes:
[0048] S201: Determine whether the number of free hard drives in the current first candidate hard drive set and the second candidate hard drive set is greater than or equal to the second sum of the third and fourth numbers.
[0049] In one embodiment, in response to selecting one of the multiple first candidate hard disk sets corresponding to multiple multi-arm hard disks as the current first candidate hard disk set, and storing multiple first data blocks and second data blocks corresponding to the data to be stored based on the current first candidate hard disk set and the second candidate hard disk set.
[0050] In response to the fact that some of the first candidate hard disks in the current first candidate hard disk set are executing preset instructions, the first candidate hard disks are moved to the third candidate hard disk set. The number of free hard disks in the current first candidate hard disk set and second candidate hard disk set is obtained, and the second sum of the third and fourth numbers is obtained.
[0051] The number of free hard disks is compared with the second sum. If the number of free hard disks is greater than or equal to the second sum, step S202 is executed; if the number of free hard disks is less than the second sum, step S203 is executed.
[0052] S202: Determine the target hard disk corresponding to each first data block and each second data block from the free hard disk.
[0053] In one embodiment, step S202 includes: selecting free hard drives sequentially as the target hard drives corresponding to each first data block based on the order of free hard drives in the current first candidate hard drive set; and selecting free hard drives sequentially as the target hard drives corresponding to each second data block based on the order of free hard drives in the second candidate hard drive set.
[0054] Specifically, the free hard drives in the current first candidate hard drive set are sorted in descending order of storage space, and one free hard drive in the current first candidate hard drive set is selected as the target hard drive for the first data block according to the sorting order; and the free hard drives in the second candidate hard drive set are sorted in descending order of storage space, and one free hard drive in the second candidate hard drive set is selected as the target hard drive for the second data block according to the sorting order. For example, when there are two first data blocks, according to the sorting order of the free hard drives in the current first candidate hard drive set, the free hard drive ranked first is selected as the target hard drive for one first data block, and the free hard drive ranked second is selected as the target hard drive for the other first data block.
[0055] Optionally, in other embodiments, the free hard drives in the corresponding candidate hard drive sets can be sorted according to the numbering order of the multiple multi-arm hard drives or multiple single-arm hard drives in the storage system. For example, each multi-arm hard drive and each single-arm hard drive can be assigned a corresponding number, and the free hard drives in the current first candidate hard drive set can be sorted according to the corresponding number, as can the free hard drives in the second candidate hard drive set.
[0056] Furthermore, in response to determining the target hard disk corresponding to each first data block and each second data block, the target hard disk is moved to the third candidate hard disk set to facilitate subsequent data storage on the target hard disk within the third candidate hard disk set. This also ensures that both the current first and second candidate hard disk sets are currently free hard disks, thereby improving the efficiency of subsequent data storage and / or retrieval.
[0057] S203: Based on the free hard disks and at least some of the hard disks in the third candidate hard disk set, determine the target hard disks corresponding to each first data block and each second data block.
[0058] In one embodiment, step S203 includes: in response to the fact that the number of free hard disks is less than the second sum value, at least some of the remaining data blocks in the first data block and the second data block cannot find a corresponding free hard disk as the target hard disk. At this time, it is necessary to select a corresponding number of hard disks from the third candidate hard disk set as the target hard disks for each of the remaining data blocks.
[0059] Specifically, the number of free hard drives in the current first candidate hard drive set and second candidate hard drive set is obtained, and the third difference between the second sum and the number of free hard drives is obtained.
[0060] Furthermore, the hard drives in the third candidate hard drive set are arranged in order of utilization from low to high, and the hard drive with the third-highest utilization after sorting is used as a supplementary hard drive.
[0061] Optionally, the above utilization rate can be determined using the util metric, i.e., by setting up a hard disk performance monitoring module in the storage system to detect and obtain the util value of each hard disk in the third candidate hard disk set at preset intervals. Alternatively, the utilization rate can be determined based on the data size corresponding to the storage and / or read operations performed on each hard disk in the third candidate hard disk set.
[0062] It should be noted that when the selected supplementary hard drive is a single disk in a multi-arm hard drive, the supplementary hard drive is a single disk in the current first candidate hard drive set before being added to the third candidate hard drive.
[0063] Furthermore, the target hard drives corresponding to the first and second data blocks are determined based on the supplementary hard drive and the free hard drive.
[0064] Specifically, in response to selecting a portion of the third candidate hard disk set as supplementary hard disks, the total number of supplementary hard disks and free hard disks is consistent with the total number of the first data blocks and the second data blocks. First, based on the free hard disks in the current first candidate hard disk set, the target hard disks corresponding to a portion of the first data blocks are determined, and based on the free hard disks in the second candidate hard disk set, the target hard disks corresponding to a portion of the second data blocks are determined. The specific process can be referred to in step S202 above.
[0065] Furthermore, the target hard disk corresponding to each remaining data block is sequentially determined from the supplementary hard disk, with each remaining data block corresponding to one supplementary hard disk. After determining the target hard disks corresponding to each first data block and each second data block, the target hard disks are moved to the third candidate hard disk set.
[0066] In one specific implementation, please refer to Figure 4 , Figure 4This is a schematic diagram of an implementation method corresponding to step S203. The current first candidate hard disk set list1 includes free hard disks vdisk4-1 and vdisk5-1, and the second candidate hard disk set list2 includes free hard disk vdisk8. When the number of first data blocks is 3 and the number of second data blocks is 2, after setting vdisk4-1, vdisk5-1, and vdisk8 as the target hard disks for the corresponding data blocks, one first data block and one second data block remain without a corresponding target hard disk. At this time, two hard disks with lower utilization rates, vdisk6 and vdisk1-1, are selected from the third candidate hard disk list3 as supplementary hard disks, so that the remaining first and second data blocks obtain their corresponding target hard disks.
[0067] In another embodiment, in response to the number of free hard disks being greater than or equal to the second sum value, the method further includes the following step before step S202:
[0068] In response to the third quantity being greater than the number of free hard drives in the current first candidate hard drive set, a first difference is obtained between the third quantity and the number of free hard drives in the current first candidate hard drive set. The first data blocks corresponding to the first difference are then updated as second data blocks.
[0069] Specifically, when the third quantity is greater than the number of free hard drives in the current first candidate hard drive set, it indicates that at least some remaining first data blocks cannot find a corresponding free hard drive as the target hard drive in the current first candidate hard drive set. However, since the number of free hard drives in the current first and second candidate hard drive sets is greater than or equal to the total number of data blocks corresponding to the data to be stored, after determining the target hard drive for each second data block from the second candidate hard drive set, the number of remaining free hard drives in the second candidate hard drive set is greater than or equal to the number of remaining first data blocks. At this time, the first difference between the third quantity corresponding to all first data blocks and the number of free hard drives in the current first candidate hard drive set is obtained, and the first data blocks corresponding to the first difference value are updated as second data blocks. This ensures that after the update, all first data blocks can find a corresponding target hard drive in the corresponding current first candidate hard drive set, and all second data blocks can also obtain a corresponding target hard drive in the corresponding second candidate hard drive set. This avoids selecting the corresponding hard drive from the third candidate hard drive set as the target hard drive for the remaining first data blocks, improving data storage efficiency.
[0070] Alternatively, in response to the fourth quantity being greater than the number of free hard disks in the second candidate hard disk set, a second difference between the fourth quantity and the number of free hard disks in the second candidate hard disk set is obtained, and the second data blocks corresponding to the second difference are updated to the first data blocks.
[0071] Specifically, the fourth quantity corresponding to all second data blocks is obtained and the second difference between the number of free hard disks in the second candidate hard disk set is obtained, and the second data blocks corresponding to the second difference are updated to first data blocks; so that after the update, all first data blocks and all second data blocks can obtain the corresponding target hard disks from the corresponding candidate hard disk sets.
[0072] Furthermore, the target hard disk corresponding to each first data block and each second data block is determined from the free hard disk. The specific process can be referred to step S202 above, and will not be described in detail here.
[0073] Please see Figure 5 , Figure 5 This is a schematic diagram of one embodiment of the data storage device of this application. Specifically, the device includes an acquisition module 10, a first processing module 20, a second processing module 30, and a storage module 40 that are coupled to each other.
[0074] Specifically, the obtaining module 10 is used to obtain multiple data blocks corresponding to the data to be stored.
[0075] The first processing module 20 is used to determine a third number of first data blocks and a fourth number of second data blocks from a plurality of data blocks based on a first number and a second number. Different first data blocks are used to store data on different multi-arm hard drives, and different second data blocks are used to store data on different single-arm hard drives.
[0076] The second processing module 30 is used to determine the target hard disk corresponding to each first data block and each second data block based on the hard disk status of each multi-arm hard disk and each single-arm hard disk; wherein, the hard disk status is at least related to the utilization rate of the hard disk.
[0077] Storage module 40 is used to store the first data block and the second data block to the corresponding target hard disk.
[0078] Please see Figure 6 , Figure 6This is a schematic diagram of one embodiment of the data storage system of this application. The image selection model training device includes a memory 50 and a processor 60 coupled to each other. The processor 60 stores program instructions and is used to execute the program instructions to implement the data storage method in any of the above embodiments. Specifically, the processor 60 can also be called a CPU (Central Processing Unit). The processor 60 may be an integrated circuit chip with signal processing capabilities. The processor 60 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. In addition, the processor 60 can be implemented by an integrated circuit chip.
[0079] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0080] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0082] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data storage method, characterized in that, The data storage method is applied to a storage system, the storage system comprising a first number of multi-arm hard disks and a second number of single-arm hard disks, the data storage method comprising: Obtain multiple data blocks corresponding to the data to be stored; Based on the first quantity and the second quantity, a third quantity of first data blocks and a fourth quantity of second data blocks are determined from the plurality of data blocks; wherein different first data blocks are used to store in different multi-arm hard disks, and different second data blocks are used to store in different single-arm hard disks; Based on the hard drive status of each of the multi-arm hard drives and each of the single-arm hard drives, the target hard drives corresponding to each of the first data blocks and each of the second data blocks are determined respectively; wherein, the hard drive status is at least related to the utilization rate of the hard drive; Store the first data block and the second data block to the corresponding target hard disk; All of the multi-arm hard drives correspond to multiple first candidate hard drive sets, and all of the single-arm hard drives correspond to one second candidate hard drive set; wherein, each first candidate hard drive set contains a single disk belonging to a different multi-arm hard drive. The step of determining the target hard disk corresponding to each first data block and each second data block based on the hard disk status of each of the multi-arm hard disks and each of the single-arm hard disks includes: selecting one from a plurality of first candidate hard disk sets as the current first candidate hard disk set; determining the target hard disk corresponding to each first data block and each second data block based at least on the current first candidate hard disk set and the idle hard disks in the second candidate hard disk set; wherein the idle hard disks include hard disks that are different from those in the third candidate hard disk set, and the third candidate hard disk set includes the first candidate hard disk and / or the second candidate hard disk that are executing preset instructions.
2. The method according to claim 1, characterized in that, The step of determining a third number of first data blocks and a fourth number of second data blocks from the plurality of data blocks based on the first number and the second number includes: The first sum of the first quantity and the second quantity is used as a first reference value, the ratio of the first quantity to the first reference value is used as a first weight, and the ratio of the second quantity to the first reference value is used as a second weight. Based on the product of the number of the plurality of data blocks with the first weight and the second weight, the plurality of data blocks are divided into a third number of first data blocks and a fourth number of second data blocks.
3. The method according to claim 1, characterized in that, Each of the multi-arm hard disks includes multiple single disks, and each of the first candidate hard disk sets includes one of the single disks of each of the multi-arm hard disks. The number of the first candidate hard disk sets is positively correlated with the number of arms of the multi-arm hard disks, and the multiple first candidate hard disk sets are connected end to end. Each single-arm hard disk is disposed in the second candidate hard disk set.
4. The method according to claim 3, characterized in that, The first candidate hard disk in the first candidate hard disk set that is executing a preset instruction is moved to the third candidate hard disk set in advance, and the second candidate hard disk in the second candidate hard disk set that is executing a preset instruction is moved to the third candidate hard disk set in advance. The preset instruction includes at least one of storage and retrieval. After the hard disk in the third candidate hard disk set completes the preset instruction, it moves from the third candidate hard disk set to the tail position of the corresponding first candidate hard disk set or second candidate hard disk set.
5. The method according to claim 4, characterized in that, The step of determining the target hard disk corresponding to each first data block and each second data block, based at least on the current first candidate hard disk set and the free hard disks in the second candidate hard disk set, includes: Determine whether the number of free hard drives in the current first candidate hard drive set and the second candidate hard drive set is greater than or equal to the second sum of the third number and the fourth number; If so, then the target hard disk corresponding to each of the first data blocks and each of the second data blocks is determined from the free hard disk; If not, then based on the free hard disks and at least a portion of the hard disks in the third candidate hard disk set, the target hard disk corresponding to each first data block and each second data block is determined.
6. The method according to claim 5, characterized in that, Before determining the target hard disk corresponding to each of the first data blocks and each of the second data blocks from the free hard disk, the process includes: In response to the third quantity being greater than the number of free hard disks in the current first candidate hard disk set, a first difference between the third quantity and the number of free hard disks in the first candidate hard disk set is obtained, and the number of first data blocks corresponding to the first difference is updated to the second data blocks; In response to the fourth quantity being greater than the number of free hard disks in the second candidate hard disk set, a second difference between the fourth quantity and the number of free hard disks in the second candidate hard disk set is obtained, and the second data blocks corresponding to the second difference are updated to the first data blocks.
7. The method according to claim 5 or 6, characterized in that, The step of determining the target hard disk corresponding to each first data block and each second data block from the free hard disk includes: Based on the arrangement order of the free hard drives in the current first candidate hard drive set, the free hard drives are sequentially selected as the target hard drives corresponding to each first data block; and based on the arrangement order of the free hard drives in the second candidate hard drive set, the free hard drives are sequentially selected as the target hard drives corresponding to each second data block. Move the target hard drive to the third candidate hard drive set.
8. The method according to claim 5, characterized in that, The step of determining the target hard disk corresponding to each first data block and each second data block based on the free hard disk and at least a portion of the hard disks in the third candidate hard disk set includes: Obtain the third difference between the second sum and the number of free hard disks; The hard drives in the third candidate hard drive set are arranged in order of utilization from low to high, and the hard drives with the third difference after sorting are used as supplementary hard drives. The target hard disks corresponding to the first data block and the second data block are determined based on the supplementary hard disk and the free hard disk; Move the target hard drive to the third candidate hard drive set.
9. The method according to claim 3, characterized in that, After storing the first data block and the second data block to the corresponding target hard disk, the process includes: Update the first candidate hard disk set after the current first candidate hard disk set to the current first candidate hard disk set; Return to the step of obtaining multiple data blocks corresponding to the data to be stored.
10. A data storage system, characterized in that, include: A memory and a processor are coupled to each other, wherein the memory stores program data, and the processor invokes the program data to perform the method as described in any one of claims 1-9.