CN104598336B - Method for reconstructing and device based on RAID algorithm - Google Patents

Method for reconstructing and device based on RAID algorithm Download PDF

Info

Publication number
CN104598336B
CN104598336B CN201510058699.1A CN201510058699A CN104598336B CN 104598336 B CN104598336 B CN 104598336B CN 201510058699 A CN201510058699 A CN 201510058699A CN 104598336 B CN104598336 B CN 104598336B
Authority
CN
China
Prior art keywords
data
band
raid
reading
disk
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
Application number
CN201510058699.1A
Other languages
Chinese (zh)
Other versions
CN104598336A (en
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.)
Shenzhou Yunke Beijing Technology Co ltd
Wuhan Shenzhou Digital Cloud Technology Co ltd
Original Assignee
Shenzhen Science And Technology Co Ltd Digital Cloud Data
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 Shenzhen Science And Technology Co Ltd Digital Cloud Data filed Critical Shenzhen Science And Technology Co Ltd Digital Cloud Data
Priority to CN201510058699.1A priority Critical patent/CN104598336B/en
Publication of CN104598336A publication Critical patent/CN104598336A/en
Application granted granted Critical
Publication of CN104598336B publication Critical patent/CN104598336B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention provides a kind of method for reconstructing based on RAID algorithm, this method includes:When carrying out data reconstruction, acquisition needs the bar for the band rebuild locking, reads the data of the band;According to the data configuration of reading and write the data of disk for needing to rebuild.Present invention also offers a kind of reconstructing device based on RAID algorithm, which includes read through model and writing module.The present invention is by independently of the reconstruction thread outside RAID algorithm so that the process in RAID algorithm on reconstruction obtains high abstraction, and can be by the received event intervention of RAID structure, and simplify each algorithms of RAID realizes process, makes whole system be easier to safeguard.

Description

Method for reconstructing and device based on RAID algorithm
Technical field
The present invention relates to field of computer technology, and in particular to method for reconstructing and device based on RAID algorithm.
Background technology
Disk array (Redundant Arrays of independent Disks, abbreviation RAID), there is " independent disk The meaning of the array with redundant ability formed ".Principle is to make disk group using array mode, coordinates data dispersed arrangement Design, lifts the security of data.Disk array is by the relatively inexpensive disk of many prices, is combined into the huge magnetic of capacity Disk group, the whole disk system efficiency of addition effect promoting produced by providing data using indivedual disks.Using this technology, by number According to many sections are cut into, it is stored in respectively on each hard disk.Inserted again in data reconstruction, after data are computed new hard In disk.
In traditional RAID, since the principle inside each algorithm is different, often provided in specific algorithm Method for reconstructing, is produced by some specific algoritic module and rebuilds thread.
Traditional method for reconstructing is so not only created a large amount of multiple, it is necessary to each algorithm all each realizes method for reconstructing The miscellaneous code for being difficult to safeguard, adds and safeguards risk, and not intervening reconstruction outside algorithm, is sent out in state Thread is rebuild in switching plantation or startup that can not be efficiently and effectively during changing.
The content of the invention
The defects of for the prior art, the present invention provide a kind of method for reconstructing and device based on RAID, by independently of Reconstruction thread outside RAID algorithm so that the process in RAID algorithm on reconstruction obtains high abstraction, and can be by RAID The received event intervention of structure, simplify each algorithms of RAID realizes process, makes whole system be easier to safeguard.
In a first aspect, the present invention provides a kind of method for reconstructing based on RAID algorithm, the described method includes:
When carrying out data reconstruction, acquisition needs the bar for the band rebuild locking, reads the data of the band;
According to the data configuration of reading and write the data of disk for needing to rebuild.
Preferably, it is described when carrying out data reconstruction, the step of obtaining that the bar of band is locking, read the data of the band Before, the method further includes:
Judge whether disk array RAID is effective, if effectively, reading the data of band, otherwise stop rebuilding thread.
Preferably, behind the step of position by the data Write fault disk of reading, the method further includes:
The reconstruction of the band is marked to complete in the bitmap bitmap of RAID.
Preferably, the data for reading the band, including:
Construction reads the data of band described in I O read.
Preferably, the data configuration according to reading and the data for the disk for needing to rebuild are write, including:
According to the data configuration call back function of reading, the disk that data write-in is needed to rebuild.
Second aspect, the present invention provides a kind of reconstructing device based on RAID algorithm, described device includes:
Read through model, it is locking for when carrying out data reconstruction, obtaining the bar for the band for needing to rebuild, read the band Data;
Writing module, for the data configuration according to reading and writes the data of disk for needing to rebuild.
Preferably, described device further includes:
Determination module, for judging whether disk array RAID is effective, if effectively, reading the data of band, otherwise stopping Only rebuild thread.
Preferably, described device further includes:
Mark module, the reconstruction for marking the band in the bitmap bitmap of RAID have been completed.
Preferably, the read through model, is specifically used for:
Construction reads the data of band described in I O read.
Preferably, the writing module, is specifically used for:
According to the data configuration call back function of reading, the disk that data write-in is needed to rebuild.
As shown from the above technical solution, the present invention provides a kind of method for reconstructing and device based on RAID, by independently of Reconstruction thread outside RAID algorithm so that the process in RAID algorithm on reconstruction obtains high abstraction, and can be by RAID The received event intervention of structure, simplify each algorithms of RAID realizes process, makes whole system be easier to safeguard.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these figures.
Fig. 1 is the flow diagram for the method for reconstructing based on RAID algorithm that one embodiment of the invention provides;
Fig. 2 is the flow diagram for the method for reconstructing based on RAID algorithm that another embodiment of the present invention provides;
Fig. 3 is the structure diagram for the reconstructing device based on RAID algorithm that one embodiment of the invention provides.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work Embodiment, belongs to the scope of protection of the invention.
As shown in Figure 1, Fig. 1 shows the flow for the method for reconstructing based on RAID algorithm that one embodiment of the invention provides Figure, this method comprises the following steps:
101st, when carrying out data reconstruction, acquisition needs the bar for the band rebuild locking, reads the data of the band.
Wherein, construction reads the data of band described in I O read.
102nd, according to the data configuration of reading and the data of disk for needing to rebuild are write.
Wherein, according to the data configuration call back function of reading, the disk that data write-in is needed to rebuild.
Alternatively, further included before step 101:Judge whether disk array RAID is effective, if effectively, reading band Data, otherwise stop rebuilding thread.
Alternatively, further included after step 102:Mark the reconstruction of the band complete in the bitmap bitmap of RAID Into.
Specifically, the purpose rebuild in RAID algorithm is, as RAID because the extraction or damage of module disk are in After degrading state, due to the insertion of disk or the entrance of HotSpare disk so that RAID enters reconstruction state, in this case, is Ensure that the information of data disks in RAID groups and check disk is correct, it is necessary to ensure that the data for once dropping out the position of disk are weighed New write-in.
In fact for each reconstruction thread, if in units of band, reconstruction process can be attributed to reading magnetic Information on disk, and write the information of once out of order disk, two steps.In the present invention, it is only necessary to which RAID generic structures carry For, add bar locking, and write once out of order disk data call back function can complete rebuild process.
The specific workflow of the present invention:
Starting the process rebuild every time, the progress of reconstruction is started counting up from 0, and the unit rebuild every time is 1 band, After each reconstruction writes complete, this can be marked to rebuild in the bitmap of RAID and completed.During the past beginning scan rebuilding Directly skipped when running into reconstructed band.The reconstruction process of each band be obtain this band bar it is locking, check Whether suitably continue to rebuild under RAID current states, the data of the band are read if being adapted to, recall corresponding RAID algorithm Write back tune.
For each RAID algorithm, without being concerned about the scheduling of thread resources, the reading with data, need to only be concerned with how From one section of continuous data strip, calculate or directly intercept out data, and be sent to and be marked as in the disk that degradation is extracted, and Pause has been provided independently in the reconstruction module taken out, starts, and the interfaces such as thread priority is adjusted, for RAID management framework tune With.
Method provided in this embodiment, simplifies the reconstruction processing logic of RAID algorithm, enhances the maintainability of algorithm, The ability of RAID corresponding times is enhanced, reduces the time of state switching, more rapidly turns on and suspends and rebuild thread, it is right Disk, which releases bad and flash phenomenon, to have very great help.
As shown in Fig. 2, Fig. 2 shows the reconstruction based on RAID algorithm that another more specific embodiment of the present invention provides The flow chart of method, this method comprises the following steps:
201st, judge whether RAID is effective, if so, then going to step 203, otherwise go to step 202.
202nd, stop rebuilding thread and exit.
203rd, judge to rebuild whether thread receives pause request, if so, then device step 204, otherwise device step 205。
204th, thread will be rebuild to be adjusted to halted state and exit.
205th, it is locking to obtain bar.
206th, construction reads I O read strip data.
207th, the data for the disk that need to be rebuild are write according to the data configuration of reading and.
208th, released strip is locking.
209th, judge to rebuild and whether complete, if so, then going to step, otherwise go to step 211.
210th, stop rebuilding thread and exit.
211st, recalling reconstruction thread waits next time scheduled.
A kind of method for reconstructing and device based on RAID are present embodiments provided, by independently of the weight outside RAID algorithm Build thread so that the process in RAID algorithm on reconstruction obtains high abstraction, and can be done by the received event of RAID structure In advance, simplify each algorithms of RAID realizes process, makes whole system be easier to safeguard.
As shown in figure 3, Fig. 3 shows that the structure for the reconstructing device based on RAID algorithm that one embodiment of the invention provides is shown It is intended to, which includes:Read through model 301 and writing module 302.
Read through model 301, it is locking for when carrying out data reconstruction, obtaining the bar for the band for needing to rebuild, read the bar The data of band.
Writing module 302, for the data configuration according to reading and writes the data of disk for needing to rebuild.
Wherein, described device further includes:Determination module, for judging whether disk array RAID is effective, if effectively, reading The data of band are taken, otherwise stop rebuilding thread.
Wherein, described device further includes:Mark module, for marking the weight of the band in the bitmap bitmap of RAID Build and completed.
Wherein, read through model 301, are specifically used for:Construction reads the data of band described in I O read.
Wherein, writing module 302, are specifically used for:According to the data configuration call back function of reading, the data are write Need the disk rebuild.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments The present invention is described in detail, it will be understood by those of ordinary skill in the art that;It still can be to foregoing each implementation Technical solution described in example is modified, or carries out equivalent substitution to which part technical characteristic;And these modification or Replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical solution.

Claims (10)

  1. A kind of 1. method for reconstructing based on RAID algorithm, it is characterised in that the described method includes:
    When carrying out data reconstruction, the unit rebuild every time is 1 band, and acquisition needs the bar for the band rebuild locking, reads The data of the band;
    According to the data configuration of reading and write the data of disk for needing to rebuild;
    The data for reading the band, including:
    From one section of continuous data strip, calculate or directly intercept out data, and be sent to and be marked as the disk extracted that degrades In, and pause has been provided independently in the reconstruction module taken out, starts, and adjusts the interface of thread priority, and frame is managed for RAID Structure calls.
  2. 2. according to the method described in claim 1, it is characterized in that, described when carrying out data reconstruction, the band of band is obtained Before the step of locking, reading the data of the band, the method further includes:
    Judge whether disk array RAID is effective, if effectively, reading the data of band, otherwise stop rebuilding thread.
  3. 3. according to the method described in claim 1, it is characterized in that, the data configuration according to reading and write and need weight After the step of data for the disk built, the method further includes:
    The reconstruction of the band is marked to complete in the bitmap bitmap of RAID.
  4. 4. according to the method described in claim 1, it is characterized in that, the data for reading the band, including:
    Construction reads the data of band described in I O read.
  5. 5. according to the method described in claim 1, it is characterized in that, the data configuration according to reading and write and need weight The data for the disk built, including:
    According to the data configuration call back function of reading, the disk that data write-in is needed to rebuild.
  6. 6. a kind of reconstructing device based on RAID algorithm, it is characterised in that described device includes:
    Read through model, the unit for when carrying out data reconstruction, rebuilding every time are 1 band, obtain the band that needs are rebuild Bar is locking, reads the data of the band;
    Writing module, for the data configuration according to reading and writes the data of disk for needing to rebuild;
    The read through model, is specifically used for:
    From one section of continuous data strip, calculate or directly intercept out data, and be sent to and be marked as the disk extracted that degrades In, and pause has been provided independently in the reconstruction module taken out, starts, and adjusts the interface of thread priority, and frame is managed for RAID Structure calls.
  7. 7. device according to claim 6, it is characterised in that described device further includes:
    Determination module, for judging whether disk array RAID is effective, if effectively, reading the data of band, otherwise stops weight Build thread.
  8. 8. device according to claim 6, it is characterised in that described device further includes:
    Mark module, the reconstruction for marking the band in the bitmap bitmap of RAID have been completed.
  9. 9. device according to claim 6, it is characterised in that the read through model, is specifically used for:
    Construction reads the data of band described in I O read.
  10. 10. device according to claim 6, it is characterised in that the writing module, is specifically used for:
    According to the data configuration call back function of reading, the disk that data write-in is needed to rebuild.
CN201510058699.1A 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm Active CN104598336B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510058699.1A CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510058699.1A CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Publications (2)

Publication Number Publication Date
CN104598336A CN104598336A (en) 2015-05-06
CN104598336B true CN104598336B (en) 2018-04-24

Family

ID=53124150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510058699.1A Active CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Country Status (1)

Country Link
CN (1) CN104598336B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107748650B (en) * 2017-10-09 2020-07-03 暨南大学 Data reconstruction strategy based on locking mechanism in network coding cluster storage system
CN108874314A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of reconstructing method and device of raid-array
CN112732167B (en) * 2019-10-28 2024-04-16 伊姆西Ip控股有限责任公司 Method and apparatus for managing storage system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305334A (en) * 2004-12-29 2008-11-12 辉达公司 Intelligent storage engine for disk drive operations with reduced local bus traffic
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array
US7958304B1 (en) * 2008-04-30 2011-06-07 Network Appliance, Inc. Dynamically adapting the fault tolerance and performance characteristics of a raid-based storage system by merging and splitting raid groups
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array
CN102945191A (en) * 2012-11-15 2013-02-27 浪潮电子信息产业股份有限公司 RAID5 (redundant array of independent disk 5) data transfer method
CN103699336A (en) * 2013-12-03 2014-04-02 中国科学院计算技术研究所 Method and system for distributing and reestablishing data of magnetic disc array

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305334A (en) * 2004-12-29 2008-11-12 辉达公司 Intelligent storage engine for disk drive operations with reduced local bus traffic
US7958304B1 (en) * 2008-04-30 2011-06-07 Network Appliance, Inc. Dynamically adapting the fault tolerance and performance characteristics of a raid-based storage system by merging and splitting raid groups
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array
CN102945191A (en) * 2012-11-15 2013-02-27 浪潮电子信息产业股份有限公司 RAID5 (redundant array of independent disk 5) data transfer method
CN103699336A (en) * 2013-12-03 2014-04-02 中国科学院计算技术研究所 Method and system for distributing and reestablishing data of magnetic disc array

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
磁盘阵列在线重建与RAID5扩容的设计与实现;舒星;《中国优秀硕士学位论文全文数据库 信息科技辑》;20090531(第5期);正文第23页第1段-第26页第2段 *

Also Published As

Publication number Publication date
CN104598336A (en) 2015-05-06

Similar Documents

Publication Publication Date Title
CN105095013B (en) Date storage method, restoration methods, relevant apparatus and system
Rashmi et al. A" hitchhiker's" guide to fast and efficient data reconstruction in erasure-coded data centers
CN105893188B (en) Method and apparatus for accelerating the data reconstruction of disk array
CN108228086A (en) The method and apparatus that RAID is rebuild
CN104598336B (en) Method for reconstructing and device based on RAID algorithm
CN102982182B (en) Data storage planning method and device
US12001399B2 (en) Systems and methods for storage medium management
CN109934712A (en) Account checking method, account checking apparatus and electronic equipment applied to distributed system
CN107329806A (en) A kind of development environment construction method and device
CN105426427A (en) MPP database cluster replica realization method based on RAID 0 storage
CN102012792A (en) Quick reconfigurable RAID-6 coding and reconfiguration method
CN104468240B (en) Cloud terminal management method, device
CN103513942A (en) Method and device for reconstructing independent redundancy array of inexpensive disks
CN102024021A (en) Method for logging metadata in logical file system
CN110138688A (en) Dynamic adjusts method, apparatus, equipment and the readable storage medium storing program for executing of business interface
US11556255B2 (en) Method, device and computer program product for storage
CN109101320A (en) Heterogeneous processor fusion of platforms management system
CN107357689A (en) The fault handling method and distributed memory system of a kind of memory node
CN107678883A (en) A kind of cluster recovery method and apparatus based on storage system
CN105183583A (en) Method for data reconstruction of disk array, and disk array system
CN106484459A (en) It is applied to flow control method and the device of JavaScript
CN104184486B (en) Train operation state infosystem vehicular platform
CN104572374B (en) Processing method, device and the storage device of storage
CN104407806B (en) The amending method and device of RAID group hard disc information
CN102226893A (en) FAT (file allocation table) file system repairing method in embedded system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20170331

Address after: Nanshan District Guangdong streets, Shenzhen city 518131 Guangdong Province Road No. 8 financial services technology innovation base 1 building 11 floor F3

Applicant after: Shenzhen science and Technology Co.,Ltd. digital cloud data

Address before: 100085 Beijing, Haidian District, No. 9 on the ground floor of the digital science and Technology Plaza, 9

Applicant before: YUNKE CHINA DATA TECHNOLOGY LTD.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190508

Address after: 430200 Six Floors of 777B Office Building, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Address before: 518131 F3, 11th floor, No. 8 Kefa Road, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen science and Technology Co.,Ltd. digital cloud data

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230418

Address after: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Patentee after: Shenzhou Yunke (Beijing) Technology Co.,Ltd.

Address before: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee before: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

TR01 Transfer of patent right