CN112799879B - Fault processing method, device, equipment and storage medium of node - Google Patents

Fault processing method, device, equipment and storage medium of node Download PDF

Info

Publication number
CN112799879B
CN112799879B CN202110055423.3A CN202110055423A CN112799879B CN 112799879 B CN112799879 B CN 112799879B CN 202110055423 A CN202110055423 A CN 202110055423A CN 112799879 B CN112799879 B CN 112799879B
Authority
CN
China
Prior art keywords
node
data
blockchain network
accounting
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.)
Active
Application number
CN202110055423.3A
Other languages
Chinese (zh)
Other versions
CN112799879A (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

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 fault processing method, device, equipment and storage medium of a node, relates to the technical field of blockchain, and can be used for cloud computing and cloud service. The specific implementation scheme is as follows: synchronizing first accounting data acquired from the first blockchain network during the first node failure to the first node under the first node failure recovery condition; the first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node operates normally. The method and the device can improve the billing stability of the institutions in the alliance network.

Description

Fault processing method, device, equipment and storage medium of node
Technical Field
The disclosure relates to the technical field of computers, in particular to the technical field of blockchain, and specifically relates to a node fault processing method, device, equipment and storage medium.
Background
With the development of blockchain technology, the application of alliance networks is becoming more and more widespread. A federated network is typically built by an organization, typically maintained by a plurality of nodes of different federations, and may include at least one federated chain, where each federated chain may be in parallel-chain or sub-chain relationship.
However, network operation by the organizations in the federated network is subject to a number of constraints, and improvements are needed.
Disclosure of Invention
The disclosure provides a fault processing method, device, equipment and storage medium for a node.
According to an aspect of the present disclosure, there is provided a fault handling method of a node, including:
acquiring first accounting data from a first blockchain network during a first node failure;
synchronizing first accounting data acquired from the first blockchain network during the first node failure to the first node under the first node failure recovery condition;
the first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node operates normally.
According to another aspect of the present disclosure, there is provided a fault handling method of another node, including:
under the condition that a first node normally operates, acquiring first accounting data from the first blockchain network;
in the event of a failure recovery of the first node, the second node is synchronized with first accounting data acquired from the first blockchain network during the failure of the first node.
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 account book sending module is used for synchronizing first account data acquired from the first blockchain network during the fault period of the first node to the first node under the fault recovery condition 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 operates normally.
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 blockchain network under the condition that a first node normally operates;
and the first account book receiving module is used for synchronizing the first account data acquired by the second node from the first blockchain network during the fault period of the first node under the fault recovery condition of the first node.
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 memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of fault handling of a node as claimed 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 the computer to perform a method of fault handling of a node as in any 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 a method of fault handling for a node according to any of the embodiments of the present application.
The techniques according to the present application can improve billing stability for an organization in a federated network.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flow chart of a fault handling method of a node according to an embodiment of the present application;
fig. 2a is a schematic flow chart of a method for processing a failure of a node according to an embodiment of the present application;
FIGS. 2 b-2 d are schematic diagrams illustrating operation of a first node and a second node, respectively, in a single-node scenario provided in accordance with embodiments of the present application;
Fig. 3a is a schematic flow chart of a method for processing a failure of a node according to an embodiment of the present application;
FIGS. 3 b-3 d are schematic diagrams illustrating operation of a first node and a second node, respectively, in the case of a dual-node single-blockchain provided in accordance with embodiments of the present application;
fig. 4a is a schematic flow chart of a method for processing a failure of a node according to an embodiment of the present application;
FIGS. 4 b-4 d are schematic diagrams illustrating operation of a first node and a second node, respectively, in the case of a dual-node dual-blockchain provided in accordance with embodiments of the present application;
fig. 5 is a flow chart of a fault handling method of a node according to an embodiment of the present application;
fig. 6 is a flow chart of a method for processing a failure of a node according to an embodiment of the present application;
fig. 7 is a flow chart of a method for processing a failure of a node according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a fault handling device of a node according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a fault handling device of a node according to an embodiment of the present application;
FIG. 10 illustrates 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 in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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 describing the embodiments of the present application, a brief description of a federation network applicable to the embodiments of the present application will be provided. The federated network typically is built up of a federated network system by a plurality of organizations, each of which may provide computing devices and storage devices to carry the operation of blockchains as blockchain nodes. One federated network may also be referred to as a federated chain, in which one or more federated networks may be created, each supporting a different service. The federated network system includes three organizations, each provided with an Internet computer room (IDS) in which electronic devices and storage devices are deployed as blockchain nodes. The federation chain may run between blockchain nodes.
In the federation network system, a part of the authorities may install the chain management client having the federation master authority as a federation master authority, a part of the authorities may install the chain management client having the sub-federation master authority as a sub-federation master authority, and a part of the authorities may install the chain management client having the member authority as a member authority. The chain management client is a blockchain service (Blockchain as a Service, baaS for short) platform client, and can control devices by interacting with blockchain link points and other hardware devices. Nodes in the member institution room are used for accounting as accounting nodes for synchronizing the generated block data through the P2P transmission of the blockchain network and verifying the generated block.
Fig. 1 is a flow chart of a fault handling method of a node according to an embodiment of the present application. The embodiment can be applied to the billing verification process of the node to the block in the member institution. The fault processing method of the node disclosed in this embodiment may be executed by an electronic device, and in particular, may be executed by a fault processing apparatus of the node, 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 provided in this embodiment includes:
S110, acquiring first accounting data from a first blockchain network during a first node failure.
And S120, under the condition of fault recovery of the first node, synchronizing the first accounting data acquired from the first blockchain network during the fault of the first node to 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 operates normally, namely the first node refers to an accounting node of the first blockchain network.
In the embodiment of the application, the member mechanism may set at least a first node and a second node. The first node is a billing node of the first blockchain 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, i.e., only one of the nodes accesses the blockchain network as an accounting node, the other node is not started off-line, does not access the blockchain network, and as a common node, data traffic of both the service layer and the network layer of the member institution reaches the accounting node, but not the common node. The member institution may also perform dual-node accounting for both nodes, e.g., 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 mechanism is not specifically limited, for example, as the number of access blockchain networks increases, the number of nodes may increase.
Acquiring first accounting data from the first blockchain network by the second node during the first node failure, the first accounting data loss during the first node failure can be avoided; in the case of the first node failure recovery, the second node synchronizes the first accounting data acquired from the first blockchain network during the first node failure to the first node, so that the first node can acquire the first accounting data during the failure, and the first node can be used as an accounting node of the first blockchain network again, and in particular, in the case of the second node failure, the first node can be directly used as the accounting node of the first blockchain network again.
According to the technical scheme, the first node and the second node are set to be disaster-tolerant and backed up by the member mechanism, and under the condition that one node fails, the normal operation of the member mechanism can be kept 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 rooms of a member institution. Through setting up first node and second node in different internet computer lab respectively, can avoid leading to first node, second node to break down simultaneously because of the computer lab environment to further improve stability.
Fig. 2a is a flow chart of a fault handling method of a node according to an embodiment of the present application. This embodiment is an alternative to the embodiments described above. Referring to fig. 2a, the method for processing a node failure provided in this embodiment includes:
s210, under the condition that the first node normally operates, first accounting data of the first blockchain network are obtained from the first node.
S220, acquiring first accounting data from a first blockchain network during a first node failure.
And S230, under the condition of fault recovery of the first node, synchronizing the first accounting data acquired from the first blockchain network during the fault of the first node to the first node.
Fig. 2b to fig. 2d are schematic diagrams of the operation of the first node and the second node, respectively, in the case of a single node according to an embodiment of the present application. Referring to fig. 2b, in a case where the first node is operating normally, the first node is configured to obtain first accounting data from the first blockchain network, that is, the first node is used 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 normal operation condition of the first node, only the first node accesses the first blockchain network, the second node is not started off-line, and does not access the first blockchain network, and is used as a common node.
Referring to fig. 2c, during a first node failure, 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 first node failure is obtained from the first blockchain network. It should be noted that, during the failure of the first node, the failure recovery may be performed for the first node.
Referring to fig. 2d, in case of a 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 the failure of the first node to 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 an accounting node according to the service requirement, the first node may be a common node (refer to fig. 2 d), the first node may also be used as an 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 can be controlled by the node grid to continuously use the second node or switch back to the first node.
In the single-node billing technical scheme, one node of a member mechanism is used as a billing node to access a first blockchain network to acquire first billing data, the other node is used as a common node to go offline, the first blockchain network is not accessed, and two nodes can be used as billing nodes and common nodes in different periods. And under the abnormal condition of the accounting node, the common node accesses the first blockchain network to acquire first accounting data during the fault period of the accounting node, and under the fault recovery condition of the accounting node, the first accounting data during 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. Only one node is used as an accounting node in the single-node accounting, 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, only one node in the member institution serves as an accounting node, namely only one node verifies the existing block in the first block chain, and the other node serves as a common node without verifying the existing block, so that the stability of the member institution is improved, and the resource consumption of block verification can be reduced.
In the above technical solution, the operation of the second node obtaining the first accounting data of the first blockchain network from the first node may specifically include the following cases:
first, acquiring the full amount of block data and compiled intelligent contract data in a first blockchain 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 the embodiment of the present application, the transaction state data may be a statistical result of blockchain data, and taking the blockchain data as an example of the transfer transaction record, the transaction state data may be an account balance of a blockchain account. By synchronizing the full amount of blockchain data and compiled smartcontract 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, smartcontract data and the determined transaction state data in the event of a second node start-up, e.g., in the event of a first node failure. 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 ensured not to be tampered.
Second, transaction state data, compiled smart contract data, and up-to-date N pieces of block data in the first blockchain network are obtained from the first node.
In this embodiment of the present application, the value of N may be determined according to the service requirement, or may be a default value, for example, 100. The second node may detect whether the block height associated with the latest transaction state data is the same as the block chain height associated with the latest block in the case that the second node is started by synchronizing the transaction state data, the smart contract data, and the latest N pieces of block data from the first node, and may directly provide the accounting node service using the transaction state data, the smart contract data in the same case, and may supplement the transaction block data according to the latest N pieces of block chain data in the case that the block height (e.g., 98) associated with the latest transaction state data is less than the block height (e.g., 120) associated with the latest block, and provide the accounting service according to the supplemented transaction state data, the smart contract data. By synchronizing the transaction state data, the amount of transaction state data determined under the condition of starting the second node can be reduced, and thus the starting efficiency of the second node can be improved.
Thirdly, acquiring block data and compiled intelligent contract data in a first block chain network from a first node in real time; transaction state data in the first blockchain network is updated at fixed time intervals.
The second node processes the first ledger data to update local transaction state data by synchronizing the block data (i.e., synchronizing the full amount of block data) and the compiled smart contract data from the first node in real time and periodically starting a ledger data processing program of the second node without the second node accessing the first blockchain network. The second node is used for updating the transaction state data at regular time, so that the starting efficiency of the second node under the condition of the first node fault can be improved, and the accuracy of the transaction state data can be improved.
Fig. 3a is a flow chart of a fault handling method of a node according to an embodiment of the present application. This embodiment is an alternative to the embodiments described above. Referring to fig. 3a, the method for processing a node failure provided in this embodiment includes:
s310, under the condition that the first node normally operates, first accounting data are acquired from the first blockchain network.
S320, acquiring first accounting data from a first blockchain network during a first node failure.
S330, under the condition of the first node fault recovery, the first accounting data acquired from the first block chain network during the first node fault is synchronized to the first node.
Fig. 3b to 3d 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 double-node single-block-chain, the first node and the second node are both connected to the first block-chain network, the set intelligent contracts are the same, and the recorded account data are the same.
Referring to fig. 3b, in the case that the first node operates normally, both the first node and the second node start to access the first blockchain network, and first accounting data is acquired 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 blockchain network, the first node and the second node do not need to synchronize data with each other under the normal running condition of the first node. In the case of the dual-node single-block chain, the first node and the second node are in parallel relationship, and may not be distinguished, i.e., any one of the nodes may be the first node, and the other node may be the second node.
Referring to fig. 3c, during a failure of the first node, the second node continues to acquire first accounting data from the first blockchain network, the first node disconnects from the first blockchain network, and the first node is recovered from the failure offline.
Referring to fig. 3d, in the event of a failure recovery of the first node, a communication connection is established between the first node and the second node, the second node synchronizes the first accounting data acquired from the first blockchain network during the failure of the first node to the first node until the first accounting data of the first node and the second node are synchronized, e.g., the blockheight is the same, and the first node is re-accessed to the first blockchain network.
In the dual-node single-chain accounting technical scheme, two nodes of a member mechanism are used as accounting nodes to access a first blockchain network to acquire first accounting data. And, in the case that one of the accounting nodes (i.e. the first node) is abnormal, the other accounting node (i.e. the second node) continues to acquire the first accounting data from the first blockchain network, in the case of the fault recovery of the first node, the second node synchronizes the first accounting data during the fault of the first node to the first node, and after the synchronization is completed, the first node is re-connected to the first blockchain network. By using the dual node as the billing node of the same blockchain, the first billing data can still be recorded under the condition of any node fault, and the synchronous data is not needed under the condition of normal operation of the dual node.
According to the technical scheme, through the fact that two nodes in the member institution are all used as accounting nodes of the same blockchain network, stability of the member institution can be improved, and data communication between the two nodes can be reduced.
Fig. 4a is a flow chart of a fault handling method of a node according to an embodiment of the present application. This embodiment is an alternative to the embodiments described above. Referring to fig. 4a, the method for processing a node failure provided in this embodiment includes:
s410, under the condition that the first node and the second node are both in normal operation, second billing data is acquired from the second blockchain network, and first billing data of the first blockchain network is acquired from the first node.
S420, acquiring first accounting data from a first blockchain network during a first node failure.
S430, in the case of failure recovery of the first node, synchronizing the first accounting data acquired from the first blockchain network during the failure of the first node to 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 operates normally; the first node is further configured to obtain second accounting data of the second blockchain network from the second node under a condition that both the first node and the second node are operating normally.
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-blockchain according to the embodiment of the present application. Under the condition of double-node double-block-chain, a first node is accessed to a first block-chain network, and 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, intelligent contracts and recorded account book data set by the first node and the second node are different.
Referring to fig. 4b, in the case where both the first node and the second node are operating 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, the second node further synchronizes the second accounting data to the first node, and acquires 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 second accounting data from the second blockchain network, but also accesses the first blockchain network from which the first accounting data is obtained. Accordingly, during a failure of the second node, the first node obtains not only the first billing data from the first blockchain network but also the second billing data from the second blockchain network.
Referring to fig. 4d, in the event of a first node failure recovery, a communication connection is established between the first node and a second node that synchronizes the first accounting data acquired from the first blockchain network during the first node failure to the first node until the first accounting data of the first node and the second node are completely synchronized, e.g., the blockheight is the same. The second node disconnects from the first blockchain network and re-accesses the first node to the first blockchain network to take the first node as a billing node of the first blockchain network.
In the dual-node double-chain billing technical scheme, one node of a member mechanism accesses a first blockchain network to acquire first billing data, and the other node accesses a second blockchain network to acquire second billing data. And under the abnormal condition of the first node, the second node also accesses the first blockchain network to acquire first accounting data from the first blockchain network. Under the condition of fault recovery of the first node, the second node synchronizes the 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 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 still be recorded under the condition of any node fault, and the stability of the blockchain networks is improved.
According to the technical scheme, two nodes in the member institution are respectively used as the accounting nodes of different blockchain networks, so that the accounting data of the different blockchain networks can still be recorded under the condition of any node fault, and the stability of the blockchain networks is improved.
In the above technical solution, the operation of the second node obtaining the first accounting data of the first blockchain network from the first node may specifically include the following cases:
first, acquiring the full amount of block data and compiled intelligent contract data in a first blockchain 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 the embodiment of the present application, the transaction state data may be a statistical result of blockchain data, and taking the blockchain data as an example of the transfer transaction record, the transaction state data may be an account balance of a blockchain account. By synchronizing the full amount of blockchain data and compiled smart 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 smart contract data, and the determined transaction state data in the event of a second node start-up, such as in the event of a first node failure. 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 ensured not to be tampered.
Second, transaction state data, compiled smart contract data, and up-to-date N pieces of block data in the first blockchain network are obtained from the first node.
In this embodiment of the present application, the value of N may be determined according to the service requirement, or may be a default value, for example, 100. The second node may detect whether the block height associated with the latest transaction state data is the same as the block chain height associated with the latest block in the case that the second node is started by synchronizing the transaction state data, the smart contract data, and the latest N pieces of block data from the first node, and may directly provide the accounting node service using the transaction state data, the smart contract data in the same case, and may supplement the transaction block data according to the latest N pieces of block chain data in the case that the block height (e.g., 98) associated with the latest transaction state data is less than the block height (e.g., 120) associated with the latest block, and provide the accounting service according to the supplemented transaction state data, the smart contract data. By synchronizing the transaction state data, the amount of transaction state data determined under the condition of starting the second node can be reduced, and thus the starting efficiency of the second node can be improved.
Thirdly, acquiring block data and compiled intelligent contract data in a first block chain network from a first node in real time; transaction state data in the first blockchain network is updated at fixed time intervals.
The second node processes the first ledger data to update local transaction state data by synchronizing the block data (i.e., synchronizing the full amount of block data) and the compiled smart contract data from the first node in real time and periodically starting a ledger data processing program of the second node without the second node accessing the first blockchain network. The second node is used for updating the transaction state data at regular time, so that the starting efficiency of the second node under the condition of the first node fault can be improved, and the accuracy of the transaction state data can be improved.
Fig. 5 is a flow chart of a fault handling method of a node according to an embodiment of the present application. The embodiment can be applied to the billing verification process of the node to the block in the member institution. The fault processing method of the node disclosed in this embodiment may be executed by an electronic device, and in particular, may be executed by a fault processing apparatus of the node, 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 provided in this embodiment includes:
S510, under the condition that the first node normally operates, first accounting data are acquired from the first blockchain network.
S520, under the condition of fault recovery of the first node, synchronizing first accounting data acquired by the second node from the first blockchain network during the fault of the first node.
In the embodiment of the application, the member mechanism may set at least a first node and a second node. The member institution may perform single-node accounting, i.e., only one of the nodes accesses the blockchain network as an accounting node, the other node is offline inactive, does not access the blockchain network, and as a common node, data traffic, such as the business layer and the network layer of the member institution, reaches the accounting node, but not the common node. The member institution may also perform dual-node accounting for both nodes, e.g., 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 mechanism is not specifically limited, for example, as the number of access blockchain networks increases, the number of nodes may increase.
The first node is used as a billing node of the first blockchain network, and under the normal operation condition, first billing data are acquired from the first blockchain network; during the failure of the first node, the first accounting data cannot be continuously recorded, for example, the connection between the first node and the first blockchain network can be disconnected, the first node is subjected to offline failure recovery processing, and accordingly, the second node is used for acquiring the first accounting data from the first blockchain network during the failure of the first node; in the event of a failure recovery of the first node, the first node establishes a communication connection with the second node, and the second node synchronizes from the second node first accounting data acquired from the first blockchain network by the second node during the failure of the first node. Through the mutual cooperation of the first node and the second node, under the condition of the fault of the first node, the accounting data of the first blockchain network can be recorded through the second node, so that the accounting stability of the first blockchain network is improved.
According to the technical scheme, the first node and the second node are set to be disaster-tolerant and backed up by the member mechanism, and under the condition that one node fails, the normal operation of the member mechanism can be kept through other nodes, so that the billing stability of the member mechanism is improved.
In the above technical solution, the first node and the second node are disposed in different internet rooms of a member institution. Through setting up first node and second node in different internet computer lab respectively, can avoid leading to first node, second node to break down simultaneously because of the computer lab environment to further improve stability.
Fig. 6 is a flow chart of a fault handling method of a node according to an embodiment of the present application. This embodiment is an alternative to the embodiments described above. Referring to fig. 6, the method for processing a node fault provided in this embodiment includes:
and S610, under the condition that the first node normally operates, acquiring first accounting data from the first blockchain network.
S620, under the condition that the first node normally operates, the first accounting data acquired from the first blockchain network is synchronized to the second node.
S630, under the condition of fault recovery of the first node, the first accounting data acquired from the first blockchain network during the fault of the first node is synchronized to the first node.
Under the single-node accounting condition, under the condition that the first node normally operates, the first node acquires first accounting data from the first blockchain network, namely the first node is used as an accounting node of the first blockchain network; the first node also synchronizes first accounting data acquired from the first blockchain network to a second node that is configured to acquire the first accounting data of the first blockchain network from the first node. It should be noted that, under the normal operation condition of the first node, only the first node accesses the first blockchain network, and the second node is offline, not started, and does not access the first blockchain network, as a common node.
During the failure of the first node, the first node can be offline without accessing the first blockchain network, and the failure recovery is carried out on the first node; the second node is configured to access the first blockchain network and obtain first accounting data during a failure of the first node from the first blockchain network.
In the event of a failure recovery of the first node, a communication connection is established between the first node and the second node, the first node further synchronizing first accounting data during the failure of the first node from the second node. After the first billing data of the first node and the second node are synchronized, for example, after the block heights are the same, the second node can be continuously used as the billing node according to the service requirement, the first node can be used as a common node, the first node can also be used as the billing node, and the second node can be used as the common node. Specifically, the first blockchain traffic of the service layer and the network layer can be controlled by the node grid to continuously use the second node or switch back to the first node.
In the single-node billing technical scheme, one node of a member mechanism is used as a billing node to access a first blockchain network to acquire first billing data, the other node is used as a common node to be offline and not to access the first blockchain network, and both nodes can be used as billing nodes and common nodes in different periods. And under the abnormal condition of the accounting node, the common node accesses the first blockchain network to acquire first accounting data during the fault period of the accounting node, and under the fault recovery condition of the accounting node, the first accounting data during 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, only one node in the member institution serves as an accounting node, namely only one node verifies the existing block in the first block chain, and the other node serves as a common node without verifying the existing block, so that the stability of the member institution is improved, and the resource consumption of block verification can be reduced.
In the above technical solution, the operation of the first node to synchronize the first accounting data acquired from the first blockchain network to the second node may specifically include the following cases:
synchronizing a full amount of block data in a first blockchain network with compiled intelligent contract data to a second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In the embodiment of the present application, the transaction state data may be a statistical result of blockchain data, and taking the blockchain data as an example of the transfer transaction record, the transaction state data may be an account balance of a blockchain account. The first node synchronizes the full amount of blockchain data and compiled smart contract data to the second node, and in the event of a second node start-up, such as in the event of a first node failure, the second node may determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockdata, the smart 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 ensured not to be tampered.
Second, synchronizing to the second node the full amount of transaction state data, the compiled smart contract data, and the latest N pieces of block data in the first blockchain network.
In this embodiment of the present application, the value of N may be determined according to the service requirement, or may be a default value, for example, 100. The first node may synchronize the transaction state data, the smart contract data, and the latest N pieces of block data to the second node such 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 blockchain height associated with the latest block, in the same case, the transaction state data and the smart contract data may be directly used to provide the accounting node service, and in a case where the latest transaction state data associated block height (for example, 98) is smaller than the latest block height (for example, 120), the transaction block data may be supplemented according to the latest N pieces of blockchain data, and the accounting service may be provided according to the supplemented transaction state data and the smart contract data. By synchronizing the transaction state data, the amount of transaction state data determined under the condition of starting the second node can be reduced, and thus the starting efficiency of the second node can be improved.
Third, synchronizing the block data in the first blockchain 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 can synchronize the block data (i.e. synchronize the full amount of block data) and the compiled intelligent contract data to the second node in real time, so that the second node can start the account data processing program of the second node at regular time under the condition that the second node is not connected to the first blockchain network, and process the first account data to update the local transaction state data. The second node is used for updating the transaction state data at regular time, so that the starting efficiency of the second node under the condition of the first node fault can be improved, and the accuracy of the transaction state data can be improved.
This embodiment is an alternative to the embodiments described above. In the method for processing a node failure provided in this embodiment, the second node is configured to obtain first accounting data from the first blockchain network.
Under the condition of the double-node single-blockchain in the embodiment, the first node and the second node are both connected to the first blockchain network, the set intelligent contracts are the same, and the recorded account data are the same.
Under the condition that the first node normally operates, the first node and the second node are both started to access the first blockchain network, and first accounting data is acquired from the first blockchain network, namely 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 blockchain network, the first node and the second node do not need to synchronize data with each other under the normal running condition of the first node. In the case of the dual-node single-block chain, the first node and the second node are in parallel relationship, and may not be distinguished, i.e., any one of the nodes may be the first node, and the other node may be the second node.
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 the first node is recovered from the failure offline.
Under the condition of fault recovery of the first node, a communication connection between the first node and the second node is established, the first node acquires first accounting data during the fault of the first node from the second node until the first accounting data of the first node and the second node are synchronous, for example, the block heights are the same, and the first node is re-connected to the first block chain network.
In the dual-node single-chain accounting technical scheme, two nodes of a member mechanism are used as accounting nodes to access a first blockchain network to acquire first accounting data. And in the case that one of the accounting nodes (i.e. the first node) is abnormal, the other accounting node (i.e. the second node) continues to acquire the first accounting data from the first blockchain network, and in the case of the fault recovery of the first node, the second node is further used for synchronizing the first accounting data during the fault of the first node to the first node, and after the synchronization is completed, the first node is re-accessed to the first blockchain network. By using the dual node as the billing node of the same blockchain, the first billing data can still be recorded under the condition of any node fault, and the synchronous data is not needed under the condition of normal operation of the dual node.
According to the technical scheme, through the fact that two nodes in the member institution are all used as accounting nodes of the same blockchain network, stability of the member institution can be improved, and data communication between the two nodes can be reduced.
Fig. 7 is a flow chart of a fault handling method of a node according to an embodiment of the present application. This embodiment is an alternative to the embodiments described above. Referring to fig. 7, the method for processing a node fault provided in this embodiment includes:
S710, under the condition that the first node normally operates, first accounting data are acquired from the first blockchain network.
S720, under the condition of fault recovery of the first node, synchronizing first accounting data acquired by the second node from the first blockchain network during the fault of the first node.
And S730, under the condition that the first node and the second node both operate normally, synchronizing the first accounting data acquired from the first blockchain network to the second node.
The second node is used for synchronizing second billing data acquired from the second blockchain network to the first node under the condition that the first node and the second node are both in normal operation.
The first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node operates normally; the first node is further configured to obtain second accounting data of the second blockchain network from the second node under a condition that both the first node and the second node are operating normally.
Under the condition of double-node double-block-chain, a first node is accessed to a first block-chain network, and 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, intelligent contracts and recorded account book data set by the first node and the second node are different.
Under the condition that the first node and the second node both normally operate, the first node acquires first billing data from the first blockchain network, the second node acquires second billing data from the second blockchain network, the second node synchronizes the first billing data to the second node, and the second billing data synchronized by the second node is acquired.
During a failure of the first node, a failure recovery may be performed for the first node. The second node is used for acquiring second accounting data from the second blockchain network, and accessing the first blockchain network to acquire first accounting data from the first blockchain network.
A communication connection is established between the first node and the second node, the first node obtains first accounting data during the failure of the first node from the second node until the first accounting data of the first node and the second node are synchronized, e.g., the block heights are the same, the second node disconnects from the first blockchain network, and the first node is re-connected to the first blockchain network to take the first node as an accounting node of the first blockchain network.
In the dual-node double-chain billing technical scheme, one node of a member mechanism accesses a first blockchain network to acquire first billing data, and the other node accesses a second blockchain network to acquire second billing data. And under the abnormal condition of the first node, the second node is further used for accessing the first blockchain network to acquire first accounting data from the first blockchain network. Under the condition of fault recovery of the first node, the first node acquires first accounting data during the fault of the first node from the second node, and after 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 still be recorded under the condition of any node fault, and the stability of the blockchain networks is improved.
According to the technical scheme, two nodes in the member institution are respectively used as the accounting nodes of different blockchain networks, so that the accounting data of the different blockchain networks can still be recorded under the condition of any node fault, and the stability of the blockchain networks is improved.
In the above technical solution, the operation of the first node to synchronize the first accounting data acquired from the first blockchain network to the second node may specifically include the following cases:
synchronizing a full amount of block data in a first blockchain network with compiled intelligent contract data to a second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In the embodiment of the present application, the transaction state data may be a statistical result of blockchain data, and taking the blockchain data as an example of the transfer transaction record, the transaction state data may be an account balance of a blockchain account. The first node synchronizes the full amount of blockchain data and compiled smart contract data to the second node, and in the event of a second node start-up, such as in the event of a first node failure, the second node may determine transaction state data from the synchronized blockchain data and provide accounting node services from the blockdata, the smart 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 ensured not to be tampered.
Second, synchronizing to the second node the full amount of transaction state data, the compiled smart contract data, and the latest N pieces of block data in the first blockchain network.
In this embodiment of the present application, the value of N may be determined according to the service requirement, or may be a default value, for example, 100. The first node may synchronize the transaction state data, the smart contract data, and the latest N pieces of block data to the second node such 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 blockchain height associated with the latest block, in the same case, the transaction state data and the smart contract data may be directly used to provide the accounting node service, and in a case where the latest transaction state data associated block height (for example, 98) is smaller than the latest block height (for example, 120), the transaction block data may be supplemented according to the latest N pieces of blockchain data, and the accounting service may be provided according to the supplemented transaction state data and the smart contract data. By synchronizing the transaction state data, the amount of transaction state data determined under the condition of starting the second node can be reduced, and thus the starting efficiency of the second node can be improved.
Third, synchronizing the block data in the first blockchain 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 can synchronize the block data (i.e. synchronize the full amount of block data) and the compiled intelligent contract data to the second node in real time, so that the second node can start the account data processing program of the second node at regular time under the condition that the second node is not connected to the first blockchain network, and process the first account data to update the local transaction state data. The second node is used for updating the transaction state data at regular time, so that the starting efficiency of the second node under the condition of the first node fault 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 device of a node according to an embodiment of the present application. Referring to fig. 8, a fault handling apparatus 800 of a node provided in an embodiment of the present application may include:
a backup accounting module 801 for acquiring first accounting data from the first blockchain network during a first node failure;
a first ledger sending module 802, configured to synchronize, in a first node failure recovery situation, first accounting data acquired from a first blockchain network during a first node failure to a first node;
The first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node operates normally.
In an alternative embodiment, the fault handling apparatus 800 of the node further comprises:
and the first account book processing module is used for acquiring first accounting data of the first blockchain network from the first node under the condition that the first node operates normally.
In an alternative embodiment, the fault handling apparatus 800 of the node further comprises:
and the first accounting module is used for acquiring the first accounting data from the first blockchain network under the condition that the first node normally operates.
In an alternative embodiment, the fault handling apparatus 800 of the node further comprises:
the second account book processing module is used for acquiring second account book data from the second blockchain network and acquiring first account book data of the first blockchain network from the first node under the condition that the first node and the second node are both in normal operation;
the first node is further configured to obtain second accounting data of the second blockchain network from the second node under a condition that both the first node and the second node are operating normally.
In an alternative embodiment, the first ledger processing module or the second ledger processing module is specifically configured to:
Obtaining full amount of block data and compiled intelligent contract data in a first blockchain 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 alternative embodiment, the first ledger receiving module or the second ledger processing module is specifically configured to:
transaction state data, compiled smart contract data, and up-to-date N pieces of block data in a first blockchain network are obtained from a first node.
In an alternative embodiment, 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 blockchain network from a first node in real time;
transaction state data in the first blockchain network is updated at fixed time intervals.
In an alternative embodiment, the first node and the second node are disposed in different internet rooms of a member institution.
According to the technical scheme, the first node and the second node are set to be disaster-tolerant and backed up by the member mechanism, and under the condition that one node fails, the normal operation of the member mechanism can be kept through other nodes, so that the stability of the member mechanism is improved.
Fig. 9 is a schematic structural diagram of a fault handling device of a node according to an embodiment of the present application. Referring to fig. 9, a fault handling apparatus 900 of a node provided in an embodiment of the present application may include:
the first accounting module 901 is configured to obtain first accounting data from the first blockchain network under a normal operation condition of a first node;
first ledger receiving module 902 is configured to synchronize first ledger data acquired by the second node from the first blockchain network during the failure of the first node in the 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 account data acquired from the first blockchain network to the second node under the condition that the first node operates normally.
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 account book processing module is used for synchronizing the first account data acquired from the first blockchain network to the second node under the condition that the first node and the second node are both in normal operation;
The second node is used for synchronizing second billing data acquired from the second blockchain network to the first node under the condition that the first node and the second node are both in normal operation.
In an alternative embodiment, the first ledger processing module or the second ledger processing module is specifically configured to:
synchronizing the full amount of block data in the first blockchain network with the compiled smart contract data to the second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network.
In an alternative embodiment, the first ledger processing module or the second ledger processing module is specifically configured to:
the second node is synchronized with the full amount of transaction state data, compiled smart contract data, and the latest N pieces of block data in the first blockchain network.
In an alternative embodiment, 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 fixed time intervals.
In an alternative embodiment, the first node and the second node are disposed in different internet rooms of a member institution.
According to the technical scheme, the first node and the second node are set to be disaster-tolerant and backed up by the member mechanism, and under the condition that one node fails, the normal operation of the member mechanism can be kept by the other nodes, so that the billing stability of the member mechanism is improved.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary 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 required for the operation of the device 1000 can also be stored. The computing 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.
Various 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 communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, 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 on a machine-readable medium, such as the 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 communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the above-described failure handling method of the node may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the failure handling method of the node in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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 hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (23)

1. A method of fault handling of a node, performed by a second node, the method comprising:
acquiring first accounting data from a first blockchain network during a first node failure;
synchronizing first accounting data acquired from the first blockchain network during the first node failure to the first node under the first node failure recovery condition;
under the condition that the first node and the second node are both in normal operation, acquiring second accounting data from the second blockchain network, and acquiring first accounting data of the first blockchain network from 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 operates normally; the first node is further configured to obtain second accounting data of the second blockchain network from the second node under a condition that both the first node and the second node are operating normally; the first node is an accounting node of a first blockchain network; and the second node is used for carrying out disaster recovery backup on the first node.
2. The method of claim 1, further comprising:
under the condition that a first node normally operates, acquiring first accounting data of a first blockchain network from the first node; or alternatively, the first and second heat exchangers may be,
under the condition that the first node operates normally, first accounting data is obtained from the first blockchain network.
3. The method of claim 1 or 2, wherein the obtaining first accounting data of the first blockchain network from the first node comprises:
obtaining full amount of block data and compiled intelligent contract data in a first blockchain network from a first node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network; or alternatively, the first and second heat exchangers may be,
transaction state data, compiled smart contract data, and up-to-date N pieces of block data in a first blockchain network are obtained from a first node.
4. The method of claim 1 or 2, wherein the obtaining first accounting data of the first blockchain network from the first node comprises:
acquiring block data and compiled intelligent contract data in a first blockchain network from a first node in real time;
transaction state data in the first blockchain network is updated at fixed time intervals.
5. The method of claim 1 or 2, wherein the first node and the second node are disposed at different internet rooms of a member institution.
6. A method of fault handling of a node, performed by a first node, the method comprising:
under the condition that a first node normally operates, acquiring first accounting data from a first blockchain network;
synchronizing first accounting data acquired by the second node from the first blockchain network during the first node failure in the first node failure recovery condition;
under the condition that the first node and the second node both normally operate, synchronizing first accounting data acquired from a first blockchain network to the second node;
the second node is used for synchronizing second billing data acquired from the second blockchain network to the first node under the condition that the first node and the second node are both in normal operation; the first node is an accounting node of a first blockchain network; and the second node is used for carrying out disaster recovery backup on the first node.
7. The method of claim 6, further comprising:
under the condition that the first node normally operates, first accounting data acquired from the first blockchain network are synchronized to the second node; or alternatively, the first and second heat exchangers may be,
the second node is configured to obtain first accounting data from a first blockchain network.
8. The method of claim 6 or 7, wherein synchronizing the first accounting data acquired from the first blockchain network to the second node comprises:
synchronizing the full amount of block data in the first blockchain network with the compiled smart contract data to the second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network; or alternatively, the first and second heat exchangers may be,
the second node is synchronized with the full amount of transaction state data, compiled smart contract data, and the latest N pieces of block data in the first blockchain network.
9. The method of claim 6 or 7, 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 fixed time intervals.
10. The method of claim 6 or 7, wherein the first node and the second node are disposed at different internet rooms of a member institution.
11. A fault handling device for a node, configured at a second node, the device 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 account book sending module is used for synchronizing first account data acquired from the first blockchain network during the fault period of the first node to the first node under the fault recovery condition of the first node;
the second account book processing module is used for acquiring second account book data from the second blockchain network and acquiring first account book data of the first blockchain network from the first node under the condition that the first node and the second node are both in normal operation;
the first node is used for acquiring first accounting data from the first blockchain network under the condition that the first node operates normally; the first node is further configured to obtain second accounting data of the second blockchain network from the second node under a condition that both the first node and the second node are operating normally; the first node is an accounting node of a first blockchain network; and the second node is used for carrying out disaster recovery backup on the first node.
12. The apparatus of claim 11, further comprising:
the first account book processing module is used for acquiring first account recording data of the first blockchain network from the first node under the condition that the first node operates normally; or alternatively, the first and second heat exchangers may be,
and the first accounting module is used for acquiring the first accounting data from the first blockchain network under the condition that the first node normally operates.
13. The apparatus of claim 11 or 12, wherein the first ledger processing module or the second ledger processing module is specifically configured to:
obtaining full amount of block data and compiled intelligent contract data in a first blockchain network from a first node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network; or alternatively, the first and second heat exchangers may be,
transaction state data, compiled smart contract data, and up-to-date N pieces of block data in a first blockchain network are obtained from a first node.
14. The apparatus of claim 11 or 12, wherein 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 blockchain network from a first node in real time;
transaction state data in the first blockchain network is updated at fixed time intervals.
15. The apparatus of claim 11 or 12, wherein the first node and the second node are disposed at different internet rooms of a member institution.
16. A fault handling device for a node, configured at a first node, the device comprising:
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;
the first account book receiving module is used for synchronizing first account data acquired by the second node from the first blockchain network during the fault period of the first node under the fault recovery condition of the first node;
the second account book processing module is used for synchronizing the first account data acquired from the first blockchain network to the second node under the condition that the first node and the second node are both in normal operation;
the second node is used for synchronizing second billing data acquired from the second blockchain network to the first node under the condition that the first node and the second node are both in normal operation; the first node is an accounting node of a first blockchain network; and the second node is used for carrying out disaster recovery backup on the first node.
17. The apparatus of claim 16, further comprising:
The first account book processing module is used for synchronizing the first account data acquired from the first blockchain network to the second node under the condition that the first node operates normally; or alternatively, the first and second heat exchangers may be,
the second node is configured to obtain first accounting data from a first blockchain network.
18. The apparatus of claim 16 or 17, wherein the first ledger processing module or the second ledger processing module is specifically configured to:
synchronizing the full amount of block data in the first blockchain network with the compiled smart contract data to the second node; wherein the full amount of block data is used to determine transaction state data in the first blockchain network; or alternatively, the first and second heat exchangers may be,
the second node is synchronized with the full amount of transaction state data, compiled smart contract data, and the latest N pieces of block data in the first blockchain network.
19. The apparatus of claim 16 or 17, 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 fixed time intervals.
20. The apparatus of claim 16 or 17, wherein the first node and the second node are disposed at different internet rooms of a member institution.
21. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
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-10.
22. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-10.
23. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-10.
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 CN112799879A (en) 2021-05-14
CN112799879B true 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)

Families Citing this family (1)

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

Citations (7)

* 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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102181136B1 (en) * 2018-11-15 2020-11-20 엔에이치엔 주식회사 A method and blockchain system for constructing a sub blockchain in a blockchain system comprising a distributed network of a plurality of nodes
US11966818B2 (en) * 2019-02-21 2024-04-23 Hewlett Packard Enterprise Development Lp System and method for self-healing in decentralized model building for machine learning using blockchain
US10956444B2 (en) * 2019-07-31 2021-03-23 Advanced New Technologies Co., Ltd. Block chain state data synchronization method, apparatus, and electronic device

Patent Citations (7)

* 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
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
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
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
基于区块链的学位证书存证系统设计与实现;刘东伟;张学旺;郭晓金;;计算机工程与设计;20200216(第02期);全文 *

Also Published As

Publication number Publication date
CN112799879A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN109951331B (en) Method, device and computing cluster for sending information
CN111091429B (en) Electronic bill identification distribution method and device and electronic bill generation system
CN103294701B (en) A kind of method that distributed file system and data process
CN111949444A (en) Data backup and recovery system and method based on distributed service cluster
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
CN112799879B (en) Fault processing method, device, equipment and storage medium of node
CN117931523A (en) Disaster recovery switching method, device, equipment and storage medium
CN114116288A (en) Fault processing method, device and computer program product
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN103780433B (en) Self-healing type virtual resource configuration management data architecture
CN117082046A (en) Data uploading method, device, equipment and storage medium
CN102882709A (en) Monitoring system and monitoring method in cloud computing environment
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN110413686A (en) A kind of method for writing data, device, equipment and storage medium
CN113641688B (en) Node updating method, related device and computer program product
CN114500443A (en) Message pushing method, device, system, electronic equipment and storage medium
CN117395263B (en) Data synchronization method, device, equipment and storage medium
CN109005059A (en) A kind of system and method for realizing Redis automated back-up
CN116881229A (en) Database exercise environment construction method, device, equipment and storage medium
CN114598743A (en) Service discovery method, device, electronic equipment and storage medium
CN116700824A (en) Synchronization method, device and computer program product for configuration strategy
CN116049311A (en) Data synchronization method and device, electronic equipment and storage medium
CN114138538A (en) Abnormal instance processing method and device and electronic equipment
CN105162873A (en) High available method and system of K1 servers
CN113672384A (en) Client cluster maintenance method, system, terminal and storage medium based on Monitor

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