CN115237682A - Block chain node fault synchronization method and device, computer equipment and storage medium - Google Patents

Block chain node fault synchronization method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115237682A
CN115237682A CN202210746762.0A CN202210746762A CN115237682A CN 115237682 A CN115237682 A CN 115237682A CN 202210746762 A CN202210746762 A CN 202210746762A CN 115237682 A CN115237682 A CN 115237682A
Authority
CN
China
Prior art keywords
node
fault
standby
full
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210746762.0A
Other languages
Chinese (zh)
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.)
Hangzhou Yunxiang Network Technology Co Ltd
Original Assignee
Hangzhou Yunxiang Network 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 Hangzhou Yunxiang Network Technology Co Ltd filed Critical Hangzhou Yunxiang Network Technology Co Ltd
Priority to CN202210746762.0A priority Critical patent/CN115237682A/en
Publication of CN115237682A publication Critical patent/CN115237682A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2028Failover techniques eliminating a faulty processor or activating a spare
    • 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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2041Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant with more than one idle spare processing component
    • 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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2046Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant where the redundant components share persistent storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS

Abstract

The application relates to a method and a device for synchronizing faults of block link points, computer equipment and a storage medium. The method comprises the following steps: acquiring fault node information, wherein the fault node is a node in a starting state at present; acquiring a corresponding relation between a fault node and a network file storage system based on fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node; if the fault node is a full node, establishing an association relation between the standby node and the historical data based on the corresponding relation, and taking the standby node as a current starting node. By adopting the method, the data synchronization can be quickly realized when the block chain link point fails, and the stability of the block chain network is further ensured.

Description

Block chain node fault synchronization method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method and an apparatus for synchronizing a fault of a block chain link point, a computer device, and a storage medium.
Background
The blockchain consists of a shared, fault-tolerant distributed database and a multi-node network. In a blockchain multi-node network, all nodes have the authority to browse blocks, can verify the blocks, participate in data consensus, and add data through the consensus, but cannot completely control the blocks.
In a conventional blockchain, a blockchain network may include a plurality of blockchain full nodes and light nodes. Each whole node can participate in data consensus and can provide transaction uplink and query services for the mechanism to which the whole node belongs, when a server to which a whole node belongs fails, the server cannot normally access, data on the node cannot be used, and services bound by the node are difficult to migrate to other nodes for processing, so that the blockchain node cannot normally provide services.
In the existing scheme for processing the fault node of the block chain, the fault node is usually isolated and repaired first, and after the repair is completed, the normal operation of the block chain network is restored and the service is provided to the outside. However, in the repair process, the blockchain network often cannot perform data synchronization and provide external services normally, which is not favorable for maintaining the stability of the blockchain network.
In order to improve the efficiency of solving the fault of the block link point in the prior art, no effective solution is provided at present.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a block link point fault synchronization method, device, computer device and storage medium capable of quickly solving data synchronization when a block link point fault occurs.
In a first aspect, the present application provides a block link point fault synchronization method. The method comprises the following steps:
acquiring fault node information, wherein the fault node is a node in a current starting state;
acquiring the corresponding relation between the fault node and the network file storage system based on the fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relationship between a standby node and the historical data based on the corresponding relationship, and taking the standby node as a current starting node.
In one embodiment, the establishing the association relationship between the standby node and the historical data based on the corresponding relationship comprises:
and acquiring a standby full-node cluster, and selecting one full node from the standby full-node cluster as a standby node, wherein all nodes in the standby full-node cluster are connected with the network file storage system.
In one embodiment, the selecting one full node from the standby full node cluster as a standby node includes:
acquiring the resource occupancy rate of a server to which each standby full node in the standby full node cluster belongs;
and selecting one full node from the standby full nodes as a standby node according to the resource occupancy rate.
In one embodiment, the taking the standby node as the current starting node comprises:
and repairing the fault node, and adding the repaired fault node into the standby full-node cluster as the standby full node.
In one embodiment, the setting the standby node as the current initiating node further includes:
and updating a service forwarding mapping list, establishing a corresponding relation between the received data request and the starting node, enabling the starting node to respond to the data request through the network file storage system, and providing data service.
In one embodiment, the acquiring the information of the failed node includes:
and acquiring heartbeat information of all nodes, and determining fault node information according to the heartbeat information.
In one embodiment, the node further includes a light node, and the obtaining of the correspondence between the failed node and the network file storage system based on the failed node information further includes:
and if the fault node is a light node, establishing a replacement light node as a current starting light node, deactivating the fault node, updating a service forwarding mapping list, enabling the starting light node to respond to the data request through the network file storage system, and providing data service.
In a second aspect, the present application also provides a block link point fault synchronization device, the device comprising: the system comprises a node monitoring module, a data synchronization module and a node updating module.
The node monitoring module is used for acquiring fault node information, wherein the fault node is a node in a starting state at present;
the data synchronization module is used for acquiring the corresponding relation between the fault node and the network file storage system based on the fault node information, and the network file storage system is managed by a block chain system and stores the historical data of the fault node;
and the node updating module is used for establishing an association relationship between a standby node and the historical data based on the corresponding relationship if the fault node is a full node, and taking the standby node as a current starting node.
In a third aspect, the application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring fault node information, wherein the fault node is a node in a starting state at present;
acquiring a corresponding relation between the fault node and the network file storage system based on the fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relationship between a standby node and the historical data based on the corresponding relationship, and taking the standby node as a current starting node.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring fault node information, wherein the fault node is a node in a starting state at present;
acquiring a corresponding relation between the fault node and the network file storage system based on the fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relationship between a standby node and the historical data based on the corresponding relationship, and taking the standby node as a current starting node.
According to the block chain node fault synchronization method, the block chain node fault synchronization device, the computer equipment and the storage medium, after the detected fault node, the corresponding relation between the fault node and the network file storage system can be determined through the obtained fault node information, wherein the network file storage system is managed by the block chain system, and all historical data of the fault node before the fault occurs are stored on the network file storage system. And under the condition that the fault node is a full node, establishing an incidence relation between the standby node and the historical data based on the determined corresponding relation, and taking the standby node as the current starting node. By means of the corresponding relation between the network file storage system and the block chain link points, data can be stored in the network file storage system after the corresponding block chain full nodes finish data consensus, and when the nodes break down, the backup nodes are used for replacing the broken full nodes, and then the association with historical data can be established again through the network file storage system. The data synchronization is realized by transmitting historical data to each standby node, the data synchronization when the block chain link point fails is quickly realized, the data synchronization efficiency of the failed node is improved, and the stability of a block chain network is further ensured.
Drawings
FIG. 1 is a diagram of an exemplary embodiment of a block link point fault synchronization method;
FIG. 2 is a schematic flow chart diagram illustrating a method for block link point fault synchronization in accordance with an embodiment;
FIG. 3 is an interaction diagram illustrating the application of block link points in one embodiment;
FIG. 4 is a flow diagram of block link point management in one embodiment;
FIG. 5 is a schematic flow chart diagram of a block link point fault synchronization method in accordance with a preferred embodiment;
FIG. 6 is a diagram illustrating the overall functional structure of a blockchain network in one embodiment;
FIG. 7 is an overall architecture diagram of a blockchain network in one embodiment;
FIG. 8 is a flow diagram illustrating the service of a blockchain in one embodiment;
FIG. 9 is a block diagram of a block link point fault synchronization apparatus according to an embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The block link point fault synchronization method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Fig. 1 is an application environment diagram of the block link point fault synchronization method according to this embodiment, and as shown in fig. 1, a container arrangement module 101 may monitor each node container in a block link point cluster 102, analyze the type of a node when it is detected that the node is down, and then select a corresponding fault synchronization method according to the type of the node. And when the fault node is a full node, determining a standby node from the standby full node cluster to replace the fault node, and when the fault node is a light node, creating a replacement light node to replace the fault node. And rapidly acquiring historical data of the block chain by means of the corresponding relation between the fault node and the network file storage system 103 so as to keep the stable operation of the block chain network and rapidly realize the data synchronization of the fault node.
In the present embodiment, a block link point fault synchronization method is provided, and fig. 2 is a flowchart of the block link point fault synchronization method of the present embodiment, as shown in fig. 2, the flowchart includes the following steps:
step S201, obtaining fault node information, wherein the fault node is a node in a starting state at present.
The block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and a centralized shared general ledger which is guaranteed in a cryptology mode and cannot be tampered and forged is achieved. The block chain system is a distributed ledger system constructed based on the block chain technology.
Nodes in the blockchain system can be divided into full nodes and light nodes, wherein the full nodes are nodes having a complete blockchain ledger. In the block chain, all nodes can participate in synchronizing all block chain data, independently check all transactions on the block chain, update the data in real time and participate in broadcasting and verification of the block chain transaction; a lightweight node is defined as a node that stores only a minimal amount of state as a node to send or communicate transaction information without storing or maintaining a complete blockchain copy. In the working process of the block chain network, the light nodes cannot participate in data synchronization, and only the whole nodes are allowed to participate in data synchronization.
The failed node information in this embodiment includes types of failed nodes, i.e., full nodes and light nodes. When the node in the starting state is monitored to have a fault, different data synchronization methods can be determined according to specific node types. Optionally, one organization side in the block chain of this embodiment includes a full node and a plurality of light nodes, and the light nodes serve as slave nodes of the full node.
Step S202, based on the information of the fault node, acquiring the corresponding relation between the fault node and the network file storage system, wherein the network file storage system is managed by a block chain system and stores the historical data of the fault node.
In the blockchain system, the network file storage system can be managed in a tamper-proof way through an encryption algorithm and a hash digest algorithm. For example, after the uplink request is received by the whole node, the request may be submitted to each blockchain node in the blockchain network in a transaction manner for consensus, and when the transaction passes the consensus, the blockchain whole node performs block packing and stores the block packing in the network file storage system.
The history data of the failed node includes history synchronization data of the corresponding blockchain and a record of the received data request of the failed node.
Specifically, for all nodes, if the nodes are down, historical data before the nodes are down are stored in the network file storage system; if the light node is down, the data synchronized by all the nodes before the light node is down is stored in the network file storage system.
Further, the network file storage system further stores node configuration information, specifically, the node configuration information includes cluster network configuration information of the block chain, data encryption configuration information, network communication information, block chain algorithm configuration information, and the like.
Step S203, if the fault node is a full node, establishing an association relationship between a standby node and the historical data based on the corresponding relationship, and using the standby node as a current starting node.
The standby node is a full-node mirror image created before block chain networking, has the function of full nodes of the block chain, and can be used as the full node after being started. After networking of the block chain link points is completed, only one full node is started to operate, the full node mirror image is in a standby state, and further, when the block chain is networked, all nodes contained in the block chain are connected with a network file storage system, and all nodes share the same stored data. After the downtime of the full node is monitored, the standby node can be used as a current starting node, meanwhile, the association relationship between the standby nodes is established by means of the connection between the network file storage system and the standby node and based on the corresponding relationship between the network file storage system and the fault node, namely, the data synchronization of the fault node is completed, the information in the fault node is not required to be completely resynchronized to the standby node, and then the standby node is started.
In the block chain node fault synchronization method, the fault node information is acquired after the fault node is monitored by monitoring the block chain node, and the corresponding relation between the fault node and the network file storage system is acquired based on the fault node information, wherein the network file storage system stores the historical data of the fault node. And if the fault node is a full node, establishing an association relationship between the standby node and the historical data based on the corresponding relationship, and taking the standby node as the current starting node. The method avoids that all the commonly identified data on the whole nodes are synchronized to all the block chain nodes when the whole nodes are started, and all the data in the block chain are stored by the network file storage system, so that all the nodes in the current block chain mechanism share one data, and the repeated data synchronization is reduced. Furthermore, when all starting nodes of the block chain fail, only the corresponding relation between the failed node and the network file storage system needs to be considered to establish the incidence relation with historical data, the data request type which can be completed by the failed node and the data transfer on the failed node do not need to be disturbed, and then the data synchronization when the block chain link fails is rapidly realized, the data synchronization efficiency of the failed node is improved, and further the stability of the block chain network is ensured.
In one embodiment, before establishing the association relationship between the standby node and the historical data based on the corresponding relationship, the method includes: and acquiring a standby full-node cluster, and selecting a full node from the standby full-node cluster as a standby node, wherein all nodes in the standby full-node cluster are connected with a network file storage system. The standby full nodes are mirror nodes of the starting full nodes, and in the block chain network, the standby full nodes only participate in data synchronization after being started and do not participate in the data synchronization of the block chain in a non-standby state. In this embodiment, for the full node in the startup state, it may correspond to at least two standby full nodes, and the specific number may be created by a technician according to actual situations. After detecting that the full nodes in the starting state have faults, one full node can be selected from the standby full-node cluster to serve as a standby node to replace the fault node for use.
In this embodiment, a full node is elected from the standby full node cluster as a standby node to replace a failed full node, and a mode of randomly confirming a standby full node as a standby node or designating a special full node as a standby node is not adopted, so that election can be performed according to a certain standard during the confirmation of the standby node, which is convenient for election of the standby node based on the actual situation of the block chain node, and provides a basis for subsequently improving the stability of the block chain network.
In another embodiment, the full node in the startup state may also correspond to only one standby full node, and after detecting that the full node in the startup state fails, the standby full node is directly used as a standby node.
In one embodiment, the selecting one full node from the standby full node cluster as a standby node comprises: acquiring the resource occupancy rate of a server to which each standby full node belongs in the standby full node cluster; and selecting one full node from the standby full nodes as a standby node according to the resource occupancy rate. When a node is created, due to factors such as the attributes of the server, corresponding system deployment conditions, and the number of servers corresponding to each node, the resource occupancy rate of each node may have a certain difference, and when a standby node is elected, the standby full node with the lowest resource occupancy rate needs to be elected from the standby full nodes to serve as the standby full node according to the principle of the optimal resource occupancy rate.
In this embodiment, the resource utilization rate of each node in the standby full-node cluster is calculated, and the standby nodes are elected based on the resource utilization rate, so that the optimal standby full node is selected as the standby node, and then the block chain link point service can be quickly extracted after the standby node is started subsequently, and the working efficiency of the block chain node is improved.
In one embodiment, the taking the standby node as the current starting node comprises: and repairing the fault node, and adding the repaired fault node into the standby full-node cluster as the standby full node. It can be understood that after the failed node is abandoned, a technician may also be notified to repair the failed node, and after the repair is completed, the failed node is used as a standby full node, and at this time, a server corresponding to the failed node has been initialized.
Furthermore, if the fault node cannot be repaired, a new standby full node can be created to be added into the standby full node cluster, so that the number of nodes in the standby full node cluster is ensured, and the optimal node can be selected from the standby full node cluster for replacement in time when the full node is started next time and is down.
In this embodiment, after the failed node is repaired, the repaired node is added to the standby full-node cluster, and is used when waiting for the next full node to fail, and compared with the prior art in which the repaired full node is used as the starting full node again, the repeated migration of data before different nodes is avoided, the replacement frequency of the block link points is reduced, and the stability of the block chain is better maintained.
In one embodiment, the step of using the standby node as the current starting node further comprises: and updating the service forwarding mapping list, establishing a corresponding relation between the received data request and the starting node, enabling the starting node to respond to the data request through the network file storage system, and providing data service. For example, when the block link receives an external data request, the data request may be sent to the corresponding service node based on the service forwarding mapping list according to the type of the data request. When a failed node is detected and a standby node is taken as a current starting node, which is equivalent to using the standby node to replace the failed node, a subsequent block link receives a data request for the failed node and should also complete a task at the standby node, so that a service forwarding mapping list needs to be updated, the standby node is added to the service forwarding mapping list, and the failed node is removed from the list. Further, after the update is completed, when a data request is received, the corresponding relationship between the received data request and the start node may be established according to the service forwarding mapping list, so as to respond to the data request.
Optionally, the Network File storage System in the present application is a Distributed File System (DFS), and may be at least one of a Network File System (NFS), a Hadoop Distributed File System (HDFS), a Common Internet File System (CIFS), and a Google File System (GFS).
In the embodiment, the service forwarding mapping list is updated, the standby node is replaced by the current starting full node, and the request can be sent to the corresponding node according to the list in time after the data request is received, so that better node service is provided.
In one embodiment, the acquiring of the failure node information includes: and acquiring heartbeat information of all nodes, and determining fault node information according to the heartbeat information. The heartbeat information is a judgment basis for monitoring whether the nodes can normally communicate and provide services to the outside in the distributed system technology, if the container arrangement module monitors the heartbeat of the corresponding node, the node can normally communicate, and if the container arrangement module fails to monitor the heartbeat of a certain node, the node is down, and maintenance is needed to enable the node to normally provide services to the outside.
The container arrangement module is a system for managing node containers in a block chain by means of a containerization technology and a Kubernetes technology (k 8s for short). The container arrangement module can manage the starting sequence and the starting number of the container of the block chain link points in the block chain, and further realize the quick deployment and quick capacity expansion of the block chain.
In the embodiment, the state of the node is monitored according to the heartbeat information broadcast by each node, so that the fault can be found at the first time when the node fails, the fault node information is determined, a foundation is laid for selecting a standby node later, and the stability of a block chain network is maintained.
In one embodiment, the node further includes a light node, and after acquiring the corresponding relationship between the failed node and the network file storage system based on the failed node information, the method further includes: and if the fault node is a light node, establishing a replacement light node as a current starting light node, stopping the fault node, updating a service forwarding mapping list, enabling the starting light node to respond to the data request through a network file storage system, and providing data service. In this embodiment, the light node has the function of reading the blockchain data in the network file storage system to provide an off-line query function, and the function of establishing a connection with the full node to provide a data uplink function.
Because the light node cannot participate in data synchronization in the block chain, data information cannot be generated in the light node and stored in the network file storage system, but the light node can read data in the network storage file through the corresponding relation between the light node and the network storage file to provide data query service for the outside.
When receiving a data request, the light node forwards the data request to the whole node for processing if the data request is an uplink request, and directly performs block data query service through a network file storage system if the data request is a data query request.
For the light nodes, the corresponding standby nodes are not set, and only one replacement light node for replacing the failed light node needs to be created after the downtime of the light nodes is monitored. Similarly, after the replacement node is used as the current start light node, the service forwarding mapping list needs to be updated, and meanwhile, the fault node is abandoned. Furthermore, the failed node can be repaired by technicians, and can be used as a new light node after the repair is completed, or can be formatted and used when the node needs to be created.
In this embodiment, when it is monitored that the light node fails, the light node is directly created and replaced as the light node to be started, and the failed node can be replaced at the first time when the block link node fails, so that normal operation of the block chain is guaranteed, and stability of a block chain network is maintained.
Optionally, in another embodiment, the failed node may also be a standby full node, and when it is detected that the standby full node is down, a new standby full node is created to access the standby full node cluster, without updating the service forwarding mapping list. After the standby full nodes with faults are repaired, the repaired nodes can be added into the standby full nodes for use.
Fig. 3 is an application interaction diagram of block link nodes in the embodiment of the present application, and as shown in fig. 3, uplink and uplink data query requests may be sent to the full node and the light node through application middleware. When the full node receives the data uplink request, the uplink request can be synchronized to all nodes in the whole block chain network, and uplink storage data in the uplink request can be synchronized to a network file storage system after common identification of all nodes to the uplink request passes; when the whole node receives the data query request on the link, the query service can be directly provided according to the request content. When the light node receives the data uplink request, the light node forwards the data uplink request to the full node, and the full node completes the data uplink request; when the light node receives the on-chain data query request, the query service can be directly provided according to the request content.
Fig. 4 is a flowchart of block link node management in the embodiment of the present application, and as shown in fig. 4, request amounts of block link nodes may be monitored, one or more light nodes are started to share load pressure when it is monitored that request load pressure of the nodes is greater than a preset value, and one or more light nodes may be stopped from the started light nodes when it is monitored that request load pressure of the nodes is less than the preset value, so as to avoid resource waste. Further, when receiving a service invocation request of another blockchain node, the load balancing policy may also send the request to the corresponding blockchain container for processing.
Fig. 5 is a flowchart of the block link point fault synchronization method of the present preferred embodiment. As shown in fig. 5, the block link point fault synchronization method includes the following steps:
step S501, according to the node state of each node in the node heartbeat information monitoring block chain, fault node information is obtained when the fact that the node goes down is monitored.
Step S502, acquiring the corresponding relation between the fault node and the network file storage system according to the fault node information, wherein the network file storage system is managed by the block chain system and stores the historical data of the block chain.
Step S503, the node type of the fault node is determined according to the fault node information, and if the fault node is a full node, a full node is selected from the standby full node cluster as a standby node.
Step S504, according to the corresponding relation between the fault node and the network file storage system, the incidence relation between the standby node and the historical data is established, and the standby node is used as the current starting full node.
Step S505, the corresponding relationship between the received data request and the currently started full node is established, and the service forwarding mapping list is updated.
Step S506, if the failed node is a light node, a replacement light node is created as the current start light node.
Step S507, the connection between the replacement light node and the network file storage system is established, and the service forwarding mapping list is updated.
In this embodiment, the node state is monitored through heartbeat information of each node in the block chain, and when it is monitored that a node fails, failure node information is obtained in time. Then determining a corresponding node type according to the fault node information, selecting a full node from the standby full node cluster as a standby node if the fault node is a full node, and then using the standby node as a starting full node to realize the replacement of the fault node; and if the fault node is the light node, establishing a replacement light node, and using the replacement light node as the current starting light node to realize the replacement of the fault node. After the replacement of the failed node is completed, the relationship between the received data request and the currently started full node or the started light node is established, and the service forwarding mapping list is updated. The data synchronization is realized by transmitting historical data to each standby full node, the data synchronization when the block chain link point fails is quickly realized, the data synchronization efficiency of the failed node is improved, and the stability of a block chain network is further ensured.
Fig. 6 is an overall functional structure diagram of a blockchain network in an embodiment of the present application, as shown in fig. 6, the functional structure diagram includes an operation and maintenance service class and a blockchain functional class, where the operation and maintenance service class includes container fault migration, server resource monitoring, cluster, container state monitoring and alarm, service release deployment and rapid capacity expansion, and also includes network flow control, blockchain transaction information query, statistics and security audit, contract deployment, blockchain node management, and message queue monitoring in the above embodiments; the blockchain functional classes include intelligent contracts, partition consensus, authority control, trusted file sharing, private transactions, data encryption mechanisms, and predictive machines.
Fig. 7 is an overall architecture diagram of a blockchain network in the embodiment of the present application, as shown in fig. 7, including a business layer, a basic service layer, an operation and maintenance monitoring layer, a storage layer, and a hardware layer. The service layer mainly comprises a plurality of platforms using block chains; the basic service layer calls the interaction process of the data request of the mechanism in the block chain and the block chain link points of other mechanisms to the block chain nodes of the mechanism; the operation and maintenance monitoring layer comprises a mirror image management module, a container arrangement module, a visual operation and maintenance platform and a data storage module; the storage tier includes a plurality of distributed file systems, such as NFS, HDFS, CIFS, GFS, and CEPH; the hardware layer includes a public cloud, a private cloud, a hybrid cloud, and an owned server.
Fig. 8 is a service flow diagram of a blockchain in the embodiment of the present application, and as shown in fig. 8, a blockchain service provider may issue an application middleware service to a visual operation and maintenance platform, and the visual operation and maintenance platform may update a system corresponding to the application middleware service through a container arrangement module and a mirror management module. Meanwhile, the visual operation and maintenance platform may be capable of monitoring service states and block information of the application middleware, the block chain and a Message Queue (MQ for short), the application middleware may perform block chain interaction, the block chain may push a Message to the Message Queue, and the Message Queue notifies the application middleware of the corresponding Message. Furthermore, when a business developer develops a business system, the business developer can interact with the blockchain through application middleware. Optionally, the operation and maintenance personnel can realize operation and maintenance management through a visual operation and maintenance platform. Specifically, the visual operation and maintenance platform may monitor all containers in the application middleware, the message queue, and the block chain through the container arrangement module, implement service expansion and/or deployment, implement container management, and may also be in case of node failure. Pulling a mirror image node from the mirror image management module through the container arrangement module; furthermore, the visual operation and maintenance platform can also monitor the state and resources of the server.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a block link point fault synchronization device for implementing the above related block link point fault synchronization method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the method, so specific limitations in one or more embodiments of the block chain node fault synchronization apparatus provided below may refer to the limitations on the block chain node fault synchronization method in the foregoing, and details are not described here again.
In one embodiment, as shown in fig. 9, there is provided a block link point fault synchronization apparatus including: a node monitoring module 91, a data synchronization module 92 and a node updating module 93, wherein:
the node monitoring module 91 is configured to acquire information about a failed node, where the failed node is a node currently in a start state;
the data synchronization module 92 is configured to obtain a corresponding relationship between a failed node and a network file storage system based on the information of the failed node, where the network file storage system is managed by a block chain system and stores historical data of the failed node;
the node updating module 93 is configured to, if the failed node is a full node, establish an association relationship between the standby node and the historical data based on the correspondence relationship, and use the standby node as a current start node.
In the device, the fault node information is acquired after the fault node is monitored by monitoring the block link points, and the corresponding relation between the fault node and the network file storage system is acquired based on the fault node information, wherein the network file storage system stores historical data of the fault node. If the fault node is a full node, establishing an association relationship between the standby node and the historical data based on the corresponding relationship, and taking the standby node as a current starting node. The method avoids that all the commonly identified data on the whole nodes are synchronized to all the block chain nodes when the whole nodes are started, and all the data in the block chain are stored by the network file storage system, so that all the nodes in the current block chain mechanism share one data, and the repeated data synchronization is reduced. Furthermore, when all starting nodes of the block chain fail, only the corresponding relation between the failed node and the network file storage system needs to be considered to establish the incidence relation with historical data, the data request type which can be completed by the failed node and the data transfer on the failed node do not need to be disturbed, and then the data synchronization when the block chain link fails is rapidly realized, the data synchronization efficiency of the failed node is improved, and the stability of the block chain network is further ensured
Further, the device further comprises an election module used for obtaining the standby full-node cluster and electing a full node from the standby full-node cluster as a standby node, wherein all nodes in the standby full-node cluster are connected with the network file storage system.
Furthermore, the election module is further configured to obtain resource occupancy rates of servers to which all standby nodes in the standby full-node cluster belong; and selecting one full node from the standby full nodes as a standby node according to the resource occupancy rate.
Further, the node updating module 93 is further configured to repair the failed node, and add the repaired failed node to the standby full-node cluster as the standby full node.
Further, the node update module 93 is further configured to update the service forwarding mapping list, establish a corresponding relationship between the received data request and the start node, enable the start node to respond to the data request through the network file storage system, and provide a data service.
Further, the node monitoring module 91 is further configured to acquire heartbeat information of all nodes, and determine fault node information according to the heartbeat information.
Further, the node updating module 93 is further configured to create a replacement light node as a current startup light node if the failed node is a light node, deactivate the failed node, and update the service forwarding mapping list, so that the startup light node responds to the data request through the network file storage system, and provides the data service.
The modules in the block chain node fault synchronization device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data of blockchain nodes. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a block link point failure synchronization method.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring fault node information, wherein the fault node is a node in a current starting state;
acquiring a corresponding relation between a fault node and a network file storage system based on fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relation between the standby node and the historical data based on the corresponding relation, and taking the standby node as the current starting node. In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring fault node information, wherein the fault node is a node in a current starting state;
acquiring a corresponding relation between a fault node and a network file storage system based on fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relation between the standby node and the historical data based on the corresponding relation, and taking the standby node as the current starting node.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases involved in the embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A block link point fault synchronization method, the method comprising:
acquiring fault node information, wherein the fault node is a node in a current starting state;
acquiring a corresponding relation between the fault node and a network file storage system based on the fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and if the fault node is a full node, establishing an association relationship between a standby node and the historical data based on the corresponding relationship, and taking the standby node as a current starting node.
2. The method of claim 1, wherein said associating the backup node with the historical data based on the correspondence comprises:
and acquiring a standby full-node cluster, and selecting one full node from the standby full-node cluster as a standby node.
3. The method of claim 2, wherein the electing a full node from the standby full node cluster as a standby node comprises:
acquiring the resource occupancy rate of a server to which each standby full node in the standby full node cluster belongs;
and selecting one full node from the standby full nodes as a standby node according to the resource occupancy rate.
4. The method of claim 1, wherein the taking the standby node as the current initiating node comprises:
and repairing the fault node, and adding the repaired fault node into the standby full-node cluster as the standby full node.
5. The method of claim 1, wherein the treating the standby node as a current initiating node further comprises:
and updating a service forwarding mapping list, establishing a corresponding relation between the received data request and the starting node, enabling the starting node to respond to the data request through the network file storage system, and providing data service.
6. The method of claim 1, wherein the obtaining of the failed node information comprises:
and acquiring heartbeat information of all nodes, and determining fault node information according to the heartbeat information.
7. The method according to claim 1, wherein the nodes further include a light node, and the obtaining the correspondence between the failed node and the network file storage system based on the failed node information further comprises:
and if the fault node is a light node, establishing a replacement light node as a current starting light node, establishing the connection between the replacement light node and the network file storage system, and updating a service forwarding mapping list, so that the starting light node responds to the data request through the network file storage system and provides data service.
8. A block link point fault synchronization apparatus, the apparatus comprising: the system comprises a node monitoring module, a data synchronization module and a node updating module;
the node monitoring module is used for acquiring fault node information, wherein the fault node is a node in a starting state at present;
the data synchronization module is used for acquiring the corresponding relation between the fault node and a network file storage system based on the fault node information, wherein the network file storage system is managed by a block chain system and stores historical data of the fault node;
and the node updating module is used for establishing an association relationship between a standby node and the historical data based on the corresponding relationship if the fault node is a full node, and taking the standby node as a current starting node.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202210746762.0A 2022-06-29 2022-06-29 Block chain node fault synchronization method and device, computer equipment and storage medium Pending CN115237682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210746762.0A CN115237682A (en) 2022-06-29 2022-06-29 Block chain node fault synchronization method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210746762.0A CN115237682A (en) 2022-06-29 2022-06-29 Block chain node fault synchronization method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115237682A true CN115237682A (en) 2022-10-25

Family

ID=83671166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210746762.0A Pending CN115237682A (en) 2022-06-29 2022-06-29 Block chain node fault synchronization method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115237682A (en)

Similar Documents

Publication Publication Date Title
CN107193490B (en) Distributed data storage system and method based on block chain
US7546486B2 (en) Scalable distributed object management in a distributed fixed content storage system
RU2449358C1 (en) Distributed file system and data block consistency managing method thereof
CN109729129A (en) Configuration modification method, storage cluster and the computer system of storage cluster
CN111400112B (en) Writing method and device of storage system of distributed cluster and readable storage medium
CN113515499B (en) Database service method and system
WO2019210580A1 (en) Access request processing method, apparatus, computer device, and storage medium
CN106936623A (en) The management method of distributed cache system and cache cluster
CN108319618B (en) Data distribution control method, system and device of distributed storage system
CN115114305A (en) Lock management method, device, equipment and storage medium for distributed database
CN107992491A (en) A kind of method and device of distributed file system, data access and data storage
CN107508700B (en) Disaster recovery method, device, equipment and storage medium
WO2023050986A1 (en) Maintenance of network architecture information of blockchain system
CN115277727A (en) Data disaster recovery method, system, device and storage medium
CN108509296B (en) Method and system for processing equipment fault
CN116389233A (en) Container cloud management platform active-standby switching system, method and device and computer equipment
CN110545197B (en) Node state monitoring method and device
CN115237682A (en) Block chain node fault synchronization method and device, computer equipment and storage medium
CN114338670B (en) Edge cloud platform and network-connected traffic three-level cloud control platform with same
CN114880717A (en) Data archiving method and device
US20200358597A1 (en) Blockchain-based data processing
CN113518126A (en) Cross fault-tolerant method for alliance chain
US20020078437A1 (en) Code load distribution
CN114584940A (en) Slicing service processing method and device
CN114691395A (en) Fault processing method and device, electronic equipment and storage medium

Legal Events

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