CN104216792B - The method and memory database storage engines of data backup - Google Patents

The method and memory database storage engines of data backup Download PDF

Info

Publication number
CN104216792B
CN104216792B CN201310208187.XA CN201310208187A CN104216792B CN 104216792 B CN104216792 B CN 104216792B CN 201310208187 A CN201310208187 A CN 201310208187A CN 104216792 B CN104216792 B CN 104216792B
Authority
CN
China
Prior art keywords
page
backed
snapshot
data
memory 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.)
Expired - Fee Related
Application number
CN201310208187.XA
Other languages
Chinese (zh)
Other versions
CN104216792A (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
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

Abstract

The invention discloses the method and memory database storage engines of a kind of data backup, it is related to data processing field.Snapshot page by being provided for storing initial data for page to be backed up of the invention, even if to ensure to carry out data modification in data backup process it is also ensured that initial data can be backuped to, so that the data when Backup Data obtained when ensureing Backup end starts with backup are consistent.The method that the present invention is provided can apply in data backup and data modification process.

Description

The method and memory database storage engines of data backup
Technical field
Method and internal storage data library storage the present invention relates to data processing field, more particularly to a kind of data backup are drawn Hold up.
Background technology
In current memory database system, all data are all stored in internal memory, to provide high-performance data storehouse Service.In order to be further ensured that the availability of memory database, the backup of memory database is also provided and recovers function:User is first First the data in internal memory are backed up, in backing up data to disk file, after memory database breaks down, then will be standby The data of part are used for data recovery.
In existing implementation method, when being backed up to memory database, typically backed up in the way of page, that is, Say, internal storage data is split in units of page, form page, page is then pressed successively by RAM date backup to disk text Part.Also, when the data especially in page to be backed up in backup procedure are changed, typically all preferentially modify so Backed up again afterwards, and, in order to ensure the uniformity of data, in addition it is also necessary to back up for record these modification redo log text Part is in disk file.
Realize it is of the invention during, inventor find at least there are the following problems in the prior art:In general, working as When being backed up to certain object, the Backup Data that user intentionally gets is data when backup occurs.But from above-mentioned existing In the description of technology it is known that by prior art back up user finally back up the memory database for obtaining data be back up At the end of data, rather than backup start when data.Especially as the increase of internal storage data storage capacity, BACKUP TIME is therewith Elongated, the situation that difference occur in data during Backup end and when backup starts can more and more substantially, so that it is difficult to ensure that data That backs up is ageing.
The content of the invention
Embodiments of the invention provide the method and memory database storage engines of a kind of data backup, ensure that data That backs up is ageing.
To reach above-mentioned purpose, embodiments of the invention are adopted the following technical scheme that:
In a first aspect, a kind of method of data backup is the embodiment of the invention provides, including:
Obtain the mark of current page to be backed up;
According to the mark of the current page to be backed up, it is right with the current page to be backed up to be searched from snapshot page memory space The snapshot page answered, obtains the corresponding original number of the current page to be backed up from snapshot page corresponding with the current page to be backed up According to, and the corresponding initial data of the current page to be backed up is backed up, wherein, the corresponding snapshot of the current page to be backed up Page stores the initial data that the current page to be backed up is stored when backup process starts;
Discharge the memory space shared by snapshot page corresponding with the current page to be backed up.
It is described current to be backed up discharging with reference in a first aspect, in the first possible implementation of first aspect After memory space shared by the corresponding snapshot page of page, also include:
The mark of remaining page to be backed up is obtained, wherein described remaining page to be backed up is except when treating outside preceding page to be backed up Backed-up pages;
According to the mark of remaining page to be backed up, searched from snapshot page memory space each with described remaining page to be backed up Self-corresponding snapshot page;
There is corresponding snapshot page when at least one of described remaining page to be backed up is found, then preferentially looked into from each The initial data that page to be backed up is obtained in the snapshot page for finding is backed up, and discharges the storage shared by the snapshot page for having backed up Space;
After the initial data of the snapshot page memory storage found to each completes backup, directly from the absence of correspondence Data are obtained in remaining page to be backed up of snapshot page to be backed up.
With reference to the first possible implementation of first aspect, in second possible implementation, it is described from The corresponding initial data of the current page to be backed up is obtained in the corresponding snapshot page of the current page to be backed up, and to described current The corresponding initial data of page to be backed up carries out backup to be included:
Detected in described remaining backed-up pages from snapshot page memory space, if there is described remaining page to be backed up Memory space shared by memory space shared by corresponding snapshot page snapshot page corresponding with the current page to be backed up is Continuously;
If in the presence of memory space and the current page to be backed up shared by described remaining corresponding snapshot page of page to be backed up Memory space shared by corresponding snapshot page is continuous, then preferentially from snapshot page institute corresponding with the current page to be backed up The initial data that page to be backed up is obtained in the continuous snapshot page of memory space of occupancy is backed up, and is then currently treated from described The initial data that page to be backed up is obtained in the discontinuous snapshot page of memory space shared by the corresponding snapshot page of backed-up pages is carried out Backup.
One of possible implementation of first two with reference to first aspect or first aspect, in the third possible realization side In formula, before the mark of current page to be backed up is obtained, also include:
Data modification request is received, the data modification request carries the mark of page where data to be modified;
The mark of page according to where the data to be modified, it is determined that current data to be modified are in page to be backed up, according to institute The initial data of page storage to be backed up where data to be modified is stated, is treated where being the data to be modified in snapshot page memory space Backed-up pages distribute snapshot page, and mark using page to be backed up where the data to be modified is marked;
The initial data of the page storage to be backed up is copied to the snapshot page for distributing to be stored;
Data to be modified in the page to be backed up are modified.
With reference to the third possible implementation of first aspect, in the 4th kind of possible implementation, when snapshot page The remaining space of memory space distributes the storage shared by a snapshot page less than the page to be backed up where the data to be modified During space, the initial data to the page storage to be backed up is backed up;
Data to be modified in the page to be backed up are modified.
Second aspect, the embodiment of the invention provides a kind of memory database storage engines, including:
Acquiring unit, the mark for obtaining current page to be backed up;
Searching unit, the mark of the page current to be backed up for being obtained according to the acquiring unit is empty from snapshot page storage Between middle lookup snapshot page corresponding with the current page to be backed up;Wherein, the corresponding snapshot page storage of the page currently to be backed up The initial data that the current page to be backed up is stored when backup process starts;
Backup units, obtain in snapshot page corresponding with the current page to be backed up for being found from the searching unit Take the corresponding initial data of the current page to be backed up, and the corresponding initial data of the current page to be backed up is backed up;
Resource releasing unit, for the snapshot corresponding with the current page to be backed up that discharges that the backup units have backed up Memory space shared by page.
With reference to second aspect, in the first possible implementation of second aspect, the acquiring unit is additionally operable to obtain The mark of remaining page to be backed up is taken, wherein described remaining page to be backed up is the page to be backed up except when outside preceding page to be backed up;
The searching unit, is additionally operable to the mark of remaining page to be backed up according to the acquiring unit is obtained, from fast According to lookup in page memory space and remaining each self-corresponding snapshot page of page to be backed up;
The backup units, for existing when the searching unit finds at least one of described remaining page to be backed up Corresponding snapshot page, the then initial data that page to be backed up is preferentially obtained from the snapshot page that each has found is backed up;With And, directly obtain data from remaining page to be backed up in the absence of correspondence snapshot page and backed up;
The resource releasing unit, for discharging the memory space shared by the snapshot page that the backup units have been backed up.
With reference to the first possible implementation of second aspect, in second possible implementation, the backup Unit includes:
Detection module, for being detected in described remaining backed-up pages from snapshot page memory space, if there is institute State memory space shared by the corresponding snapshot page of remaining page to be backed up snapshot page corresponding with the current page to be backed up shared Memory space is continuous;
Backup module, for there is depositing shared by described remaining corresponding snapshot page of page to be backed up in the detection module When memory space shared by the snapshot page corresponding with the current page to be backed up of storage space is continuous, then preferentially from it is described The initial data of page to be backed up is obtained in the continuous snapshot page of memory space shared by the current corresponding snapshot page of page to be backed up Backed up, then from the discontinuous snapshot page of memory space shared by snapshot page corresponding with the current page to be backed up The initial data for obtaining page to be backed up is backed up.
One of possible implementation of first two with reference to second aspect or second aspect, in the third possible realization side In formula, also include:
Receiving unit, for receiving data modification request, the data modification request carries page where data to be modified Mark;
Determining unit, for the mark of the page according to where the data to be modified, it is determined that current data to be modified are treating standby In part page;
Allocation unit, the original number of the data to be modified place page storage to be backed up for being determined according to the determining unit According to, page to be backed up where being the data to be modified in snapshot page memory space distributes a snapshot page, and using described to be repaired The mark for changing page to be backed up where data is marked;
Copied cells, is deposited for the initial data of the page storage to be backed up to be copied into the snapshot for distributing page Storage;
Modification unit, for being modified to the data to be modified in the page to be backed up.
With reference to the third possible implementation of second aspect, in the 4th kind of possible implementation, the backup Unit is used to distribute one less than the page to be backed up where the data to be modified when the remaining space in snapshot page memory space During memory space shared by snapshot page, the initial data to the page to be backed up storage is backed up;
The modification unit, for being modified to the data to be modified in the page to be backed up.
The method and memory database storage engines of data backup provided in an embodiment of the present invention, by that will be page to be backed up In data snapshot page be provided stored, even if to ensure to there are data in backup process and changed, it is also ensured that repair Data before changing can be saved so that the data that backup process is obtained all are data when backup process starts, and are compared Compared in amended data can only be stored if it there is data modification in the prior art, it is ensured that all backup data stores Be all backup start when data, make and then be effectively ensured the ageing of data backup.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of structure composed figure of memory database system provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram of data backup provided in an embodiment of the present invention;
Fig. 3 is the method flow diagram of another data backup provided in an embodiment of the present invention;
Fig. 4 is the method flow diagram of another data backup provided in an embodiment of the present invention;
Fig. 5 is a kind of method flow diagram of data modification provided in an embodiment of the present invention;
Fig. 6 is the method flow diagram of another data modification provided in an embodiment of the present invention;
Fig. 7 is a kind of structure drawing of device of memory database storage engines provided in an embodiment of the present invention;
Fig. 8 is the structure drawing of device of another memory database storage engines provided in an embodiment of the present invention;
Fig. 9 is the structure drawing of device of another memory database storage engines provided in an embodiment of the present invention;
Figure 10 is the structure drawing of device of another memory database storage engines provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
A kind of method that the embodiment of the invention provides data backup and modification, can apply to as shown in Figure 1 interior Deposit data storehouse system, the system may include SQL conversation modules, memory database SQL engines, memory database storage engines, standby Number is according to file module.
Wherein, SQL conversation modules are used to set up session for each SQL client, to process client to internal storage data Backup and the request of modification.
Memory database SQL engines are used to call the data read and write interface of memory database storage engines to come to internal storage data The data of library storage engine internal storage are backed up and changed.
Memory database storage engines are used to store all internal storage datas and the mirror image copies as partial memory data Snapshot page data;Also, the data of snapshot page possess independent memory space, and can not be changed, and are repaiied in internal storage data Data before the modification retained when changing.
Backup data files module is used to store all Backup Datas.
The data back up method provided based on above-mentioned memory database system framework, the present invention is as shown in Fig. 2 general by interior Deposit data library storage engine implementation, including:
101st, the mark of current page to be backed up is obtained.
Wherein, each data page in memory database has respective mark, to be made a distinction with other data pages. Can generally be realized using numbering, cryptographic Hash etc..And page to be backed up of the present invention refers to the needs when backup process starts The general designation of the data page for being backed up.
102nd, according to the mark of current page to be backed up, it is right with the current page to be backed up to be searched from snapshot page memory space The snapshot page answered, the snapshot page corresponding with the current page to be backed up stores the current page to be backed up in backup process The initial data stored during startup.
, wherein it is desired to explanation, snapshot page is exactly the mirror image of backed-up pages, is preferably stored in memory headroom, so as to can The related real of page is referred to by no write de-lay and reading, itself storage architecture and related write-read method Existing mode.Also, in order to search conveniently, can be marked the mark of page to be backed up in the generating process of snapshot page, to ensure Snapshot page is corresponded with page to be backed up.
103rd, to obtain the current page to be backed up from snapshot page corresponding with the current page to be backed up corresponding original Data, and the corresponding initial data of the current page to be backed up is backed up.
What deserves to be explained is, when data storage to be backed up is in multiple backed-up pages, then need successively to each backed-up pages Backed up, the backup procedure of each page to be backed up is with reference to the process step of step 101 to 103.
Remark additionally herein, however, it is determined that current page to be backed up is then directly currently treated in the absence of corresponding snapshot page from described Data are obtained in backed-up pages to be backed up.
104th, the memory space shared by the corresponding snapshot page of the page currently to be backed up is discharged.
The method of data backup provided in an embodiment of the present invention, by will enter for the data in page to be backed up provide snapshot page Row storage, even if to ensure that there are data in backup process is changed, it is also ensured that the data before modification can be saved Get off so that the data that backup process is obtained all are data when backup process starts, if compared to generation number in the prior art Amended data can only be then stored according to modification to compare, it is ensured that all backup data stores are all to back up number when starting According to making and then be effectively ensured the ageing of data backup.
Also, after the RAM date backup for completing to change part, before just directly deleting for preserving modification The snapshot page of internal storage data discharges unnecessary memory space resource, so that for the snapshot page of other data to be backed up is provided Enough memory spaces, and then ensure that each internal storage data changed can have snapshot page come before preserving modification before backup Data message, be used to ensure all backup data stores is all data when backup starts.
After backup process startup, there can be enough memory spaces to allow all data changed as far as possible, Therefore, on the basis of execution step 101 to 104, after step 104 is performed, as shown in figure 3, the embodiment of the present invention is provided Data backup method another embodiment in also include:
105th, the mark of remaining page to be backed up is obtained.
Wherein, described remaining page to be backed up is the page to be backed up except when outside preceding page to be backed up, also, described herein Mark is identical with the relevant description of step 101.
106th, according to the mark of remaining page to be backed up, searched from snapshot page memory space each with remaining page to be backed up Self-corresponding snapshot page.There is corresponding snapshot page when at least one of described remaining page to be backed up is found, then first carry out 107, then perform 108;Otherwise directly perform 108.
107th, the initial data that page to be backed up is obtained from the snapshot page that each has found is backed up, and is discharged standby Memory space shared by the snapshot page of part.
108th, directly data are obtained from remaining page to be backed up in the absence of correspondence snapshot page to be backed up.
In the present embodiment, backed up in the page to be backed up preferentially to there is snapshot page, and institute is discharged after backup There is the memory space of snapshot page to discharge unnecessary memory space resource, so that for the snapshot page of other data to be backed up is carried For enough memory spaces, and then ensure that each internal storage data changed there can be snapshot page to preserve modification before backup Preceding data message, be used to ensure all backup data stores is all data when backup starts.
On the basis of execution step 101 to 108, the another kind of the method for data backup provided in an embodiment of the present invention is real Apply in mode, the realization to step 107 provides a kind of specific embodiment, as shown in figure 4, including:
1071st, detected in described remaining backed-up pages from snapshot page memory space, if remaining is treated described in existing Storage shared by memory space shared by backed-up pages corresponding snapshot page snapshot page corresponding with the current page to be backed up Space is continuous.
If the 1072, currently treating standby with described in the presence of the memory space shared by described remaining corresponding snapshot page of page to be backed up Memory space shared by the corresponding snapshot page of part page is continuous, then preferentially from snapshot corresponding with the current page to be backed up The initial data that page to be backed up is obtained in the continuous snapshot page of memory space shared by page is backed up, and is then worked as from described The initial data of page to be backed up is obtained in the discontinuous snapshot page of memory space shared by the preceding corresponding snapshot page of page to be backed up Backed up.
Remark additionally herein, after step 1071 is performed, if in the absence of described remaining corresponding snapshot page of page to be backed up Memory space shared by shared memory space snapshot page corresponding with the current page to be backed up is continuous, then from it Balance chooses one and carries out step 101 to backup flow 104 Suo Shi again in the page to be backed up of snapshot page, or, perform step Backup flow shown in 101 to 108.
In the present embodiment, preferentially the data message in the continuous snapshot page of memory space is being backed up, to keep away Exempt from discrete disk I/O process occur, improve backup rate.
Based on memory database system as shown in Figure 1, the embodiment of the present invention additionally provides the method for data modification Flow, it is necessary to when backup flow has been started up perform with step 101 before, as shown in figure 5, including:
201st, data modification request is received, the data modification request carries the mark of page where data to be modified.
Wherein, mark described herein is identical with the relevant description of step 101.
202nd, according to the mark of the data place to be modified page, it is determined that current data to be modified are in page to be backed up.
Wherein, the concrete methods of realizing of step 202 be exactly using the mark of page where the data to be modified with needed The mark of backed-up pages is compared one by one, equally then determines data to be modified in page to be backed up, otherwise it is assumed that data to be modified Not in page to be backed up.
203rd, the initial data that the page to be backed up according to where the data to be modified is stored, is institute in snapshot page memory space Page to be backed up where stating data to be modified distributes a snapshot page, and uses the mark of page to be backed up where the data to be modified It is marked.
Wherein, be flow that the page to be backed up distributes a snapshot page be exactly in snapshot page memory space be page to be backed up One piece of memory space of distribution, and the block memory space is set to the storage form of page.
204th, the initial data of the page storage to be backed up is copied to the snapshot page for distributing to be stored.
205th, the data to be modified in the page to be backed up are modified.
In addition, after performing step 202, when it is determined that data to be modified are not in page to be backed up, then directly to be backed up The initial data of page storage is modified.
Data modification flow provided in an embodiment of the present invention, by before a modification by initial data preserve to snapshot page, so The initial data only to the page storage to be backed up is modified afterwards, without being modified to the initial data in snapshot page, is made The initial data that each page to be backed up when backup starts can be got in backup procedure is obtained, so as to ensure all Backup Datas Storage is all to back up data when starting, and makes and then be effectively ensured the ageing of data backup.
The embodiment of the present invention additionally provides the another embodiment of data modification, as shown in fig. 6, in the step 203 When cannot perform, i.e., when the remaining space in snapshot page memory space is less than page distribution to be backed up where the data to be modified During memory space shared by one snapshot page, also include:
206th, the initial data to the page storage to be backed up is backed up.
207th, the data to be modified in the page to be backed up are modified.
In present embodiment, when snapshot page cannot be distributed for page to be backed up, preferentially backed up and modified again, to protect Demonstrate,prove all backup data stores is all data when backup starts, and makes and then be effectively ensured the ageing of data backup.
The embodiment of the present invention additionally provides a kind of memory database storage engines, can be used for realizing as shown in Figures 2 to 6 Method flow, as shown in fig. 7, the device includes:
Acquiring unit 31, the mark for obtaining current page to be backed up.
Searching unit 32, the mark of the page current to be backed up for being obtained according to the acquiring unit 31 is deposited from snapshot page Search snapshot page corresponding with the current page to be backed up in storage space, the corresponding snapshot page of the current page to be backed up is stored The initial data that the current page to be backed up is stored when backup process starts.
Backup units 33, for finding snapshot page corresponding with the current page to be backed up from the searching unit 32 It is middle to obtain the corresponding initial data of the current page to be backed up, and the corresponding initial data of the current page to be backed up is carried out standby Part.
Resource releasing unit 34, it is corresponding with the current page to be backed up for discharge that the backup units 33 have backed up Memory space shared by snapshot page.
Optionally, the acquiring unit 31 be additionally operable to obtain remaining page to be backed up mark, wherein it is described remaining treat standby Part page is the page to be backed up except when outside preceding page to be backed up.
The searching unit 32, is additionally operable to the mark of remaining page to be backed up according to the acquiring unit 31 is obtained, Searched from snapshot page memory space and remaining each self-corresponding snapshot page of page to be backed up.
The backup units 33, for finding at least one of described remaining page to be backed up when the searching unit 32 There is corresponding snapshot page, then preferentially obtained from the snapshot page that each has found the initial data of page to be backed up carry out it is standby Part;And, directly obtain data from remaining page to be backed up in the absence of correspondence snapshot page and backed up.
The resource releasing unit 34, for discharging the storage sky shared by the snapshot page that the backup units 33 have been backed up Between.
Optionally, as shown in figure 8, the backup units 33 include:
Detection module 331, for being detected in described remaining backed-up pages from snapshot page memory space, if exist Memory space shared by the corresponding snapshot page of remaining page to be backed up snapshot page institute corresponding with the current page to be backed up The memory space of occupancy is continuous.
Backup module 332, it is shared for there is described remaining corresponding snapshot page of page to be backed up in the detection module 331 When memory space shared by memory space snapshot page corresponding with the current page to be backed up is continuous, then preferentially from The original of page to be backed up is obtained in the continuous snapshot page of memory space shared by snapshot page corresponding with the current page to be backed up Beginning data are backed up, and then the memory space shared by snapshot page corresponding with the current page to be backed up is discontinuous fast Backed up according to the initial data that page to be backed up is obtained in page.
Optionally, as shown in figure 9, also including:
Receiving unit 41, for receiving data modification request, the data modification request is carried where data to be modified The mark of page.
Determining unit 42, for the mark of the page according to where the data to be modified, it is determined that current data to be modified are being treated In backed-up pages.
Allocation unit 43, the original of the data to be modified place page storage to be backed up for being determined according to the determining unit 42 Beginning data, page to be backed up where being the data to be modified in snapshot page memory space distributes a snapshot page, and using described The mark of page to be backed up is marked where data to be modified.
Copied cells 44, is deposited for the initial data of the page storage to be backed up to be copied into the snapshot for distributing page Storage.
Modification unit 45, for being modified to the data to be modified in the page to be backed up.
Optionally, it is described to be repaired that the backup units 44 are used for when the remaining space in snapshot page memory space is less than When page to be backed up where changing data distributes the memory space shared by a snapshot page, to the original number of the page storage to be backed up According to being backed up.
The modification unit 45, for being modified to the data to be modified in the page to be backed up.
Memory database storage engines provided in an embodiment of the present invention, by the way that snapshot will be provided for the data in page to be backed up Page is stored, even if to ensure to there are data in backup process and changed, it is also ensured that data before modification can be by Preserve so that the data that backup process is obtained all are data when backup process starts, if compared to hair in the prior art Raw data modification can only then store amended data and compare, it is ensured that all backup data stores are all when backing up to start Data, make and then be effectively ensured the ageing of data backup.
The embodiment of the present invention additionally provides a kind of memory database storage engines, as shown in Figure 10, including the He of processor 51 Input/output interface 52, the input/output interface 52 is communicated for processor 51 with external devices.
Wherein, the processor 51 is used to obtain the mark of current page to be backed up;According to the mark of the current page to be backed up Know, snapshot page corresponding with the current page to be backed up searched from snapshot page memory space, from the current page to be backed up Obtain the corresponding initial data of the current page to be backed up in corresponding snapshot page, and to the corresponding original of the current page to be backed up Beginning data are backed up, wherein, the corresponding snapshot page of the current page to be backed up stores the current page to be backed up in backup The initial data stored during process initiation;Discharge the memory space shared by snapshot page corresponding with the current page to be backed up.
Optionally, the processor 51 is additionally operable to obtain the mark of remaining page to be backed up, wherein described, remaining is to be backed up Page is the page to be backed up except when outside preceding page to be backed up;It is empty from snapshot page storage according to the mark of remaining page to be backed up Between middle lookup and each self-corresponding snapshot page of described remaining page to be backed up;In described remaining page to be backed up is found at least one It is individual to there is corresponding snapshot page, then preferentially obtained from the snapshot page that each has found the initial data of page to be backed up carry out it is standby Part, and discharge the memory space shared by the snapshot page for having backed up;In the original of the snapshot page memory storage found to each Data are completed after backup, and directly obtaining data from remaining page to be backed up in the absence of correspondence snapshot page is backed up.
Optionally, the processor 51 from snapshot page memory space also particularly useful for detecting that remaining is standby described In part page, if there is the memory space and the current page to be backed up shared by described remaining corresponding snapshot page of page to be backed up Memory space shared by corresponding snapshot page is continuous;If shared in the presence of described remaining corresponding snapshot page of page to be backed up Memory space snapshot page corresponding with the current page to be backed up shared by memory space be it is continuous, then preferentially from institute State the original number that page to be backed up is obtained in the continuous snapshot page of memory space shared by the corresponding snapshot page of current page to be backed up According to being backed up, the then discontinuous snapshot page of memory space shared by snapshot page corresponding with the current page to be backed up The middle initial data for obtaining page to be backed up is backed up.
Optionally, the processor 51 is additionally operable to receive data modification request, institute by the input/output interface 52 State the mark that data modification request carries page where data to be modified;The mark of page according to where the data to be modified, really Settled preceding data to be modified in page to be backed up, the initial data that the page to be backed up according to where the data to be modified is stored, Snapshot page memory space page to be backed up where the data to be modified distributes a snapshot page, and uses the data to be modified The mark of place page to be backed up is marked;The initial data of the page storage to be backed up is copied to the snapshot page for distributing to enter Row storage;Data to be modified in the page to be backed up are modified.
Optionally, it is described to be repaired that the processor 51 is additionally operable to when the remaining space in snapshot page memory space is less than When page to be backed up where changing data distributes the memory space shared by a snapshot page, to the original number of the page storage to be backed up According to being backed up;Data to be modified in the page to be backed up are modified.
Memory database storage engines provided in an embodiment of the present invention, by the way that snapshot will be provided for the data in page to be backed up Page is stored, even if to ensure to there are data in backup process and changed, it is also ensured that data before modification can be by Preserve so that the data that backup process is obtained all are data when backup process starts, if compared to hair in the prior art Raw data modification can only then store amended data and compare, it is ensured that all backup data stores are all when backing up to start Data, make and then be effectively ensured the ageing of data backup.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can be borrowed Software is helped to add the mode of required common hardware to realize, naturally it is also possible to which by hardware, but the former is more preferably in many cases Implementation method.Based on such understanding, the portion that technical scheme substantially contributes to prior art in other words Dividing can be embodied in the form of software product, and the computer software product is stored in the storage medium that can read, and such as be counted The floppy disk of calculation machine, hard disk or CD etc., including some instructions are used to so that computer equipment (can be personal computer, Server, or the network equipment etc.) perform method described in each embodiment of the invention.
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all contain Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of method of data backup, it is characterised in that including:
Obtain the mark of current page to be backed up;
According to the mark of the current page to be backed up, searched from snapshot page memory space corresponding with the current page to be backed up Snapshot page, obtains the corresponding initial data of the current page to be backed up from snapshot page corresponding with the current page to be backed up, And the corresponding initial data of the current page to be backed up is backed up, wherein, the corresponding snapshot page of the current page to be backed up Store the initial data that the current page to be backed up is stored when backup process starts;
Discharge the memory space shared by snapshot page corresponding with the current page to be backed up.
2. method according to claim 1, it is characterised in that discharging the corresponding snapshot page institute of the current page to be backed up After the memory space of occupancy, also include:
The mark of remaining page to be backed up is obtained, wherein described remaining page to be backed up is except when to be backed up outside preceding page to be backed up Page;
According to the mark of remaining page to be backed up, it is each right with described remaining page to be backed up to be searched from snapshot page memory space The snapshot page answered;
There is corresponding snapshot page when at least one of described remaining page to be backed up is found, then preferentially found from each Snapshot page in obtain the initial data of page to be backed up and backed up, and the storage discharged shared by the snapshot page for having backed up is empty Between;
After the initial data of the snapshot page memory storage found to each completes backup, directly from the absence of correspondence snapshot Data are obtained in remaining page to be backed up of page to be backed up.
3. method according to claim 2, it is characterised in that described from snapshot page corresponding with the current page to be backed up It is middle to obtain the corresponding initial data of the current page to be backed up, and the corresponding initial data of the current page to be backed up is carried out standby Part includes:
Detected in described remaining page to be backed up from snapshot page memory space, if there is described remaining page phase to be backed up Memory space shared by the memory space shared by snapshot page answered snapshot page corresponding with the current page to be backed up is to connect Continuous;
If corresponding to the current page to be backed up in the presence of the memory space shared by described remaining corresponding snapshot page of page to be backed up Snapshot page shared by memory space be it is continuous, then it is preferentially shared from snapshot page corresponding with the current page to be backed up Memory space continuous snapshot page in obtain the initial data of page to be backed up and backed up, then from current to be backed up with described The initial data that page to be backed up is obtained in the discontinuous snapshot page of memory space shared by the corresponding snapshot page of page is backed up.
4. the method according to claims 1 to 3 any one, it is characterised in that obtaining the mark of current page to be backed up Before, also include:
Data modification request is received, the data modification request carries the mark of page where data to be modified;
The mark of page according to where the data to be modified, it is determined that current data to be modified are treated in page to be backed up according to described The initial data of page storage to be backed up where modification data, it is to be backed up where being the data to be modified in snapshot page memory space Page distribution one snapshot page, and mark using page to be backed up where the data to be modified is marked;
The initial data of the page storage to be backed up is copied to the snapshot page for distributing to be stored;
Data to be modified in the page to be backed up are modified.
5. method according to claim 4, it is characterised in that also include:
When the remaining space of snapshot page memory space distributes a snapshot page less than the page to be backed up where the data to be modified During shared memory space, the initial data to the page storage to be backed up is backed up;
Data to be modified in the page to be backed up are modified.
6. a kind of memory database storage engines, it is characterised in that including:
Acquiring unit, the mark for obtaining current page to be backed up;
Searching unit, the mark of the page current to be backed up for being obtained according to the acquiring unit, from snapshot page memory space Search snapshot page corresponding with the current page to be backed up;Wherein, the corresponding snapshot page of the page currently to be backed up stores institute State the initial data that current page to be backed up is stored when backup process starts;
Backup units, obtain institute in snapshot page corresponding with the current page to be backed up for being found from the searching unit State the corresponding initial data of current page to be backed up, and the corresponding initial data of the current page to be backed up is backed up;
Resource releasing unit, for the snapshot page institute corresponding with the current page to be backed up that discharges that the backup units have backed up The memory space of occupancy.
7. memory database storage engines according to claim 6, it is characterised in that the acquiring unit is additionally operable to obtain The mark of remaining page to be backed up, wherein described remaining page to be backed up is the page to be backed up except when outside preceding page to be backed up;
The searching unit, is additionally operable to the mark of remaining page to be backed up according to the acquiring unit is obtained, from snapshot page Searched in memory space and remaining each self-corresponding snapshot page of page to be backed up;
The backup units, for there is correspondence when the searching unit finds at least one of described remaining page to be backed up Snapshot page, then the initial data that page to be backed up is obtained in the snapshot page for preferentially having found from each backed up;And, directly The acquisition data from remaining page to be backed up in the absence of correspondence snapshot page are connect to be backed up;
The resource releasing unit, for discharging the memory space shared by the snapshot page that the backup units have been backed up.
8. memory database storage engines according to claim 7, it is characterised in that the backup units include:
Detection module, for being detected in described remaining page to be backed up from snapshot page memory space, if exist described Memory space shared by the corresponding snapshot page of remaining page to be backed up snapshot page corresponding with the current page to be backed up is shared Memory space be continuous;
Backup module, for there is the storage sky shared by described remaining corresponding snapshot page of page to be backed up in the detection module Between memory space shared by snapshot page corresponding with the current page to be backed up when being continuous, then preferentially from current with described The initial data that page to be backed up is obtained in the continuous snapshot page of memory space shared by the corresponding snapshot page of page to be backed up is carried out Backup, then obtains from the discontinuous snapshot page of memory space shared by snapshot page corresponding with the current page to be backed up The initial data of page to be backed up is backed up.
9. memory database storage engines according to claim 6 to 8 any one, it is characterised in that also include:
Receiving unit, for receiving data modification request, the data modification request carries the mark of page where data to be modified Know;
Determining unit, for the mark of the page according to where the data to be modified, it is determined that current data to be modified are in page to be backed up In;
Allocation unit, the initial data of the data to be modified place page storage to be backed up for being determined according to the determining unit, Page to be backed up where being the data to be modified in snapshot page memory space distributes a snapshot page, and uses the number to be modified It is marked according to the mark of place page to be backed up;
Copied cells, is stored for the initial data of the page storage to be backed up to be copied into the snapshot for distributing page;
Modification unit, for being modified to the data to be modified in the page to be backed up.
10. memory database storage engines according to claim 9, it is characterised in that the backup units be used for when It is shared that the remaining space of snapshot page memory space distributes a snapshot page less than the page to be backed up where the data to be modified Memory space when, the initial data to the page to be backed up storage is backed up;
The modification unit, for being modified to the data to be modified in the 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 CN104216792A (en) 2014-12-17
CN104216792B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019130B (en) * 2017-12-06 2022-09-06 阿里巴巴集团控股有限公司 Database updating method and device
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
CN112559243B (en) * 2019-09-25 2022-04-29 阿里巴巴集团控股有限公司 Data snapshot method and device, electronic equipment and computer readable storage medium

Citations (3)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4483342B2 (en) * 2004-02-27 2010-06-16 株式会社日立製作所 System recovery method

Patent Citations (3)

* 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
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

Also Published As

Publication number Publication date
CN104216792A (en) 2014-12-17

Similar Documents

Publication Publication Date Title
CN104216792B (en) The method and memory database storage engines of data backup
EP3333718B1 (en) Task allocation method and task allocation apparatus for distributed data calculation
CN102831120B (en) A kind of data processing method and system
EP2288975B1 (en) Method for optimizing cleaning of maps in flashcopy cascades containing incremental maps
CN103761053B (en) A kind of data processing method and device
US20150317246A1 (en) Memory Reclamation Method and Apparatus
CN1331817A (en) Method and appts. for concurrent DBMS table operations
CN107357680A (en) Data processing equipment and the method for data processing
CN101650646A (en) Method and device for realizing shared data consistency
CN106326226B (en) The method and system of log-on data library service in a kind of public cloud
CN103455631A (en) Method, device and system for processing data
CN113849339B (en) Method, device and storage medium for restoring running state of application program
CN107590144A (en) A kind of file memory method and terminal
CN105512129A (en) Method and device for mass data retrieval, and method and device for storing mass data
CN108763572A (en) A kind of method and apparatus for realizing Apache Solr read and write abruptions
CN102508902A (en) Block size variable data blocking method for cloud storage system
CN106899654A (en) A kind of sequence value generation method, apparatus and system
CN111666266A (en) Data migration method and related equipment
CN109710466A (en) A kind of data back up method and device
CN111427931A (en) Distributed query engine and method for querying relational database by using same
CN104753992A (en) Method, device and system for data storage and method and device for virtual platform failure recovery
CN114721594A (en) Distributed storage method, device, equipment and machine readable storage medium
US8589652B2 (en) Reorganization of a fragmented directory of a storage data structure comprised of the fragmented directory and members
CN102347869A (en) Method, device and system for monitoring equipment performance
CN108664322A (en) Data processing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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