CN115129265B - Partitioned caching method, device, equipment and readable medium for redundant array of independent disks - Google Patents
Partitioned caching method, device, equipment and readable medium for redundant array of independent disks Download PDFInfo
- Publication number
- CN115129265B CN115129265B CN202211059821.3A CN202211059821A CN115129265B CN 115129265 B CN115129265 B CN 115129265B CN 202211059821 A CN202211059821 A CN 202211059821A CN 115129265 B CN115129265 B CN 115129265B
- Authority
- CN
- China
- Prior art keywords
- stripe
- cache
- pointer variable
- memory
- information structure
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 72
- 230000015654 memory Effects 0.000 claims abstract description 103
- 230000008569 process Effects 0.000 claims abstract description 27
- 238000005192 partition Methods 0.000 claims description 30
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 11
- 238000010276 construction Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0625—Power saving in storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0683—Plurality of storage devices
- G06F3/0689—Disk arrays, e.g. RAID, JBOD
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention provides a method, a device, equipment and a readable medium for partitioned caching of an independent redundant disk array, wherein the method comprises the following steps: determining the number of blocks in each strip in the disk array, and constructing a strip cache information structure body; applying for memory from a fixed object pool according to the number of the blocks in each stripe; responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process; and calculating a pointer variable of a stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable. By using the scheme of the invention, the memory cost of the disk array can be effectively saved, the performance of the storage system is improved, and the competitiveness of the product is improved.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a device, and a readable medium for partitioned caching of an array of independent redundant disks.
Background
The storage technology is widely applied to various large fields of the modern society, such as banks, colleges and universities and the like. With the progress of science and technology, the technology of storage has a qualitative leap, the development is not limited to the high efficiency of data storage, data security, reliability and the like, and the focus is gradually focused on how to save the memory and use less memory to fulfill the business requirements.
RAID6 (redundant array of independent disks) storage technology stores user data information in a cache structure sce (structure for storing block data information) corresponding to a block in a cache stripe information sde (structure for storing stripe cache information). In the process of initializing the Raid6, the number of blocks in one stripe is determined according to the number of disks created by the specification, and then memories of the buffer sce structural bodies required by the corresponding blocks and pointer variables pointing to the memories are reserved and allocated. For example: where the upper limit of the number of partitions in a stripe is 16, then when creating a 16-disk RAID6, 64 bytes per sce structure, then 64 × 16 bytes need to be allocated, and pointer variables pointing to these structures: each pointer variable is 8 bytes, i.e. 8 bytes by 16 bytes are allocated, and the memory required for one stripe is (64 + 8) bytes by 16 bytes. A RAID6 redundant array consists of a large number of stripes and the memory requirements are very large.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for partitioned caching of an independent redundant disk array.
In view of the above, an aspect of the embodiments of the present invention provides a method for partitioned caching of an raid, including the following steps:
determining the number of blocks in each strip in the disk array, and constructing a strip cache information structure body;
applying for memory from a fixed object pool according to the number of the blocks in each stripe;
responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process;
and calculating a pointer variable of a stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable.
According to an embodiment of the present invention, determining the number of blocks in each stripe in a disk array, and constructing a stripe cache information structure includes:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce SceExtension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4.
According to an embodiment of the present invention, applying for memory from a fixed object pool according to the number of partitions within each stripe comprises:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
According to an embodiment of the present invention, calculating a pointer variable of a stripe cache information structure corresponding to a block number in a cache structure corresponding to a stripe number, and reading data based on the pointer variable includes:
calculating a pointer variable of the sceExtension [ i ] according to a formula of Sce psce = sceExtension + stripnum/4, wherein the psce is the pointer variable of the sceExtension [ i ], the sceExtension is the address of the first element in the array sceExtension [ i ] of the strip cache information structure, and the stripnum is the number of the blocks;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
According to an embodiment of the present invention, the memory requested includes a memory corresponding to a block cache and a memory corresponding to a cache pointer variable.
According to one embodiment of the invention, the object pointed to by the cache pointer variable is 256 bytes of memory.
According to an embodiment of the present invention, further comprising:
it is determined whether the read data is a cache hit based on the pointer variable.
According to an embodiment of the present invention, further comprising:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
According to an embodiment of the present invention, further comprising:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
In another aspect of the embodiments of the present invention, an apparatus for partitioned caching of an raid is further provided, where the apparatus includes:
the construction module is configured to determine the number of the blocks in each stripe in the disk array and construct a stripe cache information structure body;
the application module is configured to apply for the memory from the fixed object pool according to the number of the blocks in each stripe;
the first computing module is configured to respond to the disk array to perform an io reading process, and obtain a stripe number and a block number of data to be read according to an array address of the io reading process;
and the second calculation module is configured to calculate a pointer variable of a stripe cache information structure body corresponding to the partition number in the cache structure corresponding to the stripe number, and read data based on the pointer variable.
According to one embodiment of the invention, the construction module is further configured to:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce SceExtension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4.
According to one embodiment of the invention, the application module is further configured to:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
According to one embodiment of the invention, the second computing module is further configured to:
calculating a pointer variable of the sceExtension [ i ] according to a formula of Sce psce = sceExtension + stripnum/4, wherein the psce is the pointer variable of the sceExtension [ i ], the sceExtension is the address of the first element in the array sceExtension [ i ] of the strip cache information structure, and the stripnum is the number of the blocks;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program realizes the steps of any one of the above methods when executed by a processor.
The invention has the following beneficial technical effects: the method for caching the independent redundant disk array blocks comprises the steps of determining the number of blocks in each stripe in the disk array and constructing a stripe cache information structure; applying for memory from a fixed object pool according to the number of the blocks in each stripe; responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process; the technical scheme of calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number and reading data based on the pointer variable can effectively save the memory cost of the disk array, improve the performance of the storage system and improve the competitiveness of the product.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method for partitioned caching of an RAID (redundant array of independent disks) according to one embodiment of the present invention;
FIG. 2 is a diagram of a stripe cache information structure according to an embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for partitioned caching of an RAID according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 5 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of a method for partitioned caching of redundant array of independent disks. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may comprise the steps of:
s1, determining the number of blocks in each stripe in the disk array, and constructing a stripe cache information structure body. Determining the number x of blocks in each stripe in the disk array according to the requirement, wherein the maximum value of x is 16, the minimum value of x is 5, and reconstructing a stripe cache information structure sde struct { sce SceExtension [ i ] }, as shown in FIG. 2, wherein the maximum value of i in the SceExtension [ i ] array is 4, and the minimum value is 1, based on the reconstructed stripe cache information structure, only allocating [ (x/4) to get the whole +1 ]. 8 bytes of memory to store the pointer variable, and saving x 8- [ (x + 3)/4 ] 8 bytes of memory for each stripe, for example, when creating a raid6 stripe width of 16, saving 16 x 8-4*8 bytes of memory for each stripe.
And S2, applying for the memory from the fixed object pool according to the number of the blocks in each stripe. Based on the number x of the blocks and the reconstructed stripe cache information structure, the size of the applied memory can be calculated according to a formula [ (x + 3)/4 ] integer (8 + 256) and the applied memory with the corresponding size is applied, wherein the applied memory comprises the memory corresponding to the block cache and the memory corresponding to the cache pointer variable, the object pointed by the cache pointer variable is 256 bytes of memory, the size of each sce is 64 bytes, and then 4 sce can be actually stored in the memory allocated to one pointer variable in one scextensions [ i ] array.
And S3, responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process. When the io reading process is performed on the disk array, the stripe number and the block number of the data in the normal raid can be calculated according to the address in the io reading process, and the calculation method can use any method in the prior art for calculation, which is not described herein again.
And S4, calculating a pointer variable of a stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable. After the stripe number and the partition number of the data in the normal raid are calculated, a pointer variable of the data in the reconstructed stripe cache information structure needs to be calculated, a pointer variable of a seeextension [ i ] can be calculated according to a formula Sce × psce = seeextension + stride/4, where psextension is the pointer variable of the seeextension [ i ], the seeextension is an address of a first element in an array scextension [ i ] of the stripe cache information structure, and stride is a partition number, then the partition number of the partition number in the stripe cache information structure is calculated according to a formula stripnum & =3, and stride is the partition number, and finally the pointer variable of the corresponding stripe cache block number in the cache structure corresponding to the stripe number is calculated according to a formula pointer variable = psxtension + stride, where the pointer variable after the stride is calculated according to a second formula. After the pointer variable of the cache structure corresponding to the block is obtained, the information of the cache of the block can be obtained through the pointer variable of sce, whether the cache of the data read based on the pointer variable is hit needs to be judged when the data is read, if the cache is hit, the data is read from the block corresponding to the pointer variable, if the cache is not hit, the data is read from a disk, and the read result is stored in the structure corresponding to the pointer variable.
By using the scheme of the invention, the memory cost of the disk array can be effectively saved, the performance of the storage system is improved, and the competitiveness of the product is improved.
In a preferred embodiment of the present invention, determining the number of blocks in each stripe in the disk array, and constructing the stripe cache information structure includes:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce + sce extension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4, the optimal value of i is 4, the object pointed by the cache pointer variable is 256 bytes of memory, the size of each sce is 64 bytes, and then 4 sce can be actually stored in the memory allocated by one pointer variable in one sce extension [ i ] array.
In a preferred embodiment of the present invention, applying for memory from a pool of fixed objects based on the number of partitions within each stripe comprises:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
In a preferred embodiment of the present invention, calculating a pointer variable of a stripe cache information structure corresponding to a block number in a cache structure corresponding to a stripe number, and reading data based on the pointer variable includes:
calculating a pointer variable of the scextension [ i ] according to a formula of sceptce = scextension + stripnum/4, wherein the sceptce is the pointer variable of the scextension [ i ], the scextension is the address of the first element in an array scextension [ i ] of the stripe cache information structure, and the stripnum is a block number;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
In a preferred embodiment of the present invention, the memory of the application includes a memory corresponding to the block cache and a memory corresponding to the cache pointer variable.
In a preferred embodiment of the present invention, the object pointed to by the cache pointer variable is 256 bytes of memory.
In a preferred embodiment of the present invention, the method further comprises:
it is determined whether the read data is a cache hit based on the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
By using the scheme of the invention, the memory cost of the disk array can be effectively saved, the performance of the storage system is improved, and the competitiveness of the product is improved.
It should be noted that, as can be understood by those skilled in the art, all or part of the processes in the methods of the embodiments described above can be implemented by instructing relevant hardware by a computer program, and the program may be stored in a computer-readable storage medium, and when executed, the program may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments corresponding thereto.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for partitioned caching of redundant array of independent disks, as shown in fig. 3, the apparatus 200 includes:
the construction module is configured to determine the number of the blocks in each stripe in the disk array and construct a stripe cache information structure body;
the application module is configured to apply for the memory from the fixed object pool according to the number of the blocks in each stripe;
the first computing module is configured to respond to the disk array to perform an io reading process, and obtain a stripe number and a block number of data to be read according to an array address of the io reading process;
and the second calculation module is configured to calculate a pointer variable of a stripe cache information structure body corresponding to the partition number in the cache structure corresponding to the stripe number, and read data based on the pointer variable.
In a preferred embodiment of the invention, the construction module is further configured to:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce plus seeextension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4.
In a preferred embodiment of the present invention, the application module is further configured to:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
In a preferred embodiment of the present invention, the second calculation module is further configured to:
calculating a pointer variable of the scextension [ i ] according to a formula of sceptce = scextension + stripnum/4, wherein the sceptce is the pointer variable of the scextension [ i ], the scextension is the address of the first element in an array scextension [ i ] of the stripe cache information structure, and the stripnum is a block number;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
In a preferred embodiment of the present invention, the memory of the application includes a memory corresponding to the block cache and a memory corresponding to the cache pointer variable.
In a preferred embodiment of the present invention, the object pointed to by the cache pointer variable is 256 bytes of memory.
In a preferred embodiment of the present invention, the apparatus further includes a determining module, and the determining module is configured to:
it is determined whether the read data is a cache hit based on the pointer variable.
In a preferred embodiment of the present invention, the determining module is further configured to:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
In a preferred embodiment of the present invention, the determining module is further configured to:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 4 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 4, the embodiment of the present invention includes the following means: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 executable on the processor, the instructions when executed by the processor implementing the method of:
and determining the number of the blocks in each stripe in the disk array, and constructing a stripe cache information structure body. Determining the number x of blocks in each stripe in the disk array according to requirements, wherein the maximum value of x is 16, the minimum value of x is 5, and reconstructing a stripe cache information structure sde structure { sce. Sce extension [ i ] }, wherein the maximum value of i in the sce extension [ i ] array is 4, and the minimum value is 1, based on the reconstructed stripe cache information structure, only allocating [ (x/4) and +1 ]. 8 bytes of memory to store pointer variables, and saving x 8- [ (x + 3)/4 ] 8 bytes of memory for each stripe, for example, when creating a raid6 stripe with a width of 16, saving 16 x 8-4*8 bytes of memory for each stripe.
And applying for memory from the fixed object pool according to the number of the blocks in each stripe. Based on the number x of the blocks and the reconstructed stripe cache information structure, the size of the applied memory can be calculated according to a formula [ (x + 3)/4 ] by (8 + 256) and the applied memory with the corresponding size is applied, wherein the applied memory comprises the memory corresponding to the block cache and the memory corresponding to the cache pointer variable, the object pointed by the cache pointer variable is 256 bytes of memory, the size of each sce is 64 bytes, and then 4 sce can be actually stored in the memory allocated to one pointer variable in one sce extensions [ i ] array.
And responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process. When the disc array performs the io reading process, the stripe number and the block number of the data in the normal raid can be calculated according to the address in the io reading process, and the calculation method can use any method in the prior art for calculation, which is not described herein again.
And calculating a pointer variable of a stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable. After the stripe number and the partition number of the data in the normal raid are calculated, a pointer variable of the data in the reconstructed stripe cache information structure needs to be calculated, a pointer variable of a seeextension [ i ] can be calculated according to a formula Sce × psce = seeextension + stride/4, where psextension is the pointer variable of the seeextension [ i ], the seeextension is an address of a first element in an array scextension [ i ] of the stripe cache information structure, and stride is a partition number, then the partition number of the partition number in the stripe cache information structure is calculated according to a formula stripnum & =3, and stride is the partition number, and finally the pointer variable of the corresponding stripe cache block number in the cache structure corresponding to the stripe number is calculated according to a formula pointer variable = psxtension + stride, where the pointer variable after the stride is calculated according to a second formula. After the pointer variable of the cache structure corresponding to the block is obtained, the information of the cache of the block can be obtained through the pointer variable of sce, whether the cache of the data read based on the pointer variable is hit needs to be judged when the data is read, if the cache is hit, the data is read from the block corresponding to the pointer variable, if the cache is not hit, the data is read from a disk, and the read result is stored in the structure corresponding to the pointer variable.
In a preferred embodiment of the present invention, determining the number of blocks in each stripe in the disk array, and constructing the stripe cache information structure includes:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce SceExtension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4.
In a preferred embodiment of the present invention, applying for memory from a pool of fixed objects based on the number of partitions within each stripe comprises:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
In a preferred embodiment of the present invention, calculating a pointer variable of a stripe cache information structure corresponding to a block number in a cache structure corresponding to a stripe number, and reading data based on the pointer variable includes:
calculating a pointer variable of the sceExtension [ i ] according to a formula of Sce psce = sceExtension + stripnum/4, wherein the psce is the pointer variable of the sceExtension [ i ], the sceExtension is the address of the first element in the array sceExtension [ i ] of the strip cache information structure, and the stripnum is the number of the blocks;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
In a preferred embodiment of the present invention, the memory applied for the application includes a memory corresponding to the block cache and a memory corresponding to the cache pointer variable.
In a preferred embodiment of the present invention, the object pointed to by the cache pointer variable is 256 bytes of memory.
In a preferred embodiment of the present invention, further comprising:
it is determined whether the read data is a cache hit based on the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 5 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 5, the computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the method of:
and determining the number of the blocks in each stripe in the disk array, and constructing a stripe cache information structure body. Determining the number x of the partitioned blocks in each stripe in the disk array according to the requirement, wherein the maximum value of x is 16, the minimum value of x is 5, and reconstructing a stripe cache information structure sde struct { sce sche scextension [ i ] }, wherein the maximum value of i in the array of scextension [ i ] is 4, and the minimum value is 1, based on the reconstructed stripe cache information structure, only allocating memory of [ (x/4) integer +1] × 8 bytes to store a pointer variable, and saving memory of x 8- [ (x + 3)/4 ] × 8 bytes for each stripe, for example, when creating a raid6 stripe with the width of 16, saving memory of 16 × 8-4*8 bytes for each stripe.
And applying for memory from the fixed object pool according to the number of the blocks in each stripe. Based on the number x of the blocks and the reconstructed stripe cache information structure, the size of the applied memory can be calculated according to a formula [ (x + 3)/4 ] by (8 + 256) and the applied memory with the corresponding size is applied, wherein the applied memory comprises the memory corresponding to the block cache and the memory corresponding to the cache pointer variable, the object pointed by the cache pointer variable is 256 bytes of memory, the size of each sce is 64 bytes, and then 4 sce can be actually stored in the memory allocated to one pointer variable in one sce extensions [ i ] array.
And responding to the disk array to carry out an io reading flow, and solving the stripe number and the block number of the data to be read according to the array address of the io reading flow. When the io reading process is performed on the disk array, the stripe number and the block number of the data in the normal raid can be calculated according to the address in the io reading process, and the calculation method can use any method in the prior art for calculation, which is not described herein again.
And calculating a pointer variable of a stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable. After the stripe number and the partition number of the data in the normal raid are calculated, a pointer variable of the data in the reconstructed stripe cache information structure needs to be calculated, a pointer variable of a seeextension [ i ] can be calculated according to a formula Sce × psce = seeextension + stride/4, where psextension is the pointer variable of the seeextension [ i ], the seeextension is an address of a first element in an array scextension [ i ] of the stripe cache information structure, and stride is a partition number, then the partition number of the partition number in the stripe cache information structure is calculated according to a formula stripnum & =3, and stride is the partition number, and finally the pointer variable of the corresponding stripe cache block number in the cache structure corresponding to the stripe number is calculated according to a formula pointer variable = psxtension + stride, where the pointer variable after the stride is calculated according to a second formula. After the pointer variable of the cache structure corresponding to the block is obtained, the information of the cache of the block can be obtained through the pointer variable of sce, whether the cache of the data read based on the pointer variable is hit needs to be judged when the data is read, if the cache is hit, the data is read from the block corresponding to the pointer variable, if the cache is not hit, the data is read from a disk, and the read result is stored in the structure corresponding to the pointer variable.
In a preferred embodiment of the present invention, determining the number of blocks in each stripe in the disk array, and constructing the stripe cache information structure includes:
determining the number x of the blocks in each strip in the disk array, wherein x is more than or equal to 5 and less than or equal to 16;
and constructing a strip cache information structure sde struct { sce SceExtension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4.
In a preferred embodiment of the present invention, applying for memory from a pool of fixed objects based on the number of partitions within each stripe comprises:
and (8 + 256) according to the formula [ (x + 3)/4 ] to calculate the size of the applied memory and apply for the memory with the corresponding size.
In a preferred embodiment of the present invention, calculating a pointer variable of a stripe cache information structure corresponding to a block number in a cache structure corresponding to a stripe number, and reading data based on the pointer variable includes:
calculating a pointer variable of the sceExtension [ i ] according to a formula of Sce psce = sceExtension + stripnum/4, wherein the psce is the pointer variable of the sceExtension [ i ], the sceExtension is the address of the first element in the array sceExtension [ i ] of the strip cache information structure, and the stripnum is the number of the blocks;
calculating the block number of the block number in the stripe cache information structure body according to the formula stripnum & =3, wherein stripnum is the block number;
and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number according to the formula pointer variable = psce + stripnum.
In a preferred embodiment of the present invention, the memory of the application includes a memory corresponding to the block cache and a memory corresponding to the cache pointer variable.
In a preferred embodiment of the present invention, the object pointed to by the cache pointer variable is 256 bytes of memory.
In a preferred embodiment of the present invention, the method further comprises:
it is determined whether the read data is a cache hit based on the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
In a preferred embodiment of the present invention, the method further comprises:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.
Claims (11)
1. A method for partitioned caching of an independent redundant disk array is characterized by comprising the following steps:
determining the number of blocks in each stripe in a disk array, and constructing a stripe cache information structure, wherein the number of blocks in each stripe in the disk array is determined, and the constructing of the stripe cache information structure comprises the steps of determining the number x of blocks in each stripe in the disk array, wherein x is more than or equal to 5 and less than or equal to 16, and constructing a stripe cache information structure sd < struct { sce. Sceeeextension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4, wherein sce is a structure for storing data information of the blocks;
applying for memory from a fixed object pool according to the number of the blocks in each stripe;
responding to the disk array to carry out an io reading process, and solving the stripe number and the block number of the data to be read according to the array address of the io reading process;
calculating a pointer variable of a stripe cache information structure body corresponding to a partition number in a cache structure corresponding to the stripe number, and reading data based on the pointer variable, wherein calculating the pointer variable of the stripe cache information structure body corresponding to the partition number in the cache structure corresponding to the stripe number, and reading data based on the pointer variable comprises: calculating a pointer variable of the scextension [ i ] according to a formula sceptce = scextension + stripnum/4, wherein the psce is the pointer variable of the scextension [ i ], the scextension is an address of a first element in an array scextension [ i ] of the stripe cache information structure, the stripnum is a segment number, calculating the segment number of the segment number in the stripe cache information structure according to a formula stripnum & =3, and according to the formula: and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number by the pointer variable = psce + stripnum, and reading data by the calculated pointer variable.
2. The method of claim 1, wherein applying for memory from a pool of fixed objects based on the number of partitions within each stripe comprises:
calculating the size of the applied memory according to the formula [ (x + 3)/4 ] (8 + 256) and applying for the memory with the corresponding size, wherein the calculation result of [ (x + 3)/4 ] is rounded.
3. The method of claim 2, wherein the memory requested includes a memory corresponding to the partitioned cache and a memory corresponding to the cache pointer variable.
4. The method of claim 3, wherein the object pointed to by the cache pointer variable is 256 bytes of memory.
5. The method of claim 1, further comprising:
it is determined whether the read data is a cache hit based on the pointer variable.
6. The method of claim 5, further comprising:
in response to a cache hit, data is read from the block corresponding to the pointer variable.
7. The method of claim 5, further comprising:
in response to a cache miss, data is read from disk and the result of the read is stored in a structure corresponding to the pointer variable.
8. An apparatus for partitioned caching of Redundant Array of Independent Disks (RAID), the apparatus comprising:
the system comprises a construction module, a cache module and a cache module, wherein the construction module is configured to determine the number of blocks in each stripe in a disk array and construct a stripe cache information structure, the construction module is further configured to determine the number x of blocks in each stripe in the disk array, wherein x is more than or equal to 5 and less than or equal to 16, and construct a stripe cache information structure sd < struct { sce. Sce extension [ i ] }, wherein i is more than or equal to 1 and less than or equal to 4, and sce is a structure for storing data information of the stripes;
an application module configured to apply for memory from a fixed object pool according to the number of partitions within each stripe;
the first computing module is configured to respond to a disk array to perform an io reading process, and obtain a stripe number and a block number of data to be read according to an array address of the io reading process;
a second calculating module, configured to calculate a pointer variable of a stripe cache information structure corresponding to a partition number in a cache structure corresponding to the stripe number, and read data based on the pointer variable, and further configured to calculate a pointer variable of a sceExtension [ i ] according to a formula Sce × psce = sceExtension + stripnum/4, where pseextension is an address of a first element in an array sceExtension [ i ] of the stripe cache information structure, stripnum is the partition number, calculate a partition number of the partition number in the stripe cache information structure according to a formula stipnum & =3, and according to the formula: and calculating the pointer variable of the stripe cache information structure body corresponding to the block number in the cache structure corresponding to the stripe number by the pointer variable = psce + stripnum, and reading data by the calculated pointer variable.
9. The apparatus of claim 8, wherein the application module is further configured to:
calculating the size of the applied memory according to the formula [ (x + 3)/4 ] (8 + 256) and applying for the memory with the corresponding size, wherein the calculation result of [ (x + 3)/4 ] is rounded.
10. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211059821.3A CN115129265B (en) | 2022-09-01 | 2022-09-01 | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks |
PCT/CN2023/114783 WO2024046213A1 (en) | 2022-09-01 | 2023-08-24 | Method and apparatus for caching blocks of redundant array of independent disks, and device and readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211059821.3A CN115129265B (en) | 2022-09-01 | 2022-09-01 | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115129265A CN115129265A (en) | 2022-09-30 |
CN115129265B true CN115129265B (en) | 2023-01-24 |
Family
ID=83386891
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211059821.3A Active CN115129265B (en) | 2022-09-01 | 2022-09-01 | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115129265B (en) |
WO (1) | WO2024046213A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115129265B (en) * | 2022-09-01 | 2023-01-24 | 苏州浪潮智能科技有限公司 | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks |
CN115373609A (en) * | 2022-10-25 | 2022-11-22 | 浪潮电子信息产业股份有限公司 | Task processing method and related equipment |
CN115543216B (en) * | 2022-11-29 | 2023-03-21 | 苏州浪潮智能科技有限公司 | Disk array distribution architecture, block calculation method, system, device and medium |
CN115543696B (en) * | 2022-11-30 | 2023-03-17 | 苏州浪潮智能科技有限公司 | Disk array reconstruction task acceleration method, system, storage medium and equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4401305B2 (en) * | 2005-02-09 | 2010-01-20 | 富士通株式会社 | Configuration definition setting method of disk array device and disk array device |
CN103049222B (en) * | 2012-12-28 | 2016-05-25 | 中国船舶重工集团公司第七0九研究所 | A kind of RAID5 writes IO optimized treatment method |
CN111007987A (en) * | 2019-11-08 | 2020-04-14 | 苏州浪潮智能科技有限公司 | Memory management method, system, terminal and storage medium for raid io |
CN112148218B (en) * | 2020-09-11 | 2023-12-22 | 北京浪潮数据技术有限公司 | Method, device, equipment and storage medium for storing check data of disk array |
CN114064979A (en) * | 2021-11-02 | 2022-02-18 | 郑州云海信息技术有限公司 | Method for accelerating acquisition of storage data of RAID (redundant array of independent disks), computer and storage medium |
CN115129265B (en) * | 2022-09-01 | 2023-01-24 | 苏州浪潮智能科技有限公司 | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks |
-
2022
- 2022-09-01 CN CN202211059821.3A patent/CN115129265B/en active Active
-
2023
- 2023-08-24 WO PCT/CN2023/114783 patent/WO2024046213A1/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2024046213A1 (en) | 2024-03-07 |
CN115129265A (en) | 2022-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115129265B (en) | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks | |
US8533397B2 (en) | Improving performance in a cache mechanism by way of destaging data in partial strides | |
CN103399823B (en) | The storage means of business datum, equipment and system | |
CN111857572B (en) | Data writing method, device and equipment of TLC solid state disk and storage medium | |
JP2002312130A (en) | Method for improved parity-stripe processing | |
CN101751343A (en) | Method for writing data in solid-state hard-disk and device thereof | |
CN113282249B (en) | Data processing method, system, device and medium | |
US20100161890A1 (en) | Cache management method and cache device using sector set | |
CN115599313B (en) | Disk array capacity expansion method, system, storage medium and equipment | |
CN111399767A (en) | IO request processing method, system, equipment and computer readable storage medium | |
CN113326005A (en) | Read-write method and device for RAID storage system | |
CN115933994A (en) | Data processing method and device, electronic equipment and storage medium | |
CN102096562A (en) | Data writing method and device | |
CN115576501A (en) | Node updating method, system and related device of RAID card | |
US8402199B2 (en) | Memory management system and method thereof | |
CN114385089A (en) | Cross addressing-based dynamic bank storage method and device and electronic equipment | |
CN116382582A (en) | RAID remapping method, system, equipment and storage medium | |
CN115639968B (en) | Method, device, equipment and medium for allocating RAID (redundant array of independent disks) capacity space | |
CN115904255A (en) | Data request method, device, equipment and storage medium | |
US20070124544A1 (en) | Multi-interfaced memory | |
US20220318015A1 (en) | Enforcing data placement requirements via address bit swapping | |
CN107861890A (en) | Memory access processing method, device and electronic equipment | |
CN112988074B (en) | Storage system management software adaptation method and device | |
CN112015328B (en) | Method and device for creating 5 th-level redundant array of independent disks | |
CN116360701A (en) | Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |