CN110059092A - The method for writing data and system of relevant database based on block chain - Google Patents
The method for writing data and system of relevant database based on block chain Download PDFInfo
- Publication number
- CN110059092A CN110059092A CN201910323480.8A CN201910323480A CN110059092A CN 110059092 A CN110059092 A CN 110059092A CN 201910323480 A CN201910323480 A CN 201910323480A CN 110059092 A CN110059092 A CN 110059092A
- Authority
- CN
- China
- Prior art keywords
- transaction
- data
- transaction data
- transaction information
- block chain
- 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/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses the method for writing data and system of a kind of relevant database based on block chain, this method comprises: obtaining Transaction Information when listening in block chain the Transaction Information that node of endorsing generates;Service channel mark, chain code mark and version identifier are extracted, from Transaction Information to set corresponding transaction data table name;There are when transaction data table name, extracting user metadata and transaction metadata from Transaction Information and being combined into the first transaction data in inquiring relevant database, the first transaction data is written in corresponding transaction data table;When transaction data table name being not present in inquiring relevant database, user metadata and transaction metadata are extracted from Transaction Information and generates gauge outfit and the second transaction data;According in the transaction data table that gauge outfit creates new transaction data table and creates the write-in of the second transaction data.The method for writing data and system can promote efficiency data query, and the data in block chain can be docked to application layer.
Description
Technical field
The present invention relates to technical field of data processing more particularly to a kind of data of the relevant database based on block chain
Wiring method.
Background technique
In block chain technology, data generate and are superimposed to form chain type one by one according to chronological order with the formation of block
Data structure, each block have recorded the Transaction Information occurred the corresponding time.Since block chain is carried out based on file system
Storage, data are stored in the form of key-value pair, because without supporting to patrol the inquiry of part specified conditions or complexity
The inquiry collected.Further, since application layer carries out the processing of data using relational data model substantially, and block chain is used
Data model be key-value pair Key-Value model, the data model of the two is different, so that the data of block chain can not be docked to
In application layer.Thus, existing block chain has that search efficiency is low and can not be docked to application layer.
Summary of the invention
In view of the above-mentioned problems, a kind of method for writing data of relevant database based on block chain of the invention and being
System, can effectively promote efficiency data query, and the data in block chain can be docked to application layer, promote application layer data
Safety.
In order to solve the above technical problems, a kind of data write-in side of relevant database based on block chain of the invention
Method includes the following steps:
When listening in block chain the Transaction Information that node of endorsing generates, the Transaction Information is obtained;
Service channel mark, chain code mark and version identifier are extracted from the Transaction Information;
According to service channel mark, chain code mark and the version identifier, corresponding transaction data table is set
Name;
There are in the case where the transaction data table name in inquiring relevant database, mentioned from the Transaction Information
It takes user metadata and transaction metadata and is combined into the first transaction data, the correspondence is written into first transaction data
Transaction data table in;
In the case where the transaction data table name is not present in inquiring the relevant database, then from the transaction
User metadata and transaction metadata are extracted in information and generate table name, gauge outfit and the second transaction data;
New transaction data table is created according to the table name and the gauge outfit, and second transaction data is written and is created
Transaction data table in.
As an improvement of the above scheme, it endorses in listening to block chain before the Transaction Information that node generates, further includes
Following steps:
Endorsement carried out to transaction by the endorsement node or the endorsement node is restarted and triggered to the back
The monitoring of book node.
As an improvement of the above scheme, further include following steps after the endorsement node is restarted:
The transaction data in the Transaction Information and the relevant database in the block chain is obtained respectively;
The Transaction Information and the transaction data are compared;
When the Transaction Information is consistent with the transaction data, continue to monitor;
In the Transaction Information and the inconsistent transaction data, obtain in the block chain with the transaction data not
Consistent Transaction Information;
Service channel mark, chain code mark and version identifier are extracted, from the inconsistent Transaction Information to be handed over
Easy data table name inquiry, and then the write-in of the inconsistent Transaction Information is completed, realize the synchronized update of data.
As an improvement of the above scheme, the method for writing data further includes following steps:
When receiving the transaction data inquiry instruction of client initiation, weighed according to the user carried in the inquiry instruction
Limit information carries out authentication;
In the case where determining the user right is to have to read permission, Xiang Suoshu client returns to query result.
In order to solve the above technical problems, the present invention also provides a kind of write-ins of the data of relevant database based on block chain
System, comprising:
Module is monitored, for when the Transaction Information of endorsement node generation, obtaining the transaction letter in listening to block chain
Breath;
Data extraction module, for extracting service channel mark, chain code mark and version identifier from the Transaction Information;
Data table name setting module, for being identified according to the service channel, the chain code identifies and the version identifier,
Set corresponding transaction data table name;
Data write. module, in inquiring relevant database there are in the case where the transaction data table name,
User metadata and transaction metadata are extracted from the Transaction Information and is combined into the first transaction data, and described first is handed over
Easy data are written in the corresponding transaction data table;
Data generation module, for the feelings of the transaction data table name to be not present in inquiring the relevant database
Under condition, then user metadata and transaction metadata are extracted from the Transaction Information to generate table name, gauge outfit and the second number of deals
According to;
Tables of data creates module, for creating new transaction data table according to the table name and the gauge outfit, and will be described
In the newly-built transaction data table of second transaction data write-in.
As an improvement of the above scheme, the data writing systems further include:
Trigger module is monitored, before the Transaction Information that node generates of endorsing in listening to block chain, by described
Endorsement node to transaction carry out endorsement or it is described endorsement node restart trigger to it is described endorse node monitoring.
As an improvement of the above scheme, the data writing systems further include:
Data obtaining module, for obtaining the friendship in the block chain respectively after the endorsement node is restarted
Transaction data in easy information and the relevant database;
Information contrast module is believed for the Transaction Information and the transaction data to be compared, and in the transaction
When ceasing consistent with the transaction data, continue to monitor;And in the Transaction Information and the inconsistent transaction data, obtain
The Transaction Information inconsistent with the transaction data in the block chain;
Data simultaneous module, for from the inconsistent Transaction Information extract service channel mark, chain code mark and
Version identifier to carry out transaction data table name inquiry, and then completes the write-in of the inconsistent Transaction Information, realizes data
Synchronized update.
As an improvement of the above scheme, the data writing systems further include:
Authentication module, for receive client initiation transaction data inquiry instruction when, according to the inquiry
The user right information carried in instruction carries out authentication;
Query result return module, for determine the user right be have read permission in the case where, Xiang Suoshu
Client returns to query result.
Compared with prior art, data read-write method of the invention and system, since node of endorsing in block chain generates
A identical Transaction Information is obtained when Transaction Information, thus can be extracted from the Transaction Information such as service channel mark, chain
Code mark, version identifier, user metadata and transaction metadata crucial transaction data;And by utilizing service channel mark
Know, chain code mark and version identifier determine unique transaction data table name corresponding with Transaction Information, being capable of further root
It is inquired according to transaction data table name with the presence or absence of corresponding transaction data table in relevant database, to complete transaction data
Write-in or transaction data table it is newly-built so that the crucial transaction data in block chain is carried out in the form of relational data model
Synchronous storage is completed by will pass through in inquiry relevant database in a manner of transaction data to transaction data crucial in block chain
The inquiry of specified conditions or the inquiry of complex logic are carried out, the inquiry velocity and inquiry to data in block chain can be effectively promoted
Efficiency.In addition, since the crucial transaction data in block chain can be written in relevant database by the method for writing data,
And relevant database can be interfaced directly in application layer, so that the data in block chain can be by between the relevant database
Connect and be docked to application layer, so can make full use of block chain decentralization and data can not tamper guarantee application layer data
Safety.Furthermore the method for writing data is handed over by extracting the crucial transaction data of the Transaction Information in block chain to be formed
Easy tables of data can avoid that redundant data is written in relevant database, and data redudancy is low, avoid occupying excessive storage
Space.
Detailed description of the invention
Fig. 1 is a kind of process of the method for writing data of relevant database based on block chain of the embodiment of the present invention 1
Schematic diagram.
Fig. 2 is the stream of the method for writing data of another relevant database based on block chain of the embodiment of the present invention 1
Journey schematic diagram.
Fig. 3 is a kind of process of the method for writing data of relevant database based on block chain of the embodiment of the present invention 2
Schematic diagram.
Fig. 4 is a kind of structure of the data writing systems of relevant database based on block chain of the embodiment of the present invention 3
Schematic diagram.
Specific embodiment
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention.But the present invention can be with
It is different from the other modes of this description much to implement, those skilled in the art can be without violating the connotation of the present invention
Similar popularization is done, therefore the present invention is not limited by the specific embodiments disclosed below.
Clear, complete description is carried out to technical solution of the present invention with attached drawing combined with specific embodiments below.
Referring to Figure 1, be the embodiment of the present invention 1 a kind of relevant database based on block chain method for writing data
Flow diagram.
As shown in Figure 1, the method for writing data includes the following steps:
S101, when listen in block chain endorse node generate Transaction Information when, obtain the Transaction Information;
As shown in Fig. 2, further including following steps before step S1:
S100, endorsement is carried out to transaction by the endorsement node or the endorsement node is restarted and triggered to institute
State the monitoring of endorsement node.
Wherein, monitoring for endorsement node can be carried out by way of starting agency service on endorsement node, and
Relevant database in method for writing data can also be deployed on endorsement node.
S102, service channel mark, chain code mark and version identifier are extracted from the Transaction Information;
S103, according to the service channel mark, the chain code mark and the version identifier, set corresponding number of deals
According to table name;
In step s 103, transaction data table name can be by being set as " service channel mark _ chain code mark _ version mark
Know " form realize.
S104, in inquiring relevant database there are in the case where the transaction data table name, believe from the transaction
User metadata and transaction metadata are extracted in breath and is combined into the first transaction data, and institute is written into first transaction data
It states in corresponding transaction data table;
S105, in inquiring the relevant database be not present the transaction data table name in the case where, then from institute
It states and extracts user metadata and transaction metadata in Transaction Information and generate table name, gauge outfit and the second transaction data;
Wherein, user metadata includes user's name and user certificate mark, and transaction metadata includes transaction id mark, hands over
Easy time and transaction content data, transaction content data are used to indicate the particular content of transaction.
In step s105, gauge outfit can be generated as by way of gauge outfit setting user metadata and transaction metadata.
S106, new transaction data table is created according to the table name and the gauge outfit, and second transaction data is write
Enter in newly-built transaction data table.
Compared with prior art, in method for writing data of the invention, since node of endorsing in block chain generates friendship
A identical Transaction Information is obtained when easy information, thus can be extracted from the Transaction Information such as service channel mark, chain code
Mark, version identifier, user metadata and trade metadata crucial transaction data;And by being identified using service channel,
Chain code mark and version identifier determine unique transaction data table name corresponding with Transaction Information, can be further according to friendship
Easy data table name whether there is corresponding transaction data table to inquire in relevant database, to complete the write-in of transaction data
Or transaction data table is newly-built, so that the crucial transaction data in block chain is synchronized in the form of relational data model
Storage is completed to carry out transaction data crucial in block chain will pass through in inquiry relevant database in a manner of transaction data
The inquiry of specified conditions or the inquiry of complex logic can be promoted effectively to the inquiry velocity of data in block chain and inquiry effect
Rate.In addition, since the crucial transaction data in block chain can be written in relevant database by the method for writing data, and
Relevant database can be interfaced directly in application layer, so that the data in block chain can be indirect by the relevant database
Be docked to application layer, so can make full use of block chain decentralization and data can not tamper guarantee application layer data
Safety.Furthermore the method for writing data forms transaction by extracting the crucial transaction data of the Transaction Information in block chain
Tables of data can avoid that redundant data is written in relevant database, and data redudancy is low, avoid occupying excessive storage sky
Between.
As shown in figure 3, being a kind of method for writing data of relevant database based on block chain of the embodiment of the present invention 2
Flow diagram.
As shown in figure 3, the method for writing data other than comprising the Overall Steps in embodiment 1, further includes walking as follows
It is rapid:
S200, after the endorsement node is restarted, obtain Transaction Information in the block chain and described respectively
Transaction data in relevant database;
S201, the Transaction Information and the transaction data are compared;
S202, when the Transaction Information is consistent with the transaction data, continue to monitor;
S203, in the Transaction Information and the inconsistent transaction data, obtain in the block chain with the transaction
The inconsistent Transaction Information of data;
S204, from the inconsistent Transaction Information extract service channel mark, chain code mark and version identifier, with into
The inquiry of row transaction data table name, and then the write-in of the inconsistent Transaction Information is completed, realize the synchronized update of data;
Wherein, step S204 specifically:
S2041, service channel mark, chain code mark and version identifier are extracted from the inconsistent Transaction Information, with
Set the transaction data table name of inconsistent Transaction Information;
S2042, there are the feelings of the transaction data table name of the inconsistent Transaction Information in inquiring relevant database
Under condition, user metadata and transaction metadata are extracted from the inconsistent Transaction Information and is combined into third transaction data,
The third transaction data to be written in the corresponding transaction data table;
S2043, the transaction data table that the inconsistent Transaction Information is not present in inquiring the relevant database
In the case where name, then user metadata and transaction metadata are extracted from the inconsistent Transaction Information and generates table name, table
Head and the 4th transaction data;
S2045, new transaction data table is created according to the table name and the gauge outfit, and the 4th transaction data is write
Enter in newly-built transaction data table.
In example 2, after nodes break down of endorsing is restarted, believed by the transaction in the block chain that will acquire
Breath is compared judge whether the two is consistent with the transaction data in relevant database, and under unanimous circumstances, continues
The Transaction Information generated to endorsement node is monitored, to complete the write-in of crucial transaction data in block chain;In addition, two
In the case that person is inconsistent, pass through the extraction to the crucial transaction data in inconsistent Transaction Information, setting transaction data table
Name, inquiry transaction data table name whether there is in relevant database, and then complete to hand over crucial in inconsistent Transaction Information
The write-in of easy data or newly-built transaction data table, realize data synchronization updating, improve transaction data storage in relevant database
Accuracy.
Preferably, further include following steps in the wiring method of above-mentioned data:
When receiving the transaction data inquiry instruction of client initiation, weighed according to the user carried in the inquiry instruction
Limit information carries out authentication;
In the case where determining the user right is to have to read permission, Xiang Suoshu client returns to query result, with
Complete the read operation of transaction data.
Fig. 4 is referred to, the present invention also provides a kind of knots of the data writing systems of relevant database based on block chain
Structure schematic diagram.
The data writing systems include: to monitor module 101, for endorsing what node 100 generated in listening to block chain
When Transaction Information, the Transaction Information is obtained;Data extraction module 102, for extracting service channel from the Transaction Information
Mark, chain code mark and version identifier;Data table name setting module 103, for according to service channel mark, the chain code
Mark and the version identifier, set corresponding transaction data table name;Data write. module 104, for inquiring relationship type
There are in the case where the transaction data table name in database 200, user metadata and transaction are extracted from the Transaction Information
Metadata is simultaneously combined into the first transaction data, and first transaction data is written in the corresponding transaction data table;Number
According to generation module 105, for the case where there is no the transaction data table names in inquiring the relevant database 200
Under, then user metadata and transaction metadata are extracted from the Transaction Information to generate table name, gauge outfit and the second transaction data;
Tables of data creates module 106, hands over for creating new transaction data table according to the table name and the gauge outfit, and by described second
In the newly-built transaction data table of easy data write-in.
Compared with prior art, it in data writing systems of the invention, endorses in block chain due to monitoring module 101
Node 100 obtains a identical Transaction Information when generating Transaction Information, and then can be by data extraction module 102 from the transaction
The crucial transaction data such as service channel mark, chain code mark and version identifier key transaction data is extracted in information, and
Data write. module 104 and data generation module 105 can be extracted such as from Transaction Information with metadata and transaction metadata
Crucial transaction data;And data table name setting module 103 is by utilizing service channel mark, chain code mark and version identifier
It determines unique transaction data table name corresponding with Transaction Information, can further inquire pass according to transaction data table name
It is with the presence or absence of corresponding transaction data table in type database 200, so that Data write. module 104 be made to complete writing for transaction data
Enter or data generation module 105 and tables of data create module 106 and complete the newly-built of transaction data table, so that in block chain
Crucial transaction data synchronizes storage in the form of relational data model, will pass through in inquiry relevant database 200
The mode of transaction data is completed to carry out the inquiry of specified conditions or the inquiry of complex logic to transaction data crucial in block chain,
The inquiry velocity and search efficiency to data in block chain can effectively be promoted.In addition, since the method for writing data can incite somebody to action
Crucial transaction data in block chain is written in relevant database 200, and relevant database 200 can be interfaced directly to
In application layer, so that the data in block chain can be docked to indirectly application layer by the relevant database 200, and then can be abundant
Using the decentralization of block chain and data can not tamper guarantee the safety of application layer data.Furthermore the data are written
Method forms transaction data table by extracting the crucial transaction data of the Transaction Information in block chain, can avoid in relationship type number
According to redundant data is written in library 200, data redudancy is low, avoids occupying excessive memory space.
Further, data writing systems, further includes: trigger module is monitored, for endorsing in listening to block chain
Before the Transaction Information that node generates, endorsement is carried out to transaction by the endorsement node or the endorsement node is restarted
To trigger the monitoring to the endorsement node.
Further, the data writing systems, further includes: data obtaining module, for weight to occur in the endorsement node
After opening, the transaction data in the Transaction Information and the relevant database in the block chain is obtained respectively;Information comparison
Module, for the Transaction Information and the transaction data to be compared, and in the Transaction Information and the transaction data
When consistent, continue to monitor;And in the Transaction Information and the inconsistent transaction data, obtain in the block chain with institute
State the inconsistent Transaction Information of transaction data;Data simultaneous module, for extracting business from the inconsistent Transaction Information
Gap marker, chain code mark and version identifier to carry out transaction data table name inquiry, and then complete the inconsistent transaction letter
The synchronized update of data is realized in the write-in of breath.
In this embodiment, after nodes break down of endorsing is restarted, data obtaining module obtains block chain respectively
In Transaction Information and relevant database in transaction data, and then using information contrast module by Transaction Information and number of deals
Both judge according to being compared it is whether consistent, and under unanimous circumstances, continue the Transaction Information that endorsement node is generated into
Row is monitored, to complete the write-in of crucial transaction data in block chain;In addition, in the case where the two is inconsistent, by not
Whether the extraction of the crucial transaction data in consistent Transaction Information, setting transaction data table name, inquiry transaction data table name are deposited
In relevant database, and then complete the write-in or newly-built transaction data to transaction data crucial in inconsistent Transaction Information
Table realizes data synchronization updating, improves the accuracy of transaction data storage in relevant database.
Wherein, information contrast module specifically:
Data extracting unit, for from the inconsistent Transaction Information extract service channel mark, chain code mark and
Version identifier, to set the transaction data table name of inconsistent Transaction Information;
Data write unit, for there are the numbers of deals of the inconsistent Transaction Information in inquiring relevant database
In the case where according to table name, user metadata and transaction metadata are extracted from the inconsistent Transaction Information and is combined into third
The third transaction data is written in the corresponding transaction data table transaction data;
Data generating unit, for the inconsistent Transaction Information to be not present in inquiring the relevant database
In the case where transaction data table name, then user metadata and transaction metadata and life are extracted from the inconsistent Transaction Information
At table name, gauge outfit and the 4th transaction data;
Tables of data creates unit, for creating new transaction data table according to the table name and the gauge outfit, and will be described
In the newly-built transaction data table of 4th transaction data write-in.
Preferably, the data writing systems, further includes: authentication module, in the friendship for receiving client initiation
When easy data query instruction, authentication is carried out according to the user right information carried in the inquiry instruction;Query result returns
Module is returned, in the case where determining the user right is to have to read permission, Xiang Suoshu client to return to query result.
The above described is only a preferred embodiment of the present invention, limitation in any form not is done to the present invention, therefore
All contents without departing from technical solution of the present invention, it is made to the above embodiment according to the technical essence of the invention any simply to repair
Change, equivalent variations and modification, all of which are still within the scope of the technical scheme of the invention.
Claims (8)
1. a kind of method for writing data of the relevant database based on block chain, which comprises the steps of:
When listening in block chain the Transaction Information that node of endorsing generates, the Transaction Information is obtained;
Service channel mark, chain code mark and version identifier are extracted from the Transaction Information;
According to service channel mark, chain code mark and the version identifier, corresponding transaction data table name is set;
There are in the case where the transaction data table name in inquiring relevant database, extracts and use from the Transaction Information
Family metadata and transaction metadata are simultaneously combined into the first transaction data, and the corresponding friendship is written in first transaction data
In easy tables of data;
In the case where the transaction data table name is not present in inquiring the relevant database, then from the Transaction Information
Middle extraction user metadata and transaction metadata simultaneously generate table name, gauge outfit and the second transaction data;
New transaction data table, and the friendship that second transaction data write-in is newly-built are created according to the table name and the gauge outfit
In easy tables of data.
2. method for writing data as described in claim 1, which is characterized in that endorse what node generated in listening to block chain
Further include following steps before Transaction Information:
By the endorsement node to transaction carry out endorsement or the endorsement node restart trigger to the endorsement section
The monitoring of point.
3. method for writing data as claimed in claim 2, which is characterized in that after the endorsement node is restarted, also
Include the following steps:
The transaction data in the Transaction Information and the relevant database in the block chain is obtained respectively;
The Transaction Information and the transaction data are compared;
When the Transaction Information is consistent with the transaction data, continue to monitor;
In the Transaction Information and the inconsistent transaction data, obtain inconsistent with the transaction data in the block chain
Transaction Information;
Service channel mark, chain code mark and version identifier are extracted, from the inconsistent Transaction Information to carry out number of deals
It is inquired according to table name, and then completes the write-in of the inconsistent Transaction Information, realize the synchronized update of data.
4. method for writing data as described in claim 1, which is characterized in that further include following steps:
When receiving the transaction data inquiry instruction of client initiation, believed according to the user right carried in the inquiry instruction
Breath carries out authentication;
In the case where determining the user right is to have to read permission, Xiang Suoshu client returns to query result.
5. a kind of data writing systems of the relevant database based on block chain characterized by comprising
Module is monitored, for when the Transaction Information of endorsement node generation, obtaining the Transaction Information in listening to block chain;
Data extraction module, for extracting service channel mark, chain code mark and version identifier from the Transaction Information;
Data table name setting module, for according to service channel mark, chain code mark and the version identifier, setting
Corresponding transaction data table name;
Data write. module, in inquiring relevant database there are in the case where the transaction data table name, from institute
It states and extracts user metadata and transaction metadata in Transaction Information and be combined into the first transaction data, by first number of deals
According in the write-in corresponding transaction data table;
Data generation module, for the case where there is no the transaction data table names in inquiring the relevant database
Under, then user metadata and transaction metadata are extracted from the Transaction Information to generate table name, gauge outfit and the second transaction data;
Tables of data creates module, for creating new transaction data table according to the table name and the gauge outfit, and by described second
In the newly-built transaction data table of transaction data write-in.
6. data writing systems as claimed in claim 5, which is characterized in that further include:
Trigger module is monitored, before the Transaction Information that node generates of endorsing in listening to block chain, passes through the endorsement
Node to transaction carry out endorsement or it is described endorsement node restart trigger to it is described endorse node monitoring.
7. data writing systems as claimed in claim 6, which is characterized in that further include:
Data obtaining module, for after the endorsement node is restarted, obtaining the letter of the transaction in the block chain respectively
Transaction data in breath and the relevant database;
Information contrast module, for the Transaction Information and the transaction data to be compared, and in the Transaction Information and
When the transaction data is consistent, continue to monitor;And in the Transaction Information and the inconsistent transaction data, described in acquisition
The Transaction Information inconsistent with the transaction data in block chain;
Data simultaneous module, for extracting service channel mark, chain code mark and version from the inconsistent Transaction Information
Mark to carry out transaction data table name inquiry, and then completes the write-in of the inconsistent Transaction Information, realizes the synchronization of data
It updates.
8. data writing systems as claimed in claim 5, which is characterized in that further include:
Authentication module, for receive client initiation transaction data inquiry instruction when, according to the inquiry instruction
The user right information of middle carrying carries out authentication;
Query result return module, for determine the user right be have read permission in the case where, Xiang Suoshu client
End returns to query result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910323480.8A CN110059092A (en) | 2019-04-22 | 2019-04-22 | The method for writing data and system of relevant database based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910323480.8A CN110059092A (en) | 2019-04-22 | 2019-04-22 | The method for writing data and system of relevant database based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110059092A true CN110059092A (en) | 2019-07-26 |
Family
ID=67320017
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910323480.8A Pending CN110059092A (en) | 2019-04-22 | 2019-04-22 | The method for writing data and system of relevant database based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110059092A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110609839A (en) * | 2019-09-17 | 2019-12-24 | 北京海益同展信息科技有限公司 | Method, device and equipment for processing block chain data and readable storage medium |
CN111104464A (en) * | 2019-12-31 | 2020-05-05 | 成都校精灵科技有限公司 | Data synchronous modification method, data synchronous reading method, data synchronous modification system and readable storage medium |
CN111310137A (en) * | 2020-03-23 | 2020-06-19 | 杭州溪塔科技有限公司 | Block chain associated data evidence storing method and device and electronic equipment |
CN111340530A (en) * | 2020-02-17 | 2020-06-26 | 深圳市二十一天网络科技有限公司 | Block chain-based digital rights and interests system |
CN111506650A (en) * | 2020-04-13 | 2020-08-07 | 西安电子科技大学 | Relational block chain data management method and storage medium |
CN114257593A (en) * | 2021-12-21 | 2022-03-29 | 瀚云科技有限公司 | Communication method, device, equipment and storage medium of block chain system |
CN115840737A (en) * | 2023-02-16 | 2023-03-24 | 济南邦德激光股份有限公司 | Database-based separate log management method and system |
CN116016689A (en) * | 2022-12-28 | 2023-04-25 | 蚂蚁区块链科技(上海)有限公司 | Message routing method, device and system based on chain codes |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160330027A1 (en) * | 2015-05-05 | 2016-11-10 | ShoCard, Inc. | Identity Management Service Using A Blockchain Providing Certifying Transactions Between Devices |
CN108830733A (en) * | 2018-06-21 | 2018-11-16 | 中国银行股份有限公司 | A kind of information processing method, block scm cluster and system |
CN109327528A (en) * | 2018-10-31 | 2019-02-12 | 阿里巴巴集团控股有限公司 | A kind of node administration method and device based on block chain |
CN109359159A (en) * | 2018-09-30 | 2019-02-19 | 深圳前海微众银行股份有限公司 | Distributed storage method, system and equipment |
CN109542980A (en) * | 2018-11-20 | 2019-03-29 | 北京磁云数字科技有限公司 | A kind of data processing method, device, equipment and the medium of block chain |
-
2019
- 2019-04-22 CN CN201910323480.8A patent/CN110059092A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160330027A1 (en) * | 2015-05-05 | 2016-11-10 | ShoCard, Inc. | Identity Management Service Using A Blockchain Providing Certifying Transactions Between Devices |
CN108830733A (en) * | 2018-06-21 | 2018-11-16 | 中国银行股份有限公司 | A kind of information processing method, block scm cluster and system |
CN109359159A (en) * | 2018-09-30 | 2019-02-19 | 深圳前海微众银行股份有限公司 | Distributed storage method, system and equipment |
CN109327528A (en) * | 2018-10-31 | 2019-02-12 | 阿里巴巴集团控股有限公司 | A kind of node administration method and device based on block chain |
CN109542980A (en) * | 2018-11-20 | 2019-03-29 | 北京磁云数字科技有限公司 | A kind of data processing method, device, equipment and the medium of block chain |
Non-Patent Citations (1)
Title |
---|
周亮瑾: "基于区块链和分布式数据库的铁路旅客隐私保护技术研究", 《中国博士学位论文全文数据库 信息科技辑(月刊)2018年》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110609839A (en) * | 2019-09-17 | 2019-12-24 | 北京海益同展信息科技有限公司 | Method, device and equipment for processing block chain data and readable storage medium |
US11966412B2 (en) | 2019-09-17 | 2024-04-23 | Jingdong Technology Information Technology Co., Ltd. | Blockchain data processing method and apparatus, device, and readable storage medium |
CN110609839B (en) * | 2019-09-17 | 2021-05-25 | 北京海益同展信息科技有限公司 | Method, device and equipment for processing block chain data and readable storage medium |
CN111104464A (en) * | 2019-12-31 | 2020-05-05 | 成都校精灵科技有限公司 | Data synchronous modification method, data synchronous reading method, data synchronous modification system and readable storage medium |
CN111104464B (en) * | 2019-12-31 | 2023-07-04 | 成都校精灵科技有限公司 | Data synchronization modification method, data synchronization modification system, data synchronization modification method and data synchronization modification system, and readable storage medium |
CN111340530A (en) * | 2020-02-17 | 2020-06-26 | 深圳市二十一天网络科技有限公司 | Block chain-based digital rights and interests system |
CN111310137A (en) * | 2020-03-23 | 2020-06-19 | 杭州溪塔科技有限公司 | Block chain associated data evidence storing method and device and electronic equipment |
CN111506650B (en) * | 2020-04-13 | 2023-06-23 | 西安电子科技大学 | Relational blockchain data management method and storage medium |
CN111506650A (en) * | 2020-04-13 | 2020-08-07 | 西安电子科技大学 | Relational block chain data management method and storage medium |
CN114257593A (en) * | 2021-12-21 | 2022-03-29 | 瀚云科技有限公司 | Communication method, device, equipment and storage medium of block chain system |
CN116016689A (en) * | 2022-12-28 | 2023-04-25 | 蚂蚁区块链科技(上海)有限公司 | Message routing method, device and system based on chain codes |
CN116016689B (en) * | 2022-12-28 | 2024-08-06 | 蚂蚁区块链科技(上海)有限公司 | Message routing method, device and system based on chain codes |
CN115840737A (en) * | 2023-02-16 | 2023-03-24 | 济南邦德激光股份有限公司 | Database-based separate log management method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110059092A (en) | The method for writing data and system of relevant database based on block chain | |
CN101136783B (en) | Backup, recovery method and apparatus for network management system to configure data | |
CN109657110B (en) | A kind of data source tracing method and corresponding data are traced to the source device | |
CN100498796C (en) | Logic log generation method, database backup/ restoration method and system | |
CN105373541B (en) | The processing method and system of the data operation request of database | |
CN102521225A (en) | Incremental data extraction device and incremental data extraction method | |
CN106709043A (en) | Data synchronous loading method based on database log | |
CN105373896A (en) | Project management system | |
WO2005098683A3 (en) | Techniques for management and generation of web forms | |
WO2001042988A3 (en) | Computer network information management system and method | |
CN109522290A (en) | A kind of HBase data block restores and data record extraction method | |
CN108416043A (en) | Multi-platform spatial data fusion and synchronization method | |
CN104636401B (en) | Method and device for data rollback of SCADA (supervisory control and data acquisition) system | |
CN106503214A (en) | A kind of complex rule matching process based on Redis memory databases | |
CN109918386A (en) | A kind of data reconstruction method and device, computer readable storage medium | |
WO2004104776A3 (en) | System and method of providing an online user with directory listing information about an entity | |
CN110209585A (en) | A kind of software test case intelligent training method, terminal and storage medium | |
CN111597267A (en) | Data middlebox based on multilayer service engine and construction method | |
CN101882135A (en) | Data processing method and device | |
CN106547646A (en) | A kind of data backup and restoration methods, data backup and recovery device | |
CN102999548B (en) | Geographical name data extended method and device in electronic chart | |
CN102693174B (en) | Object broker database constraint-oriented backup method | |
CN106250501A (en) | Report processing method and reporting system | |
CN107220280B (en) | Disaster information acquisition and reporting method and system based on zoning mapping | |
CN107783863A (en) | A kind of mass file Fast back-projection algorithm backup 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: 20190726 |