Nothing Special   »   [go: up one dir, main page]

CN111339110B - Transaction backup method and system based on block chain - Google Patents

Transaction backup method and system based on block chain Download PDF

Info

Publication number
CN111339110B
CN111339110B CN202010115516.6A CN202010115516A CN111339110B CN 111339110 B CN111339110 B CN 111339110B CN 202010115516 A CN202010115516 A CN 202010115516A CN 111339110 B CN111339110 B CN 111339110B
Authority
CN
China
Prior art keywords
transaction
main
standby
verification
node
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.)
Active
Application number
CN202010115516.6A
Other languages
Chinese (zh)
Other versions
CN111339110A (en
Inventor
裴磊
刘朝伟
罗伟彬
龚开圳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202010115516.6A priority Critical patent/CN111339110B/en
Publication of CN111339110A publication Critical patent/CN111339110A/en
Application granted granted Critical
Publication of CN111339110B publication Critical patent/CN111339110B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Computer Security & Cryptography (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a transaction backup method and system based on a block chain. The transaction backup method based on the block chain comprises the following steps: the main verification node receives the transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus; the main verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node; the standby verification node executes the intelligent contract corresponding to the transaction request and compares the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result. The invention can meet the requirement of high-availability deployment of the block chain in a cross-region on the premise of not influencing the consensus efficiency of the block chain.

Description

Transaction backup method and system based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a transaction backup method and a transaction backup system based on a block chain.
Background
The block chain system is a brand-new distributed database accounting system which stores data in a block chain structure and performs data consensus by using distributed nodes, has the core technical characteristics of openness, transparency, mediation removal, incapability of tampering and the like, is used as a tool for solving service pain points of a traditional service system, such as information isolated island, lack of trust, difficult cooperation and the like, is basically in an operation mode of a alliance chain in actual application at present, and simultaneously has the technical problems of relatively high professional technical threshold, high performance guarantee required by the service system and the like in the actual operation and maintenance process, and most enterprises adopt a block chain network to be intensively managed and deployed in the same network area for centralized operation.
In the prior art, block chain link point redundancy is deployed in a cross-region backup machine room to ensure that the cross-region availability of a block chain network is high, but with the increase of the number of block chain consensus nodes, the time consumption of consensus calculation of the block chain network when the block chain network processes intelligent contract logic is increased, and the cross-region network communication delay consumption is added, so that the consensus efficiency of the block chain network is greatly reduced.
Disclosure of Invention
The embodiments of the present invention mainly aim to provide a transaction backup method and system based on a blockchain, so as to meet the requirement of high availability deployment across areas of the blockchain on the premise of not affecting the efficiency of block chain consensus.
In order to achieve the above object, an embodiment of the present invention provides a transaction backup method based on a blockchain, where the blockchain includes a main blockchain and a spare blockchain, the main blockchain includes multiple main verification nodes, and the spare blockchain includes multiple spare verification nodes, and the method includes:
the main verification node receives the transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus;
the main verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node;
the standby verification node executes the intelligent contract corresponding to the transaction request and compares the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
The embodiment of the invention also provides a transaction backup system based on the block chain, which comprises a main block chain and a standby block chain, wherein the main block chain comprises a plurality of main verification nodes, and the standby block chain comprises a plurality of standby verification nodes;
the main verification node is used for receiving the transaction request, executing an intelligent contract corresponding to the transaction request, and broadcasting the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus; judging whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node;
the standby verification node is used for executing the intelligent contract corresponding to the transaction request and comparing the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
The main verification node of the block chain-based transaction backup method and system of the embodiment of the invention executes the intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes for transaction consensus; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node; and the standby verification node executes the intelligent contract corresponding to the transaction request, and writes the main transaction result into the master transaction result when the main transaction result is the same as the generated slave transaction result. The invention can meet the requirement of high-availability deployment of block chains across areas on the premise of not influencing the consensus efficiency of the block chains, improves the emergency capacity of the block chains in the process of practical application, and effectively ensures the continuous operation of the block chain service system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a flow chart of a blockchain based transactional backup method in one embodiment of the invention;
FIG. 2 is a block diagram of a blockchain-based transactional backup system in accordance with an embodiment of the invention;
fig. 3 is a block diagram of a blockchain-based transactional backup system and external systems in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
In view of the fact that in the prior art, block chain link point redundancy is deployed in a cross-region backup machine room to ensure that the cross-region availability of a block chain network is high, and the consensus efficiency of the block chain network can be reduced to a great extent, embodiments of the present invention provide a block chain-based transaction backup method, so as to meet the high availability deployment requirement of the block chain cross-region on the premise of not affecting the block chain consensus efficiency, improve the cross-region disaster recovery emergency capability of the block chain in the actual application process, and effectively ensure the coherent operation of a block chain service system. The present invention will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a transaction backup method based on a blockchain according to an embodiment of the present invention. As shown in fig. 1, the transaction backup method based on the blockchain includes:
s101: and the main verification node receives the transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus.
The main transaction result comprises the current block height, the hash value, the block data and the new block data generated after the transaction request is executed.
S102: the main verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes; and when the transaction consensus is successful, writing the main transaction result and transmitting the main transaction result and the transaction request to the standby verification node corresponding to the main verification node.
When the transaction consensus fails, the main verification node records a failure log, does not write the main transaction result, ends the transaction and returns an error log to an external block chain service system.
The number of the main verification nodes and the number of the standby verification nodes are both 3f +1, a Byzantine fault-tolerant algorithm is used when transaction consensus is carried out, the Byzantine fault-tolerant algorithm comprises three stages, the first stage is pre-prepare consensus, the second stage is prepare consensus, the third stage is commit consensus, and the three stages are sequentially executed. When the main verification node or the standby verification node receives 2f +1 consensus confirmation information from other verification nodes in the current block chain, the transaction can complete the consensus of the current stage and enter the next stage. When the consensus of the three stages is completed, the request transaction is legal, the transaction result is written into the block of the block chain for persistence, the verification node converts the SeqNo of the transaction result into NoHashData and stores the NoHashData into the block, and a transaction log is recorded.
S103: the standby verification node executes the intelligent contract corresponding to the transaction request and compares the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
When the main transaction result is different from the slave transaction result, the standby verification node returns a failure result to the main verification node, and the verification node is required to retransmit the main transaction result and the transaction request.
The execution main body of the block chain-based transaction backup method shown in fig. 1 is a block chain, and the block chain includes a main block chain located in a main machine room and a spare block chain located in a spare machine room, the main block chain includes a plurality of main verification nodes, and the spare block chain includes a plurality of spare verification nodes. As can be seen from the process shown in fig. 1, the main verification node of the transaction backup method based on a blockchain according to the embodiment of the present invention executes an intelligent contract corresponding to a transaction request, and broadcasts a generated main transaction result and the transaction request to other main verification nodes to perform transaction consensus; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node; and the standby verification node executes the intelligent contract corresponding to the transaction request, and writes the main transaction result into the master transaction result when the main transaction result is the same as the generated slave transaction result. The invention can meet the requirement of high-availability deployment of block chains across areas on the premise of not influencing the consensus efficiency of the block chains, improves the emergency capacity of the block chains in the process of practical application, and effectively ensures the continuous operation of the block chain service system.
In one embodiment, the blockchain further includes a primary right management node, and the spare blockchain further includes a spare right management node. And the authority management node is responsible for authority control of each node in the block chain and storage and issue of certificates. For example, the authority management node issues an identity certificate to the trusted node during networking, so as to ensure the security and the credibility of the nodes on the chain. And all nodes need to pass the authority authentication of the authority management node before being added into the block chain. The certificate is a public key and private key password pair generated by an elliptic curve encryption algorithm, and the public key is broadcasted to all verification nodes on the chain for identity verification.
In specific implementation, the authority management node selects an elliptic curve Ep (a, b), takes one point on the elliptic curve as a base point P, selects a large number k as a private key, and generates a public key Q = kP; ep (a, b) and point Q, P are broadcast to all the verification nodes on the chain.
And the nodes on the block chain encode the identity information message to a point M on the published Ep (a, b) to generate a random integer r, the encrypted ciphertext is { rP, M + rQ }, and the ciphertext is broadcasted to other nodes for transaction consensus or decryption.
And after receiving the ciphertext, the authority management node decrypts the private key to obtain M, wherein the formula is as follows:
M+rQ-k(rP)=M+K(rP)-k(rP)=M。
in an embodiment, the primary blockchain further comprises a primary access node and the spare blockchain further comprises a spare access node. Before executing S101, the method further includes: the main access node registers the self address as a main address to an external domain name resolution device; the standby access node registers the address of the standby access node as a standby address to a domain name resolution device; the master access node sends a transaction request from the domain name resolution device to one of the master verification nodes. Wherein, the main access node will convert the REST transaction request from the domain name resolution device into a GRPC transaction request interacting with the verification node.
In one embodiment, before the master verification node executes the intelligent contract corresponding to the transaction request, the method further includes: the main verification node caches the transaction information in the transaction request to a first memory array; the first memory array is reqStore.
After the master verification node writes the master transaction result, the method further comprises the following steps: the main verification node updates the first memory array according to the transaction result; when the transaction consensus fails, the main verification node does not write the main transaction result, and the first memory array is cleared.
After the writing of the primary transaction result by the standby verification node, the method further comprises the following steps: the standby verification node transmits a synchronization success result to the main verification node; and the main verification node clears the first memory array according to the synchronization success result.
In one embodiment, before executing S103, the method further includes: and the standby verification node caches the transaction information in the transaction request to the second memory array. Before the standby verifying node transmits the synchronization success result to the main verifying node, the method further comprises the following steps: the standby verification node clears the second memory array. The second memory array is a syncStore.
In one embodiment, the transaction backup method based on the blockchain further includes: the standby access node monitors whether the main block chain fails or not; when the main block chain fails, taking the address of the main block chain as a main address to register to a domain name resolution device, and activating a transaction consensus function of a plurality of standby verification nodes; a transaction request is received from a domain name resolution device.
Wherein the master access node will also monitor whether the master blockchain fails. And when the number of the currently available main verification nodes counted by the main access node or the standby access node is less than 3f +1, the main block chain fails.
In one embodiment, the transaction backup method based on the blockchain further includes: the standby access node sends a transaction request to one of the standby authentication nodes. Wherein, the standby access node converts the REST transaction request from the domain name resolution device into a GRPC transaction request interacting with the verification node.
The standby verification node receives the transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts the generated standby transaction result and the transaction request to other standby verification nodes in the standby block chain to carry out transaction consensus;
the standby transaction result comprises the current block height, the hash value, block data and new block data generated after the transaction request is executed.
The standby verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other standby verification nodes; and writing the standby transaction result when the transaction consensus is successful. And when the transaction consensus fails, the standby verification node records the failure log, does not write the standby transaction result, finishes the transaction and returns an error log to an external block chain service system.
The specific process of the embodiment of the invention is as follows:
the block chain business system establishes a main block chain and a standby block chain, wherein the main block chain comprises a plurality of main verification nodes, and the standby block chain comprises a plurality of standby verification nodes. And the authority management nodes in the main block chain and the standby block chain judge whether the nodes in the block chain are safe and credible. The main access node registers the self address as a main address to an external domain name resolution device; the standby access node registers its own address as a standby address to the domain name resolution device. The primary access node and the standby access node monitor whether the primary block chain fails. When the number of currently available main verification nodes counted by the main access node or the standby access node is less than 3f +1, the main block chain fails; when the number of the currently available main verification nodes is larger than or equal to 3f +1, the main block chain is normal.
The flow when the main block chain is normal is as follows:
1. and the external domain name resolution device sends the transaction request to the main access node, and the main access node sends the transaction request to one of the main verification nodes.
2. The main verification node receives the transaction request and caches transaction information in the transaction request to the first memory array.
3. And the main verification node executes the intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus.
4. And the main verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes.
And when the transaction consensus is successful, the main verification node writes in a main transaction result, updates the first memory array according to the transaction result, and transmits the main transaction result and the transaction request to the standby verification node corresponding to the main verification node in a point-to-point anchoring manner.
When the transaction consensus fails, the main verification node records a failure log, does not write the main transaction result, clears the first memory array, finishes the transaction and returns an error log to an external block chain service system.
5. And the standby verification node caches the transaction information in the transaction request to the second memory array.
6. And the standby verification node executes the intelligent contract corresponding to the transaction request and compares the generated slave transaction result with the master transaction result.
And when the main transaction result is the same as the slave transaction result, the standby verification node writes the main transaction result, clears the second memory array, transmits the synchronization success result to the main verification node, and clears the first memory array according to the synchronization success result.
When the master transaction result is different from the slave transaction result, the standby verification node returns a failure result to the master verification node, and the master transaction result and the transaction request are required to be retransmitted by the verification node.
The process of starting the standby block chain when the main block chain fails is as follows:
1. the standby access node registers the address of the standby access node as a main address to a domain name resolution device, and activates the transaction consensus function of the standby verification nodes.
2. And the external domain name resolution device sends the transaction request to the standby access node, and the standby access node sends the transaction request to one of the standby verification nodes.
3. And the standby verification node receives the transaction request and caches the transaction information in the transaction request to the second memory array.
4. The standby verification node executes the intelligent contract corresponding to the transaction request, and broadcasts the generated standby transaction result and the transaction request to other standby verification nodes in the standby block chain to carry out transaction consensus.
5. And the standby verification node judges whether the transaction consensus is successful according to the consensus confirmation information from other standby verification nodes.
And when the transaction consensus is successful, writing a standby transaction result and clearing the second memory array.
And when the transaction consensus fails, the standby verification node records the failure log, does not write the standby transaction result, finishes the transaction and returns an error log to an external block chain service system.
In summary, the main verification node of the block chain-based transaction backup method of the embodiment of the present invention executes the intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes to perform transaction consensus; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node; and the standby verification node executes the intelligent contract corresponding to the transaction request, and writes the main transaction result into the master transaction result when the main transaction result is the same as the generated slave transaction result. The invention can meet the requirement of high-availability deployment of block chains across areas on the premise of not influencing the consensus efficiency of the block chains, improves the emergency capacity of the block chains in the process of practical application, and effectively ensures the continuous operation of the block chain service system.
In conclusion, the invention has the following beneficial effects:
1. the consensus activation mechanism ensures the block output efficiency: when the main block chain works normally, the standby verification node does not start the transaction consensus function, only carries out real-time directional synchronization on the data of the verification node, does not participate in the block consensus of the access transaction, and does not influence the block outlet efficiency.
2. The data synchronization mechanism ensures emergency timeliness: the standby verification node ensures the consistency of the data of the standby node and the data of the main node through the real-time directional synchronization of the data between the standby verification node and the main verification node. When the main block chain fails, the consensus function can be activated in time, and the spare block chain is connected into the consensus and block-out operation of the transaction through the standby block chain link pipe, so that the emergency time effect of the regional failure is guaranteed.
3. The switching process is transparent to the access service system: the address of the access node is configured to a domain name resolution device as a connection and provides a uniform access domain name for a block chain service system, when a main block chain works normally, a transaction request is routed to the main access node of the main block chain by the domain name resolution device, when the main block chain fails, the transaction request is routed to a standby access node of a standby block chain by the domain name resolution device, the access domain name provided for the block chain service system is not changed in the whole switching process, and the switching process is transparent to the service system.
Based on the same inventive concept, the embodiment of the invention also provides a transaction backup system based on the blockchain, and as the problem solving principle of the system is similar to that of the transaction backup method based on the blockchain, the implementation of the system can refer to the implementation of the method, and repeated parts are not described again.
Fig. 2 is a block diagram of a transaction backup system based on blockchains according to an embodiment of the present invention. As shown in fig. 2, the transaction backup system based on the blockchain includes:
the system comprises a main block chain 1 and a standby block chain 5, wherein the main block chain 1 comprises a plurality of main verification nodes 4, and the standby block chain 5 comprises a plurality of standby verification nodes 8;
the main verification node is used for receiving the transaction request, executing an intelligent contract corresponding to the transaction request, and broadcasting the generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus; judging whether the transaction consensus is successful according to the consensus confirmation information from other main verification nodes; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node;
the standby verification node is used for executing the intelligent contract corresponding to the transaction request and comparing the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
In one embodiment, the master verification node is further configured to:
caching the transaction information in the transaction request to a first memory array;
updating the first memory array according to the transaction result;
clearing the first memory array according to the synchronization success result;
the standby verification node is further operable to: and transmitting the synchronization success result to the main verification node.
In one embodiment, the standby verification node is further configured to:
caching the transaction information in the transaction request to a second memory array;
clearing the second memory array.
Fig. 3 is a block diagram of a blockchain-based transactional backup system and external systems in an embodiment of the invention. As shown in fig. 2 and 3, the transaction backup system based on the blockchain further includes a primary access node 3, a backup access node 7, a primary right management node 2, and a backup right management node 6. The external system comprises a domain name resolution means connected to the main and spare blockchains, and a blockchain business system 9 connected to the domain name resolution means.
In one embodiment, the main blockchain further comprises a main access node, and the standby blockchain further comprises a standby access node;
the primary access node is configured to: registering the self address as a main address to an external domain name resolution device; sending a transaction request from a domain name resolution device to one of the master verification nodes;
the standby access node is to: the self address is registered as a backup address to the domain name resolution device.
In one embodiment, the standby access node is further configured to:
monitoring whether the main block chain fails; when the main block chain fails, the self address is used as a main address to be registered in a domain name resolution device, and the transaction consensus function of a plurality of standby verification nodes is activated; a transaction request is received from a domain name resolution device.
In one embodiment, the standby access node is further configured to:
sending a transaction request to one of the standby verification nodes;
the standby verification node is further operable to: receiving a transaction request, executing an intelligent contract corresponding to the transaction request, and broadcasting the generated standby transaction result and the transaction request to other standby verification nodes in a standby block chain to perform transaction consensus; judging whether the transaction consensus is successful according to the consensus confirmation information from other standby verification nodes; and writing the standby transaction result when the transaction consensus is successful.
In summary, the main verification node of the block chain-based transaction backup system of the embodiment of the present invention executes the intelligent contract corresponding to the transaction request, and broadcasts the generated main transaction result and the transaction request to other main verification nodes to perform transaction consensus; when the transaction consensus is successful, writing a main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node; and the standby verification node executes the intelligent contract corresponding to the transaction request, and writes the main transaction result into the master transaction result when the main transaction result is the same as the generated slave transaction result. The invention can meet the requirement of high-availability deployment of block chains across areas on the premise of not influencing the consensus efficiency of the block chains, improves the emergency capacity of the block chains in the process of practical application, and effectively ensures the continuous operation of the block chain service system.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or units, or devices described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
In one or more exemplary designs, the functions described in the embodiments of the present invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.

Claims (12)

1. A blockchain-based transaction backup method, wherein the blockchain includes a primary blockchain and a spare blockchain, the primary blockchain includes a plurality of primary verification nodes, and the spare blockchain includes a plurality of spare verification nodes, the method comprising:
the main verification node receives a transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts a generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus;
the main verification node judges whether the transaction consensus is successful according to the consensus confirmation information from the other main verification nodes; when the transaction consensus is successful, writing the main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node;
the standby verification node executes the intelligent contract corresponding to the transaction request and compares the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
2. The blockchain-based transaction backup method according to claim 1, wherein before the master verification node executes the smart contract corresponding to the transaction request, the method further comprises: the main verification node caches the transaction information in the transaction request to a first memory array;
after the master verification node writes the master transaction result, the method further comprises the following steps: the main verification node updates the first memory array according to the transaction result;
after the writing of the primary transaction result by the standby verification node, the method further comprises: the standby verification node transmits a synchronization success result to the main verification node;
and the main verification node clears the first memory array according to the synchronization success result.
3. The blockchain-based transaction backup method according to claim 2, wherein before the standby verification node executes the smart contract corresponding to the transaction request, the method further comprises:
the standby verification node adds the transaction request to the transaction request the transaction information is cached to a second memory array;
before the standby verifying node transmits the synchronization success result to the main verifying node, the method further includes:
and the standby verification node clears the second memory array.
4. The blockchain-based transactional backup method of claim 1, wherein the primary blockchain further comprises a primary access node and the spare blockchain further comprises a spare access node, the method further comprising:
the main access node registers the self address as a main address to an external domain name resolution device; the standby access node registers the address of the standby access node as a standby address to the domain name resolution device;
and the master access node sends the transaction request from the domain name resolution device to one of the master verification nodes.
5. The blockchain-based transactional backup method according to claim 4, further comprising:
the standby access node monitors whether the main block chain fails or not; when the main block chain fails, the standby access node registers the address of the standby access node as a main address to the domain name resolution device, and activates a transaction consensus function of the standby verification nodes; receiving a transaction request from the domain name resolution device.
6. The blockchain-based transactional backup method of claim 5, further comprising:
the standby access node sends the transaction request to one of the standby verification nodes;
the standby verification node receives a transaction request, executes an intelligent contract corresponding to the transaction request, and broadcasts a generated standby transaction result and the transaction request to other standby verification nodes in the standby block chain to carry out transaction consensus;
the standby verification node judges whether the transaction consensus is successful according to the consensus confirmation information from the other standby verification nodes; and writing the standby transaction result when the transaction consensus is successful.
7. A transaction backup system based on a blockchain is characterized by comprising a main blockchain and a standby blockchain, wherein the main blockchain comprises a plurality of main verification nodes, and the standby blockchain comprises a plurality of standby verification nodes;
the main verification node is used for receiving a transaction request, executing an intelligent contract corresponding to the transaction request, and broadcasting a generated main transaction result and the transaction request to other main verification nodes in the main block chain to perform transaction consensus; judging whether the transaction consensus is successful or not according to the consensus confirmation information from the other main verification nodes; when the transaction consensus is successful, writing the main transaction result, and transmitting the main transaction result and the transaction request to a standby verification node corresponding to the main verification node;
the standby verification node is used for executing the intelligent contract corresponding to the transaction request and comparing the generated slave transaction result with the master transaction result; and writing the master transaction result when the master transaction result is the same as the slave transaction result.
8. The blockchain-based transactional backup system of claim 7 wherein the primary verification node is further configured to:
caching the transaction information in the transaction request to a first memory array;
updating the first memory array according to the transaction result;
clearing the first memory array according to the synchronization success result;
the standby verification node is further to: and transmitting the synchronization success result to the main verification node.
9. The blockchain-based transaction backup system of claim 8, wherein the alternate validation node is further configured to:
caching the transaction information in the transaction request to a second memory array;
and clearing the second memory array.
10. The blockchain-based transactional backup system of claim 7 wherein the primary blockchain further comprises a primary access node and the spare blockchain further comprises a spare access node;
the primary access node is configured to: registering the self address as a main address to an external domain name resolution device; sending a transaction request from the domain name resolution device to one of the master verification nodes;
the standby access node is to: and registering the self address as a standby address to the domain name resolution device.
11. The blockchain-based transactional backup system of claim 10 wherein the backup access node is further configured to:
monitoring whether the main block chain fails; when the main block chain fails, registering the self address as a main address to the domain name resolution device, and activating the transaction consensus function of the standby verification nodes; receiving a transaction request from the domain name resolution device.
12. The blockchain-based transactional backup system of claim 11 wherein the backup access node is further configured to:
sending the transaction request to one of the standby verification nodes;
the standby verification node is further to: receiving a transaction request, executing an intelligent contract corresponding to the transaction request, and broadcasting the generated standby transaction result and the transaction request to other standby verification nodes in the standby block chain to perform transaction consensus; judging whether the transaction consensus is successful or not according to the consensus confirmation information from the other standby verification nodes; and writing the standby transaction result when the transaction consensus is successful.
CN202010115516.6A 2020-02-25 2020-02-25 Transaction backup method and system based on block chain Active CN111339110B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010115516.6A CN111339110B (en) 2020-02-25 2020-02-25 Transaction backup method and system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010115516.6A CN111339110B (en) 2020-02-25 2020-02-25 Transaction backup method and system based on block chain

Publications (2)

Publication Number Publication Date
CN111339110A CN111339110A (en) 2020-06-26
CN111339110B true CN111339110B (en) 2023-04-07

Family

ID=71181803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010115516.6A Active CN111339110B (en) 2020-02-25 2020-02-25 Transaction backup method and system based on block chain

Country Status (1)

Country Link
CN (1) CN111339110B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187900B (en) * 2020-09-18 2022-03-01 中国科学院计算技术研究所 DNS data updating method and system based on block chain shared cache
CN112398949B (en) * 2020-11-26 2024-09-06 卓尔智联(武汉)研究院有限公司 Transaction confirmation method, system, device and computer equipment
CN112767151B (en) * 2021-01-15 2024-02-09 中国工商银行股份有限公司 Transaction processing method and device applied to verification node in blockchain
CN114971602A (en) * 2021-02-19 2022-08-30 银联国际有限公司 Electronic payment method and transaction system supporting digital currency
CN112837162A (en) * 2021-03-12 2021-05-25 中国工商银行股份有限公司 Data interaction method, node and system based on block chain
CN114331732B (en) * 2022-03-15 2022-05-24 北京微芯感知科技有限公司 Consensus message compression method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN108769150A (en) * 2018-05-14 2018-11-06 百度在线网络技术(北京)有限公司 Data processing method, device, clustered node and the storage medium of block chain network
WO2019080235A1 (en) * 2017-10-26 2019-05-02 平安科技(深圳)有限公司 Ethereum-based blockchain system and transaction data processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
WO2019080235A1 (en) * 2017-10-26 2019-05-02 平安科技(深圳)有限公司 Ethereum-based blockchain system and transaction data processing method
CN108769150A (en) * 2018-05-14 2018-11-06 百度在线网络技术(北京)有限公司 Data processing method, device, clustered node and the storage medium of block chain network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张超等.Medical Chain: 联盟式医疗区块链系统Medical Chain: 联盟式医疗区块链系统.《自动化学报》.2019,第45卷(第45期),全文. *

Also Published As

Publication number Publication date
CN111339110A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN111339110B (en) Transaction backup method and system based on block chain
CN110800005B (en) Split, licensed and distributed ledger
CN110430087B (en) Block chain hot upgrade architecture design and implementation
US20180308091A1 (en) Fairness preserving byzantine agreements
US11930113B2 (en) Blockchain hybrid consensus-based system for maintaining domain name information
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
WO2020042805A1 (en) Blockchain-based transaction consensus processing method and apparatus, and electrical device
CN110032545A (en) File memory method, system and electronic equipment based on block chain
CN100586058C (en) J2EE middleware criterion based tolerant inbreak application server and tolerant inbreak method
CN111800463A (en) Inter-block chain cross-chain information interaction method, system, medium, equipment and application
CN110569251A (en) Data processing method, related equipment and computer readable storage medium
CN109104415A (en) Construct the system and method for trusted node network
CN112333213B (en) Privacy protection method and device for business data of power Internet of things
CN108810007B (en) Internet of things security architecture
CN112615847B (en) Data sharing and privacy protection method based on block chain
JP2012027587A (en) Data distribution storage, method, program and storage medium
CN110598375A (en) Data processing method, device and storage medium
CN109547195A (en) A kind of code data processing method and processing device
CN110912892B (en) Certificate management method and device, electronic equipment and storage medium
WO2024159804A1 (en) Blockchain-based key generation method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN111654375A (en) Block chain-based edge calculation security encryption method, device and system
US20230360046A1 (en) Blockchain-based block processing method and apparatus, device, storage medium, and program product
WO2024093593A1 (en) Multi-blockchain-based data processing method and apparatus, and electronic device, computer-readable storage medium and computer program product
WO2024082807A1 (en) Multi-blockchain-based asset transfer method and apparatus, and device, medium and product
CN111209542B (en) Authority management method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant