CN111104282A - Node processing method and device based on block chain - Google Patents

Node processing method and device based on block chain Download PDF

Info

Publication number
CN111104282A
CN111104282A CN201911172995.9A CN201911172995A CN111104282A CN 111104282 A CN111104282 A CN 111104282A CN 201911172995 A CN201911172995 A CN 201911172995A CN 111104282 A CN111104282 A CN 111104282A
Authority
CN
China
Prior art keywords
node
block chain
service
abnormal
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911172995.9A
Other languages
Chinese (zh)
Other versions
CN111104282B (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.)
Zhongan Information Technology Service Co Ltd
Original Assignee
Zhongan Information Technology Service 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 Zhongan Information Technology Service Co Ltd filed Critical Zhongan Information Technology Service Co Ltd
Priority to CN201911172995.9A priority Critical patent/CN111104282B/en
Publication of CN111104282A publication Critical patent/CN111104282A/en
Application granted granted Critical
Publication of CN111104282B publication Critical patent/CN111104282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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
    • G06F16/275Synchronous replication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Hardware Redundancy (AREA)

Abstract

A node processing method and device based on a block chain comprise a block chain deploying process and a block chain running process, wherein the block chain running process comprises the following steps: detecting nodes in the block chain; when the abnormal node service is detected, the abnormal node is copied according to a preset rule, the copied node is connected to the cluster of the block chain, and the external service is carried out. The method and the device provided by the embodiment of the invention comprise the steps of copying abnormal nodes according to a preset rule when the abnormal node service is detected, and connecting the copied nodes to a cluster of a block chain for external service. When the abnormal service of the node is detected, the node can be copied, so that the running stability of the chain node cluster is obviously improved.

Description

Node processing method and device based on block chain
Technical Field
The present invention relates to a block chain, and in particular, to a method and an apparatus for processing a node based on a block chain.
Background
At present, each node of the block chain has certain defects in the aspect of operation stability, and particularly, a federation chain mainly embodies the following aspects: an alliance chain adopting a Byzantine consensus mechanism needs n to be more than or equal to 3f +1 nodes to ensure the effectiveness of consensus, if the nodes are intensively damaged due to abnormity or malicious attack, or the access quantity rises sharply, the processing capacity of the chain is reduced or even down, and the chain is not recovered in time, the chain is collapsed, the service is influenced, even the enterprise is lost, and therefore special technical personnel need to be reserved to process abnormal burst problems.
Disclosure of Invention
The invention provides a node processing method and device based on a block chain, which can improve stability.
According to a first aspect of the present invention, the present invention provides a node processing method based on a block chain, including a process of deploying the block chain and a process of operating the block chain, where the process of operating the block chain includes:
detecting nodes in the block chain;
when the abnormal service of the nodes is detected, the nodes are copied according to a preset rule, and the copied nodes are connected to the cluster of the block chain and serve the outside.
In the above method, when it is detected that the node service is abnormal, replicating the node according to a preset rule specifically includes:
when one or more node service abnormity is detected in the block chain, copying the proxy node of the abnormal node, checking whether the database of the abnormal node is available, and if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
In the above method, when it is detected that the node service is abnormal, the node is copied according to a preset rule, further comprising:
when the number of the detected abnormal nodes reaches a threshold value, copying the proxy node of each node on the block chain, and connecting the proxy nodes of each node to obtain a virtual chain;
checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
In the above method, the node deployment process includes:
when a single node on the block chain is deployed, a specified number of node clusters are automatically generated according to the configuration file.
In the above method, the node exception includes:
the node service is non-responsive, the phishing algorithm verification is not in accordance with the expected requirement, the consensus algorithm is illegal, the node ip outside the cluster appears in the p2p node list, the cpu utilization rate exceeds the specified threshold value for a certain time, the memory utilization rate exceeds the specified threshold value for a certain time, the disk occupancy rate is high for a long time, and/or the node service thread occupies too many service ports.
According to a second aspect of the present invention, the present invention provides a node processing apparatus based on a block chain, including a deployment module and an execution module, where the execution module includes:
the detection unit is used for detecting the nodes in the block chain;
and the replication unit is used for replicating the nodes according to a preset rule when the abnormal service of the nodes is detected, connecting the replicated nodes to the cluster of the block chain, and serving the outside.
In the above apparatus, the copying unit includes:
the first processing subunit is used for copying an agent node of the abnormal node when detecting that one or more nodes in the block chain have abnormal service, and connecting the agent node to the cluster of the current chain;
checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
In the above apparatus, the copying unit further includes:
the second processing subunit is configured to copy the proxy node of each node on the block chain when the number of the detected abnormal nodes reaches a threshold, and connect the proxy node of each node to obtain a virtual chain;
checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
In the above apparatus, the deployment module includes:
and the deployment unit is used for automatically generating a specified number of node clusters according to the configuration file when a single node on the block chain is deployed.
According to a third aspect of the present invention, there is provided a node processing apparatus based on a block chain, including:
a memory for storing a program;
a processor for implementing the above method by executing the program stored in the memory.
Due to the adoption of the technical scheme, the invention has the beneficial effects that:
the method and the device provided by the embodiment of the invention comprise the steps of copying abnormal nodes according to a preset rule when the abnormal node service is detected, and connecting the copied nodes to a cluster of a block chain for external service. When the abnormal service of the node is detected, the node can be copied, so that the running stability of the chain node cluster is obviously improved.
Drawings
FIG. 1 is a flow chart of a method in a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a proxy node replicating an exception node in one embodiment of the method of the present invention;
FIG. 3 is a schematic diagram of a virtual chain replicated by the method of the present invention in one embodiment;
FIG. 4 is a schematic diagram of a single node augmented with multiple nodes;
FIG. 5 is a flow chart of a method in another embodiment according to the first embodiment of the present invention;
FIG. 6 is a block diagram of a program module of an apparatus according to a second embodiment of the present invention;
fig. 7 is a schematic diagram of program modules of an apparatus according to a second embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and accompanying drawings. The present invention may be embodied in many different forms and is not limited to the embodiments described in the present embodiment. The following detailed description is provided to facilitate a more thorough understanding of the present disclosure, and the words used to indicate orientation, top, bottom, left, right, etc. are used solely to describe the illustrated structure in connection with the accompanying figures.
One skilled in the relevant art will recognize, however, that one or more of the specific details can be omitted, or other methods, components, or materials can be used. In some instances, some embodiments are not described or not described in detail.
The numbering of the components as such, e.g., "first", "second", etc., is used herein only to distinguish the objects as described, and does not have any sequential or technical meaning.
Furthermore, the technical features, aspects or characteristics described herein may be combined in any suitable manner in one or more embodiments. It will be readily appreciated by those of skill in the art that the order of the steps or operations of the methods associated with the embodiments provided herein may be varied. Thus, any sequence in the figures and examples is for illustrative purposes only and does not imply a requirement in a certain order unless explicitly stated to require a certain order.
The first embodiment is as follows:
one embodiment of the node processing method based on the block chain of the present invention includes a process of deploying the block chain and a process of running the block chain. The process of the block chain operation, as shown in fig. 1, includes the following steps:
step 102: and detecting the nodes in the block chain.
In a block chain operation scene, the nodes in the block chain can be detected through the servo module, the servo module can be a single daemon thread served by a chain node, and can also be a single process or service except for the independent chain node, the function of the servo module is to monitor and manage the chain node, terminate a designated service thread or process when necessary, and restart or copy the chain node.
The detection mode can be a self-contained function of the link node, and a service for detecting the activity state of the link node can be separately deployed. The starting mode can be spontaneous behavior of the node, and can also be passive triggering of monitoring service.
The rule according to which the detection mode depends includes: service anomaly identification identifier definitions, communication protocols within blockchains, communication protocols across chains, transaction construction containers, authentication algorithms, and the like. Wherein, the node service exception may include: the node service is non-responsive, the phishing algorithm verification is not in accordance with the expected requirement, the consensus algorithm is illegal, the node ip outside the cluster appears in the p2p node list, the cpu utilization rate exceeds the specified threshold value for a certain time, the memory utilization rate exceeds the specified threshold value for a certain time, the disk occupancy rate is not high for a long time or the node service thread occupies too many service ports. The intra-block chain communication protocol is an http protocol based on TCP/IP and a P2P communication technology based on the HTTP protocol; the cross-link communication protocol is that a node is simultaneously used as a common node of two chains, receives the broadcast transaction of the two chains and participates in a consensus algorithm, and the node follows the communication protocols of the two chains simultaneously, and the mode is used for collecting the calculation result of one chain for auditing and verifying; the transaction construction container is used for constructing a transaction by the servo program and submitting the transaction to a specified node to wait for a calculation result; the authentication algorithm comprises the steps of constructing a transaction by using a servo transaction builder, submitting the transaction to a designated node, waiting for the chain consensus where the designated node is located to be finished, taking the consensus result, and verifying whether the calculation result meets the expected result.
Step 104: when the abnormal node service is detected, the abnormal node is copied according to a preset rule, the copied node is connected to the cluster of the block chain, and the external service is carried out.
When one or more nodes are detected to be abnormal in service, starting a self-copying function of the node, copying an agent node of the node, and connecting the agent node to the cluster of the current chain;
checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service, and then serving the node externally, and connecting the node with normal service to the cluster of the current chain for serving the node externally. The duplicated proxy node may be on the current device or on a designated device.
Confirming whether a node is abnormal may include: when one servo module detects that one node is abnormal, p2p broadcasts to the servo modules of other nodes, when the servo modules exceeding a preset number verify that the node is abnormal, the node is considered to be an abnormal node, the preset number can be set according to needs, and if the servo modules can be set to 2/3 or other numbers consider that the node is an abnormal node, the node can be judged to be an abnormal node.
Further, step 104 may include:
step 1042: when the servo module detects that one or more nodes in the block chain have abnormal service, the proxy node of the abnormal node is copied, and the proxy node is connected to the cluster of the current chain. Fig. 2 shows a schematic diagram of a proxy node replicating an exception node. The proxy node is connected to the cluster of the current chain. Checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
Further, step 104 may further include:
step 1044: when the number of the detected abnormal nodes reaches a threshold value, copying the proxy node of each node on the block chain, connecting the proxy node of each node to obtain a virtual chain, checking whether the database of the node on the block chain is available, and if the database is available, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service. A virtual chain is obtained by copying, and the original block chain is replaced, so that the concurrent processing capacity of the chain is improved. Fig. 3 shows a schematic diagram of a proxy node replicating each node on a blockchain resulting in a virtual chain.
The rules according to which the database is checked include: data validity identification, transaction construction algorithm, authentication algorithm and the like. The data of the database is checked in a mode that after the transaction constructed according to the transaction construction container of the servo module is submitted to a designated node, the transaction data of the Merkel tree structure is stored on a disk of a link point after the consensus is finished, and the servo module can check out the data and compare the data with expected data. Wherein, the data validity mark represents whether the data is valid or not, and the transaction construction algorithm is the construction algorithm used by the transaction constructor; the authentication algorithm is an authentication method for comparing the transaction data taken by the servo module with expected data, and the algorithm is based on an algorithm used by a chain signature, such as an ECDSA elliptic curve digital signature algorithm, a multiple signature method, an RSA algorithm and the like.
Further, the node processing method based on the block chain of the present invention, wherein the process of deploying the block chain, may include the following steps:
step 100: when a single node on the block chain is deployed, a specified number of node clusters are automatically generated according to the configuration file. The positions of the nodes can designate target machines, and node clusters meeting the expected quantity requirements are automatically and intelligently amplified. FIG. 4 shows a schematic diagram of a single node augmented with multiple nodes.
Automatically and intelligently amplifying node clusters meeting the requirement of expected number by means of appointed number or appointed target machines and the like, and avoiding pain points of each node needing manual deployment
As a service, a blockchain is deployed manually in the prior art by manually deploying a plurality of machines or a single machine and a multi-port manner, and manual deployment requires manual modification, which is roughly divided into several steps:
preparing each server user name/password of a node to be deployed → selecting one of the servers to prepare a node executable file → starting a servo service on the selected node (if the servo service is integrated into a chain node program, adding-batch _ default-configuration-yml node 192.168.1.102,192.168.1.xxx, xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.yml is used to install the specified node and form a cluster.
The consensus algorithm can be a proxy equity Byzantine fault-tolerant algorithm, and the consensus algorithm requires that the number of nodes satisfies n is more than or equal to 3f +1 to satisfy the effectiveness of consensus. The communication protocol in the block chain comprises a http protocol or a https protocol based on a TCP/IP and a p2p communication technology, the invention is not limited to a consensus algorithm, if the number n of block chain link points of other PBFT consensus algorithms is adopted, n is more than or equal to 3f + 1; if a workload certification mechanism (PoW), a rights and interests certification (PoS) or a proxy rights and interests certification (DPoS) g consensus algorithm is adopted, the number n of nodes needs to satisfy that n is more than or equal to 2f + 1.
In the embodiment of the present invention, the configuration file may be set according to a consensus algorithm and a rule based on a specific consensus algorithm, such as whether a node needs to be verified by a proxy rights-of-interest byzantine fault-tolerant algorithm (DS-PBFT), whether the node needs to pass a check label of an initial node, a communication protocol in a block chain, and the like.
The number of the nodes can be set according to the requirement of a consensus algorithm, for example, a chain of a 'agent rights Byzantine fault-tolerant algorithm (DS-PBFT)' is adopted, the nodes are automatically adjusted according to the rule setting, and the automatically amplified nodes need to be checked if the nodes are verification nodes, and are not checked if the nodes are non-verification nodes.
The difference between the automatic amplification deployment of the embodiment of the invention and the multiple deployment in the prior art is that the configuration of each node is automatically generated, and the node cluster meeting the requirement of the expected number is automatically and intelligently amplified by the modes of specifying the number, specifying a target machine and the like, so that the pain point of each node needing manual deployment is avoided.
And automatically and intelligently amplifying the deployment chain nodes, namely, automatically deploying and building a chain of nodes meeting the specified rule quantity by utilizing the specified rule or server information of the servo module, and dynamically adjusting the verification nodes according to the self-defined rule. In one embodiment, a node may be designated as a verification node and the rest as non-verification nodes.
The node processing method based on the block chain comprises a block chain deploying process and a block chain running process. Another embodiment, as shown in fig. 5, comprises the steps of:
step 502: and deploying the block chain, and automatically generating a specified number of node clusters according to the configuration file when a single node on the block chain is deployed.
Step 504: and detecting the nodes in the block chain. In an operation scene, detecting nodes in a block chain, and searching nodes with abnormal service.
Step 506: when the abnormal service of the node is detected, the agent node of the abnormal node is copied, and the agent node is connected to the cluster of the current chain. Checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
Step 508: and judging whether the number of the abnormal nodes reaches a threshold value, if so, turning to a step 510, and otherwise, turning to a step 504.
Step 510: and copying the proxy node of each node on the block chain, and connecting the proxy nodes of each node to obtain a virtual chain. Checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
The method comprises the steps of copying abnormal nodes according to a preset rule when abnormal node service is detected, and connecting the copied nodes to a cluster of a block chain for external service. When the abnormal service of the node is detected, the node can be copied, so that the running stability of the chain node cluster is obviously improved.
Example two:
as shown in fig. 6, an embodiment of a node processing apparatus based on a blockchain according to the present invention includes an operation module 600. The operation module 600 includes a detection unit 610 and a copy unit 620.
A detecting unit 610, configured to detect a node in a block chain.
In a block chain operation scene, the nodes in the block chain can be detected through the servo module, the servo module can be a single daemon thread served by a chain node, and can also be a single process or service except for the independent chain node, the function of the servo module is to monitor and manage the chain node, terminate a designated service thread or process when necessary, and restart or copy the chain node.
The detection mode can be a self-contained function of the link node, and a service for detecting the activity state of the link node can be separately deployed. The starting mode can be spontaneous behavior of the node, and can also be passive triggering of monitoring service.
The rule according to which the detection mode depends includes: service anomaly identification identifier definitions, communication protocols within blockchains, communication protocols across chains, transaction construction containers, authentication algorithms, and the like. Wherein, the node service exception may include: the node service is non-responsive, the phishing algorithm verification is not in accordance with the expected requirement, the consensus algorithm is illegal, the node ip outside the cluster appears in the p2p node list, the cpu utilization rate exceeds the specified threshold value for a certain time, the memory utilization rate exceeds the specified threshold value for a certain time, the disk occupancy rate is not high for a long time or the node service thread occupies too many service ports. The intra-block chain communication protocol is an http protocol based on TCP/IP and a P2P communication technology based on the HTTP protocol; the cross-link communication protocol is that a node is simultaneously used as a common node of two chains, receives the broadcast transaction of the two chains and participates in a consensus algorithm, and the node follows the communication protocols of the two chains simultaneously, and the mode is used for collecting the calculation result of one chain for auditing and verifying; the transaction construction container is used for constructing a transaction by the servo program and submitting the transaction to a specified node to wait for a calculation result; the authentication algorithm comprises the steps of constructing a transaction by using a servo transaction builder, submitting the transaction to a designated node, waiting for the chain consensus where the designated node is located to be finished, taking the consensus result, and verifying whether the calculation result meets the expected result.
And the copying unit 620 is configured to copy, when it is detected that the node service is abnormal, an abnormal node according to a preset rule, connect the copied node to the cluster of the block chain, and perform external service.
When one or more nodes in the block chain are detected to be abnormal in service, copying the proxy node of the abnormal node, and connecting the proxy node to the cluster of the current chain; checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to a node with normal service, and then serving the node to the outside and connecting the node to the cluster of the current chain for serving the outside. The duplicated proxy node may be on the current device or on a designated device.
Confirming whether a node is abnormal may include: when one servo module detects that one node is abnormal, p2p broadcasts to the servo modules of other nodes, when the servo modules exceeding a preset number verify that the node is abnormal, the node is considered to be an abnormal node, the preset number can be set according to needs, and if the servo modules can be set to 2/3 or other numbers consider that the node is an abnormal node, the node can be judged to be an abnormal node.
Further, the replication unit 610 may comprise a first processing sub-unit 611.
A first processing subunit 611, configured to copy an agent node of the abnormal node when detecting that one or more nodes in the block chain have abnormal service, and connect the agent node to the cluster of the current chain; checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
The rules according to which the database is checked include: data validity identification, transaction construction algorithm, authentication algorithm and the like. The data of the database is checked in a mode that after the transaction constructed according to the transaction construction container of the servo module is submitted to a designated node, the transaction data of the Merkel tree structure is stored on a disk of a link point after the consensus is finished, and the servo module can check out the data and compare the data with expected data. Wherein, the data validity mark represents whether the data is valid or not, and the transaction construction algorithm is the construction algorithm used by the transaction constructor; the authentication algorithm, i.e. the authentication method for comparing the transaction data with the expected data after the server module takes the transaction data, further comprises a second processing sub-unit 612 according to the algorithm used by the chain signature, such as ECDSA elliptic curve digital signature algorithm, multiple signature method, RSA algorithm, etc.
A second processing subunit 612, configured to copy the proxy node of each node in the block chain when the number of detected abnormal nodes reaches a threshold, and connect the proxy node of each node to obtain a virtual chain; checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
Another embodiment of the apparatus for processing a node based on a block chain according to the present invention, as shown in fig. 7, includes a deployment module 700 and an execution module 800.
The deployment module 700 may include, among other things, a deployment unit 710; the deployment unit 710 is configured to automatically generate a specified number of node clusters according to the configuration file when a single node on the blockchain is deployed.
As a service, a blockchain is deployed manually in the prior art by manually deploying a plurality of machines or a single machine and a multi-port manner, and manual deployment requires manual modification, which is roughly divided into several steps:
preparing each server user name/password of a node to be deployed → selecting one of the servers to prepare a node executable file → starting a servo service on the selected node (if the servo service is integrated into a chain node program, adding-batch _ default-configuration-yml node 192.168.1.102,192.168.1.xxx, xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.yml is used to install the specified node and form a cluster.
The consensus algorithm can be a proxy equity Byzantine fault-tolerant algorithm, and the consensus algorithm requires that the number of nodes satisfies n is more than or equal to 3f +1 to satisfy the effectiveness of consensus. The communication protocol in the block chain comprises a http protocol or a https protocol based on a TCP/IP and a p2p communication technology, the invention is not limited to a consensus algorithm, if the number n of block chain link points of other PBFT consensus algorithms is adopted, n is more than or equal to 3f + 1; if a workload certification mechanism (PoW), a rights and interests certification (PoS) or a proxy rights and interests certification (DPoS) g consensus algorithm is adopted, the number n of nodes needs to satisfy that n is more than or equal to 2f + 1.
In the embodiment of the present invention, the configuration file may be set according to a consensus algorithm and a rule based on a specific consensus algorithm, such as whether a node needs to be verified by a proxy rights-of-interest byzantine fault-tolerant algorithm (DS-PBFT), whether the node needs to pass a check label of an initial node, a communication protocol in a block chain, and the like.
The number of the nodes can be set according to the requirement of a consensus algorithm, for example, a chain of a 'agent rights Byzantine fault-tolerant algorithm (DS-PBFT)' is adopted, the nodes are automatically adjusted according to the rule setting, and the automatically amplified nodes need to be checked if the nodes are verification nodes, and are not checked if the nodes are non-verification nodes.
The difference between the automatic amplification deployment of the embodiment of the invention and the multiple deployment in the prior art is that the configuration of each node is automatically generated, and a node cluster meeting the requirement of the expected number is automatically and intelligently amplified by means of the specified number, the specified target machine and the like.
And automatically and intelligently amplifying the deployment chain nodes, namely, automatically deploying and building a chain of nodes meeting the specified rule quantity by utilizing the specified rule or server information of the servo module, and dynamically adjusting the verification nodes according to the self-defined rule. In one embodiment, a node may be designated as a verification node and the rest as non-verification nodes.
The execution module 800 may include a detection unit 810 and a replication unit 820.
A detecting unit 810, configured to detect a node in a block chain when the block chain runs;
and a copying unit 820, configured to copy a node according to a preset rule when detecting that a node service is abnormal, connect the copied node to the cluster of the block chain, and perform an external service.
Further, the replication unit 810 may comprise a first processing subunit 811.
The first processing subunit 811 is configured to copy an agent node of the abnormal node when it is detected that one or more nodes in the block chain have abnormal service, and connect the agent node to the cluster of the current chain; checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
Further, the replication unit 810 also comprises a second processing sub-unit 812.
A second processing subunit 812, configured to copy the proxy node of each node in the block chain when the number of detected abnormal nodes reaches a threshold, and connect the proxy node of each node to obtain a virtual chain; checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
The device comprises the steps of copying abnormal nodes according to a preset rule when the abnormal node service is detected, and connecting the copied nodes to a cluster of a block chain for external service. When the abnormal service of the node is detected, the node can be copied, so that the running stability of the chain node cluster is obviously improved.
Example three:
the third embodiment provides a node processing apparatus based on a block chain, comprising a memory and a processor;
a memory for storing a program;
and the processor is used for executing the program stored in the memory to realize the method in the first embodiment.
Those skilled in the art will appreciate that all or part of the steps of the various methods in the above embodiments may be implemented by instructions associated with hardware via a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is a more detailed description of the present invention that is presented in conjunction with specific embodiments, and the practice of the invention is not to be considered limited to those descriptions. It will be apparent to those skilled in the art that a number of simple derivations or substitutions can be made without departing from the inventive concept.

Claims (10)

1. A node processing method based on a block chain comprises a block chain deploying process and a block chain running process, and is characterized in that the block chain running process comprises the following steps:
detecting nodes in the block chain;
when the abnormal node service is detected, the abnormal node is copied according to a preset rule, the copied node is connected to the cluster of the block chain, and the external service is carried out.
2. The method of claim 1, wherein when the abnormal service of the node is detected, the replicating the node according to a preset rule specifically comprises:
when one or more nodes in the block chain are detected to be abnormal in service, copying the proxy node of the abnormal node, and connecting the proxy node to the cluster of the current chain;
checking whether the database of the abnormal node is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
3. The method of claim 2, wherein when the node service anomaly is detected, replicating the node according to a preset rule, further comprising:
when the number of the detected abnormal nodes reaches a threshold value, copying the proxy node of each node on the block chain, and connecting the proxy nodes of each node to obtain a virtual chain;
checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
4. The method of any of claims 1 to 3, wherein the node deployment process comprises:
when a single node on the block chain is deployed, a specified number of node clusters are automatically generated according to the configuration file.
5. The method of any of claims 1 to 3, wherein the node exception comprises:
the node service is non-responsive, the phishing algorithm verification is not in accordance with the expected requirement, the consensus algorithm is illegal, the node ip outside the cluster appears in the p2p node list, the cpu utilization rate exceeds the specified threshold value for a certain time, the memory utilization rate exceeds the specified threshold value for a certain time, the disk occupancy rate is high for a long time, and/or the node service thread occupies too many service ports.
6. A node processing device based on a block chain comprises a deployment module and an operation module, wherein the operation module comprises:
the detection unit is used for detecting the nodes in the block chain;
and the replication unit is used for replicating the nodes according to a preset rule when the abnormal service of the nodes is detected, connecting the replicated nodes to the cluster of the block chain, and serving the outside.
7. The apparatus of claim 6, wherein the copy unit comprises:
the first processing subunit is used for copying the proxy node of the abnormal node when detecting that one or more node services in the block chain are abnormal, checking whether the database of the abnormal node is available, and if the database of the abnormal node is available, continuing to use the original database to continue external services; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
8. The apparatus of claim 7, wherein the copy unit further comprises:
the second processing subunit is configured to copy the proxy node of each node on the block chain when the number of the detected abnormal nodes reaches a threshold, and connect the proxy node of each node to obtain a virtual chain; checking whether the database of the node on the block chain is available, if so, continuing to use the original database to continue the external service; otherwise, initiating a request for synchronous data to the node with normal service and then serving the node with normal service.
9. The apparatus of any one of claims 6 to 8, wherein the deployment module comprises:
and the deployment unit is used for automatically generating a specified number of node clusters according to the configuration file when a single node on the block chain is deployed.
10. A node processing apparatus based on a block chain, comprising:
a memory for storing a program;
a processor for implementing the method of any one of claims 1-5 by executing a program stored by the memory.
CN201911172995.9A 2019-11-26 2019-11-26 Node processing method and device based on block chain Active CN111104282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911172995.9A CN111104282B (en) 2019-11-26 2019-11-26 Node processing method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911172995.9A CN111104282B (en) 2019-11-26 2019-11-26 Node processing method and device based on block chain

Publications (2)

Publication Number Publication Date
CN111104282A true CN111104282A (en) 2020-05-05
CN111104282B CN111104282B (en) 2024-01-16

Family

ID=70421101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911172995.9A Active CN111104282B (en) 2019-11-26 2019-11-26 Node processing method and device based on block chain

Country Status (1)

Country Link
CN (1) CN111104282B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556327A (en) * 2021-06-29 2021-10-26 中国人民解放军战略支援部队信息工程大学 Block chain-based false flow rule injection attack detection and prevention system and method
JP2022013831A (en) * 2020-06-30 2022-01-18 ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド Management method based on database, platform, electronic device, and storage medium
CN114124486A (en) * 2021-11-09 2022-03-01 弥达斯科技(深圳)有限公司 Method for improving node security in Byzantine consensus mechanism
CN116055308A (en) * 2023-02-10 2023-05-02 青岛闪收付信息技术有限公司 Bottom layer blockchain network deployment method and device of supply chain financial platform
CN114124486B (en) * 2021-11-09 2024-06-25 弥达斯科技(深圳)有限公司 Method for improving node security in Bayesian consensus mechanism

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368507A (en) * 2017-03-28 2017-11-21 阿里巴巴集团控股有限公司 A kind of common recognition method and device based on block chain
US20180343175A1 (en) * 2017-05-24 2018-11-29 International Business Machines Corporation Decentralized change management based on peer devices using a blockchain
CN109274692A (en) * 2018-11-14 2019-01-25 众安信息技术服务有限公司 A kind of identification block chain network is done evil the method and device of node
CN109688012A (en) * 2018-12-29 2019-04-26 杭州趣链科技有限公司 A kind of method of alliance's chain node hot standby switch
CN109918261A (en) * 2019-01-25 2019-06-21 中国联合网络通信集团有限公司 Failure monitoring method, device, equipment and computer readable storage medium
CN110221938A (en) * 2019-05-06 2019-09-10 深圳壹账通智能科技有限公司 The method and storage medium of electronic device, block chain common recognition

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368507A (en) * 2017-03-28 2017-11-21 阿里巴巴集团控股有限公司 A kind of common recognition method and device based on block chain
US20180343175A1 (en) * 2017-05-24 2018-11-29 International Business Machines Corporation Decentralized change management based on peer devices using a blockchain
CN109274692A (en) * 2018-11-14 2019-01-25 众安信息技术服务有限公司 A kind of identification block chain network is done evil the method and device of node
CN109688012A (en) * 2018-12-29 2019-04-26 杭州趣链科技有限公司 A kind of method of alliance's chain node hot standby switch
CN109918261A (en) * 2019-01-25 2019-06-21 中国联合网络通信集团有限公司 Failure monitoring method, device, equipment and computer readable storage medium
CN110221938A (en) * 2019-05-06 2019-09-10 深圳壹账通智能科技有限公司 The method and storage medium of electronic device, block chain common recognition

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022013831A (en) * 2020-06-30 2022-01-18 ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド Management method based on database, platform, electronic device, and storage medium
US11709853B2 (en) 2020-06-30 2023-07-25 Beijing Baidu Netcom Science And Technology Co., Ltd. Database-based management method, platform, electronic device and storage medium
CN113556327A (en) * 2021-06-29 2021-10-26 中国人民解放军战略支援部队信息工程大学 Block chain-based false flow rule injection attack detection and prevention system and method
CN113556327B (en) * 2021-06-29 2022-09-20 中国人民解放军战略支援部队信息工程大学 Block chain-based false flow rule injection attack detection and prevention system and method
CN114124486A (en) * 2021-11-09 2022-03-01 弥达斯科技(深圳)有限公司 Method for improving node security in Byzantine consensus mechanism
CN114124486B (en) * 2021-11-09 2024-06-25 弥达斯科技(深圳)有限公司 Method for improving node security in Bayesian consensus mechanism
CN116055308A (en) * 2023-02-10 2023-05-02 青岛闪收付信息技术有限公司 Bottom layer blockchain network deployment method and device of supply chain financial platform
CN116055308B (en) * 2023-02-10 2024-01-05 青岛闪收付信息技术有限公司 Bottom layer blockchain network deployment method and device of supply chain financial platform

Also Published As

Publication number Publication date
CN111104282B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US11861343B2 (en) Systems, apparatus, and methods for updating a programmable device using a distributed ledger
US20180285217A1 (en) Failover response using a known good state from a distributed ledger
EP2196933B1 (en) Server-to-server integrity checking
CN111104282A (en) Node processing method and device based on block chain
US11165766B2 (en) Implementing authentication protocol for merging multiple server nodes with trusted platform modules utilizing provisioned node certificates to support concurrent node add and remove
US8719386B2 (en) System and method for providing configuration synchronicity
JP2018142372A (en) System and method for automated memory and thread execution anomaly detection in computer network
JP4891722B2 (en) Quarantine system and quarantine method
CN106911648B (en) Environment isolation method and equipment
CN110597918B (en) Account management method, account management device and computer readable storage medium
WO2002102010A2 (en) Intrusion tolerant server system
WO2021051581A1 (en) Server cluster file synchronization method and apparatus, electronic device, and storage medium
US20190318133A1 (en) Methods and system for responding to detected tampering of a remotely deployed computer
CN112527912A (en) Data processing method and device based on block chain network and computer equipment
CN113852506A (en) Fault processing method and device, electronic equipment and storage medium
CN116827601A (en) Data transmission method, device, electronic equipment and storage medium
US10326599B2 (en) Recovery agents and recovery plans over networks
US20220083656A1 (en) Apparatus and method for tolerating byzantine faults in blockchain platforms
JP2003258795A (en) Computer aggregate operating method, implementation system therefor, and processing program therefor
WO2022166627A1 (en) Blockchain network-based device management method, related device, and storage medium
WO2013178034A1 (en) Cloud service deployment method and system
CN111988202B (en) Node switching method, device and storage medium
CN114780327A (en) Server monitoring method, asset management method and PCIE card
US20140059661A1 (en) Management device, computer-readable recording medium, and management method
CN115695529B (en) Intelligent remote operation and maintenance method and device, computer 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
GR01 Patent grant
GR01 Patent grant