CN101840362B - Method and device for achieving copy-on-write snapshot - Google Patents

Method and device for achieving copy-on-write snapshot Download PDF

Info

Publication number
CN101840362B
CN101840362B CN2009102367550A CN200910236755A CN101840362B CN 101840362 B CN101840362 B CN 101840362B CN 2009102367550 A CN2009102367550 A CN 2009102367550A CN 200910236755 A CN200910236755 A CN 200910236755A CN 101840362 B CN101840362 B CN 101840362B
Authority
CN
China
Prior art keywords
data
snapshot
module
data block
district
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
CN2009102367550A
Other languages
Chinese (zh)
Other versions
CN101840362A (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.)
Shenzhen chuangyunke Software Technology Co.,Ltd.
Original Assignee
CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Innovation And Technology Storage Technology 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 CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd, Innovation And Technology Storage Technology Co Ltd filed Critical CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Priority to CN2009102367550A priority Critical patent/CN101840362B/en
Publication of CN101840362A publication Critical patent/CN101840362A/en
Application granted granted Critical
Publication of CN101840362B publication Critical patent/CN101840362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention discloses an improved method for achieving copy-on-write (COW) snapshot, which comprises the following steps: setting up the bitmaps for a source data area and a snapshot area, wherein each bit in the bitmap corresponds to N data blocks; and indicating that data are written in the corresponding data blocks if the bit is valid, and if not, indicating that the data are not written in the corresponding data blocks, wherein N represents a natural number. Based on the bitmaps for the source data area and the snapshot area, the following functions can be performed: when a writing request is received by the source data area, whether the corresponding data blocks are required to be copied to the snapshot data area is judged, and the copy operation is carried out only when necessary.The invention further discloses an improved device for achieving the copy-on-write snapshot. The improved scheme provided by the invention is capable of directly responding to most writing request ofa host computer instead of copying the data blocks to the snapshot data area. By making the improvement, the invention can reduce the delay in the writing request of a user, reduce the size of the snapshot citation index and the snapshot data area and increase the utilization rate of the memory space.

Description

A kind of implementation method of improved Copy on write snapshot and device
Technical field
The present invention relates to computer memory technical field, particularly a kind of implementation method of improved Copy on write snapshot and device.
Background technology
The accelerated development of infotech makes the scale of key business data of enterprise expand day by day, and enterprise not only requires memory capacity increasing, and is also increasingly high to the data safe requirement.Along with the raising of storage application demand, the user needs online backup and protected data.Snapshot (Snapshot) technology is the guard method of a kind of online data effectively, can realize online data backup fast.
Snapshot is a complete usable copy of specific data set, and this copy comprises that specific data is integrated into the reflection of certain time point.The specific data set is called the source data district, and the reflection of certain time point is called the snapshot data district.Present snapping technique mainly contains two kinds: Copy on write (Copy-On-Write) and redirected write (Redirect-On-Write).Wherein the Copy on write technology takes up room for a short time, and establishment speed is fast, and less to the influence of source data district access performance, is widely used in the various fast photographic systems.
The Copy on write technology can generate the snapshot to the storage data change when input new data or data with existing are updated at every turn.Do like this can when hard disk write error, file corruption or program mal take place restore data promptly.But, if desired all data on network or the storage medium are filed completely or when recovering, the snapshots before all must be available.The Copy on write technology is not carried out any copying data when creating snapshot, only be required to be source data district initial snapshot reference pointer index, identifies this actual present position of time point data, so create the Copy on write snapshot, moment can be accomplished establishment.
The Copy on write snapping technique is by specifying magnitude unit that the source data zoning is divided into plurality of data piece (chunk), and data block is the base unit of snapshot deal with data.The principle of Copy on write is following: after creating the Copy on write snapshot; When write data requests was received in the source data district, storage system was at first searched snapshot reference pointer index, judged whether source data district data block to be revised has set up reference pointer; If this data block is not set up reference pointer; Then earlier with this data block copy to the snapshot data district, and set up the reference pointer of this data block, upgrade source data district data block then; If this data block has been set up reference pointer, represent that then this data block has copied the snapshot data district to, can directly upgrade this data block.The snapshot data district has just backed up all change data behind the source data district snapshot like this, has promptly generated the reflection of source data district at the snapshot creation time point.
The Copy on write snapshot treating apparatus of prior art is as shown in Figure 1, comprises that the user asks receiver module 101, read-write judge module 102, block management data module 103, snapshot index of reference module 104, source data district module 105, data block copy module 106, snapshot index of reference update module 107 and snapshot data district module 108.
The user asks receiver module 101 to be used to receive the access request from the user;
Read-write judge module 102 is used for the access request that judges request receiver module 101 received and is read request or writes request, if write request, then this is write request and is sent to block management data module 103.If read request then is sent to source data district data block 105 with this read request, carry out corresponding operating by 105 pairs of these read requests of source data district data block.
Block management data module 103; Be used for start address big or small according to source data district data block and from the request of writing of reading and writing judge module 102; Calculate source data district data block number to be revised, and the gained data block number is sent to snapshot index of reference module 104.
Preserved the snapshot reference pointer index of preset setting in the snapshot index of reference module 104, the mapping relations of the data block number that said snapshot reference pointer index is the equal of the source data district and the data block number in snapshot data district.And according to search said snapshot reference pointer index from the data block number of block management data module 103; If set up snapshot index of reference about said data block number; Then notification source data field module 105 responds the said request of writing; If do not set up snapshot index of reference, then with said data block number notification data block copy module 106 about said data block number.
Source data district module 105 comprises the source data district, and is used for the data block in source data district is carried out read-write operation.
Data block copy module 106 is used for after the notice of receiving snapshot index of reference module 104, reading source data district data block to be revised, and the sector position that data block writes the snapshot data district is set, and the data block that reads is write said sector position.
Snapshot index of reference update module 107; Be used for after 106 pairs of snapshot data districts of data block copy module module 108 is carried out write operation; The snapshot data district data block that foundation newly writes and the snapshot reference pointer of source data district data block; And the snapshot reference pointer of said foundation is sent to snapshot index of reference module 104, the snapshot reference pointer index of snapshot index of reference module 104 is upgraded.
Snapshot data district module 108 is used to preserve the data block in snapshot data district.
The treatment scheme of snapping technique during for the writing of prior art shown in Figure 2 comprises the steps:
Step 201: create the snapshot data district.
Step 202: according to the data block size in the source data district of appointment; The snapshot data zoning is divided into the plurality of data piece; Each data block has unique data block number; Data block size and source data district data block equal and opposite in direction, and initial snapshot reference pointer index, the mapping relations of the data block number that said snapshot reference pointer index is the equal of the source data district and the data block number in snapshot data district.
Step 203: the source data district receives user's access request.
Step 204: judge this access request whether for writing request, if execution in step 205 then, otherwise go to step 211.
Step 205: according to source data district data block size with write the request start address, calculate data block number to be revised.
Step 206: with the gained data block number is key word, searches snapshot reference pointer index.
Step 207: judge whether to set up the snapshot reference pointer, if then go to step 211, otherwise execution in step 208.
Step 208: read the source data district and wait to revise data block X1, the sector position that data block writes the snapshot data district is set.
Step 209: the data block Y1 that the data block that reads is write the said sector position in snapshot data district.
Step 210: the snapshot reference pointer of data block Y1 of setting up data block X1 and the snapshot data district in source data district.
Step 211: response read-write requests, access originator data field data block X1.
Though Copy on write snapshot creation speed is fast; And only need preserve the data block that change takes place in the source data district; The space hold rate is also lower, but the Copy on write snapping technique needs earlier data block is backuped to the snapshot data district and in internal memory, sets up the snapshot reference pointer when data block is changed for the first time in the source data district; Could upgrade this data block then, this writes request to the user and has brought bigger delay; Along with the data of source data district change are more and more, the internal memory that the snapshot index of reference is consumed is with increasing simultaneously, and the shared storage space in snapshot data district is also increasing, and this all brings very big burden to storage system.
Summary of the invention
In view of this, the objective of the invention is to, propose a kind of implementation method and device of improved Copy on write snapshot, can reduce the storage space that postpones and save the snapshot data district.
The implementation method of a kind of improved Copy on write snapshot that the embodiment of the invention proposes is provided with source data position chart; Corresponding N the data block of the every bit of said source data position chart; Write data in the data block of bit for effectively expression correspondence, bit is not write data in the corresponding data block of invalid then expression, and N is a natural number; This method comprises the steps:
A, establishment snapshot data district; The snapshot data zoning is divided into a plurality of data blocks, snapshot data district data block size and source data district data block equal and opposite in direction, and initial snapshot reference pointer index; Duplication source data position chart to the snapshot data district as snapshot data position chart;
B, source data district receive the request of writing, and confirm saidly to write the corresponding source data district data block of request, and judge whether J bit of the source data position chart that said source data district data block is corresponding be effective, if execution in step C then, J is a natural number; Otherwise go to step e;
C, judge whether J corresponding bit of snapshot data position chart be effective, if effective, execution in step D then, otherwise go to step e;
D, judge whether said source data district data block has set up the snapshot reference pointer; If set up the snapshot reference pointer, then go to step e, otherwise; Read the data of this source data district data block; The data block that reads is written to the snapshot data district,, and adds snapshot reference pointer index for this data block is set up the snapshot reference pointer;
E, the corresponding bit state of modification source data position chart are effectively, and the source data district responds the said request of writing.
Wherein, the said definite said data block number Chunk that writes the corresponding source data district data block of request of step B nEqual to write the big or small M of request start address divided by source data district data block.
J bit of the source data position chart that said source data district data block is corresponding equals source data district data block number Chunk nDivided by the corresponding number of data blocks N of the every bit of source data position chart.
Preferably, the said source data position chart that is provided with comprises the steps:
Set up initialized source data position chart, confirm the number of data blocks N that the every bit of bitmap table identifies according to memory size, all bits of bitmap table are initialized as disarmed state.
The embodiment of the invention proposes a kind of implement device of improved Copy on write snapshot, comprising: the user asks receiver module, source data district module, snapshot data district module; Source data district module comprises the source data district that a plurality of data blocks are formed, and is used for the data block in source data district is carried out read-write operation; Snapshot data district module is used to preserve the data block in snapshot data district; The user asks receiver module, is used to receive the request of writing from the user;
It is characterized in that this device also comprises: block management data module, snapshot index of reference module, data block copy module, snapshot index of reference update module, source data position chart module and snapshot position chart module;
The block management data module is used for asking to calculate source data district data block number to be revised according to said writing, and the gained data block number is sent to source data position chart module;
Source data position chart module is used to safeguard source data position chart; Corresponding N the data block of the every bit of said source data position chart; Write data in the data block of bit for effectively expression correspondence, bit is not write data in the corresponding data block of invalid then expression; After the data block number of receiving from the block management data module, judge whether J bit of the source data position chart that said data block number is corresponding be effective, if then bit sequence number J and data block number are sent to snapshot position chart module; N, J are natural number; After the source data district carries out write operation, said data block number the bit of corresponding source data position chart be set to effectively;
Snapshot data position chart module is used for when creating snapshot, the source data position chart in the chart module of duplication source data position to the snapshot data district as snapshot data position chart; And, judge whether J bit of snapshot data position chart be effective according to bit sequence number J from source data position chart module, if effectively then said data block number is sent to snapshot index of reference module; If the invalid said source data district module of then notifying is carried out corresponding write operation;
Snapshot index of reference module; Be used to preserve the snapshot reference pointer index that is provided with in advance, and, search said snapshot reference pointer index according to data block number from snapshot position chart module; If set up snapshot index of reference about said data block number; Then notification source data field module responds is said writes request, if do not set up the snapshot index of reference about said data block number, then with said data block number notification data block copy module;
The data block copy module is used for after the notice of receiving snapshot index of reference module, reads source data district data block to be revised, and the data block that reads is write the data block in snapshot data district;
Snapshot index of reference update module; Be used for after the data block copy module is carried out write operation to snapshot data district module; The snapshot data district data block that foundation newly writes and the snapshot reference pointer of source data district data block; And the said snapshot reference pointer that will set up is sent to snapshot index of reference module, and the snapshot reference pointer index of snapshot index of reference module is upgraded, and notifies said source data district module to carry out corresponding write operation then.
Said source data position chart module further comprises:
Initialization unit is used to set up initialized source data position chart, confirms the number of data blocks N that the every bit of bitmap table identifies according to memory size, and all bits of bitmap table are initialized as disarmed state.
Can find out from above technical scheme, when creating snapshot, the bitmap table of source book this moment copied to snapped volume preserve, as the data field bitmap table of this snapshot.Write when request when the source data district receives, the bitmap table in source data district judges whether this data block is effective, and is invalid as if this data block, then directly responds this and writes request; If this data block is effective, then further judge by the bitmap table in snapshot data district whether this data block is effective; If this data block is invalid, then directly responds this and write request.Through above-mentioned improvement, writing request for main frame greatly can directly respond, and need not to copy this data block to the snapshot data district.The present invention program can reduce the clear data copy greatly, and the snapshot of when source volume data is sky, creating can not cause any copying data, can reduce snapshot index of reference and snapshot data district size than prior art, improves the storage space utilization factor.
Description of drawings
The treating apparatus of snapping technique when Fig. 1 is writing of prior art;
The treatment scheme synoptic diagram of snapping technique when Fig. 2 is writing of prior art;
Fig. 3 is for disposing the initialization process process flow diagram that the embodiment of the invention need be carried out;
Fig. 4 is the treating apparatus of embodiment of the invention snapping technique when writing;
Fig. 5 is the treatment scheme synoptic diagram of embodiment of the invention snapping technique when writing.
Embodiment
The present invention program's basic ideas are following:
On existing Copy on write snapping technique basis; Increase judge module in source data district and snapshot data district respectively; Be used for judging when the source data district receives and write when asking, whether need copy the corresponding data piece to the snapshot data district, and only under the situation of needs, just carry out said copy function.
For making the object of the invention, technical scheme and advantage clearer, the present invention is done further to set forth in detail below in conjunction with accompanying drawing.
Come identification sources data field and snapshot data district respective data blocks whether effective through introducing bitmap table (bitmap) in the embodiment of the invention.Each bit of bitmap table can corresponding one or more data blocks.In order to write down source data district data block state, bitmap table must be created when creating the source data district.When the source data district was created, the source data district did not comprise any validated user data, and it is invalid that all data blocks are, and this moment, source data position all bits of chart all were designated disarmed state.Write request along with storage system constantly receives, the data block that the request write writes is identified as the valid data piece.After creating snapshot; Source data position chart possibly change some bit state because new writing asked; The data block state in source data district when writing down snapshot creation, duplication source data position chart is to the snapshot data district, as the bitmap table in snapshot data district when creating snapshot; Snapshot data bitmap area table record during the establishment snapshot, the state of source data district data block.Through setting up said bitmap table, can reduce in the Copy on write snapshot processes copy to invalid data block, through reducing the invalid data copy, both reduced the user and write request delay, also improved the storage space utilization factor.
Embodiment of the invention scheme relates to the source data district, snapshot data district, snapshot reference pointer index, source data position chart, snapshot data position chart.Wherein user's valid data are deposited in the source data district; The data of revising behind the snapshot time point of backup source data field, snapshot data district; The mapping relations of source data district data block and snapshot data district data block set up in snapshot reference pointer index; Whether source data position chart is used for describing source data district data block effective; Snapshot data position chart is used for describing when creating snapshot, and whether source data district data block is effective.
The initial treatment flow process of the embodiment of the invention comprises the steps: according to shown in Figure 3
Step 301: in storage system, create the source data district, prepare to receive the user writable request;
Step 302: according to the data designated block size, the source data zoning is divided into the plurality of data piece, the data block size should be the integral multiple of disk sector, can be according to the big or small specified data block size of Installed System Memory (RAM);
Step 303: set up source data position chart, the data block that the every bit sign of bitmap table is N, N is a natural number.N representes the number of data blocks of every bit sign, can confirm according to Installed System Memory (RAM) size.The data block of every bit sign is few more, and then bitmap table is big more, and the degree of accuracy of specified data piece effective status is also high more; All bits of bitmap table are initialized as disarmed state; Be that all data blocks of source data district are disarmed state;
Step 304: the source data district receives user's access request.
Step 305: judge said access request whether for writing request, if order execution in step 306 then; Otherwise directly go to step 308;
Step 306: according to the data block size, every bit identification data block number and the reference position calculating source data position chart bit corresponding of writing request with this data block number.
If source data district data block sizes values is M, the number of data blocks of the every bit sign of bitmap table is N, and it is A that the user asks start address, and then the corresponding source data district data block number computing formula of this request is:
Chunk n=A/M (formula one)
The corresponding bit computing formula of data block is:
Bit n=Chunk n/ N (formula two)
Step 307: it is effective revising the source data position corresponding bit state of chart;
Step 308: source data district response user's access request, and return step 304.
The treatment scheme of the Copy on write snapshot that the embodiment of the invention proposes is as shown in Figure 4, comprises the steps:
Step 401: create the snapshot data district;
Step 402: according to the specific data block size snapshot data zoning is divided into the plurality of data piece, snapshot data district data block size and source data district data block equal and opposite in direction, and initial snapshot reference pointer index;
Step 403: duplication source data position chart is set up snapshot data position chart to the snapshot data district;
Step 404: the source data district receives user access request;
Step 405: judge that whether said user access request is for writing request, if not write request, commentaries on classics step 415; If write request, order execution in step 406;
Step 406: calculate data block number to be revised according to source data district data block size with writing the request start address, use formula one;
Step 407: according to data block number to be revised, calculate the corresponding source data position chart bit of said data block number, use formula two;
Step 408: judge whether chart corresponding bit position, source data position is effective,, represent that this data block is invalid, change step 415 if invalid; If effectively, order execution in step 409;
Step 409: judge whether chart corresponding bit position, snapshot data position is effective,, represent that this data block is invalid, change step 415 if invalid; If effectively, order execution in step 410.
Suppose that bit and chart corresponding bit position, the said source data of step 408 position that formula two calculates are J bits in the chart of source data position; Corresponding relation according to source data position chart and snapshot data position chart; Chart corresponding bit position, said snapshot data position also is a J bit of snapshot data position chart, and wherein J is a natural number.
Step 410: with the data block number is key word, searches snapshot reference pointer index;
Step 411: judge whether this source data district data block has set up the snapshot reference pointer,, change step 415 if set up the snapshot reference pointer; If do not set up the snapshot reference pointer, order execution in step 412;
Step 412: read the data of this source data district data block, and the sector position that data block writes the snapshot data district is set;
Step 413: the data block that reads is written to the snapshot data district;
Step 414:, and add snapshot reference pointer index for this data block is set up the snapshot reference pointer;
Step 415: if read request, the source data district directly reads corresponding data, and responds this read request; If write request, revising the source data position corresponding bit state of chart is that effectively the source data district writes data and responds the said request of writing.
Mainly in step 408 and step 409, promptly according to source data district and snapshot data position chart, whether judgement waits to revise data block is effective status to the improvement of traditional Copy on write snapping technique in the present invention; If this data block is a disarmed state; Then directly change step 415, can avoid the copy of invalid data block on the one hand, improve the user and write the request response; Can reduce the snapshot index of reference pointer of invalid data on the one hand; Reduce the memory headroom that the snapshot index of reference takies, can eliminate on the other hand invalid data in the snapshot data district shared storage space, thereby improve the space availability ratio of storage system.
In the use of source data district, the valid data that the user writes only account for the seldom part in source data district probably, and at this moment, promptly most of data block in source data district is disarmed state.The method of using the present invention to propose is created when writing behind the snapshot; If the most of data block in source data district is a disarmed state; During snapshot operation, directly respond user's request when then writing, avoid interpolation the copy and the snapshot reference pointer of invalid data block; Reduce the user greatly and write request delay, improve the storage system space availability ratio.
The embodiment of the invention also proposes a kind of device of improved Copy on write snapshot; This device is as shown in Figure 5, comprises that the user asks receiver module 501, read-write judge module 502, block management data module 503, source data position chart module 504, source data district module 505, snapshot data position chart module 506, snapshot index of reference module 507, data block copy module 508, snapshot index of reference update module 509 and snapshot data district module 510.Compare the Copy on write fast photographing device of prior art shown in Figure 1, increased source data position chart module 504 and snapshot data position chart module 506.The function of above-mentioned each module is following:
The user asks receiver module 501 to be used to receive the access request from the user;
Read-write judge module 502 is used for the access request that judges request receiver module 501 received and is read request or writes request, if write request, then this is write request and is sent to block management data module 503.If read request then is sent to source data district data block 505 with this read request, carry out corresponding operating by 505 pairs of these read requests of source data district data block.
Block management data module 503; Be used for start address big or small according to source data district data block and from the request of writing of reading and writing judge module 502; Calculate source data district data block number to be revised, and the gained data block number is sent to source data position chart module 504.
Source data position chart module 504 is used to safeguard source data position chart; Corresponding N the data block of the every bit of said source data position chart; Write data in the data block of bit for effectively expression correspondence, bit is not write data in the corresponding data block of invalid then expression; After the data block number of receiving from the block management data module, judge whether J bit of the source data position chart that said data block number is corresponding be effective, if then bit sequence number J and data block number are sent to snapshot position chart module 506; N, J are natural number; After the source data district carries out write operation, said data block number the bit of corresponding source data position chart be set to effectively.
Source data district module 505 comprises the source data district, and is used for the data block in source data district is carried out read-write operation.
Snapshot data position chart module 506, the source data position chart that is used for duplication source data position chart module to the snapshot data district as snapshot data position chart; And, judge whether J bit of snapshot data position chart be effective according to bit sequence number J from source data position chart module, if effectively then said data block number is sent to snapshot index of reference module 507;
Preserved the snapshot reference pointer index of preset setting in the snapshot index of reference module 507, the mapping relations of the data block number that said snapshot reference pointer index is the equal of the source data district and the data block number in snapshot data district.And according to search said snapshot reference pointer index from the data block number of snapshot data position chart module 506; If set up snapshot index of reference about said data block number; Then notification source data field module 505 responds the said request of writing; If do not set up snapshot index of reference, then with said data block number notification data block copy module 506 about said data block number.
Data block copy module 508 is used for after the notice of receiving snapshot index of reference module 507, reading source data district data block to be revised, and the sector position that data block writes the snapshot data district is set, and the data block that reads is write said sector position.
Snapshot index of reference update module 509; Be used for after 508 pairs of snapshot data districts of data block copy module module 510 is carried out write operation; The snapshot data district data block that foundation newly writes and the snapshot reference pointer of source data district data block; And the snapshot reference pointer of said foundation is sent to snapshot index of reference module 507, and the snapshot reference pointer index of snapshot index of reference module 507 is upgraded, notify said source data district module 505 to carry out corresponding write operation then.
Snapshot data district module 510 is used to preserve the data block in snapshot data district.
Embodiment of the invention scheme is improved on existing Copy on write snapshot scheme; Increase bitmap table in source data district and snapshot data district; When receiving, the source data district writes when request; Earlier judge according to source data position chart whether this data block is effective, and chart corresponding bit position, source data position is set for effective.If this data block is invalid, then directly responds this and write request; If this data block of source data position chart sign is effective, then further judge according to snapshot data position chart whether this data block is effective; If this data block is invalid, then directly responds this and write request.So when source data position chart that data block is corresponding or chart corresponding bit position, snapshot data position are invalid, can directly respond this and write request, and need not to copy this data block to the snapshot data district.Can reduce the user through improvement and write request delay, reduce snapshot index of reference and snapshot data district size, improve the storage space utilization factor.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (6)

1. the implementation method of an improved Copy on write snapshot is characterized in that, source data position chart is set; Corresponding N the data block of the every bit of said source data position chart; Write data in the data block of bit for effectively expression correspondence, bit is not write data in the corresponding data block of invalid then expression, and N is a natural number; This method comprises the steps:
A, establishment snapshot data district; The snapshot data zoning is divided into a plurality of data blocks, snapshot data district data block size and source data district data block equal and opposite in direction, and initial snapshot reference pointer index; Duplication source data position chart to the snapshot data district as snapshot data position chart;
B, source data district receive the request of writing, and confirm saidly to write the corresponding source data district data block of request, and judge whether J bit of the source data position chart that said source data district data block is corresponding be effective, if execution in step C then, J is a natural number; Otherwise go to step e;
C, judge whether J corresponding bit of snapshot data position chart be effective, if effective, execution in step D then, otherwise go to step e;
D, judge whether said source data district data block has set up the snapshot reference pointer; If set up the snapshot reference pointer, then go to step e, otherwise; Read the data of this source data district data block; The data block that reads is written to the snapshot data district,, and adds snapshot reference pointer index for this data block is set up the snapshot reference pointer;
E, the corresponding bit state of modification source data position chart are effectively, and the source data district responds the said request of writing.
2. method according to claim 1 is characterized in that, the said definite said data block number Chunk that writes the corresponding source data district data block of request of step B nEqual to write the big or small M of request start address divided by source data district data block.
3. method according to claim 2 is characterized in that, J bit of the source data position chart that said source data district data block is corresponding equals source data district data block number Chunk nDivided by the corresponding number of data blocks N of the every bit of source data position chart.
4. method according to claim 1 is characterized in that, the said source data position chart that is provided with comprises the steps:
Set up initialized source data position chart, confirm the number of data blocks N that the every bit of bitmap table identifies according to memory size, all bits of bitmap table are initialized as disarmed state.
5. the implement device of an improved Copy on write snapshot, comprising: the user asks receiver module, source data district module, snapshot data district module; Source data district module comprises the source data district that a plurality of data blocks are formed, and is used for the data block in source data district is carried out read-write operation; Snapshot data district module is used to preserve the data block in snapshot data district; The user asks receiver module, is used to receive the request of writing from the user;
It is characterized in that this device also comprises: block management data module, snapshot index of reference module, data block copy module, snapshot index of reference update module, source data position chart module and snapshot position chart module;
The block management data module is used for asking to calculate source data district data block number to be revised according to said writing, and the gained data block number is sent to source data position chart module;
Source data position chart module is used to safeguard source data position chart; Corresponding N the data block of the every bit of said source data position chart; Write data in the data block of bit for effectively expression correspondence, bit is not write data in the corresponding data block of invalid then expression; After the data block number of receiving from the block management data module, judge whether J bit of the source data position chart that said data block number is corresponding be effective, if then bit sequence number J and data block number are sent to snapshot position chart module; N, J are natural number; After the source data district carries out write operation, said data block number the bit of corresponding source data position chart be set to effectively;
Snapshot data position chart module is used for when creating snapshot, the source data position chart in the chart module of duplication source data position to the snapshot data district as snapshot data position chart; And, judge whether J bit of snapshot data position chart be effective according to bit sequence number J from source data position chart module, if effectively then said data block number is sent to snapshot index of reference module; If the invalid said source data district module of then notifying is carried out corresponding write operation;
Snapshot index of reference module; Be used to preserve the snapshot reference pointer index that is provided with in advance, and, search said snapshot reference pointer index according to data block number from snapshot position chart module; If set up snapshot index of reference about said data block number; Then notification source data field module responds is said writes request, if do not set up the snapshot index of reference about said data block number, then with said data block number notification data block copy module;
The data block copy module is used for after the notice of receiving snapshot index of reference module, reads source data district data block to be revised, and the data block that reads is write the data block in snapshot data district;
Snapshot index of reference update module; Be used for after the data block copy module is carried out write operation to snapshot data district module; The snapshot data district data block that foundation newly writes and the snapshot reference pointer of source data district data block; And the said snapshot reference pointer that will set up is sent to snapshot index of reference module, and the snapshot reference pointer index of snapshot index of reference module is upgraded, and notifies said source data district module to carry out corresponding write operation then.
6. device according to claim 5 is characterized in that, said source data position chart module further comprises:
Initialization unit is used to set up initialized source data position chart, confirms the number of data blocks N that the every bit of bitmap table identifies according to memory size, and all bits of bitmap table are initialized as disarmed state.
CN2009102367550A 2009-10-28 2009-10-28 Method and device for achieving copy-on-write snapshot Active CN101840362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102367550A CN101840362B (en) 2009-10-28 2009-10-28 Method and device for achieving copy-on-write snapshot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102367550A CN101840362B (en) 2009-10-28 2009-10-28 Method and device for achieving copy-on-write snapshot

Publications (2)

Publication Number Publication Date
CN101840362A CN101840362A (en) 2010-09-22
CN101840362B true CN101840362B (en) 2012-05-30

Family

ID=42743744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102367550A Active CN101840362B (en) 2009-10-28 2009-10-28 Method and device for achieving copy-on-write snapshot

Country Status (1)

Country Link
CN (1) CN101840362B (en)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968755B (en) * 2010-11-04 2012-02-08 清华大学 Application load change adaptive snapshot generating method
CN102096613B (en) * 2010-12-30 2012-09-05 上海爱数软件有限公司 Method and device for generating snapshot
CN102289510B (en) * 2011-08-31 2013-10-09 华为数字技术(成都)有限公司 Method and device for writing data to production volume
CN102411524A (en) * 2011-12-30 2012-04-11 云海创想信息技术(天津)有限公司 Snapshot volume data copying method
CN102971698B (en) * 2012-06-29 2014-07-09 华为技术有限公司 Snapshot data-processing method and system, storage system and snapshot agency
CN103389926B (en) * 2013-06-25 2016-04-20 百度在线网络技术(北京)有限公司 A kind of method and apparatus for backing up virtual disk
CN103412824B (en) * 2013-07-19 2016-08-10 华为技术有限公司 Copy on write Snapshot Method and device
CN105095015B (en) * 2014-05-13 2018-02-23 北京云巢动脉科技有限公司 The method for building up and device of a kind of disk snapshot
CN105138429B (en) * 2015-08-21 2018-11-02 浪潮(北京)电子信息产业有限公司 A kind of Copy on write Snapshot Method and system
CN105302665B (en) * 2015-10-12 2018-02-02 深圳市安云信息科技有限公司 A kind of improved Copy on write Snapshot Method and system
CN105938457B (en) * 2016-03-31 2018-10-02 华为技术有限公司 Filter method, device and the data reading system of data
CN105912425B (en) * 2016-04-08 2019-04-16 杭州宏杉科技股份有限公司 Snapshot image foundation, rollback method and device
CN106371763A (en) * 2016-08-23 2017-02-01 浪潮(北京)电子信息产业有限公司 Snapshot storage method and apparatus, disk and computer
CN106445421A (en) * 2016-10-14 2017-02-22 郑州云海信息技术有限公司 Storage system data migration method and system
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN109271278B (en) * 2017-07-18 2022-09-02 阿里巴巴集团控股有限公司 Method and device for determining number of references of disk snapshot data slices
CN107368393B (en) * 2017-07-28 2020-10-20 苏州浪潮智能科技有限公司 Method and device for storing snapshot
CN107423165A (en) * 2017-08-01 2017-12-01 郑州云海信息技术有限公司 A kind of data snapshot head writes copy method and device
CN109324929B (en) * 2018-09-17 2021-11-09 郑州云海信息技术有限公司 Snapshot creating method, device and equipment and readable storage medium
EP3847538A1 (en) * 2018-10-03 2021-07-14 Google LLC Maintaining block level snapshots using free storage space
US11132332B2 (en) 2018-11-02 2021-09-28 International Business Machines Corporation Method to write data ahead to snapshot area to avoid copy-on-write
CN109598156B (en) * 2018-11-19 2023-04-11 杭州信核数据科技股份有限公司 Method for redirecting engine snapshot stream during writing
CN109814979B (en) * 2018-12-17 2021-03-30 华为技术有限公司 Data loading method and device, computer equipment and readable storage medium
CN109902034B (en) * 2019-02-25 2021-09-10 杭州宏杉科技股份有限公司 Snapshot creating method and device, electronic equipment and machine-readable storage medium
CN110795389B (en) * 2019-10-28 2022-09-30 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
CN114327270B (en) * 2021-12-23 2023-09-15 郑州云海信息技术有限公司 Request processing method, device, equipment and readable storage medium
CN114356849B (en) * 2022-03-21 2022-05-17 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium
CN115826878B (en) * 2023-02-14 2023-05-16 浪潮电子信息产业股份有限公司 Copy-on-write method, device, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1955939A (en) * 2006-10-13 2007-05-02 清华大学 Backup and recovery method based on virtual flash disk
EP1804167A2 (en) * 2005-12-28 2007-07-04 Hitachi, Ltd. Storage system and snapshot management method
CN101140536A (en) * 2007-05-21 2008-03-12 中兴通讯股份有限公司 Snapshot system supporting cascades snapshot and snapshot processing method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1804167A2 (en) * 2005-12-28 2007-07-04 Hitachi, Ltd. Storage system and snapshot management method
CN1955939A (en) * 2006-10-13 2007-05-02 清华大学 Backup and recovery method based on virtual flash disk
CN101140536A (en) * 2007-05-21 2008-03-12 中兴通讯股份有限公司 Snapshot system supporting cascades snapshot and snapshot processing method thereof

Also Published As

Publication number Publication date
CN101840362A (en) 2010-09-22

Similar Documents

Publication Publication Date Title
CN101840362B (en) Method and device for achieving copy-on-write snapshot
CN102012852B (en) Method for implementing incremental snapshots-on-write
US6857057B2 (en) Virtual storage systems and virtual storage system operational methods
CN101361047B (en) Method and system for data protection in storage systems
US7660958B2 (en) Maintaining consistency for remote copy using virtualization
CN100437568C (en) Transaction consistent copy-on-write database
US9098452B2 (en) Selecting files to backup in a block level backup
EP2879040B1 (en) Data storage method, data storage apparatus, and storage device
US7698319B2 (en) Database system management method, database system, database device, and backup program
US9778860B2 (en) Re-TRIM of free space within VHDX
US7257675B2 (en) Disk array device having snapshot simulation function
JP6604115B2 (en) Storage device and storage control program
CN103597440A (en) Method for creating clone file, and file system adopting the same
CN109522154B (en) Data recovery method and related equipment and system
CN102096561B (en) Hierarchical data storage processing method, device and storage equipment
US6996582B2 (en) Virtual storage systems and virtual storage system operational methods
CN104360914A (en) Incremental snapshot method and device
US8140886B2 (en) Apparatus, system, and method for virtual storage access method volume data set recovery
CN102411524A (en) Snapshot volume data copying method
US11429498B2 (en) System and methods of efficiently resyncing failed components without bitmap in an erasure-coded distributed object with log-structured disk layout
US7650476B2 (en) System, method and computer program product for generating a consistent point in time copy of data
US9251020B1 (en) Systems and methods for file-level replication
US20050154786A1 (en) Ordering updates in remote copying of data
US8527723B1 (en) Storage system and control method for storage system
US9003129B1 (en) Techniques for inter-storage-processor cache communication using tokens

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 505, Taixing Building, 11 Garden East Road, Haidian District, Beijing, 100191

Co-patentee after: Shenzhen Innovation Software Technology Co., Ltd.

Patentee after: Innovation Technology Co., Ltd.

Address before: 100083 8th Floor of First Enjoyment Science and Technology Building, 51 College Road, Haidian District, Beijing

Co-patentee before: Chuangxinke Software Technology (Shenzhen) Co., Ltd.

Patentee before: Innovation and Technology Storage Technology Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211009

Address after: 518057 a1402e, building 1, Shenzhen software industry base, No. 81, 83 and 85, Gaoxin South 10th Road, Binhai community, Yuehai street, Nanshan District, Shenzhen, Guangdong

Patentee after: Shenzhen chuangyunke Software Technology Co.,Ltd.

Address before: 100191 room 505, Taixing building, 11 Huayuan East Road, Haidian District, Beijing

Patentee before: Innovation Technology Co.,Ltd.

Patentee before: Shenzhen Innovation Software Technology Co.,Ltd.