CN109684292A - A kind of method that flash memory database quickly carries out data recovery - Google Patents
A kind of method that flash memory database quickly carries out data recovery Download PDFInfo
- Publication number
- CN109684292A CN109684292A CN201910021665.3A CN201910021665A CN109684292A CN 109684292 A CN109684292 A CN 109684292A CN 201910021665 A CN201910021665 A CN 201910021665A CN 109684292 A CN109684292 A CN 109684292A
- Authority
- CN
- China
- Prior art keywords
- data
- affairs
- log recording
- log
- effective
- 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.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of methods that flash memory database quickly carries out data recovery, journal file in scan database, effective affairs submit log recording if it exists, show that all changes for being related to the affairs are not yet completely written in data file, it needs according to log recording, complete the rewriting of data file, effective affairs submit log recording if it does not exist, also effective rewind journal is not present, but there is still effective log recording, show that the affairs are not yet completed, check for partial log record written data file, and the case where not being written partially, as existed, then carry out rolling back action, the method that the flash memory database data of the invention are restored, devise a kind of new log record, the data address of the data member of change and its all different editions is saved as in same log recording, convenient in day Valid data record is quickly found out according to affairs ID when will rollback or submission, increases the efficiency that data are restored.
Description
Technical field
The present invention relates to flash data recovery technology field, specially a kind of flash memory database quickly carries out data recovery
Method.
Background technique
Flash memory (Flash Memory) is that a kind of the non-volatile of long-life (is still able to maintain under power blackout situation and is stored
Data information) memory, data deletion be not as unit of single byte but as unit of fixed block (note:
NOR Flash is byte storage.), block size is generally 256KB to 20MB.Flash memory is Electrical Erasable read-only memory
(EEPROM) mutation, flash memory unlike EEPROM, EEPROM can be deleted and be rewritten in byte-level rather than
Entire chip is erasable, and most of chip of flash memory needs block to wipe.Due to remaining to save data, flash memory usually quilt when its power-off
For saving setting information, such as in the BIOS(basic program of computer), PDA(personal digital assistant), money is saved in digital camera
Material etc..
Database can be considered the file cabinet of electronization in brief --- the place of storage electronic document, user can be right
Data run in file is newly-increased, interception, the operation such as updates, deletes.
So-called " database " be store in a certain way together, can with multiple user sharings, have it is as small as possible superfluous
Remaining and application program data acquisition system independent of each other.
Conventional flash memory database data restore when, need to carry out confirmation recovery step by step, the time is longer, efficiency compared with
It is low, it would therefore be highly desirable to which a kind of improved technology solves the problems, such as this in the presence of the prior art.
Summary of the invention
The purpose of the present invention is to provide a kind of methods that flash memory database quickly carries out data recovery, to solve above-mentioned back
The problem of being proposed in scape technology.
To achieve the above object, the invention provides the following technical scheme: a kind of flash memory database quickly carries out data recovery
Method, comprising the following steps:
Step 1: whether the journal file in scan database, confirming has still effective affairs to submit log in journal file
Record or transaction journal;
Step 2: the state current according to journal file is handled as follows respectively: effective affairs submit log note if it exists
Record, shows that all changes for being related to the affairs are not yet completely written in data file, needs to complete data text according to log recording
The rewriting of part checks for effective rewind journal record, and if it exists, all log recordings then are searched according to affairs ID,
And rolling back action is carried out, there is no effective affairs, and log recording to be submitted to enter in next step;
Step 3: effective affairs submit log recording if it does not exist, effective rewind journal are also not present, but presence still has
The log recording of effect shows that the affairs are not yet completed, and checks for partial log record written data file, and part
The case where not being written such as exists, then carries out rolling back action.
Preferably, rolling back action is first depending on affairs ID and finds out all about affairs from journal file in the step 3
The still effective log recording of the corresponding affairs of ID, then successively judges logging operations type, according to different operation class
Type completes following operation: if insertion operation, then deleting the data element being currently inserted into;If delete operation then reinserts
Deleted data element;If updating operation, then the value of data element is returned to original state.
Preferably, log recording includes chained list and tables of data, each affairs of sequential storage in chained list in the step 1
The log recording of the different data operation of generation, the different editions comprising each data member in a log recording in tables of data
Data, the address comprising specified tables of data in the log recording of chained list;Log recording in tables of data include affairs ID, data at
Four member, preceding member and data address table fields, wherein affairs ID is the ID number of affairs belonging to current log records;Data member
For the title for the data member that current data operation is directed toward;Preceding member is the preceding member that variation is generated in Current transaction;Data
Location table is the address of all edition datas of data member, and each edition data is attached with chained list in chronological order, works as affairs
After submission or rollback, which is set as empty.
Preferably, data file is configured as storing the data stored in the database in the step 2.
Preferably, the method that journal file constructs in the step 1 are as follows: when a new affairs unlatching, and generate first
When data variation, a log recording is inserted into for the data member of first update;Become when generating other data members in affairs
When change, then it is inserted into a new log recording, its preceding member is set as to the data record of a upper variation;For being inserted into and deleting behaviour
Make, distinguishes the data of different editions using multiple identifiers in data address table;If affairs are submitted or rollback, insert
Enter a submission or rewind journal record, the member that preceding member updates before being set as;All generation variations in database of record
Data member and its specific data manipulation, and be uniformly stored in journal file.
Compared with prior art, the beneficial effects of the present invention are:
The method that flash memory database data of the invention are restored devises a kind of new log record, by the data of change
The data address of member and its all different editions saves as in same log recording, convenient for the root in log rollback or submission
It is quickly found out valid data record according to affairs ID, increases the efficiency that data are restored.
Detailed description of the invention
Fig. 1 is flow diagram of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, the present invention provides a kind of technical solution: a kind of flash memory database quickly carries out the side of data recovery
Method, comprising the following steps:
Step 1: whether the journal file in scan database, confirming has still effective affairs to submit log in journal file
Record or transaction journal;
Step 2: the state current according to journal file is handled as follows respectively: effective affairs submit log note if it exists
Record, shows that all changes for being related to the affairs are not yet completely written in data file, needs to complete data text according to log recording
The rewriting of part checks for effective rewind journal record, and if it exists, all log recordings then are searched according to affairs ID,
And rolling back action is carried out, there is no effective affairs, and log recording to be submitted to enter in next step;
Step 3: effective affairs submit log recording if it does not exist, effective rewind journal are also not present, but presence still has
The log recording of effect shows that the affairs are not yet completed, and checks for partial log record written data file, and part
The case where not being written such as exists, then carries out rolling back action.
In step 3 rolling back action be first depending on affairs ID found out from journal file all about affairs ID it is corresponding should
The still effective log recording of affairs, then successively judges logging operations type, according to different operation type, completes as follows
Operation: if insertion operation, then the data element being currently inserted into is deleted;If delete operation, then deleted number is reinserted
According to element;If updating operation, then the value of data element is returned to original state.
Log recording includes chained list and tables of data, the different numbers that each affairs of sequential storage generate in chained list in step 1
It include the different editions data of each data member in a log recording according to the log recording of operation, in tables of data, chained list
Address comprising specified tables of data in log recording;Log recording in tables of data include affairs ID, data member, preceding member and
Four fields of data address table, wherein affairs ID is the ID number of affairs belonging to current log records;Data member is current data
Operate the title for the data member being directed toward;Preceding member is the preceding member that variation is generated in Current transaction;Data address table is data
The address of all edition datas of member, each edition data are attached with chained list in chronological order, when affairs submission or rollback
Afterwards, which is set as empty.
Data file is configured as storing the data stored in the database in step 2.
The method that journal file constructs in step 1 are as follows: when a new affairs are opened, and generate first data variation,
The data member updated for first is inserted into a log recording;When generating the variation of other data members in affairs, then it is inserted into
Its preceding member is set as the data record of a upper variation by one new log recording;For insertion and delete operation, in data
The data of different editions are distinguished in the table of location using multiple identifiers;If affairs are submitted or rollback, it is inserted into a submission
Or rewind journal record, the member that preceding member updates before being set as;All data members for generating variation in database of record
And its specific data manipulation, and be uniformly stored in journal file.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with
A variety of variations, modification, replacement can be carried out to these embodiments without departing from the principles and spirit of the present invention by understanding
And modification, the scope of the present invention is defined by the appended.
Claims (5)
1. a kind of method that flash memory database quickly carries out data recovery, it is characterised in that: the following steps are included:
Step 1: whether the journal file in scan database, confirming has still effective affairs to submit log in journal file
Record or transaction journal;
Step 2: the state current according to journal file is handled as follows respectively: effective affairs submit log note if it exists
Record, shows that all changes for being related to the affairs are not yet completely written in data file, needs to complete data text according to log recording
The rewriting of part checks for effective rewind journal record, and if it exists, all log recordings then are searched according to affairs ID,
And rolling back action is carried out, there is no effective affairs, and log recording to be submitted to enter in next step;
Step 3: effective affairs submit log recording if it does not exist, effective rewind journal are also not present, but presence still has
The log recording of effect shows that the affairs are not yet completed, and checks for partial log record written data file, and part
The case where not being written such as exists, then carries out rolling back action.
2. the method that a kind of flash memory database according to claim 1 quickly carries out data recovery, it is characterised in that: described
Rolling back action is first depending on affairs ID and finds out the corresponding affairs of all about affairs ID from journal file still in step 3
Then effective log recording successively judges logging operations type, according to different operation type, complete following operation: if
It is insertion operation, then deletes the data element being currently inserted into;If delete operation, then deleted data element is reinserted;
If updating operation, then the value of data element is returned to original state.
3. the method that a kind of flash memory database according to claim 1 quickly carries out data recovery, it is characterised in that: described
Log recording includes chained list and tables of data in step 1, and the different data of each affairs of sequential storage generation operates in chained list
Log recording, the different editions data comprising each data member in a log recording in tables of data, the log recording of chained list
In the address comprising specified tables of data;Log recording in tables of data includes affairs ID, data member, preceding member and data address
Four fields of table, wherein affairs ID is the ID number of affairs belonging to current log records;Data member is that current data operation is directed toward
Data member title;Preceding member is the preceding member that variation is generated in Current transaction;Data address table is all for data member
The address of edition data, each edition data are attached with chained list in chronological order, after affairs submission or rollback, the data
Address field is set as empty.
4. the method that a kind of flash memory database according to claim 1 quickly carries out data recovery, it is characterised in that: described
Data file is configured as storing the data stored in the database in step 2.
5. the method that a kind of flash memory database according to claim 1 quickly carries out data recovery, it is characterised in that: described
The method that journal file constructs in step 1 are as follows: be first when a new affairs are opened, and generate first data variation
The data member of update is inserted into a log recording;When generating the variation of other data members in affairs, then be inserted into one it is new
Its preceding member is set as the data record of a upper variation by log recording;For insertion and delete operation, make in data address table
The data of different editions are distinguished with multiple identifiers;If affairs are submitted or rollback, it is inserted into a submission or rollback day
Will record, the member that preceding member updates before being set as;All data members for generating variation and its specific in database of record
Data manipulation, and be uniformly stored in journal file.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910021665.3A CN109684292A (en) | 2019-01-10 | 2019-01-10 | A kind of method that flash memory database quickly carries out data recovery |
PCT/CN2019/104085 WO2020143240A1 (en) | 2019-01-10 | 2019-09-03 | Method for quickly recovering data in flash memory database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910021665.3A CN109684292A (en) | 2019-01-10 | 2019-01-10 | A kind of method that flash memory database quickly carries out data recovery |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109684292A true CN109684292A (en) | 2019-04-26 |
Family
ID=66192857
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910021665.3A Withdrawn CN109684292A (en) | 2019-01-10 | 2019-01-10 | A kind of method that flash memory database quickly carries out data recovery |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109684292A (en) |
WO (1) | WO2020143240A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134340A (en) * | 2019-05-23 | 2019-08-16 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus of metadata updates, equipment and storage medium |
CN111176907A (en) * | 2020-01-06 | 2020-05-19 | 中科驭数(北京)科技有限公司 | Hardware database rollback method, software database rollback method and device |
WO2020143240A1 (en) * | 2019-01-10 | 2020-07-16 | 江苏华存电子科技有限公司 | Method for quickly recovering data in flash memory database |
CN111694893A (en) * | 2020-04-23 | 2020-09-22 | 武汉达梦数据库有限公司 | Partial rollback analysis method based on log analysis and data synchronization system |
CN112612648A (en) * | 2020-12-29 | 2021-04-06 | 厦门市美亚柏科信息股份有限公司 | SQL Server database recovery method, terminal device and storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9298761B2 (en) * | 2009-04-30 | 2016-03-29 | Hewlett Packard Enterprise Development Lp | Adaptive merging in database indexes |
CN107220145B (en) * | 2017-05-19 | 2021-06-01 | 北京计算机技术及应用研究所 | Method for recovering data of flash memory database |
CN109684292A (en) * | 2019-01-10 | 2019-04-26 | 江苏华存电子科技有限公司 | A kind of method that flash memory database quickly carries out data recovery |
-
2019
- 2019-01-10 CN CN201910021665.3A patent/CN109684292A/en not_active Withdrawn
- 2019-09-03 WO PCT/CN2019/104085 patent/WO2020143240A1/en active Application Filing
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020143240A1 (en) * | 2019-01-10 | 2020-07-16 | 江苏华存电子科技有限公司 | Method for quickly recovering data in flash memory database |
CN110134340A (en) * | 2019-05-23 | 2019-08-16 | 苏州浪潮智能科技有限公司 | A kind of method, apparatus of metadata updates, equipment and storage medium |
CN111176907A (en) * | 2020-01-06 | 2020-05-19 | 中科驭数(北京)科技有限公司 | Hardware database rollback method, software database rollback method and device |
CN111694893A (en) * | 2020-04-23 | 2020-09-22 | 武汉达梦数据库有限公司 | Partial rollback analysis method based on log analysis and data synchronization system |
CN111694893B (en) * | 2020-04-23 | 2023-04-25 | 武汉达梦数据库股份有限公司 | Partial rollback analysis method and data synchronization system based on log analysis |
CN112612648A (en) * | 2020-12-29 | 2021-04-06 | 厦门市美亚柏科信息股份有限公司 | SQL Server database recovery method, terminal device and storage medium |
CN112612648B (en) * | 2020-12-29 | 2022-11-08 | 厦门市美亚柏科信息股份有限公司 | SQL Server database recovery method, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020143240A1 (en) | 2020-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109684292A (en) | A kind of method that flash memory database quickly carries out data recovery | |
US9183236B2 (en) | Low level object version tracking using non-volatile memory write generations | |
CN103646063B (en) | A kind of spaceborne high speed document management system | |
CN106227621B (en) | The data back up method and system of logic-based volume management simplification volume | |
CN105808633A (en) | Data archiving method and system | |
CN105224478A (en) | A kind of formation of mapping table, renewal and restoration methods and electronic equipment | |
US20100131700A1 (en) | Memory indexing system and process | |
US20060200500A1 (en) | Method of efficiently recovering database | |
KR101766790B1 (en) | Method and computing apparatus for maniging main memory database | |
CN1983265A (en) | File system having inverted hierarchical structure | |
KR20080078005A (en) | Web site multi-stage recycling | |
KR100746198B1 (en) | Apparatus and method for storing data, and readable recording medium thereof | |
JP2004348744A (en) | Identification method for identifying change carried out for table, and its system | |
CN102207898B (en) | Electronic data recovery method | |
CN108875077A (en) | Column storage method, device, server and the storage medium of database | |
KR20110046118A (en) | Adaptive logging apparatus and method | |
CN102054041B (en) | Method and system for upgrading metadata | |
CN108646987B (en) | File volume management method and device, storage medium and terminal | |
US11176089B2 (en) | Systems and methods for implementing dynamic file systems | |
CN110389714A (en) | Method, apparatus and computer storage medium for data input and output | |
KR20170106626A (en) | Method and computing apparatus for maniging main memory database | |
CN110262980A (en) | High-speed memory system based on finite lifetime storage medium | |
CN102855288A (en) | Method and device for processing difference data | |
Lee et al. | RMSS: an efficient recovery management scheme on NAND flash memory based solid state disk | |
CN114995749A (en) | Parameter storage method for embedded equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190426 |