CN110661658B - Node management method and device of block chain network and computer storage medium - Google Patents

Node management method and device of block chain network and computer storage medium Download PDF

Info

Publication number
CN110661658B
CN110661658B CN201910900043.8A CN201910900043A CN110661658B CN 110661658 B CN110661658 B CN 110661658B CN 201910900043 A CN201910900043 A CN 201910900043A CN 110661658 B CN110661658 B CN 110661658B
Authority
CN
China
Prior art keywords
node
nodes
target node
intelligent contract
management request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910900043.8A
Other languages
Chinese (zh)
Other versions
CN110661658A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910900043.8A priority Critical patent/CN110661658B/en
Publication of CN110661658A publication Critical patent/CN110661658A/en
Application granted granted Critical
Publication of CN110661658B publication Critical patent/CN110661658B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/04Network management architectures or arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

An embodiment of the present invention provides a node management method, an apparatus, and a computer storage medium for a blockchain network, where the blockchain network may include a plurality of nodes, and the method includes: detecting a node management request; if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes so that the other nodes perform consensus verification on the node management request, wherein the node management request comprises identification information and an operation type of a first target node; if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, the intelligent contract is called to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes. By adopting the invention, the node management efficiency of the block chain network can be improved.

Description

Node management method and device of block chain network and computer storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method and an apparatus for managing nodes in a blockchain network, and a computer storage medium.
Background
With the development of the blockchain technology, the service mode based on the blockchain network is more common, and how to effectively manage the blockchain network becomes a hot point of research. Generally, a dedicated manager is often configured for the blockchain network to manage the blockchain network, for example, the manager may frequently modify the configuration of the blockchain network to meet the frequently changing service requirement. In the process, if configuration information of any node in the blockchain network is modified by a manager, configuration information stored in other nodes needs to be modified one by one, so that configuration modification of the whole blockchain network is completed, codes for realizing node management are usually written in a native language of a blockchain and are embedded in the blockchain codes, and when node management logic needs to be changed, configuration of all the nodes needs to be restarted.
Disclosure of Invention
The embodiment of the invention provides a node management method and device of a block chain network and electronic equipment, which can improve the node management efficiency of the block chain network.
In a first aspect, an embodiment of the present invention provides a node management method for a blockchain network, where the blockchain network includes a plurality of nodes, and the method includes:
detecting a node management request;
if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes so that the other nodes perform consensus verification on the node management request, wherein the node management request comprises identification information and an operation type of a first target node;
if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, the intelligent contract is called to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
In a second aspect, an embodiment of the present invention provides a node management apparatus, where the blockchain network includes a plurality of nodes, and the apparatus includes:
the detection module is used for detecting the node management request;
a communication module, configured to broadcast the node management request to other nodes in the plurality of nodes if the node management request is detected, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of a first target node;
and the processing module is used for calling the intelligent contract to execute management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list if the intelligent contract detects that the consensus verification result of the other nodes meets a preset condition, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, an output device, and a memory; the memory to store program instructions; the processor calls the program instruction to realize the node management method of the block chain network.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where program instructions are stored in the computer storage medium, and when the program instructions are executed, the computer storage medium is used to implement the node management method of the above block chain network.
In summary, when the node management request is detected, the node management request may be broadcast to other nodes in the plurality of nodes in the blockchain network, so that the other nodes perform consensus verification; if the intelligent contract detects that the consensus verification results of other nodes meet the preset condition, the intelligent contract is called to execute management operation on the corresponding nodes, and compared with the process that management personnel need to manage one by one in the prior art, the node management efficiency of the block chain network can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic structural diagram of a node management system according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a block chain according to an embodiment of the present invention;
FIG. 1C is a block generation process according to an embodiment of the present invention;
FIG. 1D is a schematic diagram of a deployment of an intelligent contract provided by an embodiment of the invention;
FIG. 1E is a schematic illustration of a deployment of a billing Committee management module provided in the prior art;
fig. 2 is a flowchart illustrating a node management method of a blockchain network according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another node management method for a blockchain network according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a node management apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to the node management system shown in fig. 1A, the node management system may include a blockchain network 100 and a terminal device 102. Wherein:
the blockchain network 100 refers to a network for performing data sharing between nodes. The blockchain network may include a plurality of nodes 101, and the plurality of nodes 101 may refer to respective clients in the blockchain network. Each node 101 may receive input information and maintain shared data within the blockchain network based on the received input information while operating normally. In order to ensure information intercommunication in the blockchain network, information connection can exist between each node in the blockchain network, and information transmission can be carried out between the nodes through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all nodes in the blockchain network are consistent.
The end device 102 may access the blockchain network and may communicate with nodes in the blockchain network, e.g., initiate node management requests to the nodes, etc. The terminal device 102 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a vehicle-mounted smart terminal, and the like. It should be noted that the number of nodes shown in fig. 1A is merely illustrative, and any number of nodes may be deployed according to actual needs.
Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store node identifiers of other nodes in the blockchain network, so that the generated block can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 only illustrates the IP address as an example.
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the blockchain network stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1B, the block chain is composed of a plurality of blocks, the starting block includes a block header and a block main body, the block header stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 1C, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the block chain network where the newly generated blocks are located according to the node identifications of the other nodes in the block chain network, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
The intelligent contract can be operated on the nodes of the block chain network, the intelligent contract is realized by codes executed when a certain condition is met, developers can define contract logic through a programming language, issue the contract logic to the block chain (intelligent contract registration), and call keys or other events to trigger execution according to the logic of contract terms to complete the contract logic and simultaneously provide the functions of upgrading and cancelling the intelligent contract.
In one embodiment, the intelligent contract may run on a virtual machine. In one embodiment, the intelligent contract may be an intelligent contract for a management node.
In one embodiment, the deployment of the intelligent contracts to the virtual machines may be as follows: receiving the broadcasted intelligent contract, wherein the intelligent contract indicates a preset condition; after the other nodes pass the consensus of the intelligent contract, the intelligent contract is operated on the virtual machine. For example, taking fig. 1D as an example, nodes 1, 2, 3 are specifically accounting nodes, and node 2 may receive a broadcasted intelligent contract (specifically an accounting node committee contract) that may be used to manage the accounting nodes. After node 1 and node 3 have passed the consensus of the accounting node committee contract, the accounting node committee contract is run on the virtual machine. Compared with the prior art in which the accounting committee management module is embedded in the blockchain code as shown in fig. 1E, the embodiment of the present invention runs the accounting node committee contract on the virtual machine, so that the accounting node can be conveniently managed, and the flexible change of the accounting node is realized without restarting the configuration of all nodes.
In some possible embodiments, a certain node 101 in the blockchain network may broadcast a node management request to other nodes 101 in the plurality of nodes 101 when detecting the node management request, so that the other nodes 101 perform consensus verification on the node management request, where the node management request includes identification information and an operation type of the first target node; if the intelligent contract detects that the consensus verification results of other nodes 101 meet the preset condition, the intelligent contract is invoked to perform management operation corresponding to the operation type on the first target node according to the identification of the first target node so as to update a node member list, wherein the node member list comprises identification information of at least two nodes 101 in the plurality of nodes 101, and the identification information includes, but is not limited to, the aforementioned node names and/or node identifications. By adopting the process, the node management efficiency of the block chain network can be improved based on consensus verification and intelligent contracts.
In some possible embodiments, the node member list may be the aforementioned node identification list, such as table 1.
In some possible embodiments, the at least two nodes 101 may be configured to perform accounting and write the blocks generated by accounting into the block chain, i.e. the at least two nodes 101 may be accounting nodes. Accordingly, the node member list may be a list of billing node information.
Based on the above description, the embodiments of the present invention provide a node management method for a blockchain network, which can be applied to a target node. Wherein the target node may be a node of a plurality of nodes comprised by the blockchain network. Referring to fig. 2, the method may specifically include the following steps:
s201, detecting a node management request.
Wherein, the node management request includes but is not limited to any of the following: a node delete request, a node add request, a node modify request. The node modification request may be a node information modification request, such as a node permission modification request.
In one embodiment, the node management request may be generated by the target node itself.
In one application scenario, the target node may obtain a list of node members and display the list of node members. A user (such as an administrator) may click a delete button corresponding to the information of the node 1 included in the node member list, and the target node may respond to the click operation on the delete button to obtain a node management request, that is, a node delete request, where the node management request carries an identifier and an operation type of the node 1: and deleting the nodes.
In one embodiment, a node management request may be sent by the terminal device to the node.
In one application scenario, the first device may obtain a node member list and display the node member list. The user may click a delete button corresponding to the information of the node 1 included in the node member list, and first, may display confirmation prompt information in response to a click operation of the delete button. The user may click a confirmation button included in the confirmation prompt information, the first device may obtain a node management request, that is, a node deletion request, in response to a click operation on the confirmation button, and may send the node management request to a target node, and the target node may receive the node management request.
In one embodiment, the node management request may be broadcast by the node to the target node.
S202, if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of the first target node.
The identification information may include information such as a node name and/or a node identifier. The operation type may include any one of: deleting nodes, adding nodes, and modifying node information, such as modifying node permissions. When the node management request is a node deletion request, the operation type included in the node management request is a deletion node. When the node management request is a node addition request, the operation type included in the node management request is an addition node. When the node management request is a node modification request, the node management request includes an operation type of modified node information. Further, when the node management request is a node authority modification request, the node management request includes an operation type of modifying node authority.
In the embodiment of the present invention, if the target node detects the node management request, the target node broadcasts the node management request to other nodes in the plurality of nodes, and the other nodes can receive the node management request and perform consensus verification on the node management request.
In one embodiment, the target node may be any one of a plurality of nodes. In one embodiment, the other node may refer to all nodes of the plurality of nodes except the target node.
For example, referring to fig. 1, if the target node is the node 101 in the upper left corner of fig. 1, when the node 101 detects a node management request, the node management request may be broadcast to the remaining three nodes 101, and the remaining three nodes 101 may receive the node management request and perform consensus verification on the node management request.
In one embodiment, the target node may be any one of a first set of nodes in the plurality of nodes, and the other nodes may refer to all nodes of the first set of nodes except the target node.
In one embodiment, the target node may be any accounting node in the first set of nodes.
In one embodiment, the first set of nodes may be a set of billing nodes and the other nodes may refer to all billing nodes in the first set of nodes except the target node.
For example, referring to fig. 1, if the target node is the node 101 in the upper left corner of fig. 1, and the node in the upper left corner of fig. 1 is an accounting node, when the node 101 detects a node management request, the node management request may be broadcast to all accounting nodes in the remaining three nodes 101, and all accounting nodes in the remaining three nodes 101 may receive the node management request and perform consensus verification on the node management request.
S203, if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, calling the intelligent contract to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
For example, the node member list may correspond to the aforementioned accounting node committee, and managing the accounting node committee may correspond to managing the members of the node member list.
Specifically, any node broadcasts the consensus verification result of the node to each node in the block chain network, the node invokes an intelligent contract to detect whether the consensus verification results of other nodes meet preset conditions, and if so, the intelligent contract is invoked to execute management operation corresponding to the operation type on the first target node according to the identification information of the first target node.
In one embodiment, the meeting of the predetermined condition may include the number of passes of the verification reaching a predetermined number. The preset value may be smaller than the number of nodes included in the other nodes. Or may also be equal to the number of nodes that the other node comprises.
In one embodiment, the operation type is a delete node, and the process of the target node invoking the intelligent contract to perform the management operation corresponding to the operation type on the first target node according to the identifier of the first target node may be: the target node calls the intelligent contract to delete the identification information of the first target node from the node member list. Specifically, the target node may invoke the intelligent contract to search the identification information of the first target node from the node member list according to the identification information of the first target node, and delete the identification information of the first target node in the node member list.
In one embodiment, the operation type is an add node, and the process of the target node invoking the intelligent contract to perform the management operation corresponding to the operation type on the first target node according to the identifier of the first target node may be: the target node calls the intelligent contract to add the identification information of the first target node in a node member list.
In one embodiment, the node management request may also carry other information of the first target node, such as authority, in addition to the identification information of the first target node, and add the other information of the first target node to the node member list. In one embodiment, the target node may also assign initial rights or rights included in other information to the first target node after the target node invokes the intelligent contract to add the identification information of the first target node to the node member list.
In one embodiment, the operation type is modified node information, and the process that the target node invokes the intelligent contract to perform the management operation corresponding to the operation type on the first target node according to the identifier of the first target node may be: the target node invokes the intelligent contract to modify the information of the first target node in a node member list. In one embodiment, the node management request may carry modification configuration information (e.g., information such as a right to modify), and the target node invokes the intelligent contract to modify the information of the first target node in the node member list according to the modification configuration information.
As can be seen, in the embodiment shown in fig. 2, if the target node detects a node management request, the target node broadcasts the node management request to other nodes in the plurality of nodes, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of the first target node; if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, the target node calls the intelligent contract to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update the node member list, and therefore the node management efficiency of the block chain network is improved.
Please refer to fig. 3, which is a flowchart illustrating a node management method of a blockchain network according to another embodiment of the present invention. The method may be applied to a target node. Wherein the target node may be a node of a plurality of nodes comprised by the blockchain network. Specifically, the method may comprise the steps of:
s301, calling the intelligent contracts to detect the running states of all the nodes in the plurality of nodes.
According to the embodiment of the invention, the target node can call the intelligent contract to detect the running state of each node in the plurality of nodes so as to determine the nodes needing to be managed.
In one embodiment, the target node may invoke the smart contract to detect an operational status of each node in a first set of nodes of the plurality of nodes. In one embodiment, the first set of nodes may be a set of billing nodes. The set of accounting nodes may be made up of a plurality of accounting nodes.
In one embodiment, the operating condition includes, but is not limited to, any one or more of: login status, online times, communication status, update status, violation status, number of violations performed (e.g., number of violating data propagated, number of malicious attacks on other nodes, etc.) status. The login status can be divided into an offline status and an online status. The communication state may be classified into an abnormal communication state and a normal communication state. The online number of the node may refer to the online number of the node within a preset time range (e.g., a month). The update state may be classified into an abnormal update state and a normal update state. The abnormal update state refers to a state in which normal update is not possible. The normal update state refers to a state capable of normal update. The violation operating states may be classified into an executed violation operating state and an unexecuted violation operating state.
S302, determining a first target node from the plurality of nodes according to the running state of each node.
S303, generating a node management request aiming at the first target node.
In the embodiment of the present invention, the target node may determine a first target node from the plurality of nodes according to the operating state of each node, and generate a node management request for the first target node. By adopting the process, some abnormal nodes can be determined according to the running state of each node to delete, or some key nodes can be determined to open more authorities.
In one embodiment, the method for determining, by the target node, the first target node from the plurality of nodes according to the operating state of each node may be: the target node determines abnormal nodes from the plurality of nodes according to the running state of each node; the target node takes the abnormal node as a first target node.
In one embodiment, when the first target node is an abnormal node, the node management request may include an operation type of deleting a node or modifying a node authority (e.g., deleting a portion of the authority).
In one embodiment, the abnormal node may include a malicious node and/or a non-working state node.
In an embodiment, a manner that the target node determines the first target node from the plurality of nodes according to the operating state of each node may specifically be as follows: the target node determines a malicious node and a node in a non-working state from the plurality of nodes according to the login state of each node; the target node takes the malicious node and the node in the non-working state as a first target node.
In one embodiment, the operation state includes a login state, and the manner in which the target node determines the node in the non-operating state from the plurality of nodes according to the operation state of each node may be as follows: and the target node determines the node in the offline state from the plurality of nodes as the node in the non-working state according to the login state of each node.
In an embodiment, the operation state includes the number of login times, and the manner in which the target node determines the node in the non-operating state from the plurality of nodes according to the operation state of each node may be as follows: and the target node determines the node with the online times less than or equal to a first preset time (such as 3 times) from the plurality of nodes as the node in the non-working state according to the online times of each node.
In one embodiment, the operation state includes a communication state, and a manner in which the target node determines a node in a non-operating state from the plurality of nodes according to the operation state of each node may be as follows: and the target node determines the node in the abnormal communication state from the plurality of nodes as the node in the non-working state according to the communication state of each node.
In one embodiment, the operation state includes an illegal operation state, and the manner in which the target node determines the malicious node from the plurality of nodes according to the operation state of each node may be as follows: and the target node determines the node which is in the illegal operation state as a malicious node from the plurality of nodes according to the illegal operation state of each node.
In an embodiment, the operation status may include the number of times of performing the illegal operation, and the manner in which the target node determines the node in the non-operating state from the plurality of nodes according to the operation status of each node may be as follows: and the target node determines the node with the violation operation executing frequency larger than or equal to a second preset frequency (such as 1 time or 2 times) from the plurality of nodes as a malicious node according to the violation operation executing frequency of each node.
In one embodiment, the operation status may include login times and violation operations performed times, and the manner in which the target node determines the malicious node from the plurality of nodes according to the operation status of each node may be as follows: and the target node determines the node with the login times less than or equal to a first preset time and the number of illegal operation execution times greater than or equal to a second preset time from the plurality of nodes as a malicious node according to the login times of the nodes and the number of illegal operation execution times.
In one embodiment, the target node may determine at least one candidate node from the candidate node set, determine the at least one candidate node as a second target node, and may generate a node management request for the second target node, where the node management request includes an operation type of an add node.
Accordingly, if the target node detects the node management request, the node management request is broadcast to other nodes in the plurality of nodes, so that the other nodes perform consensus verification on the node management request, and the node management request includes identification information and an operation type (an added node) of a second target node. If the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, the intelligent contract is called to execute the management operation corresponding to the operation type (adding node) on the second target node according to the identification information of the second target node so as to update the node member list. In an embodiment, the determining the at least one candidate node includes, but is not limited to, a random selection mode or a selection mode according to information such as performance parameters of each candidate node in the candidate node set.
In an embodiment, the step of determining at least one candidate node from the candidate node set may be performed after the target node determines an abnormal node from the plurality of nodes according to the operating state of each node, or may be performed after the intelligent contract counts that the number of nodes indicated by the node member list is less than a specified number.
In an embodiment, the manner in which the target node determines the first target node from the plurality of nodes according to the operating state of each node may be: the target node determines a key node from the plurality of nodes according to the running state of each node; the target node takes the key node as a first target node. When the first target node is a key node, the operation type included in the node management request may be modifying node authority (e.g., adding node authority).
In one embodiment, the operation state includes login times and an illegal operation state, and the manner in which the target node determines the key node from the plurality of nodes according to the operation state of each node may be: and the target node determines that the login times are greater than or equal to a third preset time (the third preset time is greater than the first preset time) from the plurality of nodes according to the running state of each node, and the node which is not in the illegal operation state is used as a key node.
In one embodiment, each node may be further ranked according to the operating state of the node, and a node at the highest level may be selected from the plurality of nodes as a key node according to the ranking result. The higher the level, the better the running condition.
S304, detecting the node management request.
S305, if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes so that the other nodes perform consensus verification on the node management request, wherein the node management request comprises identification information and an operation type of a first target node.
S306, if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, calling the intelligent contract to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
Steps S304 to S306 can refer to steps S201 to S203 in the embodiment of fig. 2, which is not described herein again in the embodiment of the present invention.
In an optional implementation manner, the intelligent contract further indicates a block-out sequence between the at least two nodes, and the target node may further send the transaction information to a second target node included in the at least two nodes according to the block-out sequence when the submitted transaction information is acquired, so that the second target node performs accounting processing on the transaction information. And the block sequence is specified, so that the accounting management can be conveniently carried out, and the management efficiency of accounting nodes can be improved.
In one embodiment, the target node may be a billing node. The at least two nodes may be accounting nodes.
In one embodiment, when the block out sequence indicates that block out is currently performed by the target node, the target node may perform accounting processing on the transaction information when the submitted transaction information is obtained.
As can be seen, in the embodiment shown in fig. 3, the target node may determine a first target node from the plurality of nodes according to the operating state of each node, and generate a node management request for the first target node, so that the steps of performing consensus verification, performing management operation based on an intelligent contract, and the like are performed according to the node management request, thereby implementing a process of node automation and flexible management, and improving the node management efficiency of the blockchain network.
Based on the description of the above method embodiments, in an embodiment, an embodiment of the present invention further provides a schematic structural diagram of a node management apparatus as shown in fig. 4. The node management apparatus may be applied to the aforementioned target node. As shown in fig. 4, the node management apparatus in the embodiment of the present invention may include:
the detecting module 401 is configured to detect a node management request.
A communication module 402, configured to broadcast the node management request to other nodes in the plurality of nodes if the node management request is detected, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of the first target node.
A processing module 403, configured to invoke the intelligent contract to perform, according to the identification information of the first target node, a management operation corresponding to the operation type on the first target node according to the identification information of the first target node, so as to update a node member list, where the node member list includes identification information of at least two nodes in the plurality of nodes, if the intelligent contract detects that the consensus verification result of the other nodes meets a preset condition.
In an alternative embodiment, the operation type includes adding a node, deleting a node, or modifying a node authority.
In an optional implementation manner, the processing module 403 is further configured to invoke the smart contract to detect an operating state of each node in the plurality of nodes; determining a first target node from the plurality of nodes according to the running state of each node; generating a node management request for the first target node.
In an optional implementation manner, the determining module is specifically configured to determine, according to the operating state of each node, a malicious node and a node in a non-working state from the plurality of nodes; taking the malicious node and the node in the non-working state as a first target node; wherein the operation type is deleting a node.
In an optional embodiment, the preset condition includes that the number of nodes passing the verification reaches a preset value.
In an alternative embodiment, the communication module 402 is further configured to receive the broadcasted intelligent contract before the detection module 401 detects the node management request, where the intelligent contract indicates the preset condition.
In an optional implementation, the processing module 403 is further configured to run the intelligent contract on the virtual machine after the other node agrees with the intelligent contract.
In an alternative embodiment, the at least two nodes are used for accounting and the blocks resulting from accounting are added to the block chain.
In an optional implementation manner, the smart contract further indicates a block-out sequence between the at least two nodes, and the processing module 403 is further configured to, when the submitted transaction information is acquired, send the transaction information to a second target node included in the at least two nodes according to the block-out sequence, so that the second target node performs accounting processing on the transaction information.
It can be seen that, in the embodiment shown in fig. 4, if the node management apparatus detects a node management request, the node management apparatus broadcasts the node management request to other nodes in the plurality of nodes, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of the first target node; if the intelligent contract detects that the consensus verification result of the other node meets the preset condition, the node management device can call the intelligent contract to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update the node member list, and therefore the node management efficiency of the block chain network is improved.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device may be the aforementioned target node. The electronic device in the present embodiment as shown in fig. 5 may include: one or more processors 501; one or more input devices 502, one or more output devices 503, and memory 504. The processor 501, input device 502, output device 503, and memory 504 are connected via a bus or other means. Where input device 502 is an optional device. The memory 504 is used for storing a computer program comprising program instructions, and the processor 501 is used for executing the program instructions stored by the memory 504 to implement the various methods referred to above.
The memory 504 may include volatile memory (volatile memory), such as random-access memory (RAM); the memory 504 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the memory 504 may also comprise a combination of memories of the kind described above.
In one embodiment, the processor 501 may be a Central Processing Unit (CPU), and the processor may be other general-purpose processors, i.e., a microprocessor or any conventional processor. The memory 504 may include both read-only memory and random access memory. Therefore, the processor 501 and the memory 504 are not limited herein.
In one embodiment, processor 501 invokes program instructions stored in the memory 504 for detecting a node management request; if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes through an output device 503, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of a first target node; if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, the intelligent contract is called to execute the management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
In one embodiment, the operation type includes adding a node, deleting a node, or modifying node permissions.
In one embodiment, processor 501 invokes program instructions stored in memory 504 and is further configured to invoke the smart contracts to detect the operating states of the respective nodes of the plurality of nodes; determining a first target node from the plurality of nodes according to the running state of each node; generating a node management request for the first target node.
In an embodiment, the processor 501 invokes a program instruction stored in the memory 504 to execute the determining of the first target node from the plurality of nodes according to the operating state of each node, specifically, to determine a malicious node and a node in a non-working state from the plurality of nodes according to the operating state of each node; taking the malicious node and the node in the non-working state as a first target node; wherein the operation type is deleting a node.
In one embodiment, the preset condition includes that the number of nodes passing the verification reaches a preset value.
In one embodiment, processor 501 invokes program instructions stored in memory 504 that are further configured to receive via input device 502 the broadcasted intelligent contract prior to detecting a node management request, the intelligent contract indicating the preset condition; and after the other nodes pass the consensus of the intelligent contract, running the intelligent contract on a virtual machine.
In one embodiment, the at least two nodes are used for accounting and accounting generated blocks are added to the block chain.
In one embodiment, the intelligent contract further indicates an out-of-block sequence between the at least two nodes, and the processor 501 calls the program instructions stored in the memory 504, and is further configured to, when the submitted transaction information is acquired, send the transaction information to a second target node included in the at least two nodes according to the out-of-block sequence, so that the second target node performs accounting processing on the transaction information.
It should be noted that, for the specific working processes of the electronic devices and units described above, reference may be made to the relevant descriptions in the foregoing embodiments, and details are not described here again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware instructions of a computer program, where the computer program may be stored in a computer storage medium, and the computer storage medium may be a computer-readable storage medium, and when executed, the computer program may include the processes of the above embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a number of embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A node management method for a blockchain network, the method being applied to a target node in the blockchain network, the blockchain network including a plurality of nodes, each of the plurality of nodes storing an identical blockchain, the target node being any one of the plurality of nodes, the method comprising:
receiving a broadcasted intelligent contract, wherein the intelligent contract comprises preset conditions to be met by consensus verification of other nodes except the target node in the plurality of nodes;
after the other nodes pass the intelligent contract consensus, operating the intelligent contract on a virtual machine independently of the block chain;
detecting a node management request;
if the node management request is detected, broadcasting the node management request to other nodes in the plurality of nodes so that the other nodes perform consensus verification on the node management request, wherein the node management request comprises identification information and an operation type of a first target node, and the first target node is a node which is determined from the plurality of nodes according to the running state of each node in the plurality of nodes detected by calling the intelligent contract and meets a preset management condition;
if the intelligent contract detects that the consensus verification result of the other nodes meets the preset condition, calling the intelligent contract to execute a management operation corresponding to the operation type on the first target node according to the identification information of the first target node so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes.
2. The method of claim 1, wherein the operation type comprises adding a node, deleting a node, or modifying a node authority.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
calling the intelligent contracts to detect the running state of each node in the plurality of nodes;
determining the first target node from the plurality of nodes according to the running state of each node;
generating a node management request for the first target node.
4. The method of claim 3, wherein determining a first target node from the plurality of nodes based on the operational status of each of the plurality of nodes comprises:
according to the running state of each node, determining a malicious node and a node in a non-working state from the plurality of nodes;
taking the malicious node and the node in the non-working state as a first target node;
wherein the operation type is deleting a node.
5. The method of claim 1, wherein the predetermined condition comprises that the number of nodes passing the verification reaches a predetermined value.
6. The method of claim 1, wherein the at least two nodes are configured for accounting, and wherein blocks generated by accounting are added to a block chain.
7. The method of claim 1 or 6, wherein the intelligent contract further indicates an out-of-block order between the at least two nodes, the method further comprising:
and when the submitted transaction information is acquired, sending the transaction information to a second target node included in the at least two nodes according to the block output sequence, so that the second target node performs accounting processing on the transaction information.
8. A node management apparatus, applied to a target node in a blockchain network, the blockchain network including a plurality of nodes, each of the plurality of nodes storing an identical blockchain, the target node being any one of the plurality of nodes, the apparatus comprising:
the detection module is used for detecting the node management request;
a communication module, configured to broadcast the node management request to other nodes in the plurality of nodes if the node management request is detected, so that the other nodes perform consensus verification on the node management request, where the node management request includes identification information and an operation type of a first target node, and the first target node is a node that satisfies a preset management condition and is determined from the plurality of nodes according to an operation state of each node in the plurality of nodes detected by invoking an intelligent contract;
the processing module is used for calling the intelligent contract to execute management operation corresponding to the operation type on the first target node according to the identification information of the first target node if the intelligent contract detects that the common identification verification result of the other nodes meets a preset condition so as to update a node member list, wherein the node member list comprises the identification information of at least two nodes in the plurality of nodes;
the communication module is further configured to receive the broadcasted intelligent contract before the detection module detects the node management request, where the intelligent contract indicates that the preset condition exists;
the processing module is further configured to run the intelligent contract on the virtual machine independently of the block chain after the other nodes pass the consensus on the intelligent contract.
9. A computer storage medium, characterized in that there are stored program instructions which, when executed, are adapted to implement the method of any one of claims 1-7.
CN201910900043.8A 2019-09-23 2019-09-23 Node management method and device of block chain network and computer storage medium Active CN110661658B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910900043.8A CN110661658B (en) 2019-09-23 2019-09-23 Node management method and device of block chain network and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910900043.8A CN110661658B (en) 2019-09-23 2019-09-23 Node management method and device of block chain network and computer storage medium

Publications (2)

Publication Number Publication Date
CN110661658A CN110661658A (en) 2020-01-07
CN110661658B true CN110661658B (en) 2022-08-12

Family

ID=69038953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910900043.8A Active CN110661658B (en) 2019-09-23 2019-09-23 Node management method and device of block chain network and computer storage medium

Country Status (1)

Country Link
CN (1) CN110661658B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444210B (en) * 2020-03-26 2021-11-05 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111459676B (en) * 2020-03-31 2024-06-18 腾讯科技(深圳)有限公司 Node resource management method, device and storage medium
CN111461885B (en) * 2020-03-31 2024-03-19 财付通支付科技有限公司 Consensus network management method, device, computer and readable storage medium
CN111464353B (en) * 2020-03-31 2022-12-09 财付通支付科技有限公司 Block link point management method, device, computer and readable storage medium
CN111784103B (en) * 2020-05-22 2024-05-07 上海飞鱼医疗科技有限公司 Reagent quality whole-flow management system based on blockchain technology
CN111786812B (en) * 2020-05-27 2023-06-20 金蝶软件(中国)有限公司 Node management method, device, computer equipment and storage medium
CN111405074B (en) * 2020-06-08 2020-09-08 南京邮电大学 Data center network fault diagnosis and automatic configuration method based on hybrid chain
CN112055067B (en) * 2020-08-28 2023-04-18 杭州复杂美科技有限公司 Node connection method, device and storage medium
CN113010600B (en) * 2021-02-02 2023-01-31 腾讯科技(深圳)有限公司 Data management system, method, related device and medium based on block chain
CN113190285B (en) * 2021-04-23 2023-06-20 神荼科技(山东)有限公司 Virtual environment safety detection method and device based on block chain and storage medium
CN113222757A (en) * 2021-05-06 2021-08-06 永旗(北京)科技有限公司 Intelligent contract management method and system for block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN107332701A (en) * 2017-06-26 2017-11-07 中国人民银行数字货币研究所 The method and system of management node
WO2018111295A1 (en) * 2016-12-16 2018-06-21 Hitachi, Ltd. Blockchain monitoring and management
CN108768665A (en) * 2018-07-02 2018-11-06 上海达家迎信息科技有限公司 Block chain generation method, device, computer equipment and storage medium
CN109831425A (en) * 2019-01-25 2019-05-31 中国联合网络通信集团有限公司 Block chain common recognition method, apparatus, equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3423999A1 (en) * 2016-03-03 2019-01-09 NEC Laboratories Europe GmbH Method for managing data in a network of nodes
US10764142B2 (en) * 2017-11-16 2020-09-01 International Business Machines Corporation Clustered application management with a blockchain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018111295A1 (en) * 2016-12-16 2018-06-21 Hitachi, Ltd. Blockchain monitoring and management
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN107332701A (en) * 2017-06-26 2017-11-07 中国人民银行数字货币研究所 The method and system of management node
CN108768665A (en) * 2018-07-02 2018-11-06 上海达家迎信息科技有限公司 Block chain generation method, device, computer equipment and storage medium
CN109831425A (en) * 2019-01-25 2019-05-31 中国联合网络通信集团有限公司 Block chain common recognition method, apparatus, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于区块链的地学大数据管理;王亮等;《国防科技》;20180420(第02期);全文 *

Also Published As

Publication number Publication date
CN110661658A (en) 2020-01-07

Similar Documents

Publication Publication Date Title
CN110661658B (en) Node management method and device of block chain network and computer storage medium
CN110569251B (en) Data processing method, related equipment and computer readable storage medium
CN108549580B (en) Method for automatically deploying Kubernets slave nodes and terminal equipment
WO2021036545A1 (en) Smart contract-based data processing method, and device and storage medium
CN110597918B (en) Account management method, account management device and computer readable storage medium
EP3178011B1 (en) Method and system for facilitating terminal identifiers
CN111523890B (en) Block chain-based data processing method, device, storage medium and equipment
CN111343142A (en) Data processing method and device based on block chain network and storage medium
CN111460458B (en) Data processing method, related device and computer storage medium
CN111061685B (en) Log query method and device, node equipment and storage medium
CN103077345B (en) Based on software authorization method and the system of virtual machine
CN111464353A (en) Block link point management method, device, computer and readable storage medium
CN112714158A (en) Transaction processing method, relay network, cross-link gateway, system, medium, and device
CN115131022B (en) Block chain based digital asset transaction method, device, equipment and medium
CN108390786B (en) Business operation and maintenance method and device and electronic equipment
CN110336813B (en) Access control method, device, equipment and storage medium
CN111459676A (en) Node resource management method, device and storage medium
EP3848802A1 (en) Data management method and apparatus, and server
CN112037055B (en) Transaction processing method, device, electronic equipment and readable storage medium
CN111353150B (en) Trusted boot method, trusted boot device, electronic equipment and readable storage medium
WO2022133827A1 (en) Method and apparatus for processing task processing request, and blockchain node device
CN114490135A (en) Task processing method and device, electronic equipment and storage medium
US20210089497A1 (en) Method, device, and computer program product for managing data object
CN112291241A (en) Firewall wall opening method, firewall wall opening device and terminal equipment
CN111400404A (en) Node initialization method, device, 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