CN104216792A - Data backup method and memory database storage engine - Google Patents

Data backup method and memory database storage engine Download PDF

Info

Publication number
CN104216792A
CN104216792A CN201310208187.XA CN201310208187A CN104216792A CN 104216792 A CN104216792 A CN 104216792A CN 201310208187 A CN201310208187 A CN 201310208187A CN 104216792 A CN104216792 A CN 104216792A
Authority
CN
China
Prior art keywords
page
backed
snapshot
data
storage space
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
CN201310208187.XA
Other languages
Chinese (zh)
Other versions
CN104216792B (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.)
Huawei Technologies Co Ltd
Huawei Software Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310208187.XA priority Critical patent/CN104216792B/en
Publication of CN104216792A publication Critical patent/CN104216792A/en
Application granted granted Critical
Publication of CN104216792B publication Critical patent/CN104216792B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a data backup method and a memory database storage engine, and relates to the field of data processing. A to-be-backup page is provided with a snapshot page used for storing original data, and accordingly it is guaranteed that the original data can be backed up even if data are altered in the data backup process, and the backup data obtained after data backup is finished are the same as the data stored when data backup is just started. The data backup method can be applied to data backup and data alteration procedures.

Description

The method of data backup and memory database storage engines
Technical field
The present invention relates to data processing field, particularly relate to a kind of method and memory database storage engines of data backup.
Background technology
In current memory database system, all data all leave in internal memory, to provide high-performance data storehouse to serve.In order to ensure the availability of memory database further, also provide the backup of memory database and restore funcitons: first user backs up the data in internal memory, back up data in disk file, after memory database breaks down, then the data of backup are used for date restoring.
In existing implementation method, when memory database is backed up, generally back up by the mode of page, that is, internal storage data is split in units of page, form page, then press page successively by RAM date backup to disk file.And, in special data in backup procedure in page to be backed up are modified, generally all preferentially modify and then back up, and, in order to ensure the consistance of data, also need to back up for recording these redo log files revised in disk file.
Realizing in process of the present invention, inventor finds that in prior art, at least there are the following problems: generally speaking, and when backing up certain object, user wishes that the Backup Data obtained backs up data when occurring.But can learn from the description of above-mentioned prior art, the data when data finally backing up the memory database obtained by prior art backup user are Backup ends, instead of data when backup starts.Especially along with the increase of internal storage data storage capacity, BACKUP TIME is thereupon elongated, and data during Backup end and when backup starts occur that the situation of difference can be more and more obvious, thus are difficult to ensure the ageing of data backup.
Summary of the invention
Embodiments of the invention provide a kind of method and memory database storage engines of data backup, can ensure the ageing of data backup.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, embodiments provides a kind of method of data backup, comprising:
Obtain the mark of current page to be backed up;
According to the mark of described current page to be backed up, the snapshot page corresponding with described current page to be backed up is searched from snapshot page storage space, raw data corresponding to described current page to be backed up is obtained from the snapshot page corresponding with described current page to be backed up, and the raw data of described current page correspondence to be backed up is backed up, wherein, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts;
Discharge storage space snapshot page shared by corresponding with described current page to be backed up.
In conjunction with first aspect, in the first possible implementation of first aspect, after the storage space shared by the snapshot page of the described current page correspondence to be backed up of release, also comprise:
Obtain the mark of all the other pages to be backed up, all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up;
According to the mark of all the other pages to be backed up described, from snapshot page storage space, search self-corresponding snapshot page each with all the other pages to be backed up described;
When at least one finding in all the other pages to be backed up described exists corresponding snapshot page, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up, and discharges the storage space shared by snapshot page backed up;
After backup is completed to the raw data stored in each snapshot page found, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up.
In conjunction with the first possible implementation of first aspect, in the implementation that the second is possible, describedly from the snapshot page corresponding with described current page to be backed up, obtain raw data corresponding to described current page to be backed up, and backup is carried out to the raw data of described current page correspondence to be backed up comprise:
Detect in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print;
If the storage space shared by snapshot page that there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
In conjunction with one of implementation that the first two of first aspect or first aspect is possible, in the implementation that the third is possible, before the mark obtaining current page to be backed up, also comprise:
Receive data modification request, described data modification request carries the mark of data place to be modified page;
According to the mark of described data place to be modified page, determine that current data to be modified are in page to be backed up, according to the raw data that described data place to be modified page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark;
The raw data that described page to be backed up stores is copied to the snapshot page distributed store;
Data to be modified in described page to be backed up are modified.
In conjunction with the third possible implementation of first aspect, in the 4th kind of possible implementation, when the remaining space of snapshot page storage space be less than distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data that described page to be backed up stores is backed up;
Data to be modified in described page to be backed up are modified.
Second aspect, embodiments provides a kind of memory database storage engines, comprising:
Acquiring unit, for obtaining the mark of current page to be backed up;
Search unit, for the mark of page current to be backed up obtained according to described acquiring unit, from snapshot page storage space, search the snapshot page corresponding with described current page to be backed up; Wherein, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts;
Backup units, for obtaining raw data corresponding to described current page to be backed up from described searching in the snapshot page corresponding with described current page to be backed up that unit finds, and backs up the raw data of described current page correspondence to be backed up;
Resource releasing unit, for discharging the storage space shared by the snapshot page corresponding with described current page to be backed up that described backup units backed up.
In conjunction with second aspect, in the first possible implementation of second aspect, described acquiring unit is also for obtaining the mark of all the other pages to be backed up, and all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up;
Describedly search unit, also for the mark of all the other pages to be backed up described in obtaining according to described acquiring unit, from snapshot page storage space, search each self-corresponding snapshot page of the page to be backed up with all the other;
Described backup units, described in working as, search the snapshot page that at least one finding in all the other pages to be backed up described of unit exists correspondence, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up; And, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up;
Described resource releasing unit, for discharging the storage space shared by snapshot page that described backup units backed up.
In conjunction with the first possible implementation of second aspect, in the implementation that the second is possible, described backup units comprises:
Detection module, for detecting in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print;
Backup module, when being continuous print for the storage space shared by the snapshot page that the storage space shared by described all the other pages to be backed up corresponding snapshot page of described detection module existence is corresponding to described current page to be backed up, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
In conjunction with one of implementation that the first two of second aspect or second aspect is possible, in the implementation that the third is possible, also comprise:
Receiving element, for receiving data modification request, described data modification request carries the mark of data place to be modified page;
Determining unit, for the mark according to described data place to be modified page, determines that current data to be modified are in page to be backed up;
Allocation units, the raw data that data place to be modified for determining according to described determining unit page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark;
Copied cells, the raw data for being stored by described page to be backed up copies to the snapshot page distributed and stores;
Amendment unit, for modifying to the data to be modified in described page to be backed up.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation, described backup units be used for when be less than at the remaining space of snapshot page storage space distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data of described page to be backed up storage is backed up;
Described amendment unit, for modifying to the data to be modified in described page to be backed up.
The method of the data backup that the embodiment of the present invention provides and memory database storage engines, by providing snapshot page to store by for the data in page to be backed up, even if to ensure that there are data in backup process is modified, also can ensure that the data before revising can be saved, the data that backup process is obtained are all the data of backup process when starting, if there is data modification compared in prior art, can only the data after memory modify compare, what can ensure all backup data store is all back up data when starting, make and then effectively ensure the ageing of data backup.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The structure composed figure of a kind of memory database system that Fig. 1 provides for the embodiment of the present invention;
The method flow diagram of a kind of data backup that Fig. 2 provides for the embodiment of the present invention;
The method flow diagram of the another kind of data backup that Fig. 3 provides for the embodiment of the present invention;
The method flow diagram of the another kind of data backup that Fig. 4 provides for the embodiment of the present invention;
The method flow diagram of a kind of data modification that Fig. 5 provides for the embodiment of the present invention;
The method flow diagram of the another kind of data modification that Fig. 6 provides for the embodiment of the present invention;
The structure drawing of device of a kind of memory database storage engines that Fig. 7 provides for the embodiment of the present invention;
The structure drawing of device of the another kind of memory database storage engines that Fig. 8 provides for the embodiment of the present invention;
The structure drawing of device of the another kind of memory database storage engines that Fig. 9 provides for the embodiment of the present invention;
The structure drawing of device of the another kind of memory database storage engines that Figure 10 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide a kind of method of data backup and amendment, all can be applied to memory database system as shown in Figure 1, this system can comprise SQL conversation module, memory database SQL engine, memory database storage engines, backup data files module.
Wherein, SQL conversation module is used for setting up session for each SQL client, to process the backup of client to internal storage data and the request of amendment.
The data read and write interface that memory database SQL engine is used for invoke memory database storage engines backs up the data that internal storage data library storage engine internal stores and revises.
Memory database storage engines is for storing the snapshot page data of all internal storage datas and the mirror image copies as partial memory data; Further, the data of snapshot page have independently storage space, and can not be modified, and are the data before the amendment retained when internal storage data is modified.
Backup data files module is for storing all Backup Datas.
Based on above-mentioned memory database system framework, data back up method provided by the invention as shown in Figure 2, is generally realized by memory database storage engines, comprising:
101, the mark of current page to be backed up is obtained.
Wherein, each data page in memory database all has respective mark, in order to distinguish with other data page.Usually the realizations such as numbering, cryptographic hash can be used.And the page to be backed up that the present invention relates to refers to the general designation needing to carry out the data page backed up when backup process starts.
102, according to the mark of current page to be backed up, from snapshot page storage space, search the snapshot page corresponding with described current page to be backed up, the snapshot page that described and described current page to be backed up is corresponding stores the raw data that described current page to be backed up stores when backup process starts.
Wherein, it should be noted that, snapshot page is exactly the mirror image of backed-up pages, is preferentially stored in memory headroom, so that can by no write de-lay and reading, itself storage architecture and relevant write-read method all can with reference to the related realization modes of page.Further, in order to search conveniently, the mark of page to be backed up can be made in the generative process of snapshot page to mark, to ensure snapshot page and page one_to_one corresponding to be backed up.
103, from the snapshot page corresponding with described current page to be backed up, obtain raw data corresponding to described current page to be backed up, and the raw data of described current page correspondence to be backed up is backed up.
What deserves to be explained is, when data to be backed up are stored in multiple backed-up pages, then need to back up each backed-up pages successively, the backup procedure of each page to be backed up is all with reference to the process step of step 101 to 103.
In these supplementary notes, if determine there is not corresponding snapshot page in current page to be backed up, then directly from described current page to be backed up, obtain data carry out backing up.
104, the storage space shared by snapshot page of described current page correspondence to be backed up is discharged.
The method of the data backup that the embodiment of the present invention provides, by providing snapshot page to store by for the data in page to be backed up, even if to ensure that there are data in backup process is modified, also can ensure that the data before revising can be saved, the data that backup process is obtained are all the data of backup process when starting, if there is data modification compared in prior art, can only the data after memory modify compare, what can ensure all backup data store is all back up data when starting, and makes and then effectively ensures the ageing of data backup.
And, after completing the RAM date backup that part is modified, just directly delete the snapshot page for preserving the internal storage data before amendment, discharge unnecessary storage space resource, thus provide enough storage spaces for the snapshot page of other data to be backed up, and then ensure that each internal storage data be modified can both have snapshot page to preserve the data message before amendment before backup, be all back up data when starting in order to what ensure all backup data store.
After backup process starts, enough storage spaces can both be had to allow all data be modified as far as possible, therefore, in execution step 101 on the basis of 104, after step 104 is performed, as shown in Figure 3, also comprise in the another kind of embodiment of the method for data backup that the embodiment of the present invention provides:
105, the mark of all the other pages to be backed up is obtained.
Wherein, all the other pages to be backed up described are except when page to be backed up outside front page to be backed up, and mark described herein is identical with the relevant description of step 101.
106, according to the mark of all the other pages to be backed up described, from snapshot page storage space, each self-corresponding snapshot page of the page to be backed up with all the other is searched.When at least one finding in all the other pages to be backed up described exists corresponding snapshot page, then first perform 107, then perform 108; Otherwise directly perform 108.
107, the raw data obtaining page to be backed up from each snapshot page found backs up, and discharges the storage space shared by snapshot page backed up.
108, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up.
In the present embodiment, back up at the preferential page to be backed up to there is snapshot page, and the storage space of all snapshot pages is discharged afterwards in backup, discharge unnecessary storage space resource, thus provide enough storage spaces for the snapshot page of other data to be backed up, and then ensure that each internal storage data be modified can both have snapshot page to preserve the data message before amendment before backup, be all back up data when starting in order to what ensure all backup data store.
In execution step 101 on the basis of 108, in the another kind of embodiment of the method for the data backup that the embodiment of the present invention provides, a kind of embodiment is provided to the realization of step 107, as shown in Figure 4, comprising:
1071, detect in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print.
If 1072 storage spaces shared by snapshot page that there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up are continuous print, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
In these supplementary notes, after execution step 1071, if the storage space shared by snapshot page that there is not described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print, then from all the other exist the page to be backed up of snapshot page choose again one carry out step 101 to 104 Suo Shi back up flow process, or, perform the backup flow process shown in step 101 to 108.
In the present embodiment, preferential, data message in storage space continuous print snapshot page is backed up, to avoid occurring discrete disk I/O process, improve backup rate.
Based on memory database system as shown in Figure 1, the embodiment of the present invention additionally provides the method flow for data modification, needs to perform when backing up flow process and starting and before step 101, as shown in Figure 5, comprising:
201, receive data modification request, described data modification request carries the mark of data place to be modified page.
Wherein, mark described herein is identical with the relevant description of step 101.
202, according to the mark of described data place to be modified page, determine that current data to be modified are in page to be backed up.
Wherein, the concrete methods of realizing of step 202 is exactly use the mark of described data place to be modified page and the mark of all pages to be backed up to compare one by one, the same then determine that data to be modified are in page to be backed up, otherwise think data to be modified not in page to be backed up.
203, according to the raw data that described data place to be modified page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark.
Wherein, the flow process of distributing a snapshot page for described page to be backed up is exactly be that page to be backed up distributes one piece of storage space at snapshot page storage space, and this block storage space is set to the file layout of page.
204, the raw data that described page to be backed up stores is copied to the snapshot page distributed to store.
205, the data to be modified in described page to be backed up are modified.
In addition, after performing step 202, when determining that data to be modified are not in page to be backed up, then the raw data directly treating backed-up pages storage is modified.
The data modification flow process that the embodiment of the present invention provides, by before a modification raw data being saved to snapshot page, then only the raw data that described page to be backed up stores is modified, and the raw data in snapshot page is not modified, make the raw data that can get each page to be backed up when backup starts in backup procedure, thus ensure all backup data store be all backup start time data, make and then effectively ensure the ageing of data backup.
The embodiment of the present invention additionally provides the another kind of embodiment of data modification, as shown in Figure 6, when described step 203 cannot perform, namely when be less than at the remaining space of snapshot page storage space distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, also comprise:
206, the raw data that described page to be backed up stores is backed up.
207, the data to be modified in described page to be backed up are modified.
In present embodiment, when being page to be backed up distribution snapshot page, preferentially carry out backing up modifying again, be all back up data when starting with what ensure all backup data store, make and then effectively ensure the ageing of data backup.
The embodiment of the present invention additionally provides a kind of memory database storage engines, may be used for the method flow realized as shown in Figures 2 to 6, and as shown in Figure 7, this device comprises:
Acquiring unit 31, for obtaining the mark of current page to be backed up.
Search unit 32, for the mark of the page current to be backed up according to described acquiring unit 31 acquisition, from snapshot page storage space, search the snapshot page corresponding with described current page to be backed up, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts.
Backup units 33, for obtaining raw data corresponding to described current page to be backed up from described searching in the snapshot page corresponding with described current page to be backed up that unit 32 finds, and backs up the raw data of described current page correspondence to be backed up.
Resource releasing unit 34, for discharging the storage space shared by the snapshot page corresponding with described current page to be backed up that described backup units 33 backed up.
Optionally, described acquiring unit 31 is also for obtaining the mark of all the other pages to be backed up, and all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up.
Describedly search unit 32, also for the mark of all the other pages to be backed up described in obtaining according to described acquiring unit 31, from snapshot page storage space, search each self-corresponding snapshot page of the page to be backed up with all the other.
Described backup units 33, described in working as, search the snapshot page that at least one finding in all the other pages to be backed up described of unit 32 exists correspondence, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up; And, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up.
Described resource releasing unit 34, for discharging the storage space shared by snapshot page that described backup units 33 backed up.
Optionally, as shown in Figure 8, described backup units 33 comprises:
Detection module 331, for detecting in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print.
Backup module 332, when being continuous print for the storage space existed at described detection module 331 shared by storage space shared by described all the other pages to be backed up corresponding snapshot page snapshot page corresponding to described current page to be backed up, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
Optionally, as shown in Figure 9, also comprise:
Receiving element 41, for receiving data modification request, described data modification request carries the mark of data place to be modified page.
Determining unit 42, for the mark according to described data place to be modified page, determines that current data to be modified are in page to be backed up.
Allocation units 43, the raw data that data place to be modified for determining according to described determining unit 42 page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark.
Copied cells 44, the raw data for being stored by described page to be backed up copies to the snapshot page distributed and stores.
Amendment unit 45, for modifying to the data to be modified in described page to be backed up.
Optionally, described backup units 44 for when be less than at the remaining space of snapshot page storage space distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data that described page to be backed up stores is backed up.
Described amendment unit 45, for modifying to the data to be modified in described page to be backed up.
The memory database storage engines that the embodiment of the present invention provides, by providing snapshot page to store by for the data in page to be backed up, even if to ensure that there are data in backup process is modified, also can ensure that the data before revising can be saved, the data that backup process is obtained are all the data of backup process when starting, if there is data modification compared in prior art, can only the data after memory modify compare, what can ensure all backup data store is all back up data when starting, and makes and then effectively ensures the ageing of data backup.
The embodiment of the present invention additionally provides a kind of memory database storage engines, and as shown in Figure 10, comprise processor 51 and IO interface 52, described IO interface 52 communicates with external devices for the treatment of device 51.
Wherein, described processor 51 is for obtaining the mark of current page to be backed up; According to the mark of described current page to be backed up, the snapshot page corresponding with described current page to be backed up is searched from snapshot page storage space, raw data corresponding to described current page to be backed up is obtained from the snapshot page corresponding with described current page to be backed up, and the raw data of described current page correspondence to be backed up is backed up, wherein, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts; Discharge storage space snapshot page shared by corresponding with described current page to be backed up.
Optionally, described processor 51 is also for obtaining the mark of all the other pages to be backed up, and all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up; According to the mark of all the other pages to be backed up described, from snapshot page storage space, search self-corresponding snapshot page each with all the other pages to be backed up described; When at least one finding in all the other pages to be backed up described exists corresponding snapshot page, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up, and discharges the storage space shared by snapshot page backed up; After backup is completed to the raw data stored in each snapshot page found, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up.
Optionally, described processor 51 also specifically for detecting in all the other backed-up pages described from described snapshot page storage space, and the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print; If the storage space shared by snapshot page that there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
Optionally, described processor 51 is also for receiving data modification request by described IO interface 52, and described data modification request carries the mark of data place to be modified page; According to the mark of described data place to be modified page, determine that current data to be modified are in page to be backed up, according to the raw data that described data place to be modified page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark; The raw data that described page to be backed up stores is copied to the snapshot page distributed store; Data to be modified in described page to be backed up are modified.
Optionally, described processor 51 also for when be less than at the remaining space of snapshot page storage space distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data that described page to be backed up stores is backed up; Data to be modified in described page to be backed up are modified.
The memory database storage engines that the embodiment of the present invention provides, by providing snapshot page to store by for the data in page to be backed up, even if to ensure that there are data in backup process is modified, also can ensure that the data before revising can be saved, the data that backup process is obtained are all the data of backup process when starting, if there is data modification compared in prior art, can only the data after memory modify compare, what can ensure all backup data store is all back up data when starting, and makes and then effectively ensures the ageing of data backup.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in the storage medium that can read, as the floppy disk of computing machine, hard disk or CD etc., comprise some instructions and perform method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.

Claims (10)

1. a method for data backup, is characterized in that, comprising:
Obtain the mark of current page to be backed up;
According to the mark of described current page to be backed up, the snapshot page corresponding with described current page to be backed up is searched from snapshot page storage space, raw data corresponding to described current page to be backed up is obtained from the snapshot page corresponding with described current page to be backed up, and the raw data of described current page correspondence to be backed up is backed up, wherein, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts;
Discharge storage space snapshot page shared by corresponding with described current page to be backed up.
2. method according to claim 1, is characterized in that, after the storage space shared by the snapshot page of the described current page correspondence to be backed up of release, also comprises:
Obtain the mark of all the other pages to be backed up, all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up;
According to the mark of all the other pages to be backed up described, from snapshot page storage space, search self-corresponding snapshot page each with all the other pages to be backed up described;
When at least one finding in all the other pages to be backed up described exists corresponding snapshot page, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up, and discharges the storage space shared by snapshot page backed up;
After backup is completed to the raw data stored in each snapshot page found, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up.
3. method according to claim 2, is characterized in that, describedly from the snapshot page corresponding with described current page to be backed up, obtains raw data corresponding to described current page to be backed up, and carries out backup to the raw data of described current page correspondence to be backed up and comprise:
Detect in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print;
If the storage space shared by snapshot page that there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
4. the method according to claims 1 to 3 any one, is characterized in that, before the mark obtaining current page to be backed up, also comprises:
Receive data modification request, described data modification request carries the mark of data place to be modified page;
According to the mark of described data place to be modified page, determine that current data to be modified are in page to be backed up, according to the raw data that described data place to be modified page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark;
The raw data that described page to be backed up stores is copied to the snapshot page distributed store;
Data to be modified in described page to be backed up are modified.
5. method according to claim 4, is characterized in that, also comprises:
When the remaining space of snapshot page storage space be less than distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data that described page to be backed up stores is backed up;
Data to be modified in described page to be backed up are modified.
6. a memory database storage engines, is characterized in that, comprising:
Acquiring unit, for obtaining the mark of current page to be backed up;
Search unit, for the mark of page current to be backed up obtained according to described acquiring unit, from snapshot page storage space, search the snapshot page corresponding with described current page to be backed up; Wherein, the snapshot page of described current page correspondence to be backed up stores the raw data that described current page to be backed up stores when backup process starts;
Backup units, for obtaining raw data corresponding to described current page to be backed up from described searching in the snapshot page corresponding with described current page to be backed up that unit finds, and backs up the raw data of described current page correspondence to be backed up;
Resource releasing unit, for discharging the storage space shared by the snapshot page corresponding with described current page to be backed up that described backup units backed up.
7. memory database storage engines according to claim 6, is characterized in that, described acquiring unit is also for obtaining the mark of all the other pages to be backed up, and all the other pages to be backed up wherein said are except when page to be backed up outside front page to be backed up;
Describedly search unit, also for the mark of all the other pages to be backed up described in obtaining according to described acquiring unit, from snapshot page storage space, search each self-corresponding snapshot page of the page to be backed up with all the other;
Described backup units, described in working as, search the snapshot page that at least one finding in all the other pages to be backed up described of unit exists correspondence, then the preferential raw data obtaining page to be backed up from each snapshot page found backs up; And, directly never exist and obtain data in all the other pages to be backed up of corresponding snapshot page and back up;
Described resource releasing unit, for discharging the storage space shared by snapshot page that described backup units backed up.
8. memory database storage engines according to claim 7, is characterized in that, described backup units comprises:
Detection module, for detecting in all the other backed-up pages described from described snapshot page storage space, the storage space shared by snapshot page that whether there is described storage space shared by all the other pages to be backed up corresponding snapshot page corresponding to described current page to be backed up is continuous print;
Backup module, when being continuous print for the storage space shared by the snapshot page that the storage space shared by described all the other pages to be backed up corresponding snapshot page of described detection module existence is corresponding to described current page to be backed up, then the preferential raw data obtaining page to be backed up from the storage space continuous print snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up, and the raw data then obtaining page to be backed up from the storage space discontinuous snapshot page shared by the snapshot page corresponding to described current page to be backed up backs up.
9. the memory database storage engines according to claim 6 to 8 any one, is characterized in that, also comprise:
Receiving element, for receiving data modification request, described data modification request carries the mark of data place to be modified page;
Determining unit, for the mark according to described data place to be modified page, determines that current data to be modified are in page to be backed up;
Allocation units, the raw data that data place to be modified for determining according to described determining unit page to be backed up stores, be that described data place to be modified page to be backed up distributes a snapshot page at snapshot page storage space, and use the mark of described data place to be modified page to be backed up to mark;
Copied cells, the raw data for being stored by described page to be backed up copies to the snapshot page distributed and stores;
Amendment unit, for modifying to the data to be modified in described page to be backed up.
10. memory database storage engines according to claim 9, it is characterized in that, described backup units be used for when be less than at the remaining space of snapshot page storage space distribute the storage space shared by a snapshot page for described data place to be modified page to be backed up time, the raw data of described page to be backed up storage is backed up;
Described amendment unit, for modifying to the data to be modified in described page to be backed up.
CN201310208187.XA 2013-05-29 2013-05-29 The method and memory database storage engines of data backup Expired - Fee Related CN104216792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310208187.XA CN104216792B (en) 2013-05-29 2013-05-29 The method and memory database storage engines of data backup

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310208187.XA CN104216792B (en) 2013-05-29 2013-05-29 The method and memory database storage engines of data backup

Publications (2)

Publication Number Publication Date
CN104216792A true CN104216792A (en) 2014-12-17
CN104216792B CN104216792B (en) 2017-05-31

Family

ID=52098313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310208187.XA Expired - Fee Related CN104216792B (en) 2013-05-29 2013-05-29 The method and memory database storage engines of data backup

Country Status (1)

Country Link
CN (1) CN104216792B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019130A (en) * 2017-12-06 2019-07-16 阿里巴巴集团控股有限公司 A kind of method and device of database update
CN110032541A (en) * 2019-04-12 2019-07-19 苏州浪潮智能科技有限公司 A kind of writeable snapshot implementing method and system
CN110688252A (en) * 2019-08-26 2020-01-14 无锡华云数据技术服务有限公司 Data recovery method, data backup device and storage medium
CN111324295A (en) * 2018-12-17 2020-06-23 中国移动通信集团四川有限公司 Data migration method, device, equipment and medium
CN112559243A (en) * 2019-09-25 2021-03-26 阿里巴巴集团控股有限公司 Data snapshot method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567262A (en) * 2003-06-10 2005-01-19 联想(北京)有限公司 On-line data backup method based on data volume snapshot
US20070101063A1 (en) * 2004-02-27 2007-05-03 Hitachi, Ltd. System recovery method and computer system using the same
CN101201774A (en) * 2006-12-15 2008-06-18 英业达股份有限公司 Method for snapshot of magnetic disc
CN101295276A (en) * 2008-06-20 2008-10-29 中国科学院计算技术研究所 Magnetic disk data backup system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567262A (en) * 2003-06-10 2005-01-19 联想(北京)有限公司 On-line data backup method based on data volume snapshot
US20070101063A1 (en) * 2004-02-27 2007-05-03 Hitachi, Ltd. System recovery method and computer system using the same
CN101201774A (en) * 2006-12-15 2008-06-18 英业达股份有限公司 Method for snapshot of magnetic disc
CN101295276A (en) * 2008-06-20 2008-10-29 中国科学院计算技术研究所 Magnetic disk data backup system and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019130A (en) * 2017-12-06 2019-07-16 阿里巴巴集团控股有限公司 A kind of method and device of database update
CN110019130B (en) * 2017-12-06 2022-09-06 阿里巴巴集团控股有限公司 Database updating method and device
CN111324295A (en) * 2018-12-17 2020-06-23 中国移动通信集团四川有限公司 Data migration method, device, equipment and medium
CN111324295B (en) * 2018-12-17 2023-09-19 中国移动通信集团四川有限公司 Data migration method, device, equipment and medium
CN110032541A (en) * 2019-04-12 2019-07-19 苏州浪潮智能科技有限公司 A kind of writeable snapshot implementing method and system
CN110688252A (en) * 2019-08-26 2020-01-14 无锡华云数据技术服务有限公司 Data recovery method, data backup device and storage medium
CN112559243A (en) * 2019-09-25 2021-03-26 阿里巴巴集团控股有限公司 Data snapshot method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN104216792B (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US9116903B2 (en) Method and system for inserting data records into files
KR101556435B1 (en) Database backing-up and recovering method and device
JP4419884B2 (en) Data replication apparatus, method, program, and storage system
CN104216792A (en) Data backup method and memory database storage engine
US10049020B2 (en) Point in time recovery on a database
CN105573859A (en) Data recovery method and device of database
US11397537B2 (en) Data restoration method and apparatus
WO2017185210A1 (en) File filtering method and apparatus using bloomfilter
CN111666046B (en) Data storage method, device and equipment
US20160011789A1 (en) Storage control apparatus and control method of storage control apparatus
CN107391544A (en) Processing method, device, equipment and the computer storage media of column data storage
JP2015528957A (en) Distributed file system, file access method, and client device
CN110019063B (en) Method for computing node data disaster recovery playback, terminal device and storage medium
US7581135B2 (en) System and method for storing and restoring a data file using several storage media
US8015375B1 (en) Methods, systems, and computer program products for parallel processing and saving tracking information for multiple write requests in a data replication environment including multiple storage devices
JP6828253B2 (en) Backup control device, backup control method and program
US10050994B2 (en) Method and computing device for processing data
CN111124751B (en) Data recovery method and system, data storage node and database management node
CN114924911B (en) Method, device, equipment and storage medium for backing up effective data of Windows operating system
US9235349B2 (en) Data duplication system, data duplication method, and program thereof
CN108984343B (en) Virtual machine backup and storage management method based on content analysis
CN114116317A (en) Data processing method, device, equipment and medium
CN113986846A (en) Data processing method, system, device and storage medium
CN111241099A (en) Industrial big data storage method and device
WO2017050029A1 (en) Method, device, and equipment for data block processing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170531

Termination date: 20200529