A method, computer, and storage medium for accelerating the acquisition of storage data of a RAID
By introducing index numbers in RAID to determine the stripe number range and indexing hash linked lists, the problem of long hash linked list traversal time in the prior art is solved, and the IO performance is improved.
Patent Information
- Application Number
- CN202111290247.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-11-02
AI Technical Summary
The IO performance of existing RAIDs is affected by the traversal time of long hash linked lists, resulting in inefficient data access.
By increasing the index number to determine the range of strip numbers, and indexing hash link list based on the index number and strip number, the length of the hash link list is reduced and the IO performance is improved.
On the basis of not changing the existing hash linked list index rules, the hash linked list traversal time is reduced and the IO performance of RAID is improved.
Smart Images

Figure CN114064979B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage of redundant arrays of independent disks (RAID), and in particular, to a method, a computer, and a storage medium for accelerating the acquisition of stored data of a RAID. Background Art
[0002] RAID - Redundant Array of Independent Disks is a technology that combines multiple disks with discontinuous physical addresses into a virtual disk with a continuous logical address for data storage. The data storage of RAID is based on striping technology, which cuts data into multiple segments and stores them on multiple disks to form stripes. The disk numbers and disk addresses corresponding to each stripe are stored by an sde structure.
[0003] In the prior art, the IO process of a RAID includes: given an array address arraylba, then obtaining the stripe number where the data block is located according to the array address arraylba, and then determining the index of a hash linked list based on the stripe number. Among them, it is artificially stipulated that all sde structures with the same Stride % 16 result are managed by the same hash linked list. After obtaining the index of the hash linked list, traverse the hash linked list to find the sde structure storing the corresponding stripe number and obtain the disk number and disk address therein. Then, the disk can be accessed according to the obtained disk number and disk address to perform data read and write operations.
[0004] In the process of obtaining the corresponding sde structure through the hash linked list as described above, since the hash linked list may be very long and each IO requires traversing the hash linked list, this is very time-consuming and will affect the IO performance of the RAID. Summary of the Invention
[0005] In order to reduce the time required to traverse the hash linked list and improve the IO performance of the RAID, in one aspect of the present invention, a method for accelerating the acquisition of stored data of a RAID is proposed. The method includes: obtaining the array address corresponding to the stripe storing the target stored data; determining the stripe number and the index number according to the array address, where the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list; determining the corresponding hash linked list based on the stripe number and the index number, and searching for the corresponding sde structure in the corresponding hash linked list; obtaining the disk number and disk address corresponding to the stripe from the corresponding sde structure, and accessing the corresponding disk based on the disk number and disk address to obtain the target stored data.
[0006] In one or more embodiments, determining a stripe number and an index number according to the array address includes: obtaining a preset first sector length and a second sector length, where the first sector length is the sector length of data blocks within a stripe, and the second sector length is the sector length of data blocks within multiple stripes determined by one index number; determining the stripe number by dividing the array address by the first sector length; and determining the index number by dividing the array address by the second sector length.
[0007] In one or more embodiments, determining a corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index flag based on the remainder obtained by dividing the index number by the first index value; and determining the hash linked list based on the remainder obtained by dividing the stripe number by the second index value.
[0008] In one or more embodiments, the first index value and the second index value are positive integers and are configured to be adjustable index values.
[0009] In one or more embodiments, the product of the first index value and the second index value is used to control the number of hash linked lists.
[0010] In one or more embodiments, finding a corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list and sequentially determining whether the stripe number and the index number are stored in each sde structure to determine the corresponding sde structure.
[0011] In one or more embodiments, the method further includes: in response to that after traversing the corresponding hash linked list, neither the stripe number nor the index number is stored in each sde structure, calculating a disk number and a disk address corresponding to a data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number, and the disk address in the new structure.
[0012] In one or more embodiments, the array address, the stripe number, and the index number are in one-to-one correspondence.
[0013] In a second aspect of the present invention, a computer is provided, including:
[0014] At least one processor; and a memory in which a runnable computer program is stored, and when the computer program is executed, it is used to implement the steps of the method for accelerating the acquisition of stored data of a RAID as described in any one of the above embodiments, and the steps include:
[0015] Obtain the array address corresponding to the stripe storing the target stored data; determine the stripe number and the index number according to the array address, wherein the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list; determine the corresponding hash linked list based on the stripe number and the index number, and search for the corresponding sde structure in the corresponding hash linked list; obtain the disk number and disk address corresponding to the stripe from the corresponding sde structure, and access the corresponding disk based on the disk number and disk address to obtain the target stored data.
[0016] In one or more embodiments, determining the stripe number and the index number according to the array address includes: obtaining a preset first sector length and a second sector length, wherein the first sector length is the sector length of the data block within a stripe, and the second sector length is the sector length of the data blocks within multiple stripes determined by one index number; determining the stripe number by dividing the array address by the first sector length; determining the index number by dividing the array address by the second sector length.
[0017] In one or more embodiments, determining the corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index flag by taking the remainder of dividing the index number by the first index value; determining the hash linked list by taking the remainder of dividing the stripe number by the second index value.
[0018] In one or more embodiments, the first index value and the second index value are positive integers and are configured to be adjustable index values.
[0019] In one or more embodiments, the product of the first index value and the second index value is used to control the number of hash linked lists.
[0020] In one or more embodiments, searching for the corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list and sequentially determining whether the stripe number and the index number are stored in each sde structure to determine the corresponding sde structure.
[0021] In one or more embodiments, the method further includes: in response to that after traversing the corresponding hash linked list, the stripe number and the index number are not stored in any of the sde structures, calculating the disk number and the disk address corresponding to the data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number, and the disk address in the new structure.
[0022] In one or more embodiments, the array address, the stripe number, and the index number are in one-to-one correspondence.
[0023] In a third aspect of the present invention, a readable storage medium is provided. A computer program that can run is stored in the readable storage medium. When the computer program is executed, it is used to implement the steps of the method for accelerating the acquisition of storage data of a RAID as described in any of the above embodiments. The steps include:
[0024] Obtaining the array address corresponding to the stripe storing the target storage data; determining the stripe number and the index number according to the array address, where the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list; determining the corresponding hash linked list based on the stripe number and the index number, and searching for the corresponding sde structure in the corresponding hash linked list; obtaining the disk number and the disk address corresponding to the stripe from the corresponding sde structure, and accessing the corresponding disk based on the disk number and the disk address to obtain the target storage data.
[0025] In one or more embodiments, determining the stripe number and the index number according to the array address includes: obtaining a preset first sector length and a second sector length, where the first sector length is the sector length of the data blocks in a stripe, and the second sector length is the sector length of the data blocks in multiple stripes determined by one index number; determining the stripe number by dividing the array address by the first sector length; determining the index number by dividing the array address by the second sector length.
[0026] In one or more embodiments, determining the corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index flag by taking the remainder of dividing the index number by the first index value; determining the hash linked list by taking the remainder of dividing the stripe number by the second index value.
[0027] In one or more embodiments, the first index value and the second index value are positive integers and are configured to have adjustable index values.
[0028] In one or more embodiments, the product of the first index value and the second index value is used to control the number of hash linked lists.
[0029] In one or more embodiments, finding a corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list and sequentially determining whether each sde structure stores the stripe number and the index number to determine the corresponding sde structure.
[0030] In one or more embodiments, the method further includes: in response to that after traversing the corresponding hash linked list, none of the sde structures stores the stripe number and the index number, calculating the disk number and the disk address corresponding to the data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number, and the disk address in the new structure.
[0031] In one or more embodiments, the array address, the stripe number, and the index number are in one-to-one correspondence.
[0032] The beneficial effects of the present invention include: by additionally determining a corresponding index number according to the same array address for determining the index number, and stipulating that during data reading and writing, it is necessary to first determine the stripe number range according to the index number, and then index the corresponding hash linked list according to the corresponding stripe number within this stripe number range, the present invention realizes increasing the number of hash linked lists by increasing the index dimension of the hash linked list without changing the existing index rule of the hash linked list, and can control the total number of hash linked lists by adjusting the first index value and the second index value, so that when the number of stripes is the same, the length of the hash linked list formed by the present invention is shorter, thereby reducing the time used for traversing the hash linked list, and further improving the IO performance of RAID. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative efforts.
[0034] Figure 1The working flowchart of a method for accelerating the acquisition of stored data in a RAID according to the present invention;
[0035] Figure 2 The schematic diagram for determining the stripe range by index marking according to the present invention;
[0036] Figure 3 The detailed flowchart of a method for accelerating the acquisition of stored data in a RAID according to the present invention;
[0037] Figure 4 The structural schematic diagram of a computer according to the present invention;
[0038] Figure 5 The structural schematic diagram of a readable storage medium according to the present invention. Detailed implementation manners
[0039] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0040] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two entities or parameters with the same name but different identities. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. This will not be elaborated one by one in the subsequent embodiments.
[0041] Figure 1 The working flowchart of a method for accelerating the acquisition of stored data in a RAID according to the present invention. As Figure 1 shown, the working process of a method for accelerating the acquisition of stored data in a RAID according to the present invention includes: Step S1, obtaining the array address corresponding to the stripe storing the target stored data; Step S2, determining the stripe number and the index number according to the array address, where the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list; Step S3, determining the corresponding hash linked list based on the stripe number and the index number, and searching for the corresponding sde structure in the corresponding hash linked list; and Step S4, obtaining the disk number and the disk address of the corresponding stripe from the corresponding sde structure, and accessing the corresponding disk based on the disk number and the disk address to obtain the target stored data.
[0042] For step S1, obtain the array address corresponding to the strip storing the target stored data; RAID is the English abbreviation of Redundant Array of Independent Disks, that is, Redundant Array of Independent Disks. Most RAID uses striping technology to implement data storage. Striping technology is a technology that automatically balances the I / O load across multiple physical disks; specifically, striping technology divides a continuous block of data into many small parts and stores them on different disks respectively. This enables multiple processes to access different parts of the data simultaneously without causing disk conflicts, and can obtain the maximum I / O parallelism when sequential access to this data is required, thus achieving very good performance. And the so-called strip is a volume composed of multiple disks. In RAID, each array address of RAID uniquely corresponds to a strip.
[0043] For step S2, determine the strip number and the index number according to the array address. Among them, the index number is used to determine the range of the strip number, and the strip number is used to index the hash linked list; in the prior art in this step, only the strip number needs to be obtained according to the array address, which leads to the need to search in a relatively long hash linked list when looking for the sde structure corresponding to the strip number subsequently, and each RAID I / O process needs to traverse this hash linked list, thus affecting the RAID I / O performance. In the present invention, in step S2, an additional index number will be determined according to the array address. Among them, the index number is used to determine the range of the strip number, and the strip number is used to index the hash linked list. By adding the index number, it is equivalent to adding an additional dimension to the index of the hash linked list, so that under the same number of strips, the length of the hash linked list formed by the present invention is shorter, thus reducing the time used to traverse the hash linked list, and further improving the RAID I / O performance.
[0044] In one embodiment, determining a stripe number and an index number according to an array address includes: obtaining a preset first sector length and a second sector length, where the first sector length is the sector length of data blocks within a stripe, and the second sector length is the sector length of data blocks within multiple stripes determined by an index number; determining the stripe number by dividing the array address by the first sector length; and determining the index number by dividing the array address by the second sector length. Here, a sector is the minimum amount of data that needs to be read and written in one I / O operation of a RAID. It can be understood that the purpose of separately determining the sector length of data blocks within a stripe and the sector length of data blocks within multiple stripes determined by an index number in this application is to determine the number of stripe numbers that need to be managed by an index number; and the purpose of calculating the index number and the stripe number respectively from the same array address is to establish a connection between the index number and the corresponding stripe number. Therefore, the array address, stripe number, and index number in the present invention will correspond one by one.
[0045] In one embodiment, determining a corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index flag by taking the remainder of dividing the index number by the first index value; and determining the hash linked list by taking the remainder of dividing the stripe number by the second index value. Here, the first index value and the second index value are positive integers and can be set arbitrarily; the first index value determines the number of divisions of the stripe range determined by the index number, and the second index value determines the number of hash linked lists determined by the stripe number; furthermore, the product of the first index value and the second index value determines the total number of hash linked lists that need to be constructed in the RAID of this application.
[0046] For step S3, determining a corresponding hash linked list based on the stripe number and the index number, and searching for a corresponding sde structure in the corresponding hash linked list; it can be understood that both the data reading process and the data writing process need to go through step S1 and step S2. During the data reading and writing process, the corresponding index number and stripe number will be stored in a newly generated sde structure at the end of the corresponding hash linked list, thereby increasing the length of the hash linked list; correspondingly, during the data reading process, although the corresponding hash linked list can be found according to the index number and the stripe number, it is still necessary to traverse each sde structure of the hash linked list, and determine whether the disk number and disk address stored in the sde structure are those required for the corresponding stripe based on whether the sde structure has the same index number and stripe number.
[0047] In one embodiment, finding the corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list, and sequentially determining whether the stripe number and the index number are stored in each sde structure to determine the corresponding sde structure.
[0048] In a further embodiment, the method for accelerating the acquisition of the stored data of the RAID of the present invention further includes: in response to that after traversing the corresponding hash linked list, neither the stripe number nor the index number is stored in each sde structure, calculating the disk number and the disk address corresponding to the data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number and the disk address in the new structure.
[0049] The following Table 1 shows a hash linked list and the indexing method of the hash linked list, where Table 1 is as follows:
[0050] Table 1
[0051]
[0052] As shown in Table 1 above, the hash linked list is generated by the remainder of dividing the stripe number by 16. Among them, when the stripe number is less than 16, the remainder of dividing it by 16 is 0.
[0053] Figure 2 It is a schematic diagram for the present invention to determine the stripe range through index markers. As Figure 2 shown, it shows a RAID storage structure established on a total of 8 disks from disk 0 to disk 7. Among them, pack x and pack x + 1 are two index markers corresponding to the index number pack. Each small square with a number represents the space divided by the corresponding disk for the corresponding stripe, and other small squares represent spaces for other purposes, such as parity blocks, etc. As Figure 2 can be seen from, in this example, one index number can determine at least 12 stripes (the small squares with the same number form a stripe), and these 12 stripes are respectively grouped by packx and pack x + 1. Each stripe is composed of 6 storage spaces under the corresponding disks.
[0054] Figure 3 It is a detailed flowchart for accelerating the acquisition of the stored data of the RAID of the present invention. The detailed process for accelerating the acquisition of the stored data of the RAID of the present invention includes:
[0055] The first step: Given the array number arraylba, and respectively calculating the pack number (index number) and the stride number (stripe number)
[0056] Pack = arraylba / pack_data_length;
[0057] stride = arraylba / stride_data_length;
[0058] The second step:
[0059] Find the index marker of the stripe number corresponding to the pack number in the first step, and then based on this, find the index of the hash linked list based on the stripe number.
[0060] Pack_index = pack % 16;
[0061] Stride_index = stride % 16;
[0062] The third step:
[0063] After finding the index of the hash linked list, access the corresponding hash linked list and search for the sde structure in the hash linked list. Determine whether the pack and stride stored in the sde structure are the pack and stride calculated in the first step. If the search is successful, extract the data we need from this sde. If the search fails, it means that the information of this pack and stride has not been cached. Then we will perform regular calculations to record the information in the sde structure and then insert it into the corresponding hash linked list.
[0064] In the above embodiments, the present invention additionally determines the corresponding index number according to the same array address as the determined index number, and stipulates that during the data reading and writing process, it is necessary to first determine the stripe number range according to the index number, and then index the corresponding hash linked list according to the corresponding stripe number within this stripe number range. Thus, on the basis of not changing the existing index rule of the hash linked list, the number of hash linked lists is increased by increasing the index dimension of the hash linked list, and the total number of hash linked lists can be controlled by adjusting the first index value and the second index value. Therefore, when the number of stripes is the same, the length of the hash linked list formed by the present invention is shorter, thereby reducing the time used to traverse the hash linked list, and further improving the IO performance of RAID.
[0065] In the second aspect of the present invention, a computer is also disclosed. Figure 4 It is a schematic structural diagram of a computer of the present invention. As Figure 4As shown in the figure, the computer of the present invention includes: at least one processor 200; and a memory 300 in which a computer program 301 that can run is stored. When the computer program 301 is executed, it is used to implement step S1: obtaining the array address corresponding to the strip storing the target storage data; step S2: determining the strip number and the index number according to the array address, where the index number is used to determine the range of the strip number, and the strip number is used to index the hash linked list; step S3: determining the corresponding hash linked list based on the strip number and the index number, and searching for the corresponding sde structure in the corresponding hash linked list; and step S4: obtaining the disk number and the disk address of the corresponding strip from the corresponding sde structure, and accessing the corresponding disk based on the disk number and the disk address to obtain the target storage data.
[0066] For step S1: obtaining the array address corresponding to the strip storing the target storage data; RAID is the English abbreviation of Redundant Array of Independent Disks, that is, Redundant Array of Independent Disks. Most RAID implementations use striping technology to achieve data storage. Striping technology is a technology that automatically balances the I / O load across multiple physical disks; specifically, striping technology divides a continuous block of data into many small parts and stores them on different disks respectively. This allows multiple processes to access different parts of the data simultaneously without causing disk conflicts, and can achieve the maximum I / O parallelism when sequential access to this data is required, thus obtaining very good performance. And the so-called strip is a volume composed of multiple disks. In RAID, each array address of RAID uniquely corresponds to a strip.
[0067] For step S2: determining the strip number and the index number according to the array address, where the index number is used to determine the range of the strip number, and the strip number is used to index the hash linked list; in the prior art in this step, only the strip number needs to be obtained according to the array address, which leads to the need to search in a relatively long hash linked list when looking for the sde structure corresponding to the strip number later, and each RAID I / O process needs to traverse this hash linked list, thus affecting the RAID I / O performance. In the present invention, in step S2, an additional index number will be determined according to the array address. The index number is used to determine the range of the strip number, and the strip number is used to index the hash linked list. By adding the index number, it is equivalent to adding an additional dimension to the index of the hash linked list, so that under the same number of strips, the length of the hash linked list formed by the present invention is shorter, thereby reducing the time used to traverse the hash linked list, and thus improving the RAID I / O performance.
[0068] In one embodiment, determining the stripe number and the index number according to the array address includes: obtaining a preset first sector length and a second sector length, where the first sector length is the sector length of data blocks within a stripe, and the second sector length is the sector length of data blocks within multiple stripes determined by an index number; determining the stripe number by dividing the array address by the first sector length; and determining the index number by dividing the array address by the second sector length. Here, a sector is the minimum amount of data that needs to be read and written in a single I / O operation of a RAID. It can be understood that the purpose of separately determining the sector length of data blocks within a stripe and the sector length of data blocks within multiple stripes determined by an index number in this application is to determine the number of stripe numbers that need to be managed by an index number; and the purpose of calculating the index number and the stripe number respectively from the same array address is to establish the connection between the index number and the corresponding stripe number. Therefore, the array address, the stripe number, and the index number in the present invention will correspond one by one.
[0069] In one embodiment, determining the corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index mark by taking the remainder of dividing the index number by the first index value; and determining the hash linked list by taking the remainder of dividing the stripe number by the second index value. Here, the first index value and the second index value are positive integers and can be set arbitrarily; the first index value determines the number of divisions of the stripe range determined by the index number, and the second index value determines the number of hash linked lists determined by the stripe number; furthermore, the product of the first index value and the second index value determines the total number of hash linked lists that need to be constructed in the RAID of this application.
[0070] For step S3, determining the corresponding hash linked list based on the stripe number and the index number, and searching for the corresponding sde structure in the corresponding hash linked list; it can be understood that both the data reading process and the writing process need to go through step S1 and step S2. During the data reading and writing process, the corresponding index number and stripe number will be stored in a newly generated sde structure at the end of the corresponding hash linked list, thereby increasing the length of the hash linked list; correspondingly, during the data reading process, although the corresponding hash linked list can be found according to the index number and the stripe number, it is still necessary to traverse each sde structure of the hash linked list, and determine whether the disk number and disk address stored in the sde structure are those required for the corresponding stripe based on whether the sde structure has the same index number and stripe number.
[0071] In one embodiment, finding the corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list and sequentially determining whether the stripe number and the index number are stored in each sde structure to determine the corresponding sde structure.
[0072] In a further embodiment, the method for accelerating the acquisition of the stored data of the RAID according to the present invention further includes: in response to that after traversing the corresponding hash linked list, neither the stripe number nor the index number is stored in each sde structure, calculating the disk number and the disk address corresponding to the data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number and the disk address in the new structure.
[0073] In a third aspect of the present invention, a readable storage medium is proposed. Figure 5 The structure diagram of a readable storage medium of the present invention is shown in Figure 5 As shown, a runnable computer program 401 is stored in the readable storage medium 400 of the present invention. When the computer program 401 is executed, it is used to implement: Step S1, obtaining the array address corresponding to the stripe storing the target stored data; Step S2, determining the stripe number and the index number according to the array address, where the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list; Step S3, determining the corresponding hash linked list based on the stripe number and the index number, and finding the corresponding sde structure in the corresponding hash linked list; and Step S4, obtaining the disk number and the disk address corresponding to the corresponding stripe from the corresponding sde structure, and accessing the corresponding disk based on the disk number and the disk address to obtain the target stored data.
[0074] For Step S1, obtaining the array address corresponding to the stripe storing the target stored data; RAID is the English abbreviation of Redundant Array of Independent Disks, that is, Redundant Array of Independent Disks. Most RAID implementations use striping technology to store data. Striping technology is a technique that automatically balances the I / O load across multiple physical disks; specifically, striping technology divides a continuous block of data into many small parts and stores them on different disks respectively. This allows multiple processes to access different parts of the data simultaneously without causing disk conflicts, and can obtain the maximum I / O parallelism when sequential access to this data is required, thus achieving very good performance. And the so-called stripe is a volume composed of multiple disks. In RAID, each array address of the RAID uniquely corresponds to a stripe.
[0075] For step S2, determine the stripe number and the index number according to the array address. Among them, the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list. In the prior art, in this step, only the stripe number needs to be obtained according to the array address, which results in the need to search in a relatively long hash linked list when looking for the sde structure corresponding to the stripe number later. And each RAID IO process needs to traverse this hash linked list, thus affecting the RAID IO performance. In step S2 of the present invention, an additional index number is determined according to the array address. Among them, the index number is used to determine the range of the stripe number, and the stripe number is used to index the hash linked list. By adding the index number, it is equivalent to adding an additional dimension to the index of the hash linked list, so that in the case of the same number of stripes, the length of the hash linked list formed by the present invention is shorter, thereby reducing the time used to traverse the hash linked list, and further improving the RAID IO performance.
[0076] In one embodiment, determining the stripe number and the index number according to the array address includes: obtaining a preset first sector length and a second sector length. Among them, the first sector length is the sector length of the data blocks within a stripe, and the second sector length is the sector length of the data blocks within multiple stripes determined by one index number; determining the stripe number by dividing the array address by the first sector length; determining the index number by dividing the array address by the second sector length. Among them, a sector is the minimum amount of data that needs to be read and written in a single RAID IO. It can be understood that the purpose of separately determining the sector length of the data blocks within a stripe and the sector length of the data blocks within multiple stripes determined by one index number in this application is to determine the number of stripe numbers that need to be managed by one index number; and the purpose of calculating the index number and the stripe number respectively from the same array address is to establish the connection between the index number and the corresponding stripe number. Therefore, the array address, the stripe number, and the index number in the present invention will correspond one by one.
[0077] In one embodiment, determining the corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining the index mark by taking the remainder of dividing the index number by the first index value; determining the hash linked list by taking the remainder of dividing the stripe number by the second index value. Among them, the first index value and the second index value are positive integers and can be set arbitrarily; the first index value determines the number of divisions of the stripe range determined by the index number, and the second index value determines the number of hash linked lists determined by the stripe number; furthermore, the product of the first index value and the second index value determines the total number of hash linked lists that need to be constructed in the RAID of this application.
[0078] For step S3, determine the corresponding hash linked list based on the stripe number and the index number, and search for the corresponding sde structure in the corresponding hash linked list; it can be understood that both the data reading process and the writing process need to go through step S1 and step S2. During the data reading and writing process, the corresponding index number and stripe number will be stored in a newly generated sde structure at the end of the corresponding hash linked list, thereby increasing the length of the hash linked list; correspondingly, during the data reading process, although the corresponding hash linked list can be found according to the index number and the stripe number, it is still necessary to traverse each sde structure of the hash linked list, and determine whether the disk number and disk address stored in the sde structure are those required by the corresponding stripe based on whether the index number and the stripe number are the same in each sde structure.
[0079] In one embodiment, searching for the corresponding sde structure in the corresponding hash linked list includes: traversing the corresponding hash linked list, and sequentially determining whether each sde structure stores the stripe number and the index number to determine the corresponding sde structure.
[0080] In a further embodiment, the method for accelerating the acquisition of storage data of the RAID in the present invention further includes: in response to that after traversing the corresponding hash linked list, neither the stripe number nor the index number is stored in each sde structure, calculating the disk number and disk address corresponding to the data block of the stripe of the array address according to a preset algorithm; generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number, and the disk address in the new structure.
[0081] The above are exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein do not need to be performed in any specific order. In addition, although the elements disclosed by the embodiments of the present invention can be described or claimed in individual form, they can also be understood as multiple unless explicitly limited to the singular.
[0082] It should be understood that, as used herein, unless the context clearly supports exceptions, the singular form "a" is also intended to include the plural form. It should also be understood that "and / or" as used herein refers to any and all possible combinations including one or more of the associated listed items.
[0083] The serial numbers of the disclosed embodiments of the present invention above are only for description and do not represent the advantages and disadvantages of the embodiments.
[0084] Those of ordinary skill in the art should understand that any discussion of the above embodiments is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for accelerating the acquisition of storage data of a RAID, characterized in that The method includes: Obtaining an array address corresponding to a stripe storing target storage data; Determining a stripe number and an index number according to the array address, where the index number is used to determine the range of the stripe number, and the stripe number is used to index a hash linked list; Determining a corresponding hash linked list based on the stripe number and the index number, and searching for a corresponding sde structure in the corresponding hash linked list; Obtaining a disk number and a disk address corresponding to the stripe from the corresponding sde structure, and accessing a corresponding disk based on the disk number and the disk address to obtain the target storage data; Among them, determining the stripe number and the index number according to the array address includes: obtaining a preset first sector length and a second sector length, where the first sector length is the sector length of a data block within a stripe, and the second sector length is the sector length of data blocks within multiple stripes determined by an index number; determining the stripe number by dividing the array address by the first sector length; determining the index number by dividing the array address by the second sector length; Determining a corresponding hash linked list based on the stripe number and the index number includes: obtaining a preset first index value and a second index value; determining an index flag by taking the remainder of dividing the index number by the first index value; determining a hash linked list by taking the remainder of dividing the stripe number by the second index value.
2. The method for accelerating the acquisition of stored data of a RAID according to claim 1, wherein The first index value and the second index value are positive integers and are configured to be adjustable index values.
3. The method for accelerating the acquisition of storage data of RAID according to claim 2, wherein The product of the first index value and the second index value is used to control the number of hash linked lists.
4. The method for accelerating the acquisition of stored data of a RAID according to claim 1, characterized in that, Searching for a corresponding sde structure in the corresponding hash linked list includes: Traversing the corresponding hash linked list, and sequentially determining whether each sde structure stores the stripe number and the index number to determine the corresponding sde structure.
5. The method for accelerating the acquisition of stored data of a RAID according to claim 4, wherein The method further includes: In response to that after traversing the corresponding hash linked list, none of the sde structures stores the stripe number and the index number, Calculating a disk number and a disk address corresponding to a data block of the stripe of the array address according to a preset algorithm; Generating a new structure in the corresponding hash linked list, and storing the stripe number, the index number, the disk number, and the disk address in the new structure.
6. The method for accelerating the acquisition of stored data of a RAID according to any one of claims 1-5, characterized in that, The array address, the stripe number, and the index number correspond one by one.
7. A computer, characterized in that, Including: At least one processor; And A memory, where a runnable computer program is stored in the memory, and when the computer program is executed, it is used to implement the steps of the method for accelerating the acquisition of storage data of a RAID as described in any one of claims 1-6.
8. A readable storage medium, characterized in that, A readable storage medium stores a runnable computer program, and when the computer program is executed, it is used to implement the steps of the method for accelerating the acquisition of storage data of a RAID as described in any one of claims 1-6.
Citation Information
Patent Citations
A method for optimizing the write performance of a RAID6 disk array
CN102270102A
Method and device for restoring disk arrays based on stripping
CN103699457A