CN116360701A - Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks) - Google Patents

Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks) Download PDF

Info

Publication number
CN116360701A
CN116360701A CN202310345227.9A CN202310345227A CN116360701A CN 116360701 A CN116360701 A CN 116360701A CN 202310345227 A CN202310345227 A CN 202310345227A CN 116360701 A CN116360701 A CN 116360701A
Authority
CN
China
Prior art keywords
data
block
pointers
reading
data pointers
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.)
Pending
Application number
CN202310345227.9A
Other languages
Chinese (zh)
Inventor
孙波
邵海波
朱雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202310345227.9A priority Critical patent/CN116360701A/en
Publication of CN116360701A publication Critical patent/CN116360701A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 reading a data pointer of RAID, wherein the method comprises the following steps: grouping all stripes in the RAID according to a preset stepping value, and dividing the RAID into a plurality of blocks by taking each group as a block; and in response to receiving an instruction for reading the data pointers in the RAID, sequentially reading the data pointers in each block, and storing the read data pointers. By using the scheme of the invention, the problem that the current read content is stored discontinuously in the DDR can be solved, and the problem of hardware resource redundancy caused by once reading all data pointers in the RAID array can be solved.

Description

Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks)
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, apparatus, device, and readable medium for reading data pointers of RAID.
Background
The RAID technology combines a plurality of independent physical hard disks into a logic hard disk in different modes, thereby improving the read-write performance and the data security of the hard disk.
In some special processing scenarios, for example, when all data_pointers in the whole RAID array need to be read, because the RAID array has a large number of disks and a large number of sub-stripes, the buffer depth needs to be large to put down the data_pointers of the whole array at a time, which has a certain requirement on hardware resources. In an actual chip, the data_pointer of the whole array is read at one time, the hardware is certainly required to have a larger buffer, however, when the number of disks of the RAID array is smaller, the number of sub-stripes is smaller, and the larger buffer is certainly wasteful of resources and cost.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method, apparatus, device and readable medium for reading data pointers of RAID, which can solve the problem of discontinuous storage of current read contents in DDR and solve the problem of hardware resource redundancy caused by once reading all data pointers in RAID array.
Based on the above objects, an aspect of an embodiment of the present invention provides a method for reading a data pointer of a RAID, including the steps of:
grouping all stripes in the RAID according to a preset stepping value, and taking each group as a block to divide the RAID into a plurality of blocks (partitioning blocks);
and in response to receiving an instruction for reading the data pointers in the RAID, sequentially reading the data pointers in each block, and storing the read data pointers.
According to one embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction for reading a data pointer in the RAID, reading the data pointer in the first block into a cache, and storing the data pointer in the cache;
releasing the buffer memory space and reading the data pointers in the second block into the buffer memory in response to the completion of the data pointer storage in the buffer memory, and storing the data pointers in the buffer memory;
and in response to the completion of the data pointer storage in the cache, releasing the cache space and continuing to read the data pointers in the next block until the complete reading of the data pointers in the RAID is completed.
According to one embodiment of the present invention, further comprising:
acquiring the number of stripes, the number of disks, the size of a data page, the initial offset of the data page and a pointer pointing to the next data page;
calculating the position of a first data pointer stored in a first data page according to the data page size and the data page starting offset;
the data pointers stored in each data page are calculated based on the location of the first data pointer and the data page size.
According to one embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction to read a data pointer in the RAID, reading the data pointer of a first disk in a first block according to the position and the step value of the first data pointer stored in the first data page;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the first block, reading the data pointer of the second disk in the first block according to the stepping value, and repeating the steps until the data pointers of all the disks in the first block are read.
According to one embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the first block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position and the stepping value of the first data pointer stored in the first data page, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the second block according to the stepping value;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the second block, reading the data pointers of the second disk in the second block according to the stepping value, and repeating the steps until the data pointers of all the disks in the second block are read.
According to one embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the previous block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position of the first data pointer stored in the first data page, the stepping value and the number of the block, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the block according to the stepping value;
calculating the number of data pointers to be skipped according to the number of stripes, the stepping value and the number of the blocks, starting to skip a corresponding number of data pointers at the next data pointer of the last data pointer of the first disk in the block, reading the data pointer of the second disk in the block according to the stepping value, and repeating the steps until the data pointers of all the disks in the block are read;
repeating the steps until the reading of the data pointers of all the blocks in the RAID is completed.
According to one embodiment of the present invention, further comprising:
the process of reading the data pointer by each block is divided into 6 states, wherein the state 1 is that the read part does not span the data page, the state 2 is that the read part spans the data page, the state 3 is that the read part ends at the tail of the data page, the state 4 is that the skipped part does not span the data page, the state 5 is that the skipped part spans the data page, and the state 6 is that the skipped part ends at the tail of the data page.
In another aspect of the embodiment of the present invention, there is also provided an apparatus for reading a data pointer of a RAID, including:
the dividing module is configured to group all stripes in the RAID according to a preset stepping value, and each group is used as a block to divide the RAID into a plurality of blocks;
and the reading module is configured to respond to the received instruction of reading the data pointers in the RAID, sequentially read the data pointers in each block and store the read data pointers.
In another aspect of the embodiments of the present invention, there is also provided a computer apparatus including:
at least one processor; and
and a memory storing computer instructions executable on the processor, the instructions when executed by the processor performing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the methods described above.
The invention has the following beneficial technical effects: the method for reading the data pointer of the RAID provided by the embodiment of the invention groups all stripes in the RAID according to the preset stepping value, and takes each group as a block to divide the RAID into a plurality of blocks; the technical scheme of sequentially reading the data pointers in each block and storing the read data pointers in response to receiving the instruction of reading the data pointers in the RAID can solve the problem that the current read content is stored discontinuously in the DDR, and can solve the problem of hardware resource redundancy caused by once reading all the data pointers in the RAID array.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method of reading data pointers of a RAID according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of a RAID array data_pointer in DDR page save according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a partition of RAID array data according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of a first block read according to one embodiment of the invention;
FIG. 5 is a schematic diagram of the reading of an intermediate partition according to one embodiment of the invention;
FIG. 6 is a schematic diagram of the reading of the last chunk according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an apparatus for reading data pointers of a RAID according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a computer device according to one embodiment of the invention;
fig. 9 is a schematic diagram of a computer-readable storage medium according to one embodiment of the 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 will be described in further detail with reference to the accompanying drawings.
First, the meanings corresponding to English and abbreviations in the present invention are described as follows:
redundant Array of Independent Disks (RAID), redundant array of independent disks;
strip, strip;
sub_stripe, sub stripe;
chunk_size, number of sub-stripes;
step_num, step value;
drv_num, number of physical disks;
link_pointer, pointer to next page;
data_pointer;
page, data Page;
page_size, data Page size;
buffer, buffer;
read_addr, read address;
page_remain, the current Page remaining space;
offset, start Offset;
current step num, the number of sub-bands contained in the Current portion needs to be read;
page_start_addr, the current Page starting address;
seg_domain, the remaining number of parts currently to be read after the page is crossed;
current_gap_num, the number of sub-bands contained in the Current part to be skipped;
gap_domain, the remaining number of parts after the cross-page that currently need to be skipped.
With the above object in view, in a first aspect, an embodiment of a method for reading data pointers of a RAID is provided. Fig. 1 shows a schematic flow chart of the method.
As shown in fig. 1, the method may include the steps of:
s1, grouping all stripes in the RAID according to a preset stepping value, and dividing the RAID into a plurality of blocks by taking each grouping as one block. The preset step value is the number of stripes contained in one block, i.e. the blocks are divided according to the number of stripes, for example, the RAID has 130 total stripes, the step value is set to 64, the first block is the first 64 stripes, the second block is the middle 64 stripes, the third block is the last 2 stripes, and the step value can be set according to the requirement. The data_pointer of the RAID array is shown in FIG. 2 in relation to page pages in DDR (e.g., page pages can hold 1023 data_pointers). The RAID array is partitioned by a stepping value of 64, a block diagram is shown in fig. 3, the whole RAID array is split into 3 blocks, and the number of sub-stripes of each block is 64, 64 and 2 respectively.
S2, in response to receiving an instruction for reading the data pointers in the RAID, sequentially reading the data pointers in each block, and storing the read data pointers. Reading the data_pointers of one block each time, namely reading the data_pointers of 64 sub-stripes each time, storing the data_pointers of the block, then releasing the cache space, and continuing to read the data_pointers of the next block until the data_pointers of the whole RAID array are read after the cache space is released. The process of reading the data_pointers of each chunk is shown in FIGS. 4-6, e.g., reading the data_pointers corresponding to D0-D63 in the first chunk, then skipping the data_pointers corresponding to D64-D129, then reading the data_pointers corresponding to D130-D193, then skipping the data_pointers corresponding to D194-D259, and so on until the data_pointers of the first chunk are read. When the data_pointer of the second block is read, the data_pointer corresponding to D0-D63 is skipped, the data_pointer corresponding to D64-D127 is read, the data_pointer corresponding to D128-D193 is skipped, the data_pointer corresponding to D194-D257 is read, and so on until the data_pointer of the second block is read, and the reading of the remaining blocks is similar to the above process.
By using the technical scheme of the invention, the problem that the current read content is stored discontinuously in the DDR can be solved, and the problem of hardware resource redundancy caused by once reading all data pointers in the RAID array can be solved.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction for reading a data pointer in the RAID, reading the data pointer in the first block into a cache, and storing the data pointer in the cache;
releasing the buffer memory space and reading the data pointers in the second block into the buffer memory in response to the completion of the data pointer storage in the buffer memory, and storing the data pointers in the buffer memory;
and in response to the completion of the data pointer storage in the cache, releasing the cache space and continuing to read the data pointers in the next block until the complete reading of the data pointers in the RAID is completed. By partitioning RAID, reading data_pointer of one block each time, reading another block after the cache resource of the current block is released, and so on, the algorithm of data_pointer partitioned reading in the array is realized, and the problem of reading larger data volume with smaller buffer depth is solved.
In a preferred embodiment of the present invention, further comprising:
acquiring the number of stripes, the number of disks, the size of a data page, the initial offset of the data page and a pointer pointing to the next data page;
calculating the position of a first data pointer stored in a first data page according to the data page size and the data page starting offset;
the data pointers stored in each data page are calculated based on the location of the first data pointer and the data page size. In a data page, the position of the first data pointer stored in the first data page is obtained by subtracting the start offset of the data page from the size (capacity size) of the data page, as shown in fig. 2, the data pointers are stored sequentially in the data page, knowing the position of the first data pointer and the size of the data page, it is known how many data pointers are stored in the first data page, i.e. which data pointer is the last data pointer stored in the first data page, then the first data pointer stored in the next data page is known, and so on, and the data pointers stored in each data page are all calculated.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction to read a data pointer in the RAID, reading the data pointer of a first disk in a first block according to the position and the step value of the first data pointer stored in the first data page;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the first block, reading the data pointer of the second disk in the first block according to the stepping value, and repeating the steps until the data pointers of all the disks in the first block are read.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the first block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position and the stepping value of the first data pointer stored in the first data page, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the second block according to the stepping value;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the second block, reading the data pointers of the second disk in the second block according to the stepping value, and repeating the steps until the data pointers of all the disks in the second block are read.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the previous block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position of the first data pointer stored in the first data page, the stepping value and the number of the block, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the block according to the stepping value;
calculating the number of data pointers to be skipped according to the number of stripes, the stepping value and the number of the blocks, starting to skip a corresponding number of data pointers at the next data pointer of the last data pointer of the first disk in the block, reading the data pointer of the second disk in the block according to the stepping value, and repeating the steps until the data pointers of all the disks in the block are read;
repeating the steps until the reading of the data pointers of all the blocks in the RAID is completed. As shown in fig. 4-6, the data pointers of each disk in each block are not continuous, and the data pointers of other blocks need to be skipped for reading, after the data pointers stored in each data page can be obtained through calculation, the number of the data pointers needing to be skipped can be calculated according to the number of stripes and the stepping value, so that the data pointers needed to be read by each block in each data page can be read.
In a preferred embodiment of the present invention, further comprising:
the process of reading the data pointer by each block is divided into 6 states, wherein the state 1 is that the read part does not span the data page, the state 2 is that the read part spans the data page, the state 3 is that the read part ends at the tail of the data page, the state 4 is that the skipped part does not span the data page, the state 5 is that the skipped part spans the data page, and the state 6 is that the skipped part ends at the tail of the data page. The size of the data page is limited and therefore the above 6 states can occur. State 1 when all data_pointers to be read are in one data page, state 2 when not all data_pointers to be read are in one data page, state 3 when the last data_pointer to be read is at the end of the current data page, state 4 when all skipped parts are in one data page, state 5 when not all skipped parts are in one data page, and state 6 when skipped parts are at the end of the data page.
The data_pointer in the RAID array is calculated to occupy the page number in the DDR, and the calculation formula is as follows:
cross_page_num=(chunk_size*drv_num)/page_size。
then loop through cross_page_num:
for(int i=0;i<cross_page_num;i++)begin
and End, recording the state of each page, namely the current page residual space, when traversing the pages. In the cycle of traversing the cross_page_num, the 6 states are mutually skipped until the data_pointer of the current block is read out. For the 1 st to the second last block internal processing logic, its current_step_num is the step value step_num, its current_gap_num=chunk_size-step_num, whereas for the last block its current_step_num=chunk_size% step_num, its current_gap_num=chunk_size-current_step_num.
The segment_num is traversed outside the for loop traversed by the cross_page_num, and whether the current block is the last block is judged, and the specific implementation is as follows:
Figure BDA0004160268600000111
by using the technical scheme of the invention, the problem that the current read content is stored discontinuously in the DDR can be solved, and the problem of hardware resource redundancy caused by once reading all data pointers in the RAID array can be solved.
It should be noted that, it will be understood by those skilled in the art that all or part of the procedures in implementing the methods of the above embodiments may be implemented by a computer program to instruct related hardware, and the above program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the above methods when executed. Wherein the storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
Furthermore, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When executed by a CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
In view of the above object, a second aspect of the embodiments of the present invention provides an apparatus for reading data pointers of a RAID, as shown in fig. 7, an apparatus 200 includes:
the dividing module is configured to group all stripes in the RAID according to a preset stepping value, and each group is used as a block to divide the RAID into a plurality of blocks;
and the reading module is configured to respond to the received instruction of reading the data pointers in the RAID, sequentially read the data pointers in each block and store the read data pointers.
Based on the above object, a third aspect of the embodiments of the present invention proposes a computer device. FIG. 8 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 8, an 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 performing the method of:
grouping all stripes in the RAID according to a preset stepping value, and dividing the RAID into a plurality of blocks by taking each group as a block;
and in response to receiving an instruction for reading the data pointers in the RAID, sequentially reading the data pointers in each block, and storing the read data pointers.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction for reading a data pointer in the RAID, reading the data pointer in the first block into a cache, and storing the data pointer in the cache;
releasing the buffer memory space and reading the data pointers in the second block into the buffer memory in response to the completion of the data pointer storage in the buffer memory, and storing the data pointers in the buffer memory;
and in response to the completion of the data pointer storage in the cache, releasing the cache space and continuing to read the data pointers in the next block until the complete reading of the data pointers in the RAID is completed.
In a preferred embodiment of the present invention, further comprising:
acquiring the number of stripes, the number of disks, the size of a data page, the initial offset of the data page and a pointer pointing to the next data page;
calculating the position of a first data pointer stored in a first data page according to the data page size and the data page starting offset;
the data pointers stored in each data page are calculated based on the location of the first data pointer and the data page size.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
in response to receiving an instruction to read a data pointer in the RAID, reading the data pointer of a first disk in a first block according to the position and the step value of the first data pointer stored in the first data page;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the first block, reading the data pointer of the second disk in the first block according to the stepping value, and repeating the steps until the data pointers of all the disks in the first block are read.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the first block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position and the stepping value of the first data pointer stored in the first data page, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the second block according to the stepping value;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the second block, reading the data pointers of the second disk in the second block according to the stepping value, and repeating the steps until the data pointers of all the disks in the second block are read.
In a preferred embodiment of the present invention, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers includes:
responding to complete reading of the data pointers in the previous block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position of the first data pointer stored in the first data page, the stepping value and the number of the block, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the block according to the stepping value;
calculating the number of data pointers to be skipped according to the number of stripes, the stepping value and the number of the blocks, starting to skip a corresponding number of data pointers at the next data pointer of the last data pointer of the first disk in the block, reading the data pointer of the second disk in the block according to the stepping value, and repeating the steps until the data pointers of all the disks in the block are read;
repeating the steps until the reading of the data pointers of all the blocks in the RAID is completed.
In a preferred embodiment of the present invention, further comprising:
the process of reading the data pointer by each block is divided into 6 states, wherein the state 1 is that the read part does not span the data page, the state 2 is that the read part spans the data page, the state 3 is that the read part ends at the tail of the data page, the state 4 is that the skipped part does not span the data page, the state 5 is that the skipped part spans the data page, and the state 6 is that the skipped part ends at the tail of the data page.
Based on the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. Fig. 9 is a schematic diagram showing an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 9, the computer-readable storage medium 31 stores a computer program 32 that when executed by a processor performs the above method.
Furthermore, the method disclosed according to the embodiment 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. The above-described functions defined in the methods disclosed in the embodiments of the present invention are performed when the computer program is executed by a processor.
Furthermore, the above-described method steps and system units may also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-described steps or unit functions.
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 present disclosure.
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 location 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 general purpose or special purpose processor. Further, 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 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 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 foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages 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 for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.

Claims (10)

1. A method of reading a data pointer of a RAID, comprising the steps of:
grouping all stripes in the RAID according to a preset stepping value, and dividing the RAID into a plurality of blocks by taking each group as a block;
and in response to receiving an instruction for reading the data pointers in the RAID, sequentially reading the data pointers in each block, and storing the read data pointers.
2. The method of claim 1, wherein, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers comprises:
in response to receiving an instruction for reading a data pointer in the RAID, reading the data pointer in the first block into a cache, and storing the data pointer in the cache;
releasing the buffer memory space and reading the data pointers in the second block into the buffer memory in response to the completion of the data pointer storage in the buffer memory, and storing the data pointers in the buffer memory;
and in response to the completion of the data pointer storage in the cache, releasing the cache space and continuing to read the data pointers in the next block until the complete reading of the data pointers in the RAID is completed.
3. The method as recited in claim 1, further comprising:
acquiring the number of stripes, the number of disks, the size of a data page, the initial offset of the data page and a pointer pointing to the next data page;
calculating the position of a first data pointer stored in a first data page according to the data page size and the data page starting offset;
the data pointers stored in each data page are calculated based on the location of the first data pointer and the data page size.
4. A method according to claim 3, wherein, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers comprises:
in response to receiving an instruction to read a data pointer in the RAID, reading the data pointer of a first disk in a first block according to the position and the step value of the first data pointer stored in the first data page;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the first block, reading the data pointer of the second disk in the first block according to the stepping value, and repeating the steps until the data pointers of all the disks in the first block are read.
5. The method of claim 4, wherein, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers comprises:
responding to complete reading of the data pointers in the first block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position and the stepping value of the first data pointer stored in the first data page, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the second block according to the stepping value;
and calculating the number of data pointers to be skipped according to the number of the stripes and the stepping value, starting to skip a plurality of data pointers corresponding to the next data pointer of the last data pointer of the first disk in the second block, reading the data pointers of the second disk in the second block according to the stepping value, and repeating the steps until the data pointers of all the disks in the second block are read.
6. The method of claim 5, wherein, in response to receiving an instruction to read data pointers in a RAID, sequentially reading the data pointers in each block and storing the read data pointers comprises:
responding to complete reading of the data pointers in the previous block, storing the read data pointers and releasing corresponding cache spaces;
responding to the completion of the buffer space release, calculating the number of data pointers to be skipped according to the position of the first data pointer stored in the first data page, the stepping value and the number of the block, starting to skip the corresponding number of data pointers from the first data pointer, and reading the data pointer of the first disk in the block according to the stepping value;
calculating the number of data pointers to be skipped according to the number of stripes, the stepping value and the number of the blocks, starting to skip a corresponding number of data pointers at the next data pointer of the last data pointer of the first disk in the block, reading the data pointer of the second disk in the block according to the stepping value, and repeating the steps until the data pointers of all the disks in the block are read;
repeating the steps until the reading of the data pointers of all the blocks in the RAID is completed.
7. The method as recited in claim 1, further comprising:
the process of reading the data pointer by each block is divided into 6 states, wherein the state 1 is that the read part does not span the data page, the state 2 is that the read part spans the data page, the state 3 is that the read part ends at the tail of the data page, the state 4 is that the skipped part does not span the data page, the state 5 is that the skipped part spans the data page, and the state 6 is that the skipped part ends at the tail of the data page.
8. An apparatus for reading data pointers of a RAID, the apparatus comprising:
the dividing module is configured to group all stripes in the RAID according to a preset stepping value, and each group is used as a block to divide the RAID into a plurality of blocks;
and the reading module is configured to respond to the received instruction of reading the data pointers in the RAID, sequentially read the data pointers in each block and store the read data pointers.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method of any one of claims 1-7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any one of claims 1-7.
CN202310345227.9A 2023-03-30 2023-03-30 Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks) Pending CN116360701A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310345227.9A CN116360701A (en) 2023-03-30 2023-03-30 Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310345227.9A CN116360701A (en) 2023-03-30 2023-03-30 Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks)

Publications (1)

Publication Number Publication Date
CN116360701A true CN116360701A (en) 2023-06-30

Family

ID=86923631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310345227.9A Pending CN116360701A (en) 2023-03-30 2023-03-30 Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks)

Country Status (1)

Country Link
CN (1) CN116360701A (en)

Similar Documents

Publication Publication Date Title
CN103136243B (en) File system duplicate removal method based on cloud storage and device
CN106874348B (en) File storage and index method and device and file reading method
CN102682012A (en) Method and device for reading and writing data in file system
CN111868705B (en) Recording device, reading device, recording method, reading method, and magnetic tape
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
CN115129265B (en) Partitioned caching method, device, equipment and readable medium for redundant array of independent disks
CN103399823A (en) Method, equipment and system for storing service data
US8347052B2 (en) Initializing of a memory area
CN109558456A (en) A kind of file migration method, apparatus, equipment and readable storage medium storing program for executing
CN113282249B (en) Data processing method, system, device and medium
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
CN105808451B (en) Data caching method and related device
CN103970512A (en) Multi-core processor and parallel replay method thereof
CN115933994B (en) Data processing method and device, electronic equipment and storage medium
CN116382582A (en) RAID remapping method, system, equipment and storage medium
CN116431080A (en) Data disc-dropping method, system, equipment and computer readable storage medium
CN116225314A (en) Data writing method, device, computer equipment and storage medium
CN116360701A (en) Method, device, equipment and medium for reading data pointer of RAID (redundant array of independent disks)
CN106469174B (en) Method for reading data and device
CN111880735A (en) Data migration method, device, equipment and storage medium in storage system
CN111435331A (en) Data writing method and device for storage volume, electronic equipment and machine-readable storage medium
CN107547648A (en) A kind of internal data clone method and device
CN111324280B (en) Data writing method and device based on Raid5
CN111177091B (en) Video pre-distribution storage method, system and storage medium based on XFS file system
CN106991021A (en) The method and system of new data file are built from available data file

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