CN101840362A - 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
CN101840362A
CN101840362A CN200910236755A CN200910236755A CN101840362A CN 101840362 A CN101840362 A CN 101840362A CN 200910236755 A CN200910236755 A CN 200910236755A CN 200910236755 A CN200910236755 A CN 200910236755A CN 101840362 A CN101840362 A CN 101840362A
Authority
CN
China
Prior art keywords
data
snapshot
module
data block
source data
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.)
Granted
Application number
CN200910236755A
Other languages
Chinese (zh)
Other versions
CN101840362B (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 of a 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 more and more higher 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 finished 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 as follows: after creating the Copy on write snapshot, when write data requests is received in the source data district, storage system is at first searched snapshot reference pointer index, judge 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 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 as shown in Figure 1.
The user asks receiver module 101 to be used to receive request of access from the user;
Read-write judge module 102 is used to judge that the request of access that the user asks receiver module 101 to be received is read request or write request, if write request then is sent to block management data module 103 with this write request.If read request then is sent to this read request source data district data block 105, 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 write request 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 default setting in the snapshot index of reference module 104, the mapping relations of the data block number that described 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 described snapshot reference pointer index from the data block number of block management data module 103, if set up snapshot index of reference about described data block number, then notification source data field module 105 responds described write request, if do not set up snapshot index of reference, then with described data block number notification data block copy module 106 about described 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 reading source data district data block to be revised after the notice of receiving snapshot index of reference module 104, the sector position that data block writes the snapshot data district is set, and the data block that reads is write described 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 described 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 comprises the steps: when Figure 2 shows that the writing of prior art
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 described 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 request of access.
Step 204: judge whether this request of access is write request, if execution in step 205 then, otherwise go to step 211.
Step 205:, calculate data block number to be revised according to source data district data block size and write request start address.
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 described sector position in snapshot data district.
Step 210: the snapshot reference pointer of setting up the data block Y1 in the data block X1 in source data district and snapshot 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, when but the Copy on write snapping technique is changed for the first time in source data district data block, need earlier data block to be backuped to the snapshot data district and set up the snapshot reference pointer in internal memory, could upgrade this data block then, this has brought bigger delay for user's write request; 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 described 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 write request, determine the source data district data block of described write request correspondence, and judge whether J the bit of source data position chart of described source data district data block correspondence be effective, if execution in step C then, J is a natural number; Otherwise go to step e;
C, judge whether J bit of snapshot data position chart correspondence be effective, if effectively, execution in step D then, otherwise go to step e;
D, judge whether described 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;
The bit state of E, modification source data position chart correspondence is that effectively the source data district responds described write request.
Wherein, the described data block number Chunk that determines the source data district data block of described write request correspondence of step B nEqual the big or small M of write request start address A divided by source data district data block.
J bit of the source data position chart of described source data district data block correspondence equals source data district data block number Chunk nNumber of data blocks N divided by the every bit correspondence of source data position chart.
Preferably, the described source data position chart that is provided with comprises the steps:
Set up initialized source data position chart, determine 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 source data district receives user's write request, determines the source data district data block of described write request correspondence, and the bit state of revising the source data position chart of source data district data block correspondence is effective.
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 write request 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 calculating source data district data block number to be revised according to described write request, 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 described 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 the bit of source data position chart of described data block number correspondence 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, described 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 described data block number is sent to snapshot index of reference module; If the invalid described 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 of default setting, and according to data block number from snapshot position chart module, search described snapshot reference pointer index, if set up snapshot index of reference about described data block number, the described write request of notification source data field module responds then is not if set up snapshot index of reference about described data block number, then with described 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 snapshot reference pointer of described foundation is sent to snapshot index of reference module, the snapshot reference pointer index of snapshot index of reference module is upgraded, notify described source data district module to carry out corresponding write operation then.
Described source data position chart module further comprises:
Initialization unit is used to set up initialized source data position chart, determines 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.
As can be seen from the above technical solutions, when creating snapshot, the bitmap table of source book is this moment copied to snapped volume preserve, as the data field bitmap table of this snapshot.When the source data district received write request, the bitmap table in source data district judged whether this data block is effective, if this data block is invalid, then directly responded this write 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 respond this write request.By above-mentioned improvement, can directly respond for main frame write request greatly, 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 creating when source volume data is sky 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 as follows:
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 write request, whether need to copy the corresponding data piece to the snapshot data district, and only under the situation of needs, just carry out described copy function.
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is further elaborated below in conjunction with accompanying drawing.
Come identification sources data field and snapshot data district respective data blocks whether effective by 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.Along with storage system constantly receives write request, the data block that write request writes is identified as the valid data piece.After creating snapshot, source data position chart may change some bit state because of new write request, the data block state in source data district when writing down snapshot creation, duplication source data position chart is to the snapshot data district when creating snapshot, bitmap table as the snapshot data district, snapshot data bitmap area table record during the establishment snapshot, the state of source data district data block.By setting up described bitmap table, can reduce in the Copy on write snapshot processes copy to invalid data block, by reducing the invalid data copy, both reduced the time-delay of user's write request, 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 represents the number of data blocks of every bit sign, can determine 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 request of access.
Step 305: judge whether described request of access is write request, if then the order execution in step 306; Otherwise directly go to step 308;
Step 306: according to the data block size, the reference position of every bit identification data block number and write request is calculated the source data position chart bit corresponding 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 bit computing formula of data block correspondence is:
Bit n=Chunk n/ N (formula two)
Step 307: the bit state of revising source data position chart correspondence is effective;
Step 308: source data district response user's request of access, and return step 304.
The treatment scheme of the Copy on write snapshot that the embodiment of the invention proposes comprises the steps: as shown in Figure 4
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 whether described user access request is write request, if not write request is changeed 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 and write request start address, use formula one;
Step 407: according to data block number to be revised, calculate the source data position chart bit of described data block number correspondence, 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 described 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, described 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, the bit state of revising source data position chart correspondence is that effectively the source data district writes data and responds described write request.
The present invention to the improvement of traditional Copy on write snapping technique mainly in step 408 and step 409, promptly according to source data district and snapshot data position chart, judge whether wait to revise data block is effective status, 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 response of user's write request, 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 invalid data on the other hand at the shared storage space in snapshot data district, 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, when then writing during snapshot operation, directly response user request, avoid interpolation to the copy and the snapshot reference pointer of invalid data block, reduce the time-delay of user's write request greatly, 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 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 as shown in Figure 5.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 as follows:
The user asks receiver module 501 to be used to receive request of access from the user;
Read-write judge module 502 is used to judge that the request of access that the user asks receiver module 501 to be received is read request or write request, if write request then is sent to block management data module 503 with this write request.If read request then is sent to this read request source data district data block 505, 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 write request 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 described 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 the bit of source data position chart of described data block number correspondence 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, described 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 described data block number is sent to snapshot index of reference module 507;
Preserved the snapshot reference pointer index of default setting in the snapshot index of reference module 507, the mapping relations of the data block number that described 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 described snapshot reference pointer index from the data block number of snapshot data position chart module 506, if set up snapshot index of reference about described data block number, then notification source data field module 505 responds described write request, if do not set up snapshot index of reference, then with described data block number notification data block copy module 506 about described data block number.
Data block copy module 508 is used for reading source data district data block to be revised after the notice of receiving snapshot index of reference module 507, the sector position that data block writes the snapshot data district is set, and the data block that reads is write described 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 described foundation is sent to snapshot index of reference module 507, the snapshot reference pointer index of snapshot index of reference module 507 is upgraded, notify described 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 the source data district receives write 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 respond this write request; If it is effective that source data position chart identifies this data block, then further judge according to snapshot data position chart whether this data block is effective; If this data block is invalid, then directly respond this write request.So when the source data position chart of data block correspondence or chart corresponding bit position, snapshot data position are invalid, can directly respond this write request, and need not to copy this data block to the snapshot data district.Can reduce the time-delay of user's write request by improving, reduce snapshot index of reference and snapshot data district size, improve the storage space utilization factor.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, 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 described 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 write request, determine the source data district data block of described write request correspondence, and judge whether J the bit of source data position chart of described source data district data block correspondence be effective, if execution in step C then, J is a natural number; Otherwise go to step e;
C, judge whether J bit of snapshot data position chart correspondence be effective, if effectively, execution in step D then, otherwise go to step e;
D, judge whether described 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;
The bit state of E, modification source data position chart correspondence is that effectively the source data district responds described write request.
2. method according to claim 1 is characterized in that, the described data block number Chunk that determines the source data district data block of described write request correspondence of step B nEqual the big or small M of write request start address A 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 of described source data district data block correspondence equals source data district data block number Chunk nNumber of data blocks N divided by the every bit correspondence of source data position chart.
4. method according to claim 1 is characterized in that, the described source data position chart that is provided with comprises the steps:
Set up initialized source data position chart, determine 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 source data district receives user's write request, determines the source data district data block of described write request correspondence, and the bit state of revising the source data position chart of source data district data block correspondence is effective.
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 write request 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 calculating source data district data block number to be revised according to described write request, 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 described 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 the bit of source data position chart of described data block number correspondence 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, described 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 described data block number is sent to snapshot index of reference module; If the invalid described 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 of default setting, and according to data block number from snapshot position chart module, search described snapshot reference pointer index, if set up snapshot index of reference about described data block number, the described write request of notification source data field module responds then is not if set up snapshot index of reference about described data block number, then with described 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 snapshot reference pointer of described foundation is sent to snapshot index of reference module, the snapshot reference pointer index of snapshot index of reference module is upgraded, notify described source data district module to carry out corresponding write operation then.
6. device according to claim 5 is characterized in that, described source data position chart module further comprises:
Initialization unit is used to set up initialized source data position chart, determines 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 true CN101840362A (en) 2010-09-22
CN101840362B 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)

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968755A (en) * 2010-11-04 2011-02-09 清华大学 Application load change adaptive snapshot generating method
CN102096613A (en) * 2010-12-30 2011-06-15 上海爱数软件有限公司 Method and device for generating snapshot
CN102289510A (en) * 2011-08-31 2011-12-21 成都市华为赛门铁克科技有限公司 Method and device for writing data to production volume
CN102411524A (en) * 2011-12-30 2012-04-11 云海创想信息技术(天津)有限公司 Snapshot volume data copying method
CN103389926A (en) * 2013-06-25 2013-11-13 百度在线网络技术(北京)有限公司 Method and device used for backing-up virtual disk
CN103412824A (en) * 2013-07-19 2013-11-27 华为技术有限公司 Method and device for copy-on-write snapshotting
WO2014000249A1 (en) * 2012-06-29 2014-01-03 华为技术有限公司 Snapshot data processing method and system, storage system and snapshot agency
CN105095015A (en) * 2014-05-13 2015-11-25 北京云巢动脉科技有限公司 Disk snapshot establishment method and apparatus
CN105138429A (en) * 2015-08-21 2015-12-09 浪潮(北京)电子信息产业有限公司 Copy-on-write method and system of snapshots
CN105302665A (en) * 2015-10-12 2016-02-03 深圳市安云信息科技有限公司 Improved copy-on-write snapshot method and system
CN105912425A (en) * 2016-04-08 2016-08-31 杭州宏杉科技有限公司 Snapshot image establishment and rollback method and apparatus
CN105938457A (en) * 2016-03-31 2016-09-14 华为技术有限公司 Data filtering method, and device and data reading system
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
CN107368393A (en) * 2017-07-28 2017-11-21 郑州云海信息技术有限公司 A kind of 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
CN109271278A (en) * 2017-07-18 2019-01-25 阿里巴巴集团控股有限公司 A kind of method and apparatus of the reference number of determining disk snapshot data slicer
CN109324929A (en) * 2018-09-17 2019-02-12 郑州云海信息技术有限公司 A kind of snapshot creation method, device, equipment and readable storage medium storing program for executing
CN109598156A (en) * 2018-11-19 2019-04-09 杭州信核数据科技股份有限公司 Engine snapshot stream method is redirected when one kind is write
CN109814979A (en) * 2018-12-17 2019-05-28 华为技术有限公司 Data load method, device, computer equipment and readable storage medium storing program for executing
CN109902034A (en) * 2019-02-25 2019-06-18 杭州宏杉科技股份有限公司 Snapshot creation method, device, electronic equipment and machine readable storage medium
CN110795389A (en) * 2019-10-28 2020-02-14 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
CN112639715A (en) * 2018-10-03 2021-04-09 谷歌有限责任公司 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
CN114356849A (en) * 2022-03-21 2022-04-15 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium
CN115826878A (en) * 2023-02-14 2023-03-21 浪潮电子信息产业股份有限公司 Copy-on-write method, device, equipment and computer readable storage medium
WO2023116109A1 (en) * 2021-12-23 2023-06-29 郑州云海信息技术有限公司 Request processing method and apparatus, and device and non-volatile readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4800031B2 (en) * 2005-12-28 2011-10-26 株式会社日立製作所 Storage system and snapshot management method
CN1955939A (en) * 2006-10-13 2007-05-02 清华大学 Backup and recovery method based on virtual flash disk
CN101140536B (en) * 2007-05-21 2012-09-05 中兴通讯股份有限公司 Snapshot system supporting cascades snapshot and snapshot processing method thereof

Cited By (43)

* 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
CN101968755A (en) * 2010-11-04 2011-02-09 清华大学 Application load change adaptive snapshot generating method
CN102096613A (en) * 2010-12-30 2011-06-15 上海爱数软件有限公司 Method and device for generating snapshot
CN102096613B (en) * 2010-12-30 2012-09-05 上海爱数软件有限公司 Method and device for generating snapshot
CN102289510A (en) * 2011-08-31 2011-12-21 成都市华为赛门铁克科技有限公司 Method and device for writing data to production volume
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
WO2014000249A1 (en) * 2012-06-29 2014-01-03 华为技术有限公司 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
CN103389926A (en) * 2013-06-25 2013-11-13 百度在线网络技术(北京)有限公司 Method and device used for backing-up virtual disk
CN103412824A (en) * 2013-07-19 2013-11-27 华为技术有限公司 Method and device for copy-on-write snapshotting
CN103412824B (en) * 2013-07-19 2016-08-10 华为技术有限公司 Copy on write Snapshot Method and device
CN105095015A (en) * 2014-05-13 2015-11-25 北京云巢动脉科技有限公司 Disk snapshot establishment method and apparatus
CN105095015B (en) * 2014-05-13 2018-02-23 北京云巢动脉科技有限公司 The method for building up and device of a kind of disk snapshot
CN105138429A (en) * 2015-08-21 2015-12-09 浪潮(北京)电子信息产业有限公司 Copy-on-write method and system of snapshots
CN105138429B (en) * 2015-08-21 2018-11-02 浪潮(北京)电子信息产业有限公司 A kind of Copy on write Snapshot Method and system
CN105302665A (en) * 2015-10-12 2016-02-03 深圳市安云信息科技有限公司 Improved 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
CN105938457A (en) * 2016-03-31 2016-09-14 华为技术有限公司 Data filtering method, and device and data reading 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
CN105912425A (en) * 2016-04-08 2016-08-31 杭州宏杉科技有限公司 Snapshot image establishment and rollback method and apparatus
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
CN109271278A (en) * 2017-07-18 2019-01-25 阿里巴巴集团控股有限公司 A kind of method and apparatus of the reference number of determining disk snapshot data slicer
CN107368393A (en) * 2017-07-28 2017-11-21 郑州云海信息技术有限公司 A kind of method and device for storing snapshot
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
CN109324929A (en) * 2018-09-17 2019-02-12 郑州云海信息技术有限公司 A kind of snapshot creation method, device, equipment and readable storage medium storing program for executing
CN112639715A (en) * 2018-10-03 2021-04-09 谷歌有限责任公司 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
CN109598156A (en) * 2018-11-19 2019-04-09 杭州信核数据科技股份有限公司 Engine snapshot stream method is redirected when one kind is write
CN109814979A (en) * 2018-12-17 2019-05-28 华为技术有限公司 Data load method, device, computer equipment and readable storage medium storing program for executing
CN109814979B (en) * 2018-12-17 2021-03-30 华为技术有限公司 Data loading method and device, computer equipment and readable storage medium
CN109902034A (en) * 2019-02-25 2019-06-18 杭州宏杉科技股份有限公司 Snapshot creation method, device, electronic equipment and machine readable storage medium
CN110795389A (en) * 2019-10-28 2020-02-14 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
CN110795389B (en) * 2019-10-28 2022-09-30 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
WO2023116109A1 (en) * 2021-12-23 2023-06-29 郑州云海信息技术有限公司 Request processing method and apparatus, and device and non-volatile readable storage medium
CN114356849A (en) * 2022-03-21 2022-04-15 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium
CN114356849B (en) * 2022-03-21 2022-05-17 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium
WO2023178899A1 (en) * 2022-03-21 2023-09-28 联想凌拓科技有限公司 Data management method and apparatus of file system, electronic device, and storage medium
CN115826878A (en) * 2023-02-14 2023-03-21 浪潮电子信息产业股份有限公司 Copy-on-write method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN101840362B (en) 2012-05-30

Similar Documents

Publication Publication Date Title
CN101840362B (en) Method and device for achieving copy-on-write snapshot
US6857057B2 (en) Virtual storage systems and virtual storage system operational methods
CN102012852B (en) Method for implementing incremental snapshots-on-write
CN101361047B (en) Method and system for data protection in storage systems
CN100437568C (en) Transaction consistent copy-on-write database
US9098452B2 (en) Selecting files to backup in a block level backup
US7660958B2 (en) Maintaining consistency for remote copy using virtualization
US7698319B2 (en) Database system management method, database system, database device, and backup program
US10359967B2 (en) Computer system
US9778860B2 (en) Re-TRIM of free space within VHDX
CN109542682B (en) Data backup method, device, equipment and storage medium
US7257675B2 (en) Disk array device having snapshot simulation function
WO2017132872A1 (en) Virtual machine backup method, backup device and host
CN109522154B (en) Data recovery method and related equipment and system
CN103597440A (en) Method for creating clone file, and file system adopting the same
US6996582B2 (en) Virtual storage systems and virtual storage system operational methods
CN103164342A (en) Mount-time reconciliation of data availability
CN104360914A (en) Incremental snapshot method and device
CN102411524A (en) Snapshot volume data copying method
CN1936866A (en) Flash memory body storing mechanism with data restoring function
US20200150866A1 (en) Volume management apparatus, volume management method, and volume management program
CN110187834B (en) Data processing method and device for duplicate copies and electronic equipment
US9003129B1 (en) Techniques for inter-storage-processor cache communication using tokens
US8281096B1 (en) Systems and methods for creating snapshots
US11074003B2 (en) Storage system and restoration method

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

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.

CP03 Change of name, title or address
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.

TR01 Transfer of patent right