CN104166601B - The backup method and device of a kind of data storage - Google Patents

The backup method and device of a kind of data storage Download PDF

Info

Publication number
CN104166601B
CN104166601B CN201410401367.4A CN201410401367A CN104166601B CN 104166601 B CN104166601 B CN 104166601B CN 201410401367 A CN201410401367 A CN 201410401367A CN 104166601 B CN104166601 B CN 104166601B
Authority
CN
China
Prior art keywords
block
data
write
raid
raid array
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
CN201410401367.4A
Other languages
Chinese (zh)
Other versions
CN104166601A (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201410401367.4A priority Critical patent/CN104166601B/en
Publication of CN104166601A publication Critical patent/CN104166601A/en
Application granted granted Critical
Publication of CN104166601B publication Critical patent/CN104166601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention proposes a kind of backup method of data storage, and applied to RAID array, methods described includes:Write buffer is created for target RAID array;Wherein, the write buffer is enabled when the target RAID array fails;When the target RAID array fails, the data write-in write buffer of the target RAID array will be write when performing and writing I/O command, data are read from the write buffer when performing reading I/O command;When the target RAID array recovers normal, the write buffer is triggered automatically written data is written back to the target RAID array, and disable when write-back is completed the write buffer.Hardware cost and the performance impact to business can be reduced by the present invention.

Description

The backup method and device of a kind of data storage
Technical field
The present invention relates to the backup method and device of field of storage, more particularly to a kind of data storage.
Background technology
When RAID array fails, all logical resources on the array can not all be read and write, and will cause service disconnection.Example Such as, there are 2 pieces of disks to read and write in RAID5 arrays, or there is 1 piece of disk to read and write in RAID0 arrays, may result in RAID Array fails.However, in most cases, it is impossible to the hard disk of read-write, it is likely that simply hard disk connector goes wrong, or DEU frame SAS lines loosen, and disk is not problematic in itself.Attendant is by changing pinboard or fixed SAS lines When recovering to RAID array, it will usually cause RAID array temporarily to fail, in the case where RAID array temporarily fails, lose Business during effect can not be provided, data can not be preserved, so that serious loss of data can be caused.Such as in monitoring application, All monitoring videos during RAID array fails can all be lost.
To solve the above problems, the current general failure that RAID array is tackled using mirror image technology.Specifically, can be first Mirror image RAID array is created to RAID array, mirror logic resource can also be created to logical resource.Write to RAID array During data, data are write on two parts of independent RAID arrays (or logical resource) simultaneously.If main RAID array failure, will Work flow is in mirror image RAID array.
But in such scheme, due to the RAID array or logical resource of formed objects must be used to create mirror image, hard disk Space cost is double;When business writes data, it is necessary to which while write two parts, in the case where system business is busy, business can be influenceed Write performance, and the load of the system resources such as CPU can be caused double, so as to influence other performances for reading and writing business.
The content of the invention
In view of this, the present invention proposes a kind of backup method of data storage, applied to RAID array, methods described bag Include:
Write buffer is created for target RAID array;Wherein, the write buffer is enabled when the target RAID array fails;
When the target RAID array fails, the data of the target RAID array will be write when performing and writing I/O command The write buffer is write, data are read from the write buffer when performing reading I/O command;
When the target RAID array recovers normal, trigger automatically the write buffer written data is written back to it is described Target RAID array, and disable when write-back is completed the write buffer.
Preferably, methods described also includes:
During the write-back, I/O command is write if necessary to perform, then this is write into the corresponding data of I/O command writes institute State target RAID array;
During the write-back, I/O command is read if necessary to perform, then is write according to data message to be read from described Data are read in caching or from the target RAID array.
Preferably, the memory space of the write buffer is divided into global head, RAID, Block and Block data Area;
The global head, record write buffer memory space size and it is each RAID whether be allocated first Bitmap bitmaps;
The RAID heads, some sons are divided into according to the target RAID array number that failure backup is carried out using write buffer Region, a target RAID array is corresponded to per sub-regions, and record the target RAID array information respectively;The target RAID The array numbering of array information including the target RAID array, Block sizes and Block numbers can be used;
The Block heads, each Block corresponds to a Block data block, and records the Block numbers respectively respectively According to the affiliated RAID numbering of block, lba address of the Block data blocks in target RAID array and record the Block data Block whether the 2nd bitmap bitmaps of written data;
The Block data fields, including several Block data blocks, the size of the Block data blocks is the RAID The Block sizes recorded in head.
Preferably, it is described to include for target RAID array establishment write buffer:
It is that the target RAID array distributes a untapped RAID head according to the first bitmap bitmaps;
It recorded by the target RAID array information and for the available Block numbers that the target RAID array is distributed In corresponding RAID.
Preferably, it is described to include the data storage write-in write buffer for writing the target RAID array:
Target RAID array numbering in the write IO request received searches corresponding RAID heads;
Lba addresses in the write IO request, it is corresponding Block at this RAID in search Block heads;
If having found corresponding Block heads, write data into this Block corresponding Block data block;
If not finding corresponding Block heads, a sky Block data block is obtained, sky Block is write data into In data block, while affiliated RAID numbering is recorded in sky Block data blocks are corresponding Block, described second This Block corresponding Block data blocks written data is recorded in bitmap bitmaps, and by the data in target RAID array In lba addresses recorded in the Block;
Wherein when getting an empty data block, update recorded in corresponding RAID described and use Block numbers.
Preferably, the read data packet from the write buffer is included:
Target RAID array numbering in the read I O request received searches corresponding RAID heads;
Lba addresses in the read I O request, it is corresponding Block at this RAID in search Block heads;
If corresponding Block heads have been found, and the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block has had been written into data, then reads the data;
If corresponding Block heads were not found, or the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block does not write data, data is read from the target RAID array, and return to reading knot Really.
The present invention also proposes a kind of back-up device of data storage, and applied to RAID array, described device includes:
Creation module, for creating write buffer for target RAID array;Wherein, the write buffer is at described target RAID gusts Enabled during row failure;
Module for reading and writing, for when the target RAID array fails, the target will to be write when I/O command is write in execution The data of RAID array write the write buffer, and data are read from the write buffer when performing reading I/O command;
Write-back module, for when the target RAID array recovers normal, the write buffer to be triggered automatically to be had been written into Write back data disables when write-back is completed the write buffer to the target RAID array.
Preferably, the write-back module is further used for:
During the write-back, I/O command is write if necessary to perform, then this is write into the corresponding data of I/O command writes institute State target RAID array;
The module for reading and writing is further used for:
During the write-back, I/O command is read if necessary to perform, then is write according to data message to be read from described Data are read in caching or from the target RAID array.
Preferably, the memory space of the write buffer is divided into global head, RAID, Block and Block data Area;
The global head, including write buffer memory space size and record each RAID whether allocated first Bitmap bitmaps;
The RAID heads, some sons are divided into according to the target RAID array number that failure backup is carried out using write buffer Region, a target RAID array is corresponded to per sub-regions, and record the target RAID array information respectively;The target RAID The array numbering of array information including the target RAID array, Block sizes and Block numbers can be used;
The Block heads, each Block corresponds to a Block data block, and records the Block numbers respectively respectively According to the affiliated RAID numbering of block, lba address of the Block data blocks in target RAID array and record the Block data Block whether the 2nd bitmap bitmaps of written data;
The Block data fields, including several Block data blocks, the size of the Block data blocks is the RAID The Block sizes recorded in head.
Preferably, the creation module is further used for:
It is that the target RAID array distributes a untapped RAID head according to the first bitmap bitmaps;
It recorded by the target RAID array information and for the available Block numbers that the target RAID array is distributed In corresponding RAID.
Preferably, the module for reading and writing is further used for:
Target RAID array numbering in the write IO request received searches corresponding RAID heads;
Lba addresses in the write IO request, it is corresponding Block at this RAID in search Block heads;
If having found corresponding Block heads, write data into this Block corresponding Block data block;
If not finding corresponding Block heads, a sky Block data block is obtained, sky Block is write data into In data block, while affiliated RAID numbering is recorded in sky Block data blocks are corresponding Block, described second This Block corresponding Block data blocks written data is recorded in bitmap bitmaps, and by the data in target RAID array In lba addresses recorded in the Block;
Wherein, when getting an empty data block, what is recorded during renewal is corresponding RAID is described with Block Number.
Preferably, the module for reading and writing is further used for:
Target RAID array numbering in the read I O request received searches corresponding RAID heads;
Lba addresses in the read I O request, it is corresponding Block at this RAID in search Block heads;
If corresponding Block heads have been found, and the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block has had been written into data, then reads the data;
If corresponding Block heads were not found, or the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block does not write data, data is read from the target RAID array, and return to reading knot Really.
It is standby that the present invention can provide failure for multiple RAID arrays simultaneously by creating write buffer, using a small amount of memory space Part, reduce hardware cost;It is additionally, since the write buffer just to enable when RAID array fails, and is lost in RAID array When effect is recovered again, the data write during a write-back failure, so as to significantly reduce the performance impact to business.
Brief description of the drawings
Fig. 1 is processing schematic diagram of the RAID storage arrays to exterior read-write IO in the prior art;
Fig. 2 is that processing of a kind of RAID array to exterior read-write IO shown in a kind of exemplary embodiment of the invention is illustrated Figure;
Fig. 3 is a kind of backup method flow chart of data storage shown in a kind of illustrative embodiments of the invention;
Fig. 4 is a kind of memory space tissue shape of write buffer storage medium shown in a kind of illustrative embodiments of the invention Formula;
Fig. 5 is that a kind of RAID array shown in a kind of illustrative embodiments of the invention carries out data failure by write buffer Backup and the handling process of data recovery;
Fig. 6 is a kind of back-up device block diagram of data storage shown in a kind of illustrative embodiments of the invention.
Embodiment
Fig. 1 is referred to, Fig. 1 is processing schematic diagram of the RAID array to exterior read-write IO in the prior art.As illustrated, RAID array is when carrying out reading and writing data, and read-write I/O Request is issued to RAID module, Raid request by upper layer module Module judges the state of the affiliated RAID array of the I/O Request, if state is normal, the I/O Request is issued into RAID IO submodules Processing, writes data into rear end hard disk, or read data from rear end hard disk;If array fails, returned to upper layer module Read or write-in data failure.
In invention, independent write buffer can be created for RAID array, and regard the write buffer as RAID array A submodule in RAID module, participates in processing of the RAID array to exterior read-write IO.
Specifically, Fig. 2 is referred to, Fig. 2 is that processing of a kind of RAID array to exterior read-write IO shown in the present embodiment is shown It is intended to.As illustrated, introducing after write buffer submodule, read-write I/O Request is issued to RAID module, Raid by upper layer module Request submodules judge the state of the affiliated RAID array of the I/O Request, if state is normal, still issue the I/O Request The processing of RAID IO submodules, writes data into rear end hard disk, or read data from rear end hard disk;If array fails, read-write I/O Request no longer issues the processing of RAID IO submodules, but is handled by write buffer submodule, and the read-write of data is all writing slow Deposit middle progress.When array recovers, the automatic write buffer that triggers is by written data write-back.
In order that technical scheme is more clearly understood, embodiment is developed simultaneously to present invention progress below in conjunction with accompanying drawing It is described in detail.
Refer in Fig. 3, a kind of exemplary embodiment of the present invention, propose a kind of backup method of data storage, should For RAID array, methods described performs following steps:
Step 301, for target RAID array create write buffer;Wherein, the write buffer is lost in the target RAID array Enabled during effect;
Step 302, when the target RAID array fails, described target RAID gusts will be write when I/O command is write in execution The data of row write the write buffer, and data are read from the write buffer when performing reading I/O command;
Step 303, when the target RAID array recover it is normal when, trigger automatically the write buffer by written data return The target RAID array is written to, and disables when write-back is completed the write buffer.
In the present embodiment, the storage medium of the write buffer can be one or more independent internal memory, one piece or many The hard disk of block independence, or one or more independent RAID arrays.Wherein, no matter which kind of storage medium is write buffer use, According to structure organization memory space as shown in Figure 4.
As shown in figure 4, in the present embodiment, the storage medium of write buffer is divided into 4 regions, and each region is recorded respectively Following information:One global head, one or more RAID, multiple Block and multiple Block data fields, each region The parameter that only record power-off must be preserved.
The function in 4 regions is described in detail with the parameter recorded to more than below.
Global head region, the size (Size) of the regional record write buffer memory space, for record each RAID whether The first bitmap bitmaps (raid_bitmap), affiliated controller ID (contol_id) and the data in the region being allocated Check value (check_sum).Wherein, the size of the write buffer memory space, can be when creating write buffer according to reality The time of business and failure backup is configured;For example, it is assumed that the road 1Mbps of RAID array Shang You 50 video recording, it is desirable to provide 24h failure backup, it is therefore desirable to create the RAID write buffers of about 528G sizes.The hard disk of so one 4TB size is as writing Caching, can provide 24h failure backups simultaneously to the RAID array of 7 this business simultaneously.
The first bitmap bitmaps, for recording whether each RAID be allocated, one RAID in the bitmap In bitmap correspondence position value be 1 when, represent the RAID it is the allocated;For 0 when, represent that the RAID is not yet distributed.
Controller ID belonging to described, the controller for distinguishing the control write buffer.For example, in specific application, being Raising reliability, target RAID array is more to be controlled by two controllers and (is commonly called as dual control), passes through the controller ID The controller for controlling the target RAID array can be distinguished.Certainly in the environment of non-dual control, the parameter is just not necessarily needed Want.
The data check value, when some parameters for being recorded in one's respective area are surprisingly lost, by verifying calculating pair The parameter of loss is recovered.
RAID head regions, the region is divided into according to the target RAID array number that failure backup is carried out using write buffer Some subregions, a target RAID array is corresponded to per sub-regions respectively;For example, it is assumed that write buffer is needed for two targets RAID array carries out failure backup, then what RAID head regions can be equal is divided into two sub-regions, the correspondence per sub-regions One target RAID region.Record correspondence target RAID array information and the region in RAID head regions respectively per sub-regions Data check value;The target RAID array information generally includes the array numbering (uuid) of the target RAID array, fan Area's size (sector_size), stripe size (strip_size), Block sizes (block_size) and Block can be used Number (block_number);Wherein, the sector-size and stripe size depend on the concrete configuration of target RAID array;It is described It is allocated when can be with Block numbers and create write buffer by keeper.
Block head regions, several Block heads, each Block heads are divided into according to the Block total numbers of write buffer A Block data block is corresponded to respectively;Each Block record the Block Block head in Block head regions respectively Numbering (index represents which Block that the Block is Block head regions), the Block affiliated Raid numbering (raid_index represents the Block which RAID belonged in RAID head regions), the Block data blocks are recorded Lba address (logical block address, logical block addresses) of the data in target RAID array and record should Block data blocks whether the 2nd bitmap bitmaps (block_bitmap) of written data.
Block data areas, the region is divided into several Block data blocks according to the Block total numbers of write buffer, The size of Block data blocks is the Block sizes that record in described RAID.Wherein, the Block total numbers of write buffer can Calculated with the Block sizes by the actual size of the space of write buffer Block data areas divided by single Block data blocks Arrive.
Fig. 5 is referred to, Fig. 5 is that the RAID array shown in the present embodiment carries out data failure backup and number by write buffer According to the handling process of recovery, data failure backup and data recovery are carried out by write buffer to RAID array below in conjunction with Fig. 4 Handling process be described in detail.
In the present embodiment, write buffer does not carry out failure backup to any RAID array in an initial condition, at RAID gusts After row are created, if to carry out failure backup to the RAID array, continue to create write buffer corresponding with the RAID array.
Specifically, when creating write buffer for the RAID array, bitmap can be used according to the heads of the RAID in global head Bitmap, distributes an empty RAID head for the RAID array, the battle array of the RAID array is then recorded in the RAID heads being assigned to The information such as column number, sector-size, stripe size, Block sizes, while Block numbers can be used for RAID array distribution, and The available Block numbers of distribution also recorded in RAID.Wherein, it is described with Block numbers in specific distribution, can be with It is to be distributed equally according to total Block numbers of write buffer for each target RAID array;Certainly, when implementing, also may be used It is the available Block numbers that different target RAID array quantity allotteds are not waited with the practical business according to target RAID array, The present embodiment is without being particularly limited to.
In the present embodiment, the write buffer completed is created, when RAID array is normally run, disabled status is defaulted as, RAID array is enabled automatically when failing.After write buffer is enabled, for for fail RAID array exterior read-write I/O Request, all Handled by write buffer.
Target RAID array numbering and lba address of the write buffer first in the write IO request received, search correspondence Block heads;Specifically, after write buffer receives write IO request, the target RAID array first in the write IO request is compiled Number corresponding RAID heads are searched, found further according to the lba addresses in the write IO request after RAID, corresponding with this RAID Block heads are searched in Block.If writing first, the content recorded in Block is sky, it is impossible to find correspondence Block heads, therefore can directly obtain a sky Block data block, data of this write-in are write into sky Block data In block, and affiliated RAID numbering is recorded (i.e. for according to read I O request in sky Block data blocks are corresponding Block The numbering of that RAID that middle target RAID array numbering is found), and will be corresponding bit in the 2nd bitmap bitmaps Set is 1;Meanwhile, lba address (lba address i.e. in the write IO request) of the data in target RAID array is also recorded To sky Block data blocks it is corresponding Block in, to facilitate target RAID array to revert to normal condition by failure state When, written data can be written back to by target RAID array according to the lba addresses recorded in Block.
When the target RAID array numbering and sevtor address in the write IO request search Block, if looked into Corresponding Block heads are have found, show to have had been written into data before this Block corresponding Block data block, then directly The data of this write-in are write in this Block corresponding Block data block.
What deserves to be explained is, when writing data to write buffer, when getting a sky Block data block, it is necessary to more It is new it is corresponding RAID in record it is described use Block numbers, can subtract 1 with Block numbers by described.
Further, after write buffer receives read I O request, RAID gusts of the target first in the read I O request received Column number and lba addresses, search Block heads in the write buffer;Specifically, it is first after write buffer receives read I O request First the target RAID array numbering in the read I O request searches corresponding RAID heads, finds after RAID further according to reading IO Lba addresses in request, search Block heads in Block corresponding with this RAID;
If corresponding Block heads have been found, and correspondence in the 2nd bitmap bitmaps in the Block Bit set are 1, show to have had been written into data before this block corresponding block data block, then directly read the number According to;
Certainly, if not finding corresponding Block heads, or in the 2nd bitmap bitmaps in the Block Correspondence bit positions position is 0, shows not recording this data for needing to read in write buffer, then from the target RAID array Middle reading data, and return to reading result.Because now the target RAID array is still within failure state, therefore directly return Retaking of a year or grade takes failure.
In the present embodiment, can also in write buffer reserved part memory space as each target RAID array competition Use space.Space is used for competition, even if any RAID can be exhausted with Block and (i.e. be recorded in RAID 0), can also there are sky Block data blocks using space if competed, then the RAID still can make with Block numbers The empty Block data blocks in space are used with competition.For competing the size using space, user can specifically match somebody with somebody according to business Put.Competition is reserved in write buffer and uses space, can be caused when only one of which target RAID array fails, using more Backup space, so as to maximize the BACKUP TIME of extension failure backup, the longer malfunction elimination time is provided for attendant.
In the present embodiment, while the failure of target RAID array enables write buffer, now attendant can go as early as possible Live investigation problem, recovers array again.For example, for hard disk connector failure, or DEU frame SAS lines such as loosen at the disk Not problematic failure, attendant itself can recover array by the replacing of pinboard or SAS lines.
After the target RAID array of failure is recovered, automatic triggering write buffer is by written data to the target RAID array Carry out after the completion of write-back, and the whole write-backs of written data in write buffer, write buffer is disabled automatically.
In the present embodiment, write buffer is when carrying out write-back, due to have recorded corresponding Block data in Block Lba address of the block in the target RAID array, therefore written data can be pressed by write sequence according to the lba addresses It is written back to target RAID array.Such as, the lba addresses can be converted into pba addresses (physics block address, Physical block address), the data of write-back are then write by corresponding physical block according to the pba addresses conversed.Wherein, by this Lba addresses are converted into implementing for pba addresses and refer to prior art, and the present invention is no longer described in detail.
In the present embodiment, during write back data, new to write IO and no longer be handled by write buffer, the data newly write will The target RAID array write direct after recovering.However, because write buffer is during write-back, the part in target RAID array has Data are imitated still in write buffer, therefore the read I O request during write-back is still first handled by write buffer, is read when from write buffer Access according to when miss corresponding data, then from target RAID array read data.
Certainly, when implementing, write buffer can also just be enabled when target RAID array is normal, by target RAID Array written data is synchronously written into write buffer, even if so that target RAID array failure is because hard disk failure causes , target RAID array local data also will not all be lost.For example, for the application of field of video monitoring, video recording write-in It is preceding to need to read video recording index data, therefore write buffer can be enabled when RAID array is normal, index data is carried out in advance Backup, so that during RAID array failure, also can normally read video recording index data.
By above description, the present invention can use a small amount of memory space can be while being by creating write buffer Multiple RAID arrays provide failure backup, reduce hardware cost;It is additionally, since write buffer ability when RAID array fails Enable, can effectively distinguish the data that write during array failure, and due to when RAID array failure recovers again, only The data that write-back writes during failing, so as to significantly reduce the performance impact to business.The program is particularly suitable for use in because of non-magnetic The data backup and resume that RAID array fails caused by disk failure.
Fig. 6 is referred to, the present invention also proposes a kind of back-up device 60 of data storage, applied to RAID array, the dress Putting 60 includes:
Creation module 601, for creating write buffer for target RAID array;Wherein, the write buffer is in the target RAID array is enabled when failing;
Module for reading and writing 602, for when the target RAID array fails, the mesh will to be write when I/O command is write in execution The data for marking RAID array write the write buffer, and data are read from the write buffer when performing reading I/O command;
Write-back module 603, for when the target RAID array recovers normal, the write buffer to be triggered automatically have been write Enter write back data to the target RAID array, and disable when write-back is completed the write buffer.
In the present embodiment, the write-back module 603 is further used for:
During the write-back, I/O command is write if necessary to perform, then this is write into the corresponding data of I/O command writes institute State target RAID array;
The module for reading and writing 602 is further used for:
During the write-back, I/O command is read if necessary to perform, then is write according to data message to be read from described Data are read in caching or from the target RAID array.
In the present embodiment, the memory space of the write buffer be divided into global head, RAID, Block and Block data fields;
The global head, including write buffer memory space size and record each RAID whether allocated first Bitmap bitmaps;
The RAID heads, some sons are divided into according to the target RAID array number that failure backup is carried out using write buffer Region, a target RAID array is corresponded to per sub-regions, and record the target RAID array information respectively;The target RAID The array numbering of array information including the target RAID array, Block sizes and Block numbers can be used;
The Block heads, each Block corresponds to a Block data block, and records the Block numbers respectively respectively According to the affiliated RAID numbering of block, lba address of the Block data blocks in target RAID array and record the Block data Block whether the 2nd bitmap bitmaps of written data;
The Block data fields, including several Block data blocks, the size of the Block data blocks is the RAID The Block sizes recorded in head.
In the present embodiment, the creation module 601 is further used for:
It is that the target RAID array distributes a untapped RAID head according to the first bitmap bitmaps;
It recorded by the target RAID array information and for the available Block numbers that the target RAID array is distributed In corresponding RAID.
In the present embodiment, the module for reading and writing 602 is further used for:
Target RAID array numbering in the write IO request received searches corresponding RAID heads;
Lba addresses in the write IO request, it is corresponding Block at this RAID in search Block heads;
If having found corresponding Block heads, write data into this Block corresponding Block data block;
If not finding corresponding Block heads, a sky Block data block is obtained, sky Block is write data into In data block, while affiliated RAID numbering is recorded in sky Block data blocks are corresponding Block, described second This Block corresponding Block data blocks written data is recorded in bitmap bitmaps, and by the data in target RAID array In lba addresses recorded in the Block;
Wherein, when getting an empty data block, what is recorded during renewal is corresponding RAID is described with Block Number.
In the present embodiment, the module for reading and writing 602 is further used for:
Target RAID array numbering in the read I O request received searches corresponding RAID heads;
Lba addresses in the read I O request, it is corresponding Block at this RAID in search Block heads;
If corresponding Block heads have been found, and the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block has had been written into data, then reads the data;
If corresponding Block heads were not found, or the 2nd bitmap bitmaps record in the Block should Block corresponding Block data block does not write data, data is read from the target RAID array, and return to reading knot Really.
It will be appreciated by those skilled in the art that the module in device in embodiment can be distributed according to embodiment description In the device of embodiment, respective change can also be carried out and be disposed other than in one or more devices of the present embodiment.Above-mentioned reality The module for applying example can be merged into a module, can also be further split into multiple submodule.Foregoing invention embodiment is numbered only Only for description, the quality of embodiment is not represented.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention God is with principle, and any modification, equivalent substitution and improvements done etc. should be included within the scope of protection of the invention.

Claims (12)

1. a kind of backup method of data storage, applied to RAID array, it is characterised in that methods described includes:
Write buffer is created for target RAID array;Wherein, the write buffer is enabled when the target RAID array fails;It is described The memory space of write buffer includes the RAID head regions being divided into;The RAID head regions are failed according to using write buffer The target RAID array number of backup is divided into some subregions;The write buffer created for the target RAID array corresponds to One of subregion in some subregions;
When the target RAID array fails, the data for writing the target RAID array are write when performing and writing I/O command The write buffer, data are read when performing reading I/O command from the write buffer;
When the target RAID array recovers normal, the write buffer is triggered automatically written data is written back to the target RAID array, and disable when write-back is completed the write buffer.
2. the method as described in claim 1, it is characterised in that methods described also includes:
During the write-back, I/O command is write if necessary to perform, then this is write into the corresponding data of I/O command writes the mesh Mark RAID array;
During the write-back, I/O command is read if necessary to perform, then according to data message to be read from the write buffer In or from the target RAID array read data.
3. the method as described in claim 1, it is characterised in that the memory space of the write buffer is divided into global Head Section Domain, RAID head regions, Block head regions and Block data areas;
The global head region, record write buffer memory space size and it is each RAID whether be allocated first Bitmap bitmaps;
The RAID head regions, some sons are divided into according to the target RAID array number that failure backup is carried out using write buffer Region, a target RAID array is corresponded to per sub-regions, and record the target RAID array information respectively;The target RAID The array numbering of array information including the target RAID array, Block sizes and Block numbers can be used;
The Block head regions, several Block heads, each Block heads are divided into according to the Block total numbers of write buffer A Block data block is corresponded to respectively, and records the Block data blocks affiliated RAID numbering, the Block data blocks respectively Lba addresses in target RAID array and record the Block data blocks whether the 2nd bitmap bitmaps of written data;
The Block data areas, including several Block data blocks, the size of the Block data blocks is the RAID heads The Block sizes of middle record.
4. method as claimed in claim 3, it is characterised in that described to include for target RAID array establishment write buffer:
It is that the target RAID array distributes a untapped RAID head according to the first bitmap bitmaps;
Correspondence is recorded by the target RAID array information and for the available Block numbers that the target RAID array is distributed RAID heads in.
5. method as claimed in claim 3, it is characterised in that described to write the data storage for writing the target RAID array Entering the write buffer includes:
Target RAID array numbering in the write IO request received searches corresponding RAID heads;
Lba addresses in the write IO request, it is corresponding Block at this RAID in search Block heads;
If having found corresponding Block heads, write data into this Block corresponding Block data block;
If not finding corresponding Block heads, a sky Block data block is obtained, sky Block data are write data into In block, while affiliated RAID numbering is recorded in sky Block data blocks are corresponding Block, described second This Block corresponding Block data blocks written data is recorded in bitmap bitmaps, and by the data in target RAID array In lba addresses recorded in the Block;
Wherein when getting an empty data block, update recorded in corresponding RAID described and use Block numbers.
6. method as claimed in claim 3, it is characterised in that the read data packet from the write buffer is included:
Target RAID array numbering in the read I O request received searches corresponding RAID heads;
Lba addresses in the read I O request, it is corresponding Block at this RAID in search Block heads;
If corresponding Block heads have been found, and the 2nd bitmap bitmaps in the Block record the Block Corresponding Block data blocks have had been written into data, then read the data;
If corresponding Block heads were not found, or the 2nd bitmap bitmaps in the Block would record the Block Corresponding Block data blocks do not write data, data are read from the target RAID array, and return to reading result.
7. a kind of back-up device of data storage, applied to RAID array, it is characterised in that described device includes:
Creation module, for creating write buffer for target RAID array;Wherein, the write buffer is lost in the target RAID array Enabled during effect;The memory space of the write buffer includes the RAID head regions being divided into;The RAID head regions are according to using The target RAID array number that write buffer carries out failure backup is divided into some subregions;Created for the target RAID array Write buffer correspond to some subregions in one of subregion;
Module for reading and writing, for when the target RAID array fails, the target RAID will to be write when I/O command is write in execution The data of array write the write buffer, and data are read from the write buffer when performing reading I/O command;
Write-back module, for when the target RAID array recovers normal, the write buffer to be triggered automatically by written data The target RAID array is written back to, and disables when write-back is completed the write buffer.
8. device as claimed in claim 7, it is characterised in that the write-back module is further used for:
During the write-back, I/O command is write if necessary to perform, then this is write into the corresponding data of I/O command writes the mesh Mark RAID array;
The module for reading and writing is further used for:
During the write-back, I/O command is read if necessary to perform, then according to data message to be read from the write buffer In or from the target RAID array read data.
9. device as claimed in claim 7, it is characterised in that the memory space of the write buffer is divided into global Head Section Domain, RAID head regions, Block head regions and Block data areas;
The global head region, including record write buffer memory space size and it is each RAID whether be allocated first Bitmap bitmaps;
The RAID head regions, some sons are divided into according to the target RAID array number that failure backup is carried out using write buffer Region, a target RAID array is corresponded to per sub-regions, and record the target RAID array information respectively;The target RAID The array numbering of array information including the target RAID array, Block sizes and Block numbers can be used;
The Block head regions, several Block heads, each Block heads are divided into according to the Block total numbers of write buffer A Block data block is corresponded to respectively, and records the Block data blocks affiliated RAID numbering, the Block data blocks respectively Lba addresses in target RAID array and record the Block data blocks whether the 2nd bitmap bitmaps of written data;
The Block data areas, including several Block data blocks, the size of the Block data blocks is the RAID heads The Block sizes of middle record.
10. device as claimed in claim 9, it is characterised in that the creation module is further used for:
It is that the target RAID array distributes a untapped RAID head according to the first bitmap bitmaps;
Correspondence is recorded by the target RAID array information and for the available Block numbers that the target RAID array is distributed RAID heads in.
11. device as claimed in claim 9, it is characterised in that the module for reading and writing is further used for:
Target RAID array numbering in the write IO request received searches corresponding RAID heads;
Lba addresses in the write IO request, it is corresponding Block at this RAID in search Block heads;
If having found corresponding Block heads, write data into this Block corresponding Block data block;
If not finding corresponding Block heads, a sky Block data block is obtained, sky Block data are write data into In block, while affiliated RAID numbering is recorded in sky Block data blocks are corresponding Block, described second This Block corresponding Block data blocks written data is recorded in bitmap bitmaps, and by the data in target RAID array In lba addresses recorded in the Block;
Wherein, when getting an empty data block, update recorded in corresponding RAID described and use Block numbers.
12. device as claimed in claim 9, it is characterised in that the module for reading and writing is further used for:
Target RAID array numbering in the read I O request received searches corresponding RAID heads;
Lba addresses in the read I O request, it is corresponding Block at this RAID in search Block heads;
If corresponding Block heads have been found, and the 2nd bitmap bitmaps in the Block record the Block Corresponding Block data blocks have had been written into data, then read the data;
If corresponding Block heads were not found, or the 2nd bitmap bitmaps in the Block would record the Block Corresponding Block data blocks do not write data, data are read from the target RAID array, and return to reading result.
CN201410401367.4A 2014-08-14 2014-08-14 The backup method and device of a kind of data storage Active CN104166601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410401367.4A CN104166601B (en) 2014-08-14 2014-08-14 The backup method and device of a kind of data storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410401367.4A CN104166601B (en) 2014-08-14 2014-08-14 The backup method and device of a kind of data storage

Publications (2)

Publication Number Publication Date
CN104166601A CN104166601A (en) 2014-11-26
CN104166601B true CN104166601B (en) 2017-08-15

Family

ID=51910431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410401367.4A Active CN104166601B (en) 2014-08-14 2014-08-14 The backup method and device of a kind of data storage

Country Status (1)

Country Link
CN (1) CN104166601B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068896B (en) * 2015-09-25 2019-03-12 浙江宇视科技有限公司 Data processing method and device based on RAID backup
CN108228084B (en) * 2016-12-21 2020-10-13 伊姆西Ip控股有限责任公司 Method and apparatus for managing storage system
KR20190089365A (en) * 2018-01-22 2019-07-31 에스케이하이닉스 주식회사 Storage device and operating method thereof
CN108491162A (en) * 2018-03-13 2018-09-04 山东超越数控电子股份有限公司 A kind of method and device improving performance of storage system
CN108874312B (en) * 2018-05-30 2021-09-17 郑州云海信息技术有限公司 Data storage method and storage device
CN112669148A (en) * 2020-12-22 2021-04-16 深圳市富途网络科技有限公司 Order processing method and device
CN117093160B (en) * 2023-10-18 2024-02-02 苏州元脑智能科技有限公司 Data processing method and device of Cache, computer equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236482A (en) * 2008-02-26 2008-08-06 杭州华三通信技术有限公司 Method for processing data under degrading state and independent redundancy magnetic disc array system
CN101527142A (en) * 2009-04-17 2009-09-09 杭州华三通信技术有限公司 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof
CN102520883A (en) * 2011-12-12 2012-06-27 杭州华三通信技术有限公司 Data access method and device thereof
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236482A (en) * 2008-02-26 2008-08-06 杭州华三通信技术有限公司 Method for processing data under degrading state and independent redundancy magnetic disc array system
CN101527142A (en) * 2009-04-17 2009-09-09 杭州华三通信技术有限公司 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array
CN102520883A (en) * 2011-12-12 2012-06-27 杭州华三通信技术有限公司 Data access method and device thereof

Also Published As

Publication number Publication date
CN104166601A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN104166601B (en) The backup method and device of a kind of data storage
US9009526B2 (en) Rebuilding drive data
JP5768587B2 (en) Storage system, storage control device, and storage control method
KR100701563B1 (en) Storage control apparatus and method
CN104035830B (en) A kind of data reconstruction method and device
US9575844B2 (en) Mass storage device and method of operating the same to back up data stored in volatile memory
US7707460B2 (en) Method, apparatus and program storage device for protecting data writes in a data storage device
KR101678868B1 (en) Apparatus for flash address translation apparatus and method thereof
US10120769B2 (en) Raid rebuild algorithm with low I/O impact
CN101236482B (en) Method for processing data under degrading state and independent redundancy magnetic disc array system
CN103718162A (en) Method and apparatus for flexible raid in ssd
CN101866307A (en) Data storage method and device based on mirror image technology
CN101609420A (en) Realize method and the redundant arrays of inexpensive disks and the controller thereof of rebuilding of disc redundant array
CN104142872A (en) Quick reestablishment method for RAID (redundan array of inexpensive disk)
CN104620230A (en) Method of managing memory
US20080091916A1 (en) Methods for data capacity expansion and data storage systems
US8938641B2 (en) Method and apparatus for synchronizing storage volumes
CN107885620A (en) A kind of method and system for improving Solid-state disc array Performance And Reliability
CN111816239A (en) Disk detection method and device, electronic equipment and machine-readable storage medium
JP5299933B2 (en) Apparatus, method, and computer program for operating mirrored disk storage system
US8775735B2 (en) Storage system and operation method of a storage system
CN107402890A (en) A kind of data processing method and system based on Solid-state disc array and caching
CN101169705A (en) Method for implementing file class mirror-image under multiple hard disk based on nude file system
US20040133741A1 (en) Disk array apparatus and data writing method used in the disk array apparatus
JP2012509533A5 (en)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant