CN107766453A - Data base management method, device and storage medium based on block chain - Google Patents
Data base management method, device and storage medium based on block chain Download PDFInfo
- Publication number
- CN107766453A CN107766453A CN201710885372.0A CN201710885372A CN107766453A CN 107766453 A CN107766453 A CN 107766453A CN 201710885372 A CN201710885372 A CN 201710885372A CN 107766453 A CN107766453 A CN 107766453A
- Authority
- CN
- China
- Prior art keywords
- block chain
- instruction
- database
- data base
- management method
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1865—Transactional file systems
Abstract
The invention discloses a kind of data base management method based on block chain, device and computer-readable recording medium, the data base management method based on block chain includes:Database instruction is received, the database instruction is sent to corresponding database, receives the return message of the corresponding database;The database instruction or the block chain equivalent with database instruction instruction are distributed to the decentralization system based on block chain.Pass through the present invention, without being again Database transaction journal, all database instructions being stored in the decentralization system based on block chain or the block chain equivalent with database instruction instruction constitute the transaction journal of database, tamper-proof mechanisms based on block chain, it ensure that the transaction journal can not be distorted illegally, improve the safety and reliability of database.
Description
Technical field
The present invention relates to data processing field, more particularly to data base management method, device and storage based on block chain
Medium.
Background technology
Database is to come tissue, storage and the warehouse for managing data according to data structure.User can be in database
Data newly such as are increased, inquired about, being updated, being deleted at the operation.At present, database technology is management information system, office automation system
The core of the various information system such as system, DSS, it is the important technology hand for carrying out scientific research and decision-making management
Section.Database all has transaction journal, and data place is done for recording all database instructions and each database instruction
Modification.Transaction journal is the significant components of database, can be according to transaction journal logarithm if Database Systems break down
Recovered according to storehouse.
Transaction journal is vital for database, but in the prior art for the protection of transaction journal
Deficiency, if transaction journal is illegally distorted, transaction journal will be caused to lose its original effect, event occur in Database Systems
During barrier, database can not be recovered according to transaction journal.
The content of the invention
It is a primary object of the present invention to provide a kind of data base management method based on block chain, device and storage to be situated between
Matter, it is intended to solve the technical problem of the protection deficiency for transaction journal in the prior art.
To achieve the above object, the present invention provides a kind of data base management method based on block chain, described to be based on block
The data base management method of chain includes:
Database instruction is received, the database instruction is sent to corresponding database, receives the corresponding data
The return message in storehouse;
The database instruction or the block chain equivalent with database instruction instruction are distributed to based on block chain
Decentralization system.
Preferably, it is described by the database instruction or the block chain equivalent with the database instruction instruction be distributed to base
Include after the decentralization system of block chain:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, the return message of the decentralization system based on block chain is received.
Preferably, it is described by the database instruction or the block chain equivalent with the database instruction instruction be distributed to base
Include in the decentralization system of block chain:
Whether the type for detecting the database instruction belongs to target type, if the type of the database instruction belongs to mesh
Type is marked, then the database instruction or the block chain equivalent with database instruction instruction are distributed to based on block chain
Decentralization system.
Preferably, the data base management method based on block chain also includes:
The command field included in the database instruction is obtained, it is corresponding that the command field is obtained from preset mapping table
Universal field;
The command field included in the database instruction is replaced with into the universal field, obtains referring to the database
Equivalent block chain is made to instruct.
Preferably, it is described by the database instruction or the block chain equivalent with the database instruction instruction be distributed to base
Include after the decentralization system of block chain:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, receive the interface message of the decentralization system feedback based on block chain, by interface message with
Database Identification association is preserved to preset memory areas domain corresponding to the database instruction.
Preferably, the data base management method based on block chain also includes:
When receiving database recovery instruction, Database Identification corresponding to the database recovery instruction is obtained;
Interface message group corresponding to the Database Identification is obtained from the preset memory areas domain, is obtained in block chain
Database instruction corresponding to each interface message or the block chain equivalent with the database instruction refer in the interface message group
Order, obtains database instruction group or block chain instruction group;
Line number is entered to database corresponding to the Database Identification according to the database instruction group or block chain instruction group
Recover according to storehouse.
Preferably, the data base management method based on block chain also includes:
Data verification instruction is received, object to be verified corresponding to data verification instruction is obtained, from database described in acquisition
The current storage status of object to be verified;
Database instruction corresponding to the object to be verified or equivalent with the database instruction is obtained from block chain
Block chain instructs, and is obtained according to the database instruction or the block chain instruction equivalent with the database instruction described to be verified
The benchmark storage state of object;
The validity of the current storage status is verified according to the benchmark storage state.
Preferably, it is described to verify that the validity of the current storage status includes according to the benchmark storage state:
Detect the current storage status and whether the benchmark storage state is consistent;
If current storage status is consistent with the benchmark storage state, the first prompt message is exported, it is current to prompt
Storage state is effective;
If current storage status and the benchmark storage state are inconsistent, the second prompt message is exported, to prompt to work as
Preceding storage state is invalid.
In addition, to achieve the above object, the present invention also provides a kind of data bank management device based on block chain, its feature
It is, the data bank management device based on block chain includes:Memory, processor and it is stored on the memory and can
The data base administrator based on block chain run on the processor, the data base administrator based on block chain
The step of data base management method as described above based on block chain is realized during the computing device.
In addition, to achieve the above object, the present invention also provides a kind of computer-readable recording medium, described computer-readable
The data base administrator based on block chain is stored with storage medium, the data base administrator based on block chain is located
Manage the step of realizing the data base management method as described above based on block chain when device performs.
In the present invention, when receiving database instruction, the database instruction is sent to corresponding database, further
, the database instruction or the block chain equivalent with database instruction instruction are distributed to the decentralization system based on block chain
System.Pass through the present invention, without being again Database transaction journal, the institute being stored in the decentralization system based on block chain
There are database instruction or the block chain equivalent with database instruction instruction to constitute the transaction journal of database, based on block chain
Tamper-proof mechanisms, it ensure that the transaction journal can not be distorted illegally, improve the safety and reliability of database.
Brief description of the drawings
Fig. 1 is the apparatus structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to;
Fig. 2 is the schematic flow sheet of the data base management method first embodiment of the invention based on block chain;
Fig. 3 is the schematic diagram of a scenario of data base management method one embodiment of the invention based on block chain.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in figure 1, Fig. 1 is the apparatus structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to.
Device of the embodiment of the present invention can be PC, can also the terminal device such as tablet personal computer, pocket computer.
As shown in figure 1, the device can include:Processor 1001, such as CPU, network interface 1004, user interface
1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used to realize the connection communication between these components.
User interface 1003 can include display screen (Display), input block such as keyboard (Keyboard), optional user interface
1003 can also include wireline interface, the wave point of standard.Network interface 1004 can optionally connect including the wired of standard
Mouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or stable memory
(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
Alternatively, device can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio
Circuit, WiFi module etc..Wherein, sensor ratio such as optical sensor, motion sensor and other sensors.Specifically, light
Sensor may include ambient light sensor and proximity transducer, wherein, ambient light sensor can according to the light and shade of ambient light come
The brightness of display screen is adjusted, proximity transducer can close display screen and/or backlight when mobile terminal is moved in one's ear.As
One kind of motion sensor, gravity accelerometer can detect in all directions the size of (generally three axles) acceleration, quiet
Size and the direction of gravity are can detect that when only, the application available for identification mobile terminal posture is (such as horizontal/vertical screen switching, related
Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match somebody with somebody
The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared ray sensor are put, will not be repeated here.
It will be understood by those skilled in the art that the restriction of the apparatus structure shown in Fig. 1 not structure twin installation, can be wrapped
Include than illustrating more or less parts, either combine some parts or different parts arrangement.
As shown in figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network
Believe module, Subscriber Interface Module SIM and the data base administrator based on block chain.
In the device shown in Fig. 1, network interface 1004 is mainly used in connecting background server, is carried out with background server
Data communicate;User interface 1003 is mainly used in connecting client (user terminal), enters row data communication with client;And processor
1001 can be used for calling the data base administrator based on block chain stored in memory 1005, and perform following operate:
Database instruction is received, the database instruction is sent to corresponding database, receives the corresponding data
The return message in storehouse;
The database instruction or the block chain equivalent with database instruction instruction are distributed to based on block chain
Decentralization system.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, the return message of the decentralization system based on block chain is received.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
Whether the type for detecting the database instruction belongs to target type, if the type of the database instruction belongs to mesh
Type is marked, then the database instruction or the block chain equivalent with database instruction instruction are distributed to based on block chain
Decentralization system.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
The command field included in the database instruction is obtained, it is corresponding that the command field is obtained from preset mapping table
Universal field;
The command field included in the database instruction is replaced with into the universal field, obtains referring to the database
Equivalent block chain is made to instruct.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, receive the interface message of the decentralization system feedback based on block chain, by interface message with
Database Identification association is preserved to preset memory areas domain corresponding to the database instruction.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
When receiving database recovery instruction, Database Identification corresponding to the database recovery instruction is obtained;
Interface message group corresponding to the Database Identification is obtained from the preset memory areas domain, is obtained in block chain
Database instruction corresponding to each interface message or the block chain equivalent with the database instruction refer in the interface message group
Order, obtains database instruction group or block chain instruction group;
Line number is entered to database corresponding to the Database Identification according to the database instruction group or block chain instruction group
Recover according to storehouse.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
Data verification instruction is received, object to be verified corresponding to data verification instruction is obtained, from database described in acquisition
The current storage status of object to be verified;
Database instruction corresponding to the object to be verified or equivalent with the database instruction is obtained from block chain
Block chain instructs, and is obtained according to the database instruction or the block chain instruction equivalent with the database instruction described to be verified
The benchmark storage state of object;
The validity of the current storage status is verified according to the benchmark storage state.
Further, processor 1001 can call the data base administration journey based on block chain stored in memory 1005
Sequence, also perform following operate:
Detect the current storage status and whether the benchmark storage state is consistent;
If current storage status is consistent with the benchmark storage state, the first prompt message is exported, it is current to prompt
Storage state is effective;
If current storage status and the benchmark storage state are inconsistent, the second prompt message is exported, to prompt to work as
Preceding storage state is invalid.
Reference picture 2, Fig. 2 are the schematic flow sheet of the data base management method first embodiment of the invention based on block chain.
In one embodiment, the data base management method based on block chain includes:
Step S10, database instruction is received, the database instruction is sent to corresponding database, it is described right to receive
The return message for the database answered, such as command operating are successfully;
Step S20, the database instruction or the block chain equivalent with database instruction instruction are distributed to and be based on
The decentralization system of block chain.
Reference picture 3, Fig. 3 are the schematic diagram of a scenario of data base management method one embodiment of the invention based on block chain.This
In embodiment, database instruction can issue corresponding program by some specific application, then be referred to the database by program
Order is sent to corresponding database, and the database instruction or the block chain equivalent with database instruction instruction are distributed to and be based on
The decentralization system of block chain.Wherein, program can be the program independently of the concrete application, can also be whole with concrete application
Close.Program or program and application integrate can be block chain node, or with some node communication in block chain, for establishing
With the communication connection of the decentralization system based on block chain.Program or program can also associate multiple data with the integration applied
Storehouse.
In the present embodiment, database instruction is for example:Database password modification instruction, data screening instruction, data insertion refer to
Make, data delete instruction, data more new command, data query instruct etc..Reduced or expanded with specific reference to being actually needed,
This is not restricted.
In the present embodiment, for block chain narrow sense, block chain is one kind sequentially in time by data block with suitable
A kind of linked data structure that the connected mode of sequence is combined into, and can not distorting of being ensured in a manner of cryptography and can not forge
Distributed account book.Broadly, block chain technology be using block linked data structure come verify with data storage, utilize distribution
Node common recognition algorithm ensure to generate and update the data, using the mode of cryptography data transfer and access safety, using by
Automatized script code composition intelligent contract come program and a kind of brand-new distributed basis framework of operation data with calculate
Normal form.
On decentralization system, in the system that one is distributed with numerous nodes, each node has high degree of autonomy
Feature.It can freely be connected each other between node, form new connection unit.Any one node is all likely to become stage
Center, but do not possess enforceable center control function.Influence between node and node, it can be formed by network non-thread
Property causality.This open, flattening, the system or structure of equality, i.e. decentralization system.
, can be by database instruction when program or program associate multiple databases with the integration applied in the present embodiment
Field extension is carried out, the field of increase mark disparate databases, when receiving database instruction, obtains the database instruction pair
The Database Identification (Database Identification is used to indicate database corresponding to the database instruction) answered, then by the database instruction
Send to database corresponding to the Database Identification, the database instruction be distributed to the decentralization system based on block chain,
The command field (database instruction includes command field i.e. data field) in the database instruction is either obtained, is reflected preset
Universal field corresponding to look-up command field in firing table, and command field is replaced with into universal field, data field is constant, obtains
The block chain instruction equivalent with the database instruction, block chain instruction is distributed to the decentralization system based on block chain.
Such as the instruction of one piece of data storehouse is " insert into tables of data (field 1, field 2, field 3 ...) values (value 1, value 2, value
3 ...) ", wherein command field is the command field " insert in " insert into ... values ... " preset mapping table
Universal field corresponding into ... values ... " is " insertion ... value ... ", after command field is replaced with into universal field, is obtained
The instruction of block chain is " insertion tables of data (field 1, field 2, field 3 ...) value (value 1, value 2, value 3 ...) ".Compiled using different language
The command field write, if the implication represented is consistent, same universal field is corresponded in preset mapping table.So that the present invention program
The database instruction of compatible a variety of different languages, and different databases is entered on block chain using same all-purpose language
Row inquiry or checking.
In the present embodiment, because some database instructions will not be modified to the data in database, such as one is looked into
Instruction is ask, if the database instruction received is query statement, center is gone based on block chain without the instruction is distributed to
Change system.Therefore, the field of database instruction can be extended, increases the field of instruction type, referred to receiving database
After order, the field can be first passed through the type of database instruction is judged, if the type of database instruction belongs to target type,
Step S20 is then performed, in the present embodiment, target type can include:Data delete instruction, the newly-increased instruction of data, data insertion
Instruction etc. can cause the set for the instruction that database data changes.For example, data delete instruction, the newly-increased instruction of data,
Data inserting instruction etc. can cause to increase field " a " in the instruction that database data is changed, if receiving database instruction
Afterwards, detect that database instruction includes field " a ", then judge that the database instruction belongs to target type.Either, number is extracted
The respective life of instruction that according to instruction, data newly-increased instruction, data inserting instruction etc. is deleted database data can be caused to change
Field is made, obtains the set of command field, after database instruction is received, if the command field of the database instruction is order
One kind in set of fields, then judge the database instruction for target type.
In the present embodiment, when receiving database instruction, the database instruction is sent to corresponding database, enters one
Step, the database instruction or the block chain equivalent with database instruction instruction are distributed to the decentralization based on block chain
System.By the present embodiment, without being again Database transaction journal, it is stored in the decentralization system based on block chain
All database instructions or the block chain equivalent with database instruction instruction constitute the transaction journal of database, based on block
The tamper-proof mechanisms of chain, it ensure that the transaction journal can not be distorted illegally, improve the safety and reliability of database.
Further, in data base management method one embodiment of the invention based on block chain, include after step S20:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, the return message of the decentralization system based on block chain is received.
In the present embodiment, when database instruction or the block chain equivalent with database instruction instruction are gone based on block chain
After being included successfully on centralized system, the return message of the decentralization system feedback based on block chain can be received, by this
Return message, inform user this time database instruction or the block chain equivalent with database instruction instruction with successfully include to based on
The decentralization system of block chain.On the concrete implementation mode of the program, database provided by the present invention can realized
The design that the program of management method returns to message sink with carrying out block chain in the interface of block chain, by the return message of block chain
It is sent into described program;Or extension is realized in the program of data base management method provided by the present invention and the interface of database
Hold, it is received the message returned from block chain.
Further, in data managing method one embodiment of the invention based on block chain, step S20 includes:
Whether the type for detecting the database instruction belongs to target type, if the type of the database instruction belongs to mesh
Type is marked, then the database instruction or the block chain equivalent with database instruction instruction are distributed to based on block chain
Decentralization system.
In the present embodiment, because some database instructions will not be modified to the data in database, such as one is looked into
Instruction is ask, if the database instruction received is query statement, center is gone based on block chain without the instruction is distributed to
Change system.Therefore, the field of database instruction can be extended, increases the field of instruction type, referred to receiving database
After order, the field can be first passed through the type of database instruction is judged, if the type of database instruction belongs to target type,
Step S20 is then performed, in the present embodiment, target type can include:Data delete instruction, the newly-increased instruction of data, data insertion
Instruction etc. can cause the set for the instruction that database data changes.For example, data delete instruction, the newly-increased instruction of data,
Data inserting instruction etc. can cause to increase field " a " in the instruction that database data is changed, if receiving database instruction
Afterwards, detect that database instruction includes field " a ", then judge that the database instruction belongs to target type.Either, number is extracted
The respective life of instruction that according to instruction, data newly-increased instruction, data inserting instruction etc. is deleted database data can be caused to change
Field is made, obtains the set of command field, after database instruction is received, if the command field of the database instruction is order
One kind in set of fields, then judge the database instruction for target type.The instruction type that specific target type includes can
Reduced or expanded according to being actually needed.
In the present embodiment, only when database instruction is target type, it can just perform database instruction or database
Equivalent block chain is instructed to instruct the step of being distributed to the decentralization system based on block chain, some will not cause database number
It just will not be distributed on block chain according to the database instruction of the instruction of change, such as query statement etc, avoid useless number
According to accumulation.
Further, in data managing method one embodiment of the invention based on block chain, the database based on block chain
Management method also includes:
The command field included in the database instruction is obtained, it is corresponding that the command field is obtained from preset mapping table
Universal field;
The command field included in the database instruction is replaced with into the universal field, obtains referring to the database
Equivalent block chain is made to instruct.
In the present embodiment, (database instruction is data word including command field to the command field in acquisition database instruction
Section), the universal field corresponding to look-up command field in preset mapping table, and command field is replaced with into universal field, data
Field is constant, obtains the block chain instruction equivalent with the database instruction, block chain instruction is distributed to based on block chain
Decentralization system.Such as the instruction of one piece of data storehouse is " insert into tables of data (field 1, field 2, field 3 ...)
Values (value 1, value 2, value 3 ...) ", wherein command field are the life in " insert into ... values ... " preset mapping table
Universal field corresponding to field " insert into ... values ... " is made to be replaced with command field logical for " insertion ... value ... "
After field, obtained block chain instruction is " insertion tables of data (field 1, field 2, field 3 ...) value (value 1, value 2, value
3…)”.The command field write using different language, if the implication represented is consistent, corresponded in preset mapping table same logical
Use field.So that the database instruction of the compatible a variety of different languages of the present invention program.
Further, in data managing method one embodiment of the invention based on block chain, include after step S20:
When the database instruction or the block chain equivalent with database instruction instruction are in going based on block chain
After being included successfully in heart system, receive the interface message of the decentralization system feedback based on block chain, by interface message with
Database Identification association is preserved to preset memory areas domain corresponding to the database instruction.
In the present embodiment, when database instruction or the block chain equivalent with database instruction instruction are gone based on block chain
After being included successfully on centralized system, the interface message of block chain feedback can be received, interface message includes this issue behavior
Corresponding block height, Address-Hash value, block cryptographic Hash, the transaction message such as cryptographic Hash or ipv4 addresses, so think afterwards
When transferring this time database instruction of issue or the block chain equivalent with database instruction instruction, input in above-mentioned interface message
One or more, you can obtained in block chain this database instruction or the block chain equivalent with database instruction instruction.
The interface message received Database Identification corresponding with database instruction is stored in the data administrator based on block chain
Memory in or the memory of other associate devices in., can in order to ensure the security of interface message storage in the present embodiment
To be stored in a manner of encryption, as storage region sets password, and preset storage can just be got by only inputting correct password
The interface message and Database Identification of preservation are associated in region, preset memory areas domain can be divided into polylith, and each piece with corresponding number
Identify and name according to storehouse.Subsequently, when if desired acquisition is sent to all database instructions of some database, in the database pair
The interface message of storage is obtained in the storage region answered, obtained according to interface message on block chain corresponding to database instruction or
The equivalent block chain instruction of database instruction.
Further, in data managing method one embodiment of the invention based on block chain, the database based on block chain
Management method also includes:
When receiving database recovery instruction, Database Identification corresponding to the database recovery instruction is obtained;
Interface message group corresponding to the Database Identification is obtained from the preset memory areas domain, is obtained in block chain
Database instruction corresponding to each interface message or the block chain equivalent with the database instruction refer in the interface message group
Order, obtains database instruction group or block chain instruction group;
Line number is entered to database corresponding to the Database Identification according to the database instruction group or block chain instruction group
Recover according to storehouse.
In the prior art, in data tool backup method, a kind of mode is transaction log backup.Transaction journal is one independent
File, the change of its database of record only needs when backup to replicate and changed since Last Backup to what data place was done
Become.When carrying out database recovery, be combined using complete DB Backup and transaction journal, can make a database or
The selected table space of person returns to some particular point in time.If all daily records text when breaking down is played from backup time
If part can obtain, then the random time point covered in daily record can be returned to.
In the present embodiment, the thing of the database instruction group or block chain instruction group that are stored in block chain equivalent to database
Business daily record.When receiving database recovery instruction, Database Identification corresponding to database recovery instruction is obtained, that is, determines to need
The database to be recovered.Then piecemeal corresponding to the Database Identification is found in the domain of preset memory areas, is obtained from the piecemeal
(storage region carries out piecemeal to interface message group with Database Identification, and the number is stored with piecemeal corresponding to each Database Identification
According to storehouse identify corresponding to total interface information).Data corresponding to each interface message in interface message group are obtained in block chain
The block chain instruction that storehouse instructs or database instruction is equivalent, obtain database instruction group and (be reduced into the instruction of each block chain pair
The database instruction answered, obtain database instruction group), that is, obtain transaction journal corresponding to the database.Then according to the data
Storehouse instruction group and advance DB Backup (when can be that the database is just established, be once backed up to database, obtained in advance
DB Backup) database is recovered.
In the present embodiment, in view of the mechanism that block chain is anti-tamper, the database instruction group obtained from block chain is complete
Reliably, recover available for database, improve the safety and reliability of database data storage.
Further, in data managing method one embodiment of the invention based on block chain, the database based on block chain
Management method also includes:
Data verification instruction is received, object to be verified corresponding to data verification instruction is obtained, from database described in acquisition
The current storage status of object to be verified;
Database instruction corresponding to the object to be verified or equivalent with the database instruction is obtained from block chain
Block chain instructs, and is obtained according to the database instruction or the block chain instruction equivalent with the database instruction described to be verified
The benchmark storage state of object;
The validity of the current storage status is verified according to the benchmark storage state.
In the present embodiment, data verification is instructed for the storage to corresponding data (object i.e. to be verified) in database
Whether state correctly tests.When receiving data verification instruction, if object to be verified corresponding to data verification instruction is
A, then A current storage status is obtained from database, such as A is currently stored in database.Then using A as index,
Database instruction corresponding to A or the instruction of equivalent block chain are obtained on block chain, when multiple database instructions or equivalent being present
Block chain instructs, and the access time a data storehouse instruction nearest from current time or equivalent block chain instruct.For example, obtain
A nearest A corresponding to the implication that represents of database instruction as:Delete A.That is the benchmark storage state of A is " deletion ",
And current storage status of the A in database is " storage ", then the stored record in database of descriptions on A is invalid.
By the present embodiment, the storage state of corresponding data can be carried out according to the database instruction being stored in block chain
Detection, to the authenticity of data in validation database.
Further, in data managing method one embodiment of the invention based on block chain, shape is stored according to the benchmark
State verifies that the validity of the current storage status includes:
Detect the current storage status and whether the benchmark storage state is consistent;
If current storage status is consistent with the benchmark storage state, the first prompt message is exported, it is current to prompt
Storage state is effective;
If current storage status and the benchmark storage state are inconsistent, the second prompt message is exported, to prompt to work as
Preceding storage state is invalid.
In the present embodiment, when current storage status is consistent with benchmark storage state, then the first prompt message is exported, to carry
Show that current storage status is effective;If current storage status and benchmark storage state are inconsistent, the second prompt message is exported, to
Prompt current storage status invalid.The mode of prompting can be light, word, sound etc..Such as first prompt message to send
The voice of " effective ", the second prompt message send the voice of engineering noise, or the first prompt message sends green flicker, the
Two prompt messages send red light flicker.
In the present embodiment, the storage state of data is detected, and exports testing result, to inform customer data base
Whether middle state data memory is correct, helps user preferably to manage database.
In addition, the embodiment of the present invention also proposes a kind of computer-readable recording medium, the computer-readable recording medium
On be stored with the data base administrator based on block chain, the data base administrator based on block chain is executed by processor
The step of data base management methods of the Shi Shixian as described above based on block chain.
The specific embodiment of computer-readable recording medium of the present invention and the above-mentioned data base management method based on block chain
Each embodiment it is essentially identical, will not be described here.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or system including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or system institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Other identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone,
Computer, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair
The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.
Claims (10)
- A kind of 1. data base management method based on block chain, it is characterised in that the data base administration side based on block chain Method includes:Database instruction is received, the database instruction is sent to corresponding database, receives the corresponding database Return to message;The database instruction or the block chain equivalent with database instruction instruction are distributed in going based on block chain Heart system.
- 2. the data base management method as claimed in claim 1 based on block chain, it is characterised in that described by the database Instruction or the block chain equivalent with database instruction instruction include after being distributed to the decentralization system based on block chain:When the database instruction or the block chain equivalent with database instruction instruction are in the decentralization based on block chain After being included successfully in system, the return message of the decentralization system based on block chain is received.
- 3. the data base management method as claimed in claim 1 based on block chain, it is characterised in that described by the database Instruction or the block chain equivalent with database instruction instruction are distributed to the decentralization system based on block chain and included:Whether the type for detecting the database instruction belongs to target type, if the type of the database instruction belongs to target class Type, then the database instruction or the block chain equivalent with database instruction instruction are distributed in going based on block chain Heart system.
- 4. the data base management method as claimed in claim 1 based on block chain, it is characterised in that described based on block chain Data base management method also includes:The command field included in the database instruction is obtained, obtains from preset mapping table and leads to corresponding to the command field Use field;The command field included in the database instruction is replaced with into the universal field, obtain with the database instruction etc. The block chain instruction of effect.
- 5. the data base management method as claimed in claim 1 based on block chain, it is characterised in that described by the database Instruction or the block chain equivalent with database instruction instruction include after being distributed to the decentralization system based on block chain:When the database instruction or the block chain equivalent with database instruction instruction are in the decentralization based on block chain After being included successfully in system, receive the interface message of the decentralization system feedback based on block chain, by interface message with it is described Database Identification association is preserved to preset memory areas domain corresponding to database instruction.
- 6. the data base management method as claimed in claim 5 based on block chain, it is characterised in that described based on block chain Data base management method also includes:When receiving database recovery instruction, Database Identification corresponding to the database recovery instruction is obtained;Interface message group corresponding to the Database Identification is obtained from the preset memory areas domain, in block chain described in acquisition Database instruction corresponding to each interface message or the block chain equivalent with database instruction instruction, are obtained in interface message group To database instruction group or block chain instruction group;Database is carried out to database corresponding to the Database Identification according to the database instruction group or block chain instruction group Recover.
- 7. the data base management method based on block chain as any one of claim 1 to 6, it is characterised in that described Data base management method based on block chain also includes:Data verification instruction is received, object to be verified corresponding to acquisition data verification instruction, is obtained from database described to be tested Demonstrate,prove the current storage status of object;Database instruction or the block equivalent with the database instruction corresponding to the object to be verified are obtained from block chain Chain is instructed, and the object to be verified is obtained according to the database instruction or the block chain instruction equivalent with the database instruction Benchmark storage state;The validity of the current storage status is verified according to the benchmark storage state.
- 8. the data base management method as claimed in claim 6 based on block chain, it is characterised in that described according to the benchmark Storage state verifies that the validity of the current storage status includes:Detect the current storage status and whether the benchmark storage state is consistent;If current storage status is consistent with the benchmark storage state, the first prompt message is exported, it is currently stored to prompt State is effective;If current storage status and the benchmark storage state are inconsistent, the second prompt message is exported, to prompt currently to deposit Storage state is invalid.
- A kind of 9. data bank management device based on block chain, it is characterised in that the data base administration dress based on block chain Put including:Memory, processor and be stored on the memory and can run on the processor based on block chain Data base administrator, the data base administrator based on block chain are realized such as claim during the computing device The step of data base management method based on block chain any one of 1 to 8.
- 10. a kind of computer-readable recording medium, it is characterised in that be stored with the computer-readable recording medium based on area The data base administrator of block chain, realize that right such as will when the data base administrator based on block chain is executed by processor The step of seeking the data base management method based on block chain any one of 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710885372.0A CN107766453A (en) | 2017-09-26 | 2017-09-26 | Data base management method, device and storage medium based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710885372.0A CN107766453A (en) | 2017-09-26 | 2017-09-26 | Data base management method, device and storage medium based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107766453A true CN107766453A (en) | 2018-03-06 |
Family
ID=61266574
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710885372.0A Pending CN107766453A (en) | 2017-09-26 | 2017-09-26 | Data base management method, device and storage medium based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107766453A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108959591A (en) * | 2018-07-11 | 2018-12-07 | 物数(上海)信息科技有限公司 | Method, system, equipment and the storage medium that database and block chain integrate |
CN110134671A (en) * | 2019-05-21 | 2019-08-16 | 北京物资学院 | A kind of block chain database data management system and method towards application of tracing to the source |
CN110633389A (en) * | 2018-05-31 | 2019-12-31 | 阿里巴巴集团控股有限公司 | Processing method, device and system of block chain data and electronic equipment |
CN111666582A (en) * | 2019-03-08 | 2020-09-15 | 深圳市网安计算机安全检测技术有限公司 | Data cleaning method, device and equipment based on block chain and storage medium |
WO2021000494A1 (en) * | 2019-07-04 | 2021-01-07 | 平安科技(深圳)有限公司 | Blockchain-based operation logging method and apparatus, device, and storage medium |
CN114168685A (en) * | 2021-12-15 | 2022-03-11 | 北京天德科技有限公司 | Novel database architecture based on block chain system and operation method |
CN114579581A (en) * | 2022-05-05 | 2022-06-03 | 武汉北大高科软件股份有限公司 | Data supervision method and device based on block chain |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130205362A1 (en) * | 2012-02-03 | 2013-08-08 | Apple Inc. | Centralized operation management |
CN106383754A (en) * | 2016-09-19 | 2017-02-08 | 北京众享比特科技有限公司 | Database backup and recovery system based on block chain technology, and database backup method based on block chain technology, and database recovery method based on block chain technology |
CN106611061A (en) * | 2016-12-29 | 2017-05-03 | 北京众享比特科技有限公司 | Database write-in method and system based on block chain network |
CN106776894A (en) * | 2016-11-29 | 2017-05-31 | 北京众享比特科技有限公司 | Log database system and synchronous method |
-
2017
- 2017-09-26 CN CN201710885372.0A patent/CN107766453A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130205362A1 (en) * | 2012-02-03 | 2013-08-08 | Apple Inc. | Centralized operation management |
CN106383754A (en) * | 2016-09-19 | 2017-02-08 | 北京众享比特科技有限公司 | Database backup and recovery system based on block chain technology, and database backup method based on block chain technology, and database recovery method based on block chain technology |
CN106776894A (en) * | 2016-11-29 | 2017-05-31 | 北京众享比特科技有限公司 | Log database system and synchronous method |
CN106611061A (en) * | 2016-12-29 | 2017-05-03 | 北京众享比特科技有限公司 | Database write-in method and system based on block chain network |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110633389A (en) * | 2018-05-31 | 2019-12-31 | 阿里巴巴集团控股有限公司 | Processing method, device and system of block chain data and electronic equipment |
CN108959591A (en) * | 2018-07-11 | 2018-12-07 | 物数(上海)信息科技有限公司 | Method, system, equipment and the storage medium that database and block chain integrate |
CN111666582A (en) * | 2019-03-08 | 2020-09-15 | 深圳市网安计算机安全检测技术有限公司 | Data cleaning method, device and equipment based on block chain and storage medium |
CN110134671A (en) * | 2019-05-21 | 2019-08-16 | 北京物资学院 | A kind of block chain database data management system and method towards application of tracing to the source |
CN110134671B (en) * | 2019-05-21 | 2020-09-01 | 北京物资学院 | Traceability application-oriented block chain database data management system and method |
WO2021000494A1 (en) * | 2019-07-04 | 2021-01-07 | 平安科技(深圳)有限公司 | Blockchain-based operation logging method and apparatus, device, and storage medium |
CN114168685A (en) * | 2021-12-15 | 2022-03-11 | 北京天德科技有限公司 | Novel database architecture based on block chain system and operation method |
CN114579581A (en) * | 2022-05-05 | 2022-06-03 | 武汉北大高科软件股份有限公司 | Data supervision method and device based on block chain |
CN114579581B (en) * | 2022-05-05 | 2022-08-30 | 武汉北大高科软件股份有限公司 | Data supervision method and device based on block chain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107766453A (en) | Data base management method, device and storage medium based on block chain | |
US10419427B2 (en) | Authenticating identity for password changes | |
CN107704770A (en) | Sensitive information desensitization method, system, equipment and readable storage medium storing program for executing | |
Shi et al. | Implicit authentication through learning user behavior | |
CN109450649A (en) | Gateway verification method and device based on application program interface and electronic equipment | |
CN106888087B (en) | A kind of method and apparatus of management certificate | |
CN107612695A (en) | Knowledge management method, terminal and server based on block chain | |
CN108009825A (en) | A kind of identity management system and method based on block chain technology | |
CN111475841A (en) | Access control method, related device, equipment, system and storage medium | |
US20190342753A1 (en) | Device configuration method, apparatus and system | |
US9565562B1 (en) | Knowledge based authentication using mobile devices | |
CN109993524A (en) | Card certificate management method, device, equipment and computer readable storage medium | |
CN109597822A (en) | A kind of storage of user data and querying method and user data processing unit | |
CN108256303A (en) | Electronic device, auth method and storage medium | |
CN109669717A (en) | Data processing method, device, equipment and storage medium based on deployment platform | |
CN108416226A (en) | Right management method, device and the computer readable storage medium of block chain | |
CN108289129A (en) | Block chain ecological environment creation method, system and computer readable storage medium | |
CN104917796A (en) | Credit account creating method, system and method | |
CN110201400A (en) | Game item method of commerce, transaction terminal and storage medium based on block chain | |
WO2009051336A1 (en) | Apparatus and method for managing terminal users | |
CN107133507A (en) | A kind of privacy services system access method, device and mobile terminal | |
CN109451503A (en) | A kind of offline user authentication state maintaining method and system | |
KR20200053239A (en) | Electronic device and method of providing personal information, and computer-readable recording medium recording the same | |
CN109088914A (en) | Generation method, the block chain ecosystem and the computer readable storage medium of block | |
JP5475226B2 (en) | External sales support system and method |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180306 |