CN112799879A - Node fault processing method, device, equipment and storage medium - Google Patents

Node fault processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112799879A
CN112799879A CN202110055423.3A CN202110055423A CN112799879A CN 112799879 A CN112799879 A CN 112799879A CN 202110055423 A CN202110055423 A CN 202110055423A CN 112799879 A CN112799879 A CN 112799879A
Authority
CN
China
Prior art keywords
node
data
accounting
blockchain network
condition
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.)
Granted
Application number
CN202110055423.3A
Other languages
Chinese (zh)
Other versions
CN112799879B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110055423.3A priority Critical patent/CN112799879B/en
Publication of CN112799879A publication Critical patent/CN112799879A/en
Application granted granted Critical
Publication of CN112799879B publication Critical patent/CN112799879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • 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/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • 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
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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

Landscapes

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

Abstract

The application discloses a node fault processing method, a node fault processing device, equipment and a storage medium, relates to the technical field of block chains, and can be used for cloud computing and cloud services. The specific implementation scheme is as follows: synchronizing first accounting data acquired from a first blockchain network during a first node failure to the first node in the case of a first node failure recovery; the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node. The method and the device can improve the accounting stability of the enterprises in the alliance network.

Description

Node fault processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a node failure.
Background
With the development of block chain technology, the application of the alliance network is more and more extensive. A federation network is generally formed by enterprises and is usually maintained by a plurality of nodes of different federations, one federation network may include at least one federation chain, and each federation chain may be in a parallel chain relationship or a sub-chain relationship.
However, the operation of the enterprise networks in the federated network is more constrained and improvements are needed.
Disclosure of Invention
The disclosure provides a fault handling method, device, equipment and storage medium for nodes.
According to an aspect of the present disclosure, there is provided a method for processing a failure of a node, including:
obtaining first accounting data from a first blockchain network during a failure of a first node;
synchronizing first accounting data acquired from a first blockchain network during a first node failure to the first node in the case of a first node failure recovery;
the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node.
According to another aspect of the present disclosure, there is provided another node fault handling method, including:
acquiring first accounting data from the first blockchain network under the condition that the first node normally operates;
in the case of a failure recovery of the first node, first accounting data acquired by the second node from the first blockchain network during the failure of the first node is synchronized.
According to still another aspect of the present disclosure, there is provided a fault handling apparatus of a node, including:
the backup accounting module is used for acquiring first accounting data from the first blockchain network during the failure of the first node;
the first accounting book sending module is used for synchronizing first accounting data acquired from a first blockchain network during the first node failure to the first node under the condition that the first node failure is recovered;
the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node.
According to still another aspect of the present disclosure, there is provided a fault handling apparatus of another node, including:
the first accounting module is used for acquiring first accounting data from the first block chain network under the condition that the first node normally operates;
the first accounting receiving module is configured to synchronize first accounting data, which is obtained by the second node from the first blockchain network during the failure of the first node, when the failure of the first node is recovered.
According to a fifth aspect, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of fault handling for a node as described in any one of the embodiments of the present application.
According to a sixth aspect, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method of fault handling of a node according to any one of the embodiments of the present application.
According to a seventh aspect, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of fault handling of a node of any of the embodiments of the present application.
According to the technology of the application, the accounting stability of the enterprises in the alliance network can be improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 2a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
2 b-2 d are schematic diagrams of the operation of a first node and a second node, respectively, under a single node condition provided by an embodiment of the present application;
fig. 3a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 3b to fig. 3d are schematic diagrams of the operation of the first node and the second node in the case of a dual-node single-block chain according to the embodiment of the present application, respectively;
fig. 4a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 4b to fig. 4d are schematic diagrams of the operation of the first node and the second node in the case of the dual-node dual-block chain provided according to the embodiment of the present application, respectively;
fig. 5 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a fault handling apparatus of a node according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a fault handling apparatus of a node according to an embodiment of the present application;
FIG. 10 shows a schematic block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Before the embodiments of the present application are described, a brief description is given to a federation network to which the embodiments of the present application are applicable. A federation network typically consists of a plurality of enterprises collectively forming a federation network system, each enterprise may provide computing devices and storage devices to carry the operation of a blockchain as blockchain nodes. One or more federation networks may be created to support different services, respectively. The alliance network system comprises three enterprises, each enterprise is provided with an internet machine room (IDS), and electronic devices and storage devices are deployed in the IDS as blockchain nodes. A federation chain may run between block link points.
In the federation network system, some enterprises may install chain management clients with federation owner authority as federation owners, some enterprises may install chain management clients with secondary federation owner authority as secondary federation owners, and some enterprises may install chain management clients with member authority as member enterprises. The chain management client is a block chain as a Service (BaaS) platform client, and can control the device by interacting with block chain nodes and other hardware devices. The node in the member institution room is used for accounting, as an accounting node, for synchronizing the generated block data by P2P transmission of the blockchain network, and for verifying the generated block.
Fig. 1 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The embodiment can be applied to the accounting verification process of the node to the block in the member institution. The node fault handling method disclosed in this embodiment may be executed by an electronic device, and specifically may be executed by a node fault handling apparatus, where the apparatus may be implemented by software and/or hardware, and is disposed in the electronic device, for example, in a second node of a member institution. Referring to fig. 1, the method for processing a node fault according to this embodiment includes:
s110, during a failure of the first node, acquiring first accounting data from the first blockchain network.
And S120, under the condition that the first node is recovered from the fault, synchronizing first accounting data acquired from the first blockchain network during the fault of the first node to the first node.
The first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node, where the first node is an accounting node of the first blockchain network.
In the embodiment of the present application, the member institution may set at least a first node and a second node. The first node is a billing node of the first block chain network; the second node is used for carrying out disaster recovery backup on the first node. The second node may be an accounting node or not, and in the case of the accounting node, the second node may be an accounting node of the first blockchain network or an accounting node of the second blockchain network; wherein the first blockchain network is different from the second blockchain network.
That is, the member institution may perform single-node accounting, that is, only one of the nodes is accessed to the blockchain network as an accounting node, the other node is not started offline, and is not accessed to the blockchain network, and as a normal node, for example, data traffic of both the service layer and the network layer of the member institution arrives at the accounting node but not at the normal node. The member institution may also perform two-node accounting of the two nodes, for example, the first node and the second node both belong to accounting nodes of different blockchain networks, or the first node and the second node respectively belong to accounting nodes of different blockchain networks. It should be noted that, in the embodiment of the present application, the number of nodes in the member organization is not specifically limited, for example, as the number of access block chain networks increases, the number of nodes may increase.
During the failure period of the first node, the first accounting data is acquired from the first block chain network through the second node, so that the first accounting data can be prevented from being lost during the failure period of the first node; in the case of failure recovery of the first node, the second node synchronizes the first accounting data acquired from the first blockchain network during failure of the first node to the first node, so that the first node can also acquire the first accounting data during failure, and thus the first node can be reused as an accounting node of the first blockchain network, especially in the case of failure of the second node, the first node can be directly reused as an accounting node of the first blockchain network.
According to the technical scheme provided by the embodiment of the application, the first node and the second node are set to be disaster-tolerant backup through the member mechanism, and when one node fails, the member mechanism can keep normal operation through other nodes, so that the stability of the member mechanism is improved.
In the above technical solution, the first node and the second node are disposed in different internet machine rooms of a member organization. Through setting up first node and second node respectively in different internet computer rooms, can avoid leading to first node, second node trouble simultaneously because of the computer lab environment to further improve stability.
Fig. 2a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 2a, the method for processing a node fault according to this embodiment includes:
s210, under the condition that the first node normally operates, first accounting data of the first block chain network are obtained from the first node.
S220, acquiring first accounting data from the first blockchain network during the first node failure.
S230, synchronizing the first accounting data acquired from the first blockchain network during the failure of the first node to the first node in case of failure recovery of the first node.
Fig. 2 b-2 d are schematic diagrams of the operation of the first node and the second node in the case of a single node according to the embodiment of the present application. Referring to fig. 2b, in a normal operation condition of the first node, the first node is configured to obtain the first accounting data from the first blockchain network, that is, the first node serves as an accounting node of the first blockchain network; the second node obtains the first accounting data of the first blockchain network from the first node, i.e. the first node is further configured to synchronize the first accounting data obtained from the first blockchain network to the second node. It should be noted that, under the condition that the first node operates normally, only the first node is accessed to the first block chain network, and the second node is not started off line and is not accessed to the first block chain network, and serves as a common node.
Referring to fig. 2c, during a failure of the first node, the first node disconnects from the first blockchain network, the second node initiates access to the first blockchain network, and first accounting data during the failure of the first node is acquired from the first blockchain network. It should be noted that, during the failure of the first node, the failure recovery of the first node may be performed.
Referring to fig. 2d, in case of failure recovery of the first node, a communication connection is established between the first node and a second node, which synchronizes to the first node first accounting data acquired from the first blockchain network during failure of the first node. After the first accounting data of the first node and the second node are synchronized, for example, after the block heights are the same, the second node may be continuously used as the accounting node according to the service demand, where the first node is used as a normal node (refer to fig. 2d), or the first node is used as the accounting node and the second node is used as a normal node. Specifically, the first blockchain traffic of the service layer and the network layer may be controlled by the node grid to continue using the second node or to switch back to the first node.
In the single-node accounting technical scheme, one node of the member mechanism is used as an accounting node to be accessed to the first block chain network to acquire first accounting data, the other node is used as a common node to be offline without being accessed to the first block chain network, and the two nodes can be used as the accounting node and the common node at different periods. And under the condition that the accounting node is abnormal, the common node accesses the first blockchain network to acquire the first accounting data in the fault period of the accounting node, and under the condition that the fault of the accounting node is recovered, the first accounting data in the fault period of the accounting node is synchronized to the accounting node, so that the first accounting data of the two nodes are synchronized. In the single-node accounting, only one node is used as an accounting node, namely only one node verifies the existing block in the first block chain, and the other node does not need to verify the existing block, so that the resource consumption of block verification can be reduced.
According to the technical scheme of the embodiment of the application, only one node in the member mechanism is used as the accounting node, namely only one node verifies the existing block in the first block chain, and the other node is used as a common node and does not need to verify the existing block, so that the stability of the member mechanism can be improved, and the resource consumption of block verification can be reduced.
In the above technical solution, the operation of the second node acquiring the first accounting data of the first blockchain network from the first node may specifically include the following several cases:
firstly, acquiring the full amount of block data and compiled intelligent contract data in a first block chain network from a first node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In this embodiment of the application, the transaction status data may be a statistical result of the blockchain data, and taking the blockchain data as a transfer transaction record as an example, the transaction status data may be an account balance of a blockchain account. By synchronizing the full blockchain data and the compiled intelligent contract data from the first node, the second node may determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockchain data, the intelligent contract data, and the determined transaction state data in the event of a startup of the second node, such as a failure of the first node. Under the condition of limited network resources, the second node synchronizes the whole block data from the first node, so that the block data can be prevented from being tampered.
And secondly, acquiring transaction state data, compiled intelligent contract data and the latest N blocks of data in the first blockchain network from the first node.
In this embodiment of the present application, a value of N may be determined according to a service requirement, or may be a default value, for example, 100. The second node synchronizes the transaction state data, the intelligent contract data and the latest N blocks of data from the first node, so that in the starting condition of the second node, whether the block height associated with the latest transaction state data is the same as the block chain height associated with the latest block can be detected, in the same condition, the accounting node service can be provided by directly using the transaction state data and the intelligent contract data, in the condition that the block height associated with the latest transaction state data (for example, 98) is smaller than the block height associated with the latest block (for example, 120), the transaction block data can be supplemented according to the latest N blocks of block chain data, and the accounting service can be provided according to the supplemented transaction state data and the intelligent contract data. By synchronizing the transaction state data, the amount of the transaction state data determined under the condition of starting the second node can be reduced, so that the starting efficiency of the second node can be improved.
Thirdly, acquiring block data and compiled intelligent contract data in the first block chain network from the first node in real time; and updating the transaction state data in the first blockchain network according to a fixed time interval.
The second node synchronizes the block data (namely, the full-amount block data) and the compiled intelligent contract data in real time from the first node, and under the condition that the second node is not connected to the first block chain network, regularly starts the ledger data processing program of the second node, and processes the first ledger data to update the local transaction state data. The transaction state data are updated at regular time through the second node, so that the starting efficiency of the second node under the condition of the failure of the first node can be improved, and the accuracy of the transaction state data can be improved.
Fig. 3a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 3a, the method for processing a node fault according to this embodiment includes:
s310, under the condition that the first node normally operates, first accounting data are obtained from the first block chain network.
S320, acquiring first accounting data from the first blockchain network during the first node failure.
S330, synchronizing the first accounting data acquired from the first blockchain network during the failure of the first node to the first node in case of the failure recovery of the first node.
Fig. 3 b-3 d are schematic diagrams of the operation of the first node and the second node in the case of the dual-node single block chain according to the embodiment of the present application. Under the condition of a double-node single-block chain, the first node and the second node are both connected into a first block chain network, the set intelligent contracts are the same, and the recorded account book data are the same.
Referring to fig. 3b, under the condition that the first node operates normally, both the first node and the second node start to access the first blockchain network, and obtain the first accounting data from the first blockchain network, that is, the first node and the second node serve as accounting nodes of the first blockchain network. Because the first node and the second node are both accounting nodes of the first block chain network, under the condition that the first node operates normally, data does not need to be synchronized between the first node and the second node. It should be noted that, in the case of a dual-node single-block chain, the first node and the second node are in a parallel relationship, and may not be distinguished, that is, any one of the nodes may be the first node, and the other is the second node.
Referring to fig. 3c, during the failure of the first node, the second node continues to acquire the first accounting data from the first blockchain network, the first node disconnects from the first blockchain network, and performs failure recovery on the first node offline.
Referring to fig. 3d, in case of failure recovery of the first node, a communication connection between the first node and the second node is established, and the second node synchronizes the first accounting data acquired from the first blockchain network during failure of the first node to the first node until the first accounting data of the first node and the second node are synchronized, for example, the block heights are the same, and the first node is re-accessed to the first blockchain network.
In the technical scheme of the double-node single-chain accounting, two nodes of a member mechanism are used as accounting nodes to be accessed into a first block chain network to obtain first accounting data. And in case of abnormality of one of the accounting nodes (namely the first node), the other accounting node (namely the second node) continues to acquire the first accounting data from the first blockchain network, in case of failure recovery of the first node, the second node also synchronizes the first accounting data during failure of the first node to the first node, and after completion of synchronization, the first node is accessed to the first blockchain network again. By using the double nodes as the accounting nodes of the same block chain, the first accounting data can be still recorded under the condition that any one node fails, and the data does not need to be synchronized under the condition that the double nodes normally operate.
According to the technical scheme, the two nodes in the member mechanism are used as the accounting nodes of the same block chain network, so that the stability of the member mechanism can be improved, and data communication between the two nodes can be reduced.
Fig. 4a is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 4a, the method for processing a node fault according to this embodiment includes:
and S410, under the condition that the first node and the second node both operate normally, acquiring second accounting data from the second blockchain network, and acquiring first accounting data of the first blockchain network from the first node.
S420, acquiring first accounting data from the first blockchain network during the first node failure.
S430, synchronizing the first accounting data acquired from the first blockchain network during the failure of the first node to the first node in case of failure recovery of the first node.
The first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node normally operates; and the first node is also used for acquiring second accounting data of the second block chain network from the second node under the condition that the first node and the second node both operate normally.
Fig. 4 b-4 d are schematic diagrams illustrating the operation of a first node and a second node in a dual-node dual-block chain according to an embodiment of the present disclosure. Under the condition of double-node double-block chain, a first node is accessed to a first block chain network, a second node is accessed to a second block chain network, wherein the first block chain network and the second block chain network are different, namely, the intelligent contract set by the first node and the second node and the recorded account book data are different.
Referring to fig. 4b, in the case that both the first node and the second node operate normally, the first node acquires the first accounting data from the first blockchain network, the second node acquires the second accounting data from the second blockchain network, and the second node further synchronizes the second accounting data to the first node and acquires the first accounting data synchronized by the first node.
Referring to fig. 4c, during a failure of the first node, the second node not only obtains the second accounting data from the second blockchain network, but also accesses the first blockchain network and obtains the first accounting data from the first blockchain network. Accordingly, during a failure of the second node, the first node obtains not only the first accounting data from the first blockchain network, but also the second accounting data from the second blockchain network.
Referring to fig. 4d, in case of failure recovery of the first node, a communication connection between the first node and the second node is established, and the second node synchronizes the first accounting data acquired from the first blockchain network during failure of the first node to the first node until the first accounting data of the first node and the second node are completely synchronized, e.g. the block heights are the same. The second node disconnects the first blockchain network, and the first node is accessed into the first blockchain network again so as to use the first node as an accounting node of the first blockchain network.
In the technical scheme of the double-node double-chain accounting, one node of the member mechanism is accessed to a first block chain network to obtain first accounting data, and the other node is accessed to a second block chain network to obtain second accounting data. And under the condition that the first node is abnormal, the second node is also accessed into the first block chain network to acquire the first accounting data from the first block chain network. And under the condition that the first node is recovered from the fault, the second node also synchronizes first accounting data during the fault of the first node to the first node, and after the synchronization is completed, the first node is accessed to the first block chain network again and the connection between the second node and the first block chain network is disconnected. By using the double nodes as the accounting nodes of different blockchain networks, the accounting data of different blockchain networks can be still recorded under the condition that any one node fails, and the stability of the blockchain networks is improved.
According to the technical scheme of the embodiment of the application, the two nodes in the member mechanism are respectively used as the accounting nodes of different block chain networks, so that the accounting data of the different block chain networks can be still recorded under the condition that any one node fails, and the stability of the block chain networks is improved.
In the above technical solution, the operation of the second node acquiring the first accounting data of the first blockchain network from the first node may specifically include the following several cases:
firstly, acquiring the full amount of block data and compiled intelligent contract data in a first block chain network from a first node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In this embodiment of the application, the transaction status data may be a statistical result of the blockchain data, and taking the blockchain data as a transfer transaction record as an example, the transaction status data may be an account balance of a blockchain account. By synchronizing the full blockchain data and the compiled intelligent contract data from the first node, the second node can determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockchain data, the intelligent contract data, and the determined transaction state data in the event of startup of the second node, such as a failure of the first node. Under the condition of limited network resources, the second node synchronizes the whole block data from the first node, so that the block data can be prevented from being tampered.
And secondly, acquiring transaction state data, compiled intelligent contract data and the latest N blocks of data in the first blockchain network from the first node.
In this embodiment of the present application, a value of N may be determined according to a service requirement, or may be a default value, for example, 100. The second node synchronizes the transaction state data, the intelligent contract data and the latest N blocks of data from the first node, so that in the starting condition of the second node, whether the block height associated with the latest transaction state data is the same as the block chain height associated with the latest block can be detected, in the same condition, the accounting node service can be provided by directly using the transaction state data and the intelligent contract data, in the condition that the block height associated with the latest transaction state data (for example, 98) is smaller than the block height associated with the latest block (for example, 120), the transaction block data can be supplemented according to the latest N blocks of block chain data, and the accounting service can be provided according to the supplemented transaction state data and the intelligent contract data. By synchronizing the transaction state data, the amount of the transaction state data determined under the condition of starting the second node can be reduced, so that the starting efficiency of the second node can be improved.
Thirdly, acquiring block data and compiled intelligent contract data in the first block chain network from the first node in real time; and updating the transaction state data in the first blockchain network according to a fixed time interval.
The second node synchronizes the block data (namely, the full-amount block data) and the compiled intelligent contract data in real time from the first node, and under the condition that the second node is not connected to the first block chain network, regularly starts the ledger data processing program of the second node, and processes the first ledger data to update the local transaction state data. The transaction state data are updated at regular time through the second node, so that the starting efficiency of the second node under the condition of the failure of the first node can be improved, and the accuracy of the transaction state data can be improved.
Fig. 5 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The embodiment can be applied to the accounting verification process of the node to the block in the member institution. The node fault handling method disclosed in this embodiment may be executed by an electronic device, and specifically may be executed by a node fault handling apparatus, where the apparatus may be implemented by software and/or hardware, and is disposed in the electronic device, for example, in a first node of a member institution. Referring to fig. 5, the method for processing a node fault according to this embodiment includes:
and S510, acquiring first accounting data from the first block chain network under the condition that the first node normally operates.
S520, under the condition that the first node is recovered from the fault, synchronizing first accounting data acquired by the second node from the first block chain network during the fault of the first node.
In the embodiment of the present application, the member institution may set at least a first node and a second node. The member institution may perform single-node accounting, that is, only one of the nodes has access to the blockchain network as an accounting node, the other node is not started offline, and does not have access to the blockchain network, and as a common node, for example, data traffic of a service layer and a network layer of the member institution reaches the accounting node but not the common node. The member institution may also perform two-node accounting of the two nodes, for example, the first node and the second node both belong to accounting nodes of different blockchain networks, or the first node and the second node respectively belong to accounting nodes of different blockchain networks. It should be noted that, in the embodiment of the present application, the number of nodes in the member organization is not specifically limited, for example, as the number of access block chain networks increases, the number of nodes may increase.
The first node is used as an accounting node of the first block chain network, and under the normal operation condition, first accounting data are obtained from the first block chain network; during the first node failure, the first accounting data cannot be recorded continuously, for example, the connection between the first node and the first blockchain network may be disconnected, and the first node may be subjected to offline failure recovery processing, and accordingly, the second node is configured to acquire the first accounting data from the first blockchain network during the first node failure; in the case of a failure recovery of the first node, the first node establishes a communication connection with the second node, and first accounting data acquired by the second node from the first blockchain network during the failure of the first node is synchronized from the second node. Through the mutual cooperation of the first node and the second node, under the condition that the first node fails, the accounting data of the first block chain network can be recorded through the second node, and the accounting stability of the first block chain network is improved.
According to the technical scheme provided by the embodiment of the application, the first node and the second node are set to be disaster-tolerant backup through the member mechanism, and when one node fails, the normal operation of the member mechanism can be kept through other nodes, so that the accounting stability of the member mechanism is improved.
In the above technical solution, the first node and the second node are disposed in different internet machine rooms of a member organization. Through setting up first node and second node respectively in different internet computer rooms, can avoid leading to first node, second node trouble simultaneously because of the computer lab environment to further improve stability.
Fig. 6 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 6, the method for processing a node fault according to this embodiment includes:
s610, under the condition that the first node normally operates, first accounting data are obtained from the first block chain network.
S620, under the condition that the first node normally operates, synchronizing the first accounting data acquired from the first blockchain network to the second node.
S630, synchronizing the first accounting data acquired from the first blockchain network during the failure of the first node to the first node in case of the failure recovery of the first node.
Under the condition of single-node accounting, under the condition that the first node normally operates, the first node acquires first accounting data from the first block chain network, namely the first node is used as an accounting node of the first block chain network; the first node also synchronizes first accounting data obtained from the first blockchain network to a second node, the second node being configured to obtain the first accounting data of the first blockchain network from the first node. It should be noted that, under the condition that the first node operates normally, only the first node is accessed to the first blockchain network, and the second node is offline and is not started to be accessed to the first blockchain network, and serves as a common node.
During the first node failure, the first node can be offline without accessing the first blockchain network, and the first node is subjected to failure recovery; the second node is configured to access the first blockchain network and obtain first accounting data from the first blockchain network during a failure of the first node.
In case of failure recovery of the first node, a communication connection between the first node and the second node is established, the first node further synchronizing first accounting data during failure of the first node from the second node. After the first accounting data of the first node and the second node are synchronized, for example, after the block heights are the same, the second node may be continuously used as the accounting node according to the service demand, the first node may be used as a common node, or the first node may be used as the accounting node, and the second node may be used as a common node. Specifically, the first blockchain traffic of the service layer and the network layer may be controlled by the node grid to continue using the second node or to switch back to the first node.
In the single-node accounting technical scheme, one node of the member mechanism is used as an accounting node to be accessed to the first block chain network to obtain first accounting data, the other node is used as a common node to be offline and not accessed to the first block chain network, and the two nodes can be used as the accounting node and the common node in different periods. And under the condition that the accounting node is abnormal, the common node accesses the first blockchain network to acquire the first accounting data in the fault period of the accounting node, and under the condition that the fault of the accounting node is recovered, the first accounting data in the fault period of the accounting node is synchronized to the accounting node, so that the first accounting data of the two nodes are synchronized.
According to the technical scheme of the embodiment of the application, only one node in the member mechanism is used as the accounting node, namely only one node verifies the existing block in the first block chain, and the other node is used as a common node and does not need to verify the existing block, so that the stability of the member mechanism can be improved, and the resource consumption of block verification can be reduced.
In the above technical solution, the operation of the first node synchronizing the first accounting data acquired from the first blockchain network to the second node may specifically include the following several cases:
firstly, synchronizing the full amount of block data and the compiled intelligent contract data in the first block chain network to a second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In this embodiment of the application, the transaction status data may be a statistical result of the blockchain data, and taking the blockchain data as a transfer transaction record as an example, the transaction status data may be an account balance of a blockchain account. The first node synchronizes full blockchain data and the compiled intelligent contract data to the second node, and in the event of a startup of the second node, such as a failure of the first node, the second node may determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockchain data, the intelligent contract data, and the determined transaction state data. Under the condition of limited network resources, the second node synchronizes the whole block data from the first node, so that the block data can be prevented from being tampered.
And secondly, synchronizing the full amount of transaction state data, the compiled intelligent contract data and the latest N pieces of block data in the first block chain network to a second node.
In this embodiment of the present application, a value of N may be determined according to a service requirement, or may be a default value, for example, 100. The first node may synchronize the transaction state data, the intelligent contract data and the latest N pieces of block data with the second node, so that in a case where the second node is started, it may be detected whether a block height associated with the latest transaction state data is the same as a block chain height associated with the latest block, in the same case, the transaction state data and the intelligent contract data may be directly used to provide an accounting node service, in a case where the block height associated with the latest transaction state data (e.g., 98) is smaller than the block height associated with the latest block (e.g., 120), the transaction block data may be supplemented according to the latest N pieces of block chain data, and the accounting service may be provided according to the supplemented transaction state data and the intelligent contract data. By synchronizing the transaction state data, the amount of the transaction state data determined under the condition of starting the second node can be reduced, so that the starting efficiency of the second node can be improved.
And thirdly, synchronizing the block data in the first block chain network and the compiled intelligent contract data to the second node in real time, so that the second node updates the transaction state data according to a fixed time interval.
The first node may synchronize block data (i.e., full-volume block data) and compiled intelligent contract data in real time to the second node, so that the second node starts an account book data processing program of the second node at regular time and processes the first account book data to update local transaction state data without accessing the first blockchain network. The transaction state data are updated at regular time through the second node, so that the starting efficiency of the second node under the condition of the failure of the first node can be improved, and the accuracy of the transaction state data can be improved.
The present embodiment is an alternative proposed on the basis of the above-described embodiments. In the method for processing a node failure provided in this embodiment, the second node is configured to obtain the first accounting data from the first blockchain network.
Under the condition of the dual-node single blockchain in the embodiment, the first node and the second node are both accessed to the first blockchain network, the set intelligent contracts are the same, and the recorded account book data are the same.
Under the condition that the first node normally operates, the first node and the second node both start to access the first block chain network, and obtain first accounting data from the first block chain network, namely the first node and the second node are used as accounting nodes of the first block chain network. Because the first node and the second node are both accounting nodes of the first block chain network, under the condition that the first node operates normally, data does not need to be synchronized between the first node and the second node. It should be noted that, in the case of a dual-node single-block chain, the first node and the second node are in a parallel relationship, and may not be distinguished, that is, any one of the nodes may be the first node, and the other is the second node.
And during the failure of the first node, the second node continuously acquires the first accounting data from the first blockchain network, the first node is disconnected from the first blockchain network, and the first node is recovered from the failure offline.
And under the condition that the first node is recovered from the fault, establishing a communication connection between the first node and the second node, acquiring first accounting data during the fault of the first node from the second node by the first node until the first accounting data of the first node and the second node are synchronized, for example, the block heights are the same, and re-accessing the first node to the first blockchain network.
In the technical scheme of the double-node single-chain accounting, two nodes of a member mechanism are used as accounting nodes to be accessed into a first block chain network to obtain first accounting data. And in case of abnormality of one of the accounting nodes (i.e. the first node), the other accounting node (i.e. the second node) continues to acquire the first accounting data from the first blockchain network, and in case of failure recovery of the first node, the second node is further configured to synchronize the first accounting data during failure of the first node to the first node, and after completion of synchronization, re-access the first node to the first blockchain network. By using the double nodes as the accounting nodes of the same block chain, the first accounting data can be still recorded under the condition that any one node fails, and the data does not need to be synchronized under the condition that the double nodes normally operate.
According to the technical scheme, the two nodes in the member mechanism are used as the accounting nodes of the same block chain network, so that the stability of the member mechanism can be improved, and data communication between the two nodes can be reduced.
Fig. 7 is a schematic flowchart of a method for processing a fault of a node according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 7, the method for processing a node fault according to this embodiment includes:
and S710, acquiring first accounting data from the first block chain network under the condition that the first node normally operates.
S720, under the condition that the first node is recovered from the fault, synchronizing first accounting data acquired by the second node from the first block chain network during the fault of the first node.
And S730, under the condition that the first node and the second node both run normally, synchronizing the first accounting data acquired from the first blockchain network to the second node.
And the second node is used for synchronizing the second accounting data acquired from the second blockchain network to the first node under the condition that the first node and the second node both run normally.
The first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node normally operates; and the first node is also used for acquiring second accounting data of the second block chain network from the second node under the condition that the first node and the second node both operate normally.
Under the condition of double-node double-block chain, a first node is accessed to a first block chain network, a second node is accessed to a second block chain network, wherein the first block chain network and the second block chain network are different, namely, the intelligent contract set by the first node and the second node and the recorded account book data are different.
Under the condition that the first node and the second node both operate normally, the first node acquires first accounting data from the first blockchain network, the second node acquires second accounting data from the second blockchain network, and the second node synchronizes the first accounting data to the second node and acquires the second accounting data synchronized by the second node.
During a failure of the first node, the first node may be failover. The second node is not only configured to obtain the second accounting data from the second blockchain network, but also to access the first blockchain network, and is configured to obtain the first accounting data from the first blockchain network.
Establishing a communication connection between a first node and a second node, the first node acquiring first accounting data during the first node failure from the second node until the first accounting data of the first node and the second node are synchronized, for example, the block heights are the same, the second node disconnecting the first blockchain network, and re-accessing the first node to the first blockchain network to use the first node as an accounting node of the first blockchain network.
In the technical scheme of the double-node double-chain accounting, one node of the member mechanism is accessed to a first block chain network to obtain first accounting data, and the other node is accessed to a second block chain network to obtain second accounting data. And under the condition that the first node is abnormal, the second node is also used for accessing the first block chain network to acquire the first accounting data from the first block chain network. And under the condition of recovering the first node from the fault, the first node acquires the first accounting data in the first node fault period from the second node, and after the synchronization is completed, the first node is accessed to the first blockchain network again, and the second node is disconnected from the first blockchain network. By using the double nodes as the accounting nodes of different blockchain networks, the accounting data of different blockchain networks can be still recorded under the condition that any one node fails, and the stability of the blockchain networks is improved.
According to the technical scheme of the embodiment of the application, the two nodes in the member mechanism are respectively used as the accounting nodes of different block chain networks, so that the accounting data of the different block chain networks can be still recorded under the condition that any one node fails, and the stability of the block chain networks is improved.
In the above technical solution, the operation of the first node synchronizing the first accounting data acquired from the first blockchain network to the second node may specifically include the following several cases:
firstly, synchronizing the full amount of block data and the compiled intelligent contract data in the first block chain network to a second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In this embodiment of the application, the transaction status data may be a statistical result of the blockchain data, and taking the blockchain data as a transfer transaction record as an example, the transaction status data may be an account balance of a blockchain account. The first node synchronizes full blockchain data and the compiled intelligent contract data to the second node, and in the event of a startup of the second node, such as a failure of the first node, the second node may determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockchain data, the intelligent contract data, and the determined transaction state data. Under the condition of limited network resources, the second node synchronizes the whole block data from the first node, so that the block data can be prevented from being tampered.
And secondly, synchronizing the full amount of transaction state data, the compiled intelligent contract data and the latest N pieces of block data in the first block chain network to a second node.
In this embodiment of the present application, a value of N may be determined according to a service requirement, or may be a default value, for example, 100. The first node may synchronize the transaction state data, the intelligent contract data and the latest N pieces of block data with the second node, so that in a case where the second node is started, it may be detected whether a block height associated with the latest transaction state data is the same as a block chain height associated with the latest block, in the same case, the transaction state data and the intelligent contract data may be directly used to provide an accounting node service, in a case where the block height associated with the latest transaction state data (e.g., 98) is smaller than the block height associated with the latest block (e.g., 120), the transaction block data may be supplemented according to the latest N pieces of block chain data, and the accounting service may be provided according to the supplemented transaction state data and the intelligent contract data. By synchronizing the transaction state data, the amount of the transaction state data determined under the condition of starting the second node can be reduced, so that the starting efficiency of the second node can be improved.
And thirdly, synchronizing the block data in the first block chain network and the compiled intelligent contract data to the second node in real time, so that the second node updates the transaction state data according to a fixed time interval.
The first node may synchronize block data (i.e., full-volume block data) and compiled intelligent contract data in real time to the second node, so that the second node starts an account book data processing program of the second node at regular time and processes the first account book data to update local transaction state data without accessing the first blockchain network. The transaction state data are updated at regular time through the second node, so that the starting efficiency of the second node under the condition of the failure of the first node can be improved, and the accuracy of the transaction state data can be improved.
Fig. 8 is a schematic structural diagram of a fault handling apparatus of a node according to an embodiment of the present application. Referring to fig. 8, a fault handling apparatus 800 of a node according to an embodiment of the present disclosure may include:
a backup accounting module 801, configured to obtain first accounting data from the first blockchain network during a failure of the first node;
a first accounting book sending module 802, configured to synchronize, to a first node, first accounting data acquired from a first blockchain network during a failure of the first node in a case where the failure of the first node is recovered;
the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node.
In an optional implementation, the fault handling apparatus 800 of the node further includes:
the first account book processing module is used for acquiring first account book data of the first block chain network from the first node under the condition that the first node normally operates.
In an optional implementation, the fault handling apparatus 800 of the node further includes:
and the first accounting module is used for acquiring first accounting data from the first blockchain network under the condition that the first node normally operates.
In an optional implementation, the fault handling apparatus 800 of the node further includes:
the second account book processing module is used for acquiring second accounting data from the second block chain network and acquiring first accounting data of the first block chain network from the first node under the condition that the first node and the second node both operate normally;
and the first node is also used for acquiring second accounting data of the second block chain network from the second node under the condition that the first node and the second node both operate normally.
In an optional implementation manner, the first ledger processing module or the second ledger processing module is specifically configured to:
acquiring full block data and compiled intelligent contract data in a first block chain network from a first node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In an optional implementation manner, the first ledger receiving module or the second ledger processing module is specifically configured to:
transaction state data, compiled smart contract data, and the latest N block data in the first blockchain network are obtained from the first node.
In an optional implementation manner, the first ledger receiving module or the second ledger processing module is specifically configured to:
acquiring block data and compiled intelligent contract data in a first block chain network from a first node in real time;
and updating the transaction state data in the first blockchain network according to a fixed time interval.
In an alternative embodiment, the first node and the second node are located in different internet rooms of the member institution.
According to the technical scheme of the embodiment of the application, the first node and the second node are set to be disaster-tolerant backup through the member mechanism, and when one node fails, the member mechanism can keep normal operation through other nodes, so that the stability of the member mechanism is improved.
Fig. 9 is a schematic structural diagram of a fault handling apparatus of a node according to an embodiment of the present application. Referring to fig. 9, a fault handling apparatus 900 of a node according to an embodiment of the present application may include:
a first accounting module 901, configured to obtain first accounting data from the first blockchain network under a condition that a first node operates normally;
a first accounting receiving module 902, configured to synchronize first accounting data, acquired by a second node from a first blockchain network during a failure of a first node, in case of failure recovery of the first node.
In an alternative embodiment, the fault handling apparatus 900 of the node further includes:
and the first account book processing module is used for synchronizing the first accounting data acquired from the first blockchain network to the second node under the condition that the first node normally operates.
In an alternative embodiment, the second node is configured to obtain the first accounting data from the first blockchain network.
In an alternative embodiment, the fault handling apparatus 900 of the node further includes:
the second accounting book processing module is used for synchronizing the first accounting data acquired from the first block chain network to the second node under the condition that the first node and the second node both operate normally;
and the second node is used for synchronizing the second accounting data acquired from the second blockchain network to the first node under the condition that the first node and the second node both run normally.
In an optional implementation manner, the first ledger processing module or the second ledger processing module is specifically configured to:
synchronizing to a second node a full amount of block data and compiled smart contract data in the first blockchain network; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In an optional implementation manner, the first ledger processing module or the second ledger processing module is specifically configured to:
the full amount of transaction state data, the compiled smart contract data, and the latest N block data in the first blockchain network are synchronized to the second node.
In an optional implementation manner, the first ledger processing module or the second ledger processing module is specifically configured to:
and synchronizing the block data in the first block chain network and the compiled intelligent contract data to the second node in real time, so that the second node updates the transaction state data according to a fixed time interval.
In an alternative embodiment, the first node and the second node are located in different internet rooms of the member institution.
According to the technical scheme of the embodiment of the application, the first node and the second node are set to be disaster-tolerant backup through the member mechanism, and when one node fails, normal operation of the member mechanism can be kept through other nodes, so that the accounting stability of the member mechanism is improved.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 executes the respective methods and processes described above, such as the failure processing method of the node. For example, in some embodiments, the node's fault handling method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the above-described method of fault handling of a node may be performed. Alternatively, in other embodiments, the computing unit 1001 may be arranged to perform the fault handling method of the node by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (27)

1. A fault handling method of a node comprises the following steps:
obtaining first accounting data from a first blockchain network during a failure of a first node;
synchronizing first accounting data acquired from a first blockchain network during a first node failure to the first node in the case of a first node failure recovery;
the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node.
2. The method of claim 1, further comprising:
under the condition that the first node normally operates, first accounting data of the first block chain network are obtained from the first node; or the like, or, alternatively,
first accounting data is obtained from a first blockchain network under normal operation of a first node.
3. The method of claim 1, further comprising:
under the condition that the first node and the second node both operate normally, acquiring second accounting data from the second blockchain network, and acquiring first accounting data of the first blockchain network from the first node;
and the first node is also used for acquiring second accounting data of the second block chain network from the second node under the condition that the first node and the second node both operate normally.
4. A method according to claim 2 or 3, wherein said obtaining first accounting data for the first blockchain network from the first node comprises:
acquiring full block data and compiled intelligent contract data in a first block chain network from a first node; wherein the full amount of block data is used to determine transaction state data in a first blockchain network; or the like, or, alternatively,
transaction state data, compiled smart contract data, and the latest N block data in the first blockchain network are obtained from the first node.
5. A method according to claim 2 or 3, wherein said obtaining first accounting data for the first blockchain network from the first node comprises:
acquiring block data and compiled intelligent contract data in a first block chain network from a first node in real time;
and updating the transaction state data in the first blockchain network according to a fixed time interval.
6. The method of any of claims 1-3, wherein the first node and the second node are located in different Internet rooms of a member facility.
7. A fault handling method of a node comprises the following steps:
acquiring first accounting data from the first blockchain network under the condition that the first node normally operates;
in the case of a failure recovery of the first node, first accounting data acquired by the second node from the first blockchain network during the failure of the first node is synchronized.
8. The method of claim 7, further comprising:
under the condition that the first node normally operates, first accounting data acquired from the first blockchain network is synchronized to the second node; or the like, or, alternatively,
the second node is configured to obtain first accounting data from a first blockchain network.
9. The method of claim 7, further comprising:
under the condition that the first node and the second node both operate normally, first accounting data acquired from the first blockchain network is synchronized to the second node;
and the second node is used for synchronizing the second accounting data acquired from the second blockchain network to the first node under the condition that the first node and the second node both run normally.
10. The method of claim 8 or 9, wherein synchronizing the first accounting data acquired from the first blockchain network to the second node comprises:
synchronizing to a second node a full amount of block data and compiled smart contract data in the first blockchain network; wherein the full amount of block data is used to determine transaction state data in a first blockchain network; or the like, or, alternatively,
the full amount of transaction state data, the compiled smart contract data, and the latest N block data in the first blockchain network are synchronized to the second node.
11. The method of claim 8 or 9, wherein synchronizing the first accounting data acquired from the first blockchain network to the second node comprises:
and synchronizing the block data in the first block chain network and the compiled intelligent contract data to the second node in real time, so that the second node updates the transaction state data according to a fixed time interval.
12. The method of any of claims 7-9, wherein the first node and the second node are located in different internet facilities of a member organization.
13. A fault handling apparatus of a node, comprising:
the backup accounting module is used for acquiring first accounting data from the first blockchain network during the failure of the first node;
the first accounting book sending module is used for synchronizing first accounting data acquired from a first blockchain network during the first node failure to the first node under the condition that the first node failure is recovered;
the first node is configured to obtain first accounting data from the first blockchain network under a normal operation condition of the first node.
14. The apparatus of claim 13, further comprising:
the first account book processing module is used for acquiring first account book data of the first block chain network from the first node under the condition that the first node normally operates; or the like, or, alternatively,
and the first accounting module is used for acquiring first accounting data from the first blockchain network under the condition that the first node normally operates.
15. The apparatus of claim 13, further comprising:
the second account book processing module is used for acquiring second accounting data from the second block chain network and acquiring first accounting data of the first block chain network from the first node under the condition that the first node and the second node both operate normally;
and the first node is also used for acquiring second accounting data of the second block chain network from the second node under the condition that the first node and the second node both operate normally.
16. The apparatus of claim 14 or 15, wherein the first ledger processing module or the second ledger processing module is specifically configured to:
acquiring full block data and compiled intelligent contract data in a first block chain network from a first node; wherein the full amount of block data is used to determine transaction state data in a first blockchain network; or the like, or, alternatively,
transaction state data, compiled smart contract data, and the latest N block data in the first blockchain network are obtained from the first node.
17. The apparatus of claim 14 or 15, wherein the first ledger reception module or the second ledger processing module is specifically configured to:
acquiring block data and compiled intelligent contract data in a first block chain network from a first node in real time;
and updating the transaction state data in the first blockchain network according to a fixed time interval.
18. The apparatus of any of claims 13-15, wherein the first node and the second node are disposed in different internet facilities of a member institution.
19. A fault handling apparatus of a node, comprising:
the first accounting module is used for acquiring first accounting data from the first block chain network under the condition that the first node normally operates;
the first accounting receiving module is configured to synchronize first accounting data, which is obtained by the second node from the first blockchain network during the failure of the first node, when the failure of the first node is recovered.
20. The apparatus of claim 19, further comprising:
the first accounting book processing module is used for synchronizing first accounting data acquired from the first blockchain network to the second node under the condition that the first node normally operates; or the like, or, alternatively,
the second node is configured to obtain first accounting data from a first blockchain network.
21. The apparatus of claim 19, further comprising:
the second accounting book processing module is used for synchronizing the first accounting data acquired from the first block chain network to the second node under the condition that the first node and the second node both operate normally;
and the second node is used for synchronizing the second accounting data acquired from the second blockchain network to the first node under the condition that the first node and the second node both run normally.
22. The apparatus of claim 20 or 21, wherein the first ledger processing module or the second ledger processing module is specifically configured to:
synchronizing to a second node a full amount of block data and compiled smart contract data in the first blockchain network; wherein the full amount of block data is used to determine transaction state data in a first blockchain network; or the like, or, alternatively,
the full amount of transaction state data, the compiled smart contract data, and the latest N block data in the first blockchain network are synchronized to the second node.
23. The apparatus of claim 20 or 21, wherein the first ledger processing module or the second ledger processing module is specifically configured to:
and synchronizing the block data in the first block chain network and the compiled intelligent contract data to the second node in real time, so that the second node updates the transaction state data according to a fixed time interval.
24. The apparatus of any of claims 19-21, wherein the first node and the second node are disposed in different internet facilities of a member institution.
25. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.
26. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-12.
27. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-12.
CN202110055423.3A 2021-01-15 2021-01-15 Fault processing method, device, equipment and storage medium of node Active CN112799879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110055423.3A CN112799879B (en) 2021-01-15 2021-01-15 Fault processing method, device, equipment and storage medium of node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110055423.3A CN112799879B (en) 2021-01-15 2021-01-15 Fault processing method, device, equipment and storage medium of node

Publications (2)

Publication Number Publication Date
CN112799879A true CN112799879A (en) 2021-05-14
CN112799879B CN112799879B (en) 2024-04-05

Family

ID=75809711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110055423.3A Active CN112799879B (en) 2021-01-15 2021-01-15 Fault processing method, device, equipment and storage medium of node

Country Status (1)

Country Link
CN (1) CN112799879B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221777A (en) * 2021-08-17 2022-03-22 北京恒安嘉新安全技术有限公司 Digital currency flow self-synchronization monitoring method, device and equipment under limited condition

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state
CN109542980A (en) * 2018-11-20 2019-03-29 北京磁云数字科技有限公司 A kind of data processing method, device, equipment and the medium of block chain
CN109559223A (en) * 2018-10-10 2019-04-02 远光软件股份有限公司 A kind of method of commerce based on block chain technology, device and block chain network
CN110322352A (en) * 2019-07-09 2019-10-11 深圳市炳德区块链技术有限公司 A kind of account book foundation and querying method, electronic equipment based on block chain
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
US20200159717A1 (en) * 2018-11-15 2020-05-21 Nhn Corporation Method and blockchain for constructing sub blockchain in blockchain system comprising distributed network of plurality of nodes
US20200167367A1 (en) * 2019-07-31 2020-05-28 Alibaba Group Holding Limited Block chain state data synchronization method, apparatus, and electronic device
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Hot switching method for main and standby nodes, block chain system, block chain node and medium
WO2020133148A1 (en) * 2018-12-28 2020-07-02 合肥达朴汇联科技有限公司 Data processing method and apparatus for blockchain, and blockchain system
US20200272934A1 (en) * 2019-02-21 2020-08-27 Hewlett Packard Enterprise Development Lp System and method for self-healing in decentralized model building for machine learning using blockchain

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state
CN109559223A (en) * 2018-10-10 2019-04-02 远光软件股份有限公司 A kind of method of commerce based on block chain technology, device and block chain network
US20200159717A1 (en) * 2018-11-15 2020-05-21 Nhn Corporation Method and blockchain for constructing sub blockchain in blockchain system comprising distributed network of plurality of nodes
CN109542980A (en) * 2018-11-20 2019-03-29 北京磁云数字科技有限公司 A kind of data processing method, device, equipment and the medium of block chain
WO2020133148A1 (en) * 2018-12-28 2020-07-02 合肥达朴汇联科技有限公司 Data processing method and apparatus for blockchain, and blockchain system
US20200272934A1 (en) * 2019-02-21 2020-08-27 Hewlett Packard Enterprise Development Lp System and method for self-healing in decentralized model building for machine learning using blockchain
CN110322352A (en) * 2019-07-09 2019-10-11 深圳市炳德区块链技术有限公司 A kind of account book foundation and querying method, electronic equipment based on block chain
US20200167367A1 (en) * 2019-07-31 2020-05-28 Alibaba Group Holding Limited Block chain state data synchronization method, apparatus, and electronic device
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Hot switching method for main and standby nodes, block chain system, block chain node and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘东伟;张学旺;郭晓金;: "基于区块链的学位证书存证系统设计与实现", 计算机工程与设计, no. 02, 16 February 2020 (2020-02-16) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221777A (en) * 2021-08-17 2022-03-22 北京恒安嘉新安全技术有限公司 Digital currency flow self-synchronization monitoring method, device and equipment under limited condition
CN114221777B (en) * 2021-08-17 2024-01-30 北京恒安嘉新安全技术有限公司 Digital currency flow self-synchronization monitoring method, device and equipment under limited condition

Also Published As

Publication number Publication date
CN112799879B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN111091429B (en) Electronic bill identification distribution method and device and electronic bill generation system
CN109951331B (en) Method, device and computing cluster for sending information
CN111124755A (en) Cluster node fault recovery method and device, electronic equipment and storage medium
CN112835616A (en) Version upgrading method and device, electronic equipment and storage medium
CN111338834B (en) Data storage method and device
CN114327804B (en) Block chain based distributed transaction processing method, device, equipment and medium
CN112799879B (en) Fault processing method, device, equipment and storage medium of node
CN114064438A (en) Database fault processing method and device
EP4060514A1 (en) Distributed database system and data disaster backup drilling method
CN103780433B (en) Self-healing type virtual resource configuration management data architecture
CN115543423A (en) Method, device and equipment for generating benchmarks and storage medium
CN115510036A (en) Data migration method, device, equipment and storage medium
CN113641688B (en) Node updating method, related device and computer program product
US9860112B2 (en) Techniques for synchronizing operations between regions when a network connection fails
CN114116288A (en) Fault processing method, device and computer program product
CN113760469A (en) Distributed computing method and device
CN114546705B (en) Operation response method, operation response device, electronic apparatus, and storage medium
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN113872808B (en) Application processing method and device
CN117113942B (en) Model synchronization method and device, electronic equipment and storage medium
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
US20150278036A1 (en) Information processing system and method of same
CN116881229A (en) Database exercise environment construction method, device, equipment and storage medium
CN115640361A (en) Data processing method, device, equipment and storage medium between isomorphic databases
CN115391046A (en) Quota management method, device, equipment and medium

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