Movatterモバイル変換


[0]ホーム

URL:


CN103885855A - Data backup and recovery method and data backup and recovery device - Google Patents

Data backup and recovery method and data backup and recovery device
Download PDF

Info

Publication number
CN103885855A
CN103885855ACN201210560432.9ACN201210560432ACN103885855ACN 103885855 ACN103885855 ACN 103885855ACN 201210560432 ACN201210560432 ACN 201210560432ACN 103885855 ACN103885855 ACN 103885855A
Authority
CN
China
Prior art keywords
data
backup
tables
file
database
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.)
Pending
Application number
CN201210560432.9A
Other languages
Chinese (zh)
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino CorpfiledCriticalAisino Corp
Priority to CN201210560432.9ApriorityCriticalpatent/CN103885855A/en
Publication of CN103885855ApublicationCriticalpatent/CN103885855A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

An embodiment of the invention provides a data backup and recovery method and a data backup and recovery device. The method mainly comprises the following steps of performing timing backup on a data file after set timing backup conditions are met; acquiring the backup data file; storing the backup data file, which comprises a database file, in a storage medium; performing data sheet operation on a data sheet in a database, and then performing timing backup on the data sheet operation to obtain a data sheet operation backup file; and storing the data sheet operation backup file in the storage medium. According to the embodiment, a timing backup and real-time backup combined method is adopted, backup integrity is guaranteed, backup efficiency is guaranteed, the file can be simply recovered immediately after being damaged, the recovery time is short, and data backup and data recovery can be effectively performed on tax terminal equipment such as a fiscal cash register and an online billing machine.

Description

The method of data backup and resume and device
Technical field
The present invention relates to Computer Applied Technology field, relate in particular to a kind of method and device of data backup and resume.
Background technology
Tax-control cash register, network billing machine are the terminal devices that aims at state's land tax medium-sized and small enterprises tax source control solution design, have met the popularization needs of country's " Golden Taxes " engineering in the last few years.Particularly along with the clear and definite of requirement opened in " three phases of Golden Taxes " invoice networking, network billing machine will further be promoted as the efficient networking of the one terminal of making out an invoice.
The major function of tax-control cash register, network billing machine is to open machine to dismiss ticket, and safe storage and transmission invoice data.Tax-control cash register is that off-line is made out an invoice, declaration data, invoice detailed data etc. are concentrated to the tax authority of making a copy for by medium or network, network billing machine is mainly online and makes out an invoice, and real-time and tax authority's management system is carried out the mutual invoice detailed data of also uploading in real time.
The business side emphasis difference of tax-control cash register, network billing machine, security mechanism difference, data transmission are wanted summing mode difference, but all need to be in the machine detailed and other management datas of reliable memory invoice.During product uses, inevitably there will be various hardware, software fault and parts damages, even there is the damage of invoice memory, in order not delay taxpayer's the operation activity of making out an invoice, need under the prerequisite that retains original system data integrity, recover as early as possible normal use.
In prior art, also do not have the concerning taxes terminal devices such as a kind of above-mentioned tax-control cash register, network billing machine effectively to carry out the method for backup and recovery.
Summary of the invention
Embodiments of the invention provide a kind of method and device of data backup and resume, to realize, concerning taxes terminal device are carried out to backup and recovery effectively.
A method for data backup and resume, comprising:
After the timed backup condition of setting meets, data file is carried out to timed backup and obtain backup data files, described backup data files is stored in storage medium, described data file comprises database file;
Database is being carried out after tables of data operation, described tables of data operation is backed up in realtime and obtained tables of data operation backup file, described tables of data operation backup file is being stored in storage medium.
A device for data backup and resume, comprising:
Timed backup module, after meeting, carries out timed backup to data file and obtains backup data files for the timed backup condition when setting, and described data file comprises database file;
The module of backing up in realtime, for database is being carried out after tables of data operation, backs up in realtime and obtains tables of data operation backup file described tables of data operation;
Storage medium, for storing described backup data files and tables of data operation backup file.
The technical scheme being provided by the embodiment of the invention described above can be found out, the method that the embodiment of the present invention has adopted timed backup and backed up in realtime and combine, both ensured the integrality of backup, ensure again the efficiency of backup, accomplish that i.e. damage recovers, recovers to realize simple and release time is shorter, can realize the concerning taxes terminal devices such as above-mentioned tax-control cash register, network billing machine are carried out to backup and recovery effectively.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 realizes schematic diagram for the hierarchical design of a kind of data backup and resume scheme that the embodiment of the present invention provides;
The treatment scheme schematic diagram of a kind of data backup and resume method that Fig. 2 provides for the embodiment of the present invention one;
The structural representation of a kind of data backup and resume device that Fig. 3 provides for the embodiment of the present invention two.
Embodiment
For ease of the understanding to the embodiment of the present invention, be further explained explanation below in conjunction with accompanying drawing as an example of several specific embodiments example, and each embodiment does not form the restriction to the embodiment of the present invention.
Embodiment mono-
On the enforcement hardware of the embodiment of the present invention, depend on a storage medium, this storage medium can be: UKey or USB flash disk etc., other parts are all realized by software.The hierarchical design of a kind of data backup and resume scheme that the embodiment of the present invention provides realizes schematic diagram as shown in Figure 1, wherein, " business datum layer " represents two class data to be backed up in this programme: data file, comprise database file and other data files, and adopt timed backup; Tables of data operation, comprises tables of data action type (increase, revise, delete) and service data, and employing is backed up in realtime." backup and recovery management layer " comprised interface, realization, data-switching that backup is relevant with recovery operation, and the follow-up for anomaly of data and the management of backup medium etc." dielectric layer " provides the general read and write access interface to backup medium, and the function on it is realized and hardware independent.The direction indication data flow of arrow in Fig. 1.
The treatment scheme schematic diagram of the method for a kind of data backup and resume that the embodiment of the present invention provides as shown in Figure 2, comprises following treatment step:
Step 21, when set timed backup condition meet after, data file is carried out to timed backup and obtains backup data files, described backup data files is stored in storage medium, described data file comprises database file.
Described timed backup condition comprises: timing occurs or the data of backing up in realtime occur extremely to, timed events, and above-mentioned timing can be 1 day or 1 week or January etc.The mode of backup data files can adopt the mode of direct copying, and above-mentioned backup data files is stored in above-mentioned storage medium with source document form.
In actual applications, can be backup data files corresponding to this data file by data file transition by timed backup data transformation interface, above-mentioned timed backup data transformation interface can be:
Int FileBackup (char*filename); The data file that // backup is specified.
Step 22, after the tables of data in database is carried out tables of data operation, to described tables of data, operation is backed up in realtime and is obtained tables of data operation backup file, and described tables of data operation backup file is stored in storage medium.
Backup " tables of data operation " is immediately following after the tables of data operation of each business procedure, i.e. a tables of data operation of every execution follows once the backup operation of " tables of data operation " closely, has reached the object of backing up in realtime.
In actual applications, can tables of data operand be converted to this tables of data by the data transformation interface of backing up in realtime and operate corresponding tables of data operation backup file, the above-mentioned data transformation interface of backing up in realtime can be:
Int TabletoBakData (char*bakdata, int*length, void*table); // tables of data operand is converted to bak, write backup file.
Int AddRecord (void*table); The tables of data operation of record is once added in // backup, calls TabletoBakData;
Int Update (char*sql); The tables of data operation of an amendment record of // backup
Int Delete (char*sql); The tables of data operation of a deletion record of // backup
Data item in the operation of described tables of data is as described in Table 1:
Table 1
The tables of data operation backup file of backing up in realtime is with XML(extend markup language, ExtensibleMarkup Language) file, JASON file or self-defining binary file be stored in above-mentioned storage medium, and the file of backing up in realtime can be selected the one of XML, JASON or user-defined format.
Above-mentioned tables of data operation backup file can be stored with the unit of being recorded as, the operation of every corresponding tables of data of record.The record of above-mentioned tables of data operation backup file can be classified according to tables of data title, and the order from arriving first sorts according to the running time.
Step 23, the backup data files of timed backup is recovered, obtained each tables of data information in database, the tables of data operation backup file of backing up in realtime is recovered, obtain the tables of data operation information of each tables of data.
In the time carrying out data recovery, the backup data files of timed backup is recovered, obtain each tables of data information in database.
In actual applications, can recover data transformation interface by timing backup data files corresponding data file is converted to data file, above-mentioned timed backup data transformation interface can be:
Int FileRestore (char*filename); The data file that // recovery is specified
Also need the tables of data operation backup file to backing up in realtime to recover, obtain the tables of data operation information of each tables of data.The tables of data operation recovering is classified according to the title of tables of data, and the order from arriving first sorts according to the running time.
In actual applications, can tables of data be operated to corresponding tables of data operation backup file by real-time recovery data transformation interface and be converted to tables of data operation, the above-mentioned data transformation interface of backing up in realtime can be:
Int Restore (int operation, char*bakData); // recover a data table handling record, call BakDatatoTable;
Then,, for the tables of data recovering, the order according to the running time from arriving first is carried out the tables of data recovering operation corresponding to this tables of data successively, successively each tables of data is carried out to aforesaid operations, thereby recovers the end-state of whole database.
The backup of the backup of " data file " and " tables of data operation " is all atomic operation, should ensure the interruptions such as power-off do not occur in backup procedure, otherwise will cause Backup Data imperfect.
Actual should in, can carry out data exception inspection to data table handling backup file, data exception inspection refers to and checks that whether the data of backing up in realtime correctly complete.Between the corresponding tables of data operation backup file of storing in the current data of each tables of data when system starts at every turn in comparison database and backup medium, there is bias free, as find that there is inconsistent situation, execute the once backup operation of " data file ".Once " data file " backs up successfully, remove the corresponding tables of data operation backup file of storing in backup medium.
Embodiment bis-
The concrete structure of the device of a kind of data backup and resume that this embodiment provides as described in Figure 3, comprises following module:
Timedbackup module 31, after meeting, carries out timed backup to data file and obtains backup data files for the timed backup condition when setting, and described data file comprises database file.
Themodule 32 of backing up in realtime, for the tables of data of database is being carried out after tables of data operation, backs up in realtime and obtains tables of data operation backup file described tables of data operation;
The tables of data operation backup file of backing up in realtime is classified according to tables of data title, and the order according to the running time from arriving first sorts, described tables of data operation comprises: tables of data title, action type, running time, SQL condition field, SQL amendment value field and data object, described action type comprises: add, revise and delete.
Storage medium 33, for storing described backup data files and tables of data operation backup file.
Recovery processing module 34, recovers for the backup data files to timed backup, obtains each tables of data information in database, and the tables of data operation backup file of backing up in realtime is recovered, and obtains the tables of data operation information of each tables of data;
For the tables of data recovering, the order according to the running time from arriving first is carried out the tables of data recovering operation corresponding to this tables of data successively, thereby recovers the end-state of whole database.
Abnormalitydetection processing module 35, for checking that the corresponding tables of data of storing in current data and the backup medium of each tables of data of database operates between backup file and has bias free, if there is deviation, carry out once the backup operation of the data file in described database, after this backup operation completes, remove the corresponding tables of data operation backup file of storing in backup medium.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
One of ordinary skill in the art will appreciate that: the module in the equipment in embodiment can be described and be distributed in the equipment of embodiment according to embodiment, also can carry out respective change and be arranged in the one or more equipment that are different from the present embodiment.The module of above-described embodiment can be merged into a module, also can further split into multiple submodules.
The detailed process and the preceding method embodiment that carry out data backup and resume with the device of the embodiment of the present invention are similar, repeat no more herein.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can carry out the hardware that instruction is relevant by computer program to complete, described program can be stored in a computer read/write memory medium, this program, in the time carrying out, can comprise as the flow process of the embodiment of above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random AccessMemory, RAM) etc.
In sum, the method that the embodiment of the present invention has adopted timed backup and backed up in realtime and combine, both ensured the integrality of backup, ensure again the efficiency of backup, accomplish that i.e. damage recovers, recovers to realize simple and release time is shorter, can realize the concerning taxes terminal devices such as above-mentioned tax-control cash register, network billing machine are carried out to backup and recovery effectively.
The embodiment of the present invention is according to the requirement of concrete network invoice system scheme, can use general medium such as network billing machine intrinsic UKey or USB flash disk etc. to do storage medium, database in network billing machine and other data files are backed up in realtime, once there is aforementioned fault, can fast Backup Data be returned in another brand-new backup network billing machine by the backup information on UKey or USB flash disk, it is reached and the identical state of former network billing machine.
The embodiment of the present invention has fully taken into account the low feature of middle low performance operation for embedded system speed, and backup can not delay the requirement of the business of making out an invoice, and can meet in time user's needs of making out an invoice.
The above; only for preferably embodiment of the present invention, but protection scope of the present invention is not limited to this, is anyly familiar with in technical scope that those skilled in the art disclose in the present invention; the variation that can expect easily or replacement, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (10)

CN201210560432.9A2012-12-202012-12-20Data backup and recovery method and data backup and recovery devicePendingCN103885855A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201210560432.9ACN103885855A (en)2012-12-202012-12-20Data backup and recovery method and data backup and recovery device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201210560432.9ACN103885855A (en)2012-12-202012-12-20Data backup and recovery method and data backup and recovery device

Publications (1)

Publication NumberPublication Date
CN103885855Atrue CN103885855A (en)2014-06-25

Family

ID=50954763

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201210560432.9APendingCN103885855A (en)2012-12-202012-12-20Data backup and recovery method and data backup and recovery device

Country Status (1)

CountryLink
CN (1)CN103885855A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104063294A (en)*2014-07-072014-09-24国家电网公司Linux system backup and restoring method
CN105446828A (en)*2014-09-302016-03-30北京金山云网络技术有限公司Database backup and recovery method, apparatus and system
CN106445738A (en)*2016-09-132017-02-22郑州云海信息技术有限公司Database backup method and device
CN106844093A (en)*2016-12-142017-06-13国网北京市电力公司The method and device of Backup Data
CN108255909A (en)*2017-07-272018-07-06平安科技(深圳)有限公司Tables of data backup method and server based on oracle database
CN108429676A (en)*2018-05-022018-08-21四川斐讯信息技术有限公司A kind of the data backup restoration method and data backup system of router
CN108776628A (en)*2018-05-292018-11-09郑州云海信息技术有限公司A kind of method, apparatus collapsed when CTDB data being avoided to restore and medium
CN109213635A (en)*2018-09-112019-01-15许继集团有限公司A kind of the damage tables of data restorative procedure and system of wave recording device
CN110545271A (en)*2019-08-282019-12-06北京天融信网络安全技术有限公司method and system for restoring file
CN111917917A (en)*2020-06-292020-11-10维沃移动通信有限公司File backup method and device and electronic equipment
CN112650625A (en)*2020-12-282021-04-13武汉达梦数据技术有限公司Streaming backup restoration method, storage medium and device for database
CN113742340A (en)*2021-08-172021-12-03深圳Tcl新技术有限公司Database table processing method and related equipment
WO2024164593A1 (en)*2023-02-092024-08-15华为云计算技术有限公司Database backup method, apparatus and computing device cluster

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1369971A (en)*2001-02-122002-09-18华为技术有限公司Data stand-by method of switch device
CN101034364A (en)*2007-04-022007-09-12华为技术有限公司Method, device and system for implementing RAM date backup
CN101122924A (en)*2007-09-302008-02-13华为技术有限公司 Logic log generation method, database backup/restoration method and system
CN101426052A (en)*2008-12-052009-05-06上海闻泰电子科技有限公司Backup and importing method for address book and short message of mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1369971A (en)*2001-02-122002-09-18华为技术有限公司Data stand-by method of switch device
CN101034364A (en)*2007-04-022007-09-12华为技术有限公司Method, device and system for implementing RAM date backup
CN101122924A (en)*2007-09-302008-02-13华为技术有限公司 Logic log generation method, database backup/restoration method and system
CN101426052A (en)*2008-12-052009-05-06上海闻泰电子科技有限公司Backup and importing method for address book and short message of mobile terminal

Cited By (19)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104063294B (en)*2014-07-072016-03-16国家电网公司A kind of linux system backup and restoration methods
CN104063294A (en)*2014-07-072014-09-24国家电网公司Linux system backup and restoring method
CN105446828A (en)*2014-09-302016-03-30北京金山云网络技术有限公司Database backup and recovery method, apparatus and system
CN105446828B (en)*2014-09-302019-05-31北京金山云网络技术有限公司A kind of DB Backup, restoration methods, apparatus and system
CN106445738A (en)*2016-09-132017-02-22郑州云海信息技术有限公司Database backup method and device
CN106844093A (en)*2016-12-142017-06-13国网北京市电力公司The method and device of Backup Data
CN108255909B (en)*2017-07-272020-08-04平安科技(深圳)有限公司Data table backup method and server based on Oracle database
CN108255909A (en)*2017-07-272018-07-06平安科技(深圳)有限公司Tables of data backup method and server based on oracle database
CN108429676A (en)*2018-05-022018-08-21四川斐讯信息技术有限公司A kind of the data backup restoration method and data backup system of router
CN108776628A (en)*2018-05-292018-11-09郑州云海信息技术有限公司A kind of method, apparatus collapsed when CTDB data being avoided to restore and medium
CN108776628B (en)*2018-05-292021-10-15郑州云海信息技术有限公司 A method, device and medium for avoiding crash during CTDB data recovery
CN109213635A (en)*2018-09-112019-01-15许继集团有限公司A kind of the damage tables of data restorative procedure and system of wave recording device
CN109213635B (en)*2018-09-112020-10-30许继集团有限公司 A method and system for repairing a damaged data table of a wave recording device
CN110545271A (en)*2019-08-282019-12-06北京天融信网络安全技术有限公司method and system for restoring file
CN111917917A (en)*2020-06-292020-11-10维沃移动通信有限公司File backup method and device and electronic equipment
CN112650625A (en)*2020-12-282021-04-13武汉达梦数据技术有限公司Streaming backup restoration method, storage medium and device for database
CN113742340A (en)*2021-08-172021-12-03深圳Tcl新技术有限公司Database table processing method and related equipment
CN113742340B (en)*2021-08-172024-06-04深圳Tcl新技术有限公司Database table processing method and related equipment
WO2024164593A1 (en)*2023-02-092024-08-15华为云计算技术有限公司Database backup method, apparatus and computing device cluster

Similar Documents

PublicationPublication DateTitle
CN103885855A (en)Data backup and recovery method and data backup and recovery device
CN109582443A (en)Virtual machine standby system based on distributed storage technology
AU2012347883B2 (en)System and method for restoring application data
CN102135963B (en)Data transfer method and system
CN104850598A (en)Method for recovering backup of real-time database
CN102782639B (en)Enable to copy the system and method that target reclaims untapped storage space in thin supply storage system
US8095510B2 (en)Data restoration in a storage system using multiple restore points
US8001091B2 (en)Apparatus, system, and method for hierarchical rollback of business operations
US8103911B2 (en)Method and system for disaster recovery based on journal events pruning in a computing environment
CN102609337A (en)Rapid data recovery method for memory database
CN105224422A (en)A kind of data back up method and equipment
CN104166605A (en)Data backup method and system based on incremental data files
CN110597661A (en)Virtual machine backup method and device
CN108536822A (en)Data migration method, device, system and storage medium
US7802134B1 (en)Restoration of backed up data by restoring incremental backup(s) in reverse chronological order
CN104516796A (en)Command set based network element backup and recovery method and device
CN102096613B (en)Method and device for generating snapshot
CN102609484A (en)General method for managing log of system
CN102073554A (en)Method and device for recovering files closed abnormally
US9032169B2 (en)Method for high performance dump data set creation
CN102033792A (en)Virtualization-based remote data recovery method and device
CN103207916A (en)Metadata processing method and device
CN104407932A (en)Data backup method and device
CN118733340A (en) A method, device and readable and writable medium for efficient data backup and recovery
CN103218256A (en)Batch backspacing method and system of host

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20140625

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp