CN112714196B - Node management method, device, equipment and storage medium based on block chain network - Google Patents

Node management method, device, equipment and storage medium based on block chain network Download PDF

Info

Publication number
CN112714196B
CN112714196B CN202110329773.4A CN202110329773A CN112714196B CN 112714196 B CN112714196 B CN 112714196B CN 202110329773 A CN202110329773 A CN 202110329773A CN 112714196 B CN112714196 B CN 112714196B
Authority
CN
China
Prior art keywords
node
consensus
index
target device
index value
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
CN202110329773.4A
Other languages
Chinese (zh)
Other versions
CN112714196A (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 CN202110581148.9A priority Critical patent/CN113286004B/en
Priority to CN202110329773.4A priority patent/CN112714196B/en
Publication of CN112714196A publication Critical patent/CN112714196A/en
Application granted granted Critical
Publication of CN112714196B publication Critical patent/CN112714196B/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
    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/102Entity profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Power Engineering (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the application discloses a node management method, a device, equipment and a storage medium based on a block chain network, wherein the node management method based on the block chain network comprises the following steps: responding to a node registration request about target equipment, and performing consensus processing on the target equipment according to the node registration request; after the target equipment is subjected to consensus processing, acquiring index parameters, wherein the index parameters are determined according to node information of each member node in a consensus committee; according to an index distribution strategy, distributing a first index value for the target equipment by adopting an index parameter, and informing the target equipment to join a block chain network, wherein the first index value is in an unavailable state; after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state. By adopting the embodiment of the application, the consensus committee in the blockchain network can be effectively managed.

Description

Node management method, device, equipment and storage medium based on block chain network
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for node management based on a blockchain network.
Background
The consensus committee in the blockchain network comprises one or more member nodes, and each member node in the consensus committee has an accounting authority for the blockchain, wherein the accounting authority refers to the authority for proposal blocks and consensus voting on the proposal blocks. The consensus committee is managed, the accounting authority of the block chain can be promoted to be managed, and stable service can be provided for a block chain network. Currently, the block chain network does not support the management of the consensus committee, so how to effectively manage the consensus committee becomes a hot topic of current research.
Disclosure of Invention
The embodiment of the application provides a node management method, a node management device, a node management equipment and a storage medium based on a block chain network, which can effectively manage a consensus committee in the block chain network.
In one aspect, an embodiment of the present application provides a node management method based on a blockchain network, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, and each member node has an accounting right for a blockchain; the method is performed by a target member node in a consensus committee, the method comprising:
responding to a node registration request about target equipment, and performing consensus processing on the target equipment according to the node registration request;
after the target equipment is subjected to consensus processing, acquiring index parameters, wherein the index parameters are determined according to node information of each member node in a consensus committee;
according to an index distribution strategy, distributing a first index value for the target equipment by adopting an index parameter, and informing the target equipment to join a block chain network, wherein the first index value is in an unavailable state;
after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
In another aspect, an embodiment of the present application provides a node management apparatus based on a blockchain network, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, and each member node has an accounting authority for a blockchain; the apparatus is provided in a target member node in a consensus committee, the apparatus comprising:
the processing unit is used for responding to a node registration request of the target equipment and carrying out consensus processing on the target equipment according to the node registration request;
the acquisition unit is used for acquiring index parameters after the target equipment passes the consensus treatment, wherein the index parameters are determined according to the node information of each member node in the consensus committee;
the processing unit is further used for allocating a first index value to the target device by using the index parameter according to the index allocation strategy, and notifying the target device to join the block chain network, wherein the first index value is in an unavailable state; and after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
In one implementation, the node information of any member node in the consensus committee includes an index value of any member node; the node registration request comprises contract hash of a governance contract, the governance contract comprises a current value of a global index, and the current value of the global index is determined according to the index value of each member node;
an obtaining unit, configured to, when obtaining the index parameter, specifically perform the following steps: acquiring a current value of the global index from a governance contract corresponding to the contract hash, and taking the current value of the global index as an index parameter;
the processing unit is configured to, when allocating a first index value to the target device by using the index parameter according to the index allocation policy, specifically execute the following steps: and allocating the index parameter as a first index value to the target device.
In one implementation, the current value of the global index is equal to: carrying out atomic auto-increment processing on the maximum index value determined based on the index value of each member node;
wherein the maximum index value is determined from the index values of the respective member nodes and the index values of the other nodes; the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the other nodes including: each of the plurality of consensus nodes other than the consensus committee, or each of the plurality of nodes other than the consensus committee in the blockchain network.
In one implementation, after the global index value is assigned to the target device as the first index value, the processing unit is further configured to perform the following steps:
carrying out atomic self-increment processing on the current value of the global index in the governance contract so as to update the current value of the global index;
and recording the updated current value into the block chain, wherein the updated current value is used for determining an index value for the next device which joins the block chain network.
In an implementation manner, the obtaining unit, configured to obtain a current value of the global index from a governance contract corresponding to the contract hash, and before obtaining the current value of the global index, is further configured to perform the following steps:
if a deployment request about a governance contract is received, acquiring signature information of the governance contract, and performing information verification on the signature information, wherein the information verification comprises at least one of the following items: validity checking and format checking;
if the information passes the verification, calling a virtual machine to write the contract hash of the governance contract and the contract content of the governance contract into the intelligent contract of the block chain network in a correlation manner so as to update the intelligent contract;
and carrying out consensus processing on the updated intelligent contract, and storing the updated intelligent contract to the block chain after the updated intelligent contract is subjected to consensus processing.
In one implementation, the obtaining unit is further configured to perform the following steps:
if a node quitting request about the target equipment is received, analyzing the node quitting request to obtain a contract hash;
acquiring a governance contract corresponding to the contract hash, wherein the governance contract also comprises a node exit strategy;
and removing the target equipment from the blockchain network according to the node exit strategy.
In one implementation, after the target device is assigned the first index value, the node identification of the target device is added to a node list managed by the governance contract; an obtaining unit, configured to, when removing a target device from a blockchain network according to a node exit policy, specifically execute the following steps:
acquiring a node list managed by a governance contract, wherein the node list comprises node identifications of one or more nodes;
deleting the node identification of the target device in the node list, and deleting the first index value to remove the target device from the blockchain network.
In one implementation, the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the node information of any member node in the consensus committee includes a node identifier of any member node, and the target device becomes the consensus node in the blockchain network after consensus processing;
an obtaining unit, configured to, when obtaining the index parameter, specifically perform the following steps: arranging node identifications of all consensus nodes in the block chain network in sequence to obtain arrangement position information of target equipment; and using the arrangement position information as an index parameter;
the processing unit is configured to, when allocating a first index value to the target device by using the index parameter according to the index allocation policy, specifically execute the following steps: and determining the node number of the common node positioned in front of the target equipment according to the arrangement position information, calculating a first index value according to the node number, and distributing the calculated first index value to the target equipment.
In one implementation, the target member node has a second index value, the second index value being in an available state; a processing unit further configured to perform the steps of:
if an update event for the consensus committee is detected, new committee information is acquired, the new committee information comprising: updating the index value of each member node in the consensus committee;
adopting a second index value of the target member node to perform index value hit processing on the new committee information;
if the hit fails, the second index value is set to an unavailable state to indicate that the target member node does not belong to the updated consensus committee.
In one implementation, the processing unit is further configured to perform the following steps:
acquiring a consensus committee application request regarding the target device, the consensus committee application request requesting to join the target device to a consensus committee, the consensus committee application request including consensus committee evaluation information of the target device;
detecting accounting qualification of the target device according to the consensus committee evaluation information;
and if the target device is determined to have the accounting qualification, determining that the target device has the accounting authority.
In one implementation, the consensus committee elects from a plurality of consensus nodes in the blockchain network; the node registration request includes: the node registration request is used for indicating that the target equipment is to become a node under the node type; a processing unit, configured to perform consensus processing on the target device according to the node registration request, specifically perform the following steps:
acquiring a node evaluation standard corresponding to the node type;
according to the node evaluation standard and the equipment evaluation information, carrying out capability detection on the target equipment to obtain a capability detection result of the target equipment;
and performing consensus processing on the target equipment according to the capability detection result.
In one implementation, the node registration request further includes a node identifier of the target device; a processing unit further configured to perform the steps of:
acquiring a node list and a blacklist list of a block chain network, wherein the node list comprises node identifications of one or more nodes;
searching the node identifier of the target equipment in the node list, and searching the node identifier of the target equipment in the blacklist;
and if the searching in the node list and the blacklist fails, executing a step of acquiring the node evaluation standard corresponding to the node type.
In another aspect, an embodiment of the present application provides a node management device based on a blockchain network, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, and each member node has an accounting authority for a blockchain; the apparatus is a target member node in a consensus committee, the apparatus comprising:
a processor adapted to implement a computer program;
and a computer readable storage medium storing a computer program adapted to be loaded by a processor and to execute the above-mentioned node management method based on a blockchain network.
In another aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is read and executed by a processor of a computer device, the computer device is caused to execute the above node management method based on a blockchain network.
In another aspect, embodiments of the present application provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the node management method based on the blockchain network.
In the embodiment of the application, after the target device to be added to the blockchain network is subjected to consensus processing, a first index value can be allocated to the target device by using the obtained index parameter, and the target device is notified to be added to the blockchain network, wherein the allocated first index value is in an unavailable state; the first index value of the unavailable state indicates that the target device does not belong to a consensus committee of the blockchain network; after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state; therefore, after the index value is distributed to the equipment joining the blockchain network, the consensus committee of the blockchain network can be effectively managed through different states (including an available state or an unavailable state) of the index value, and therefore the accounting authority of the blockchain network can be effectively managed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1A is a schematic architecture diagram of a data sharing system according to an embodiment of the present application;
fig. 1B is a schematic structural diagram of a block chain according to an embodiment of the present disclosure;
fig. 1C is a schematic flowchart of a block generation process according to an embodiment of the present disclosure;
fig. 2 is a block chain network according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a node management method based on a blockchain network according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another node management method based on a blockchain network according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating another node management method based on a blockchain network according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a node management apparatus based on a blockchain network according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a node management device based on a blockchain network according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to make the embodiments of the present application more clearly understood, the following describes a blockchain network and a blockchain technology related to the embodiments of the present application:
referring to the data sharing system (or referred to as a blockchain network) shown in fig. 1A, fig. 1A is a schematic structural diagram of a data sharing system provided in an embodiment of the present application, where the data sharing system 10 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may refer to respective clients in the data sharing system. Each node 101 may receive input information while performing normal operations and maintain shared data within the data sharing system based on the received input information. In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system 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 the nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the other node in the data sharing system according to the node identifier of the other node in the following. 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:
TABLE 1
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 data sharing system stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1B, fig. 1B is a schematic structural diagram of the block chain provided in the embodiment of the present application, the block chain is composed of a plurality of blocks, a 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 generating each block in the block chain, referring to fig. 1C, fig. 1C is a schematic flow chart of a block generation process provided in an embodiment of the present application, when a node where the block chain is located receives input information, the input information is verified, after the verification is completed, the input information is stored in a memory pool, and a hash tree used 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 data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, 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 Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The blockchain is essentially a decentralized database, which is a series of data blocks (i.e., blocks generated by the process shown in fig. 1C) associated by using cryptography, each data block contains information of a batch of network transactions for verifying the validity (anti-counterfeit) of the information and generating the next block.
The embodiment of the application provides a node management scheme based on a block chain network, which introduces an index value and the state of the index value, allocates the index value to equipment added into the block chain network, and effectively manages a consensus committee in the block chain network by setting different states (including an available state or an unavailable state) of the index value. The index value of the available state indicates that the equipment corresponding to the index value belongs to the consensus committee, and the index value of the unavailable state indicates that the equipment corresponding to the index value does not belong to the consensus committee; and the index value allocated to each device is unique in the blockchain network, that is, different devices cannot have the same index value, so that the accuracy of the management process of the consensus committee is ensured.
The consensus committee comprises one or more member nodes, and each member node in the consensus committee has accounting authority on the block chain; the consensus committee is effectively managed, and the accounting authority of the block chain is favorably managed, so that the block chain network can provide stable service. The accounting authority refers to the authority for carrying out consensus voting on the proposal block and the proposal block; the proposal block can be understood as a process of packaging transaction data into blocks and issuing the packaged blocks to a block chain network for consensus voting; consensus voting, which may also be referred to as consensus processing, refers to a process of checking a block using a consensus mechanism; the consensus mechanism may include, but is not limited to, at least one of: a Proof of Work (PoW) mechanism, a Proof of rights (PoS) mechanism, a certificate of rights (released Proof of stamp, DPoS) mechanism, a Practical Byzantine Fault Tolerance (PBFT) mechanism, and so on.
In order to more clearly understand the node management scheme based on the blockchain network provided in the embodiment of the present application, a blockchain network applicable to the embodiment of the present application is introduced below, and the following fig. 2 may be referred to as the blockchain network applicable to the embodiment of the present application:
fig. 2 is a schematic diagram of a block chain network according to an embodiment of the present disclosure, and as shown in fig. 2, the block chain network 20 is composed of common nodes and non-common nodes, where gray circles shown in fig. 2 represent the common nodes in the block chain network, and white circles represent the non-common nodes in the block chain network; the non-consensus nodes in the blockchain network may include, but are not limited to, at least one of: routing nodes, serving nodes, etc.; the routing nodes are used for supporting communication among all nodes in the block chain network, and the service nodes are used for providing block chain services (such as law enforcement evidence storage services, commodity source tracing services and the like). It should be noted that the blockchain network shown in fig. 2 is only used as an example, and in an actual scenario, the number of the common nodes and the number of the non-common nodes in the blockchain network may be set according to actual requirements.
The blockchain network 20 includes a consensus committee 201, the consensus committee 201 including one or more member nodes; the consensus committee 201 is elected from a plurality of consensus nodes in the blockchain network 20 according to an election rule, and the consensus nodes have the authority to perform consensus voting on blocks proposed by the member nodes; election rules may include: number of consensus committee members, consensus committee tenure switching period, consensus committee election algorithm, and the like.
The node management scheme based on the blockchain network provided by the embodiment of the present application is executed by a target member node in the consensus committee, where the target member node may be any member node in the consensus committee, or the target member node may also be a certain node designated in the consensus committee, for example, the target member node is a node with the strongest service capability (for example, the largest number of executed historical services) in the consensus committee. Each node in the blockchain network may be a terminal or a server; the terminal may include, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted device, a smart speaker, a smart watch, a smart wearable device, and the like; the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services, and the embodiment of the present application is not limited herein. The nodes in the blockchain network can be directly or indirectly connected through a wireless communication mode or a wired communication mode.
It can be understood that the block chain network described in the embodiment of the present application is for more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation to the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows that along with the evolution of the system architecture and the appearance of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
In conjunction with the blockchain network 20 shown in fig. 2, the following describes a node management scheme based on a blockchain network according to an embodiment of the present application. Fig. 3 is a flowchart illustrating a node management method for a blockchain-based network according to an embodiment of the present disclosure, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, and each member node has an accounting authority for a blockchain, and the node management method for the blockchain-based network is performed by a target member node in the consensus committee; the node management method based on the blockchain network may include the following steps S301 to S304:
s301, responding to the node registration request of the target device, and performing consensus processing on the target device according to the node registration request.
Before step S301, the target member node obtains signature information of the node registration request, performs information verification on the signature information of the node registration request, and analyzes the node registration request from the signature information of the node registration request after the signature information of the node registration request passes the information verification; the information verification may include at least one of: validity checking and format checking; the node registration request is used to request that the target device be added to the blockchain network.
In one implementation, the signature information of the node registration request may be sent by the administration committee to the target member node. The administration committee acquires node registration information of target equipment to be added to the block chain network; the node registration information of the target device may include, but is not limited to, at least one of: the node identification of the target equipment, the node type of the target equipment to be added into the block chain network and additional information of the target equipment; the node identification of the target device may include: a Certificate number of a CA (Certificate Authority) Certificate of the target device, an IP address of the target device, and the like; the additional information for the target device may include organization information (e.g., organization address, organization uniform social credit code, taxpayer identification number, etc.) for the organization (e.g., company or business, etc.) to which the target device corresponds. After the administration committee acquires the node registration information of the target equipment, verifying the node registration information of the target equipment; for example, the certificate number of the CA certificate of the target device is verified, the organization information of the organization corresponding to the target device is verified, and the like; after the node registration information of the target device passes the verification, the administration committee generates a node registration request according to the node registration information of the target device, encrypts the node registration request (for example, encrypts the node registration request by using a private key of the administration committee) to obtain signature information of the node registration request, and sends the signature information of the node registration request to the target member node.
The signature information of the node registration request sent by the administration committee to the target member node may include the following two cases: the governance committee comprises one or more governance nodes, and is elected from a block chain network; after the target administration node in the administration committee checks the node registration information of the target equipment, generating a node registration request according to the node registration information of the target equipment, and sending signature information of the node registration request (for example, the signature information of the node registration request is obtained by encrypting the node registration request by using a private key of the target administration node) to the target member node; the target abatement node may be any one of the abatement nodes in the abatement committee, or the target abatement node may be a designated one of the abatement nodes in the abatement committee. The governing committee consists of several governing mechanisms outside the blockchain network; after the management equipment corresponding to the target management organization passes the verification of the node registration information of the target equipment, generating a node registration request according to the node registration information of the target equipment, and sending signature information of the node registration request (for example, the signature information of the node registration request is obtained by encrypting the node registration request by using a private key of the management equipment) to a target member node; the target abatement facility may be any of the abatement facilities in the abatement committees, or the target abatement facility may be a designated one of the abatement facilities in the abatement committees.
In another implementation, the signature information of the node registration request may be sent by the target device to the target member node. The target device generates a node registration request according to the node registration information of the target device, encrypts the node registration request (for example, encrypts the node registration request by using a private key of the target device) to obtain signature information of the node registration request, and sends the signature information of the node registration request to the target member node.
It should be noted that, the verifying the validity of the signature information of the node registration request by the target member node may include: the public key of a treatment committee (such as the public key of a target treatment node or the public key of treatment equipment corresponding to a target treatment organization) is adopted to carry out validity check on the signature information of the node registration request, if the public key is successfully decrypted, the validity check is passed, and if the public key is failed, the validity check is not passed; or, the public key of the target device is adopted to carry out validity check on the signature information of the node registration request, if the public key is successfully decrypted, the validity check is passed, and if the public key is failed, the validity check is not passed; or the signature information of the node registration request comprises a generation timestamp of the signature information of the node registration request, a receiving timestamp of the signature information of the target member node receiving the node registration request is obtained, if the difference value between the receiving timestamp and the generation timestamp is smaller than a first time threshold value, validity check is passed, and if the difference value between the receiving timestamp and the generation timestamp is larger than or equal to the first time threshold value, validity check is not passed. The format verification of the signature information of the node registration request by the target member node may be: the format of the signature information of the node registration request is checked, and if the format is the first format (for example, the signature information includes a certain specific character, the signature information includes letters or numbers, etc.), the format check is passed, and if the format is not the first format, the format check is not passed.
In step S301, the node registration request may include a node type of the target device to be added to the blockchain network and device evaluation information corresponding to the node type, where the node type may include a consensus type or a non-consensus type. The device evaluation information may include a credit evaluation score for the target device, which may be used to indicate a credit rating of the target device; the higher the credit evaluation score of the target device, indicating that the higher the credit rating of the target device, the higher the likelihood that the target device is trusted by the blockchain network; the lower the credit evaluation score of the target device, indicating a lower credit rating for the target device, the lower the likelihood that the target device is trusted by the blockchain network. In the case where signature information of the node registration request is transmitted to the target member node by the administration committee, the device evaluation information of the target device may be generated after the administration committee performs credit evaluation on the target device, and the administration committee generates the node registration request based on the node registration information of the target device and the device evaluation information of the target device. In this way, the governance committee participates in the credit assessment of the target device, making the consensus process of the target device more fair. In the case that signature information of the node registration request is sent to the target member node by the target device, device evaluation information of the target device is generated after the target device requests a credit evaluation organization to perform credit evaluation on the target device, and the target device generates the node registration request according to the node registration information of the target device and the device evaluation information of the target device.
The consensus processing of the target device according to the node registration request may include: acquiring a node evaluation standard corresponding to a node type; the node evaluation standard corresponding to the consensus type is a first credit threshold, the node evaluation standard corresponding to the non-consensus type is a second credit threshold, and the first credit threshold is higher than the second credit threshold, which indicates that the requirement of the blockchain network on the credit degree of the consensus node is higher than the requirement on the credit degree of the non-consensus node. Secondly, according to the node evaluation standard and the equipment evaluation information, the capacity of the target equipment is detected, and a capacity detection result of the target equipment is obtained. Specifically, if the node type is a consensus type, performing capability detection on a credit evaluation score of the target device by using a first credit threshold; if the credit evaluation score of the target equipment is larger than the first credit threshold value, generating a capability detection result of successful detection; and if the credit evaluation score of the target device is less than or equal to the first credit threshold value, generating a capability detection result of detection failure. If the node type is a non-consensus type, performing capability detection on the credit evaluation score of the target equipment by adopting a second credit threshold value; if the credit evaluation score of the target equipment is larger than a second credit threshold value, generating a capability detection result of successful detection; and if the credit evaluation score of the target device is less than or equal to the second credit threshold value, generating a capability detection result of detection failure. And thirdly, performing consensus processing on the target equipment according to the capability detection result. Here, the consensus process means: generating a block according to the capability detection result, uploading the generated block to a block chain, and acquiring the block comprising the capability detection result from the block chain by each consensus node in the block chain network; if the number of the identified common nodes in each common node, which is represented by the capability detection result, is greater than or equal to the common number threshold (for example, the common number threshold is two thirds of the total number of the common nodes), the capability detection result is represented to pass the common processing; and if the number of the consensus nodes representing consensus of the ability detection result in each consensus node is less than the consensus number threshold, indicating that the ability detection result does not pass the consensus processing. And when the node type to be added into the block chain network by the target equipment is the consensus type, if the capability detection result which is detected successfully passes the consensus processing, allowing the target equipment to become the consensus node in the block chain network. And when the type of the node to be added into the block chain network by the target equipment is a non-consensus type, if the capability detection result of successful detection passes the consensus processing, allowing the target equipment to become the non-consensus node in the block chain network.
The node registration request can also comprise a node identifier of the target equipment, and before the target equipment is subjected to capability detection, a node list and a blacklist list of the block chain network can be obtained, wherein the node list comprises the node identifiers of one or more nodes belonging to the block chain network; searching a node identifier of the target device in the node list, namely checking whether the target device is added into the block chain network, and searching the node identifier of the target device in the blacklist list, namely judging whether the target device is a device which is not allowed to be added into the block chain network; and if the searching in the node list and the blacklist list fails, namely the target equipment is not added into the block chain network and the target equipment is not the equipment which is not allowed to be added into the block chain network, further carrying out capability detection on the target equipment.
S302, after the target device is subjected to consensus processing, the index parameters are obtained.
And S303, according to the index allocation strategy, allocating a first index value to the target equipment by using the index parameter, and informing the target equipment of joining the block chain network.
In steps S302 to S303, after the target device passes the consensus process, the index parameter may be obtained, and a first index value is allocated to the target device according to the index allocation policy, and the target device is notified to join the blockchain network; the first index value is now in an unavailable state. Wherein, allocating the first index value to the target device may refer to: an object instance of the target device is generated, and a node identification of the target device (e.g., an IP address, a certificate number of a CA certificate, etc.), a node type of the target device, additional information of the target device, and a first index value are assigned to the object instance of the target device together. The index parameter is determined based on node information of each member node in the consensus committee.
In one implementation, the index assignment policy comprises a governance contract assignment policy, where the node information of any member node in the consensus committee includes an index value of the any member node. Specifically, a governance contract may be deployed in the blockchain network, where the governance contract includes governance-related information of the blockchain network, and the governance-related information may include: the number of nodes in the blockchain network, the node list of the blockchain network, the number of members of the consensus committee, the consensus committee tenure, the switching period of the consensus committee tenure, the election rule of the consensus committee, the current value of the global index, and the like; the node list of the block chain network comprises node identifications of all nodes in the block chain network; the current value of the global index is determined from the index values of the respective member nodes. The governing contract allocation strategy is as follows: and taking the current value of the global index in the governance contract as an index parameter, taking the index parameter as a first index value, and allocating the index parameter to the strategy of the target equipment. The global index in the governance contract is monotonically increased, and the initial value of the global index is 0; after the current value of the global index in the governance contract is adopted for index value distribution, the current value of the global index can be updated, the updated current value of the global index is recorded into the blockchain, and the updated current value of the global index is used for determining the index value for the next device added into the blockchain network. The deployment process of the governance contract, the determination process of the first index value, and the update process of the current value of the global index in this implementation may specifically refer to the following description of the embodiment shown in fig. 4.
In another implementation, the index allocation policy includes a node identifier ordering policy, where the node identifier ordering policy is applicable to a case where the target device has become a consensus node in the blockchain network, and the node information of any member node in the consensus committee includes a node identifier of the member node. Specifically, an index distribution component of a target member node acquires a consensus list, wherein the consensus list comprises node identifiers of all consensus nodes; the index distribution component arranges the node identifications of all the consensus nodes in the consensus list in sequence to obtain a sequenced consensus list; and the index distribution component distributes a group of monotonically increasing numerical values to the consensus nodes in sequence according to the arrangement sequence of the node identifications of the consensus nodes in the sorted consensus list to realize one-to-one mapping between the node identifications of the consensus nodes and the index values, wherein the number of the numerical values in the group of numerical values is the same as that of the node identifications of the consensus nodes in the consensus list. The node identification ordering strategy can effectively avoid the dependence on the global index in the governance contract, and the allocated index value exists only in the blockchain network, so that the consensus committee in the blockchain network can be accurately managed. The process of determining the first index value in this implementation may specifically refer to the following description of the embodiment shown in fig. 5.
It should be noted that, in the two index allocation policies (i.e., the governance contract allocation policy and the node identifier ordering policy), the blockchain network may select any one of the two index allocation policies as an index allocation policy used by the blockchain network, and the selected index allocation policy needs to be subjected to consensus processing; if the selected index allocation strategy passes the consensus processing, the selected index allocation strategy can be used as an index allocation strategy used by the blockchain network; if the selected index allocation strategy does not pass the consensus processing, the index allocation strategy needs to be reselected for the consensus processing until the selected index allocation strategy passes the consensus processing.
And S304, after the target device is determined to have the accounting authority, setting the first index value to be in an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
Upon determining that the target device has the accounting authority, a first index value of an available state may be set, the first index value of the available state indicating that the target device becomes a new member node in the consensus committee, so that the target device participates in the accounting process of the block chain as the new member node in the consensus committee based on the first index value of the available state. The process of determining that the target device has the billing right may include: acquiring a consensus committee application request regarding a target device, the consensus committee application request requesting to join the target device to a consensus committee, the consensus committee application request including consensus committee evaluation information of the target device; the consensus board evaluation information may include historical traffic volumes for the target device (e.g., the number of processed traffic volumes for the target device). The consensus committee application request may be generated by the administration committee after consensus committee evaluation of the target device and sent to the target member node; the consensus committee application request may also be sent by the target device to the target member node after the target device requests the governance committee to perform consensus committee evaluation on the target device. And detecting accounting qualification of the target equipment according to the consensus committee evaluation information. For example, billing qualification of the target device may be detected based on the historical traffic volume of the target device; if the historical service quantity of the target equipment is larger than or equal to the service quantity threshold value, determining that the target equipment has accounting qualification; and if the historical service quantity of the target equipment is less than the service quantity threshold value, determining that the target equipment does not have accounting qualification. And thirdly, if the target device is determined to have the accounting qualification, determining that the target device has the accounting authority. In this way, the target device may actively apply for membership in a consensus committee that participates in the consensus committee evaluation of the target device, making the detection process of the billing qualification more fair.
In the operation process of the block chain network, the governance contract periodically checks whether the consensus committee switching is required, and if the current consensus committee is expired, the governance contract elects a new consensus committee from all the consensus nodes of the block chain network according to the election rule. At this time, the consensus module of the target member node may acquire new committee information upon detecting an update event for the consensus committee, the new committee information including: updating the index value of each member node in the consensus committee; and the consensus module of the target member node adopts the second index value of the target member node to perform index value hit processing on the new committee information, namely, whether the second index value of the target member node exists in the updated index values of the member nodes in the consensus committee is checked. If the hit fails, namely the updated second index value of the target member node does not exist in the index values of all the member nodes in the consensus committee, setting the second index value to be in an unavailable state to indicate that the target member node does not belong to the updated consensus committee, and the target member node does not have the accounting authority for the block chain, so that the occupation of the storage space in the block chain network is reduced; in this case, if the target member node rejoins the consensus committee, the second index value of the target member node may be set to the available state again, so that the target member node participates in the accounting process of the blockchain again based on the second index value of the available state. If the hit is successful, namely the updated index values of the member nodes in the consensus committee have the second index value of the target member node, the available state of the second index value is kept unchanged.
In the embodiment of the application, the governance contract allocation strategy allocates the index value to the target device based on the current value of the global index in the governance contract, updates the current value of the global index after allocation is completed, and allocates the index value to the next node added to the blockchain network by using the updated index value of the global index, so that the allocated index value can be ensured to exist uniquely in the blockchain network, and the consensus committee in the blockchain network can be accurately managed. In addition, the node identification ordering strategy can effectively avoid the dependence on the global index in the governance contract, and the allocated index value exists only in the blockchain network, so that the consensus committee in the blockchain network can be accurately managed. After the consensus committee is updated, the second index value of the target member node can be adopted to perform index value hit processing on new committee information, and the state of the second index value is switched according to a hit result, so that the effective management of the consensus committee is realized.
Fig. 4 is a flowchart illustrating another node management method for a blockchain-based network according to an embodiment of the present disclosure, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, each of the member nodes has an accounting authority for a blockchain, and the node management method for the blockchain-based network is performed by a target member node in the consensus committee; the node management method based on the blockchain network may include the following steps S401 to S404:
s401, responding to the node registration request of the target device, and performing consensus processing on the target device according to the node registration request.
The process of executing step S401 in the embodiment of the present application may refer to the description of step S301 in the embodiment shown in fig. 3.
It should be noted that, in the scheme of allocating the first index value to the target device by using the governance contract allocation policy, the node registration request further includes a contract hash of the governance contract. Searching a node identifier of target equipment in a node list, and before searching the node identifier of the target equipment in a blacklist list, calling a virtual machine by a target member node to search a governance contract corresponding to a contract hash according to a contract hash in a node registration request, wherein the governance contract comprises a node newly-added strategy; if the improvement contract is successfully searched, judging whether the node registration request contains parameters (such as a node identifier of the target equipment, a node type of the target equipment, additional information of the target equipment and the like) required by the node addition strategy; and if the node registration request contains parameters required by the node adding strategy, searching the node identifier of the target equipment in the node list, and searching the node identifier of the target equipment in the blacklist list.
S402, after the target device is subjected to consensus processing, acquiring a current value of the global index from a governance contract corresponding to the contract hash, and taking the current value of the global index as an index parameter.
Before step S402, an abatement contract needs to be deployed in the blockchain network. The deployment process of the target member node on the governance contract can comprise the following steps: firstly, if a deployment request of a governance contract is received, signature information of the governance contract is obtained, the signature information of the governance contract is sent by a governance committee, and the signature information of the governance contract is obtained by encrypting the governance contract by the governance committee (for example, encrypting the governance contract by a private key of the governance committee (for example, a private key of a target governance node or a private key of a governance device corresponding to a target governance institution)). Secondly, information verification is carried out on the signature information of the governance contract, and the information verification comprises at least one of the following items: validity check and format check. The validation of the signature information of the governance contract may include: the public key of a treatment committee (such as the public key of a target treatment node or the public key of treatment equipment corresponding to a target treatment organization) is adopted to carry out validity check on the signature information of a treatment contract, if the public key is successfully decrypted, the validity check is passed, and if the public key is failed, the validity check is not passed; or the signature information of the governance contract comprises a generation timestamp of the signature information of the governance contract, a receiving timestamp of the signature information of the governance contract received by the target member node is obtained, if the difference value between the receiving timestamp and the generation timestamp is smaller than a second time threshold value, the validity check is passed, and if the difference value between the receiving timestamp and the generation timestamp is larger than or equal to the second time threshold value, the validity check is not passed. The format check of the signature information of the governance contract may refer to: the format of the signature information of the governance contract is checked, and if the format is the second format (for example, the signature information includes a certain specific character, the signature information is composed of letters or numbers, and the like), the format check is passed, and if the format is not the second format, the format check is not passed. And thirdly, if the signature information of the governance contract passes the information verification, calling a virtual machine to write the contract hash of the governance contract and the contract content of the governance contract into the intelligent contract of the block chain network in a correlation manner so as to update the intelligent contract. The intelligent contract for writing the contract hash of the governance contract and the contract content of the governance contract in association with the blockchain network may include: and writing a key value pair consisting of the contract hash of the governance contract and the contract content of the governance contract into an intelligent contract of the block chain network to update the intelligent contract. Carrying out consensus processing on the updated intelligent contract, and storing the updated intelligent contract to the block chain after the updated intelligent contract is processed by consensus. The consensus process of the updated intelligent contract may include: generating a block according to the updated intelligent contract, uploading the generated block to a block chain, and acquiring the block comprising the updated intelligent contract from the block chain by each consensus node in the block chain network; if the number of the identified common-knowledge nodes in each common-knowledge node is larger than or equal to the common-knowledge number threshold (for example, the common-knowledge number threshold is two thirds of the total number of the common-knowledge nodes), the updated intelligent contract is processed through common-knowledge; and if the number of the consensus nodes which represent consensus on the updated intelligent contract in each consensus node is smaller than the consensus number threshold, the updated intelligent contract is not treated through consensus. And fifthly, sending the contract hash of the governance contract to a governance committee so that the governance committee generates a node registration request according to the node registration information of the target equipment and the contract hash of the governance contract in the process of generating the node registration request.
In step S402, after the target device is subjected to consensus processing, a current value of the global index is obtained from a governance contract corresponding to the contract hash, and the current value of the global index is used as an index parameter. The current value of the global index is determined from the index values of the respective member nodes. The current value of the global index is equal to: and carrying out atomic auto-increment processing on the maximum index value determined based on the index value of each member node. The maximum index value is determined from the index values of the respective member nodes and the index values of the other nodes. In one implementation, the target device becomes a consensus node in the blockchain network, and the target member node assigns an index value to the consensus node added to the blockchain network. At this time, the other nodes include: each consensus node of the plurality of consensus nodes, except the consensus committee; that is, the maximum index value is determined according to the index value of each member node and the index values of each of the plurality of consensus nodes except the consensus committee; further, the maximum index value refers to the index value of each member node, and the index value having the largest value among the index values of the plurality of common nodes except the common committee. In another implementation, the target device becomes a node in the blockchain network, and the target member node assigns an index value to the node added to the blockchain network. At this time, the other nodes include: each node in the blockchain network except for the consensus committee; that is, the maximum index value is determined according to the index value of each member node and the index values of each node except the consensus committee in the blockchain network; further, the maximum index value refers to the index value of each member node, and the index value with the largest value among the index values of each node except the consensus committee in the blockchain network. Here, the atomic auto-increment processing on the maximum index value means: a process of updating the maximum index value with a target value (e.g., 1) to obtain a current value of the global index, for example, the current value of the global index is equal to the maximum index value plus the target value. The process of updating the maximum index value by adopting the target value is not interrupted by other processes; for example, an index value is allocated to the first device, and the maximum index value needs to be updated by using a target value to obtain a current value of the global index; in the updating process of the maximum index value, the requirement of allocating the index value to the second equipment exists; in the atomic self-increment processing mode, the process of allocating the index value to the first equipment is executed firstly, and then the process of allocating the index value to the second equipment is executed, the two processes are not influenced mutually, the allocated index value is ensured to exist only in the block chain network, and the accuracy of the index value allocation process is effectively improved.
And S403, allocating the index parameter as a first index value to the target device, and notifying the target device to join the block chain network.
And the index parameter is used as a first index value, is distributed to the target equipment, informs the target equipment of joining the block chain network, and adds the node identification of the target equipment to a node list of the block chain network managed by the governance contract.
After the index parameter is used as a first index value and is distributed to the target equipment, the current value of the global index can be subjected to atomic self-increment processing in a governance contract so as to update the current value of the global index; performing consensus processing on the updated current value, wherein the process of performing consensus processing on the updated current value is similar to the process of performing consensus processing on the updated intelligent contract, and can be referred to as the process of performing consensus processing on the updated intelligent contract; if the updated current value is processed by consensus, the updated current value can be recorded into the blockchain, and the updated current value is used for determining an index value for the next device added into the blockchain network.
And S404, after the target device is determined to have the accounting authority, setting the first index value to be in an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
The process of executing step S404 in the embodiment of the present application may refer to the detailed description of step S304 in the embodiment shown in fig. 3.
The target device may apply for exiting the blockchain network, and the target device may apply for exiting the blockchain network may include the following two cases:
(1) signature information of the node exit request is sent by the administration committee to the target member node. Firstly, the target member node acquires the signature information of the node exit request, performs information verification on the signature information of the node exit request, and analyzes the node exit request from the signature information of the node exit request after the signature information of the node exit request passes the information verification, wherein the node exit request can comprise contract hash and a node identifier of target equipment, so that the node exit request can be analyzed to obtain the contract hash and the node identifier of the target equipment. Secondly, the target member node calls a virtual machine to search a governance contract corresponding to the contract hash according to the contract hash in the node exit request, wherein the governance contract comprises a node exit strategy; if the governance contract is found successfully, acquiring a governance contract corresponding to the hash of the contract; the target device may be removed from the blockchain network in accordance with the node exit policy.
Removing the target device from the blockchain network according to the node exit policy may include: judging whether the node quitting request contains parameters (such as node identification of target equipment) required by the node quitting strategy; if the node quit request contains parameters required by the node quit strategy, acquiring a node list managed by a governance contract, wherein the node list comprises node identifications of one or more nodes; after the target device is allocated with the first index value, the node identification of the target device is added into a node list managed by the governance contract; if the node list has the node identifier of the target device, deleting the node identifier of the target device and deleting the first index value in the node list so as to remove the target device from the block chain network, thereby reducing the occupation of the storage space in the block chain network.
Wherein, the information checking of the signature information of the node exit request may include at least one of: and checking the validity of the signature fineness of the node exit request and checking the format of the signature information of the node exit request. The validity check of the signature information of the node exit request by the target member node may include: the public key of a treatment committee (such as the public key of a target treatment node or the public key of treatment equipment corresponding to a target treatment organization) is adopted to carry out validity check on the signature information of the node quitting request, if the public key is successfully decrypted, the validity check is passed, and if the public key is failed, the validity check is not passed; or the signature information of the node quitting request comprises a generation timestamp of the signature information of the node quitting request, a receiving timestamp of the signature information of the target member node receiving the node quitting request is obtained, if the difference value between the receiving timestamp and the generation timestamp is smaller than a third time threshold value, validity check is passed, and if the difference value between the receiving timestamp and the generation timestamp is larger than or equal to the third time threshold value, validity check is not passed. The format check of the signature information of the node exit request by the target member node may be: the format of the signature information of the node exit request is checked, and if the format is the third format (for example, the signature information includes a specific character, the signature information includes letters or numbers, etc.), the format check is passed, and if the format is not the third format, the format check is not passed.
(2) Signature information of the node exit request is sent to the target member node by the target device. Firstly, the target member node obtains the signature information of the node quitting request, and performs information verification on the signature information of the node quitting request, and after the signature information of the node quitting request passes the information verification, the node quitting request is analyzed from the signature information of the node quitting request, and the node quitting request can include the node identification of the target device. Then, the target member node acquires a node list from the block chain network, wherein the node list comprises node identifications of one or more nodes; after the target device is allocated with the first index value, the node identification of the target device is added into a node list managed by the governance contract; if the node list has the node identifier of the target device, deleting the node identifier of the target device and deleting the first index value in the node list so as to remove the target device from the block chain network, thereby reducing the occupation of the storage space in the block chain network.
In this way, the target device exits the blockchain network, and the first index value allocated to the target device is not retained in the blockchain network, so that the current value of the global index is not affected. If the target device rejoins the blockchain network, a new index value can be allocated to the target device through the governance contract allocation strategy.
In the embodiment of the application, the governance contract allocation strategy allocates the index value to the target device based on the current value of the global index in the governance contract, updates the current value of the global index after allocation is completed, and allocates the index value to the next node added to the blockchain network by using the updated index value of the global index, so that the allocated index value can be ensured to exist uniquely in the blockchain network, and the consensus committee in the blockchain network can be accurately managed. In addition, after the consensus committee is updated, the index value of the member node which exits the consensus committee is set to be in an unavailable state, and the index value of the new member node of the consensus committee is set to be in an available state, so that the new consensus committee can be smoothly transited to under the condition that the consensus committee is switched, and the new consensus committee is effectively managed, so that the accounting authority of the block chain can be effectively managed. In addition, the target device may apply for exiting the blockchain network, and if the target device exits the blockchain network, the first index value allocated to the target device is not retained in the blockchain network, so that the current value of the global index is not affected, and the consensus committee can be accurately managed. In addition, a treatment committee is introduced, and the treatment committee initiates a node registration request, a node deletion request and a deployment request of a treatment contract to the consensus committee, so that the management process is more fair and transparent.
Fig. 5 is a flowchart illustrating another node management method for a blockchain-based network according to an embodiment of the present disclosure, where the blockchain network includes a consensus committee, where the consensus committee includes one or more member nodes, each of the member nodes has an accounting authority for a blockchain, and the node management method for the blockchain-based network is performed by a target member node in the consensus committee; the node management method based on the blockchain network may include the following steps S501 to S504:
s501, responding to the node registration request of the target device, and performing consensus processing on the target device according to the node registration request.
The process of step S501 in the embodiment of the present application can be referred to the description of step S301 in the embodiment shown in fig. 3.
And S502, after the target equipment is subjected to consensus processing, arranging the node identifiers of all consensus nodes in the block chain network in sequence to obtain the arrangement position information of the target equipment, and taking the arrangement position information as an index parameter.
After the target device is subjected to consensus processing, the target device becomes a consensus node in the blockchain network, and at this time, a consensus list of the blockchain network may be obtained, where the consensus list of the blockchain network includes node identifiers of the consensus nodes in the blockchain network, and the node identifier of each consensus node may include a character string composed of english letters and numbers. The following table 2 shows an exemplary consensus list:
TABLE 2
Consensus node Node identification of consensus node
Consensus node 1 1Z
Consensus node 2 1A
Consensus node 3 1W
As shown in table 2, the blockchain network includes 3 common nodes, which are: the node identification of the consensus node 1 is '1Z', the node identification of the consensus node 2 is '1A', and the node identification of the consensus node 3 is '1W'.
After the consensus list is obtained, the node identifications of all consensus nodes in the block chain network can be arranged in sequence to obtain a sequenced consensus list; the arrangement position information of the target equipment can be determined in the sorted consensus list, and the arrangement position information of the target equipment is used as an index parameter; the arrangement position information of the target device indicates an arrangement position of the node identifier of the target device in the sorted consensus list, for example, if the node identifier of the target device is arranged at the third position in the sorted consensus list, the node identifier arrangement position information of the target device is "3".
The node identifiers of the consensus nodes in the block chain network are arranged in sequence, and obtaining the ordered consensus list may include: calculating a conversion value corresponding to the node identifier of each consensus node, wherein the conversion value corresponding to the node identifier of each consensus node is calculated according to ASCII (American Standard Code for Information exchange) of characters contained in the node identifier of the consensus node, for example, the conversion value corresponding to the node identifier of each consensus node is equal to the sum of ASCII of the characters contained in the node identifier of the consensus node; for example, for the node identifier of the common identification node 1, the decimal ASCII corresponding to the character "1" is "1", and the decimal ASCII corresponding to the character "Z" is "106", then the conversion value corresponding to the node identifier of the common identification node 1 is 107; and according to the conversion value corresponding to the node identification of each consensus node, carrying out ascending or descending order arrangement on the node identification of each consensus node to obtain an arranged consensus list. The following table 3 shows a sorted consensus list obtained by sorting the node identifiers of the consensus nodes in the consensus list shown in table 2 in an ascending order:
TABLE 3
Consensus node Node identification of consensus node
Consensus node 2 1A
Consensus node 3 1W
Consensus node 1 1Z
As can be seen from table 3, in the sorted consensus list, the node id of the consensus node 2 is arranged at the first position, the node id of the consensus node 3 is arranged at the second position, and the node id of the consensus node 1 is arranged at the third position.
S503, assigning a first index value to the target device using the permutation position information.
Specifically, the node number of the common node located before the target device may be determined according to the ranking position information, the first index value may be calculated according to the node number, and the calculated first index value may be assigned to the target device. The first index value may be equal to the number of nodes, or the first index value may be calculated from the number of nodes and a target value, e.g., the first index value is equal to the sum of the number of nodes and the target value (e.g., the target value is 1). For example, if the node identifier of the consensus node 1 (for example, the target device is the consensus node 1) is arranged at the third position in the sorted consensus list, the node identifier arrangement position information of the consensus node 1 is "3", and the node number of the consensus node located before the consensus node 1 is determined to be "2"; if the first index value is equal to the number of nodes, the first index value is "2"; if the first index value is equal to the sum of the number of nodes and the target value (e.g., the target value is 1), the first index value is "3". The following table 4 shows the index values assigned to the respective consensus nodes in the consensus list shown in table 2:
TABLE 4
Consensus node Index value
Consensus node 2 0
Consensus node 3 1
Consensus node 1 2
And S504, after the target device is determined to have the accounting authority, setting the first index value to be in an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
The target device may apply for exiting the blockchain network, and the target device may apply for exiting the blockchain network may include the following two cases:
(1) signature information of the node exit request is sent by the administration committee to the target member node. Firstly, the target member node acquires the signature information of the node exit request, performs information verification on the signature information of the node exit request, and analyzes the node exit request from the signature information of the node exit request after the signature information of the node exit request passes the information verification, wherein the node exit request can include the node identifier of the target device, so that the node exit request can be analyzed to obtain the node identifier of the target device. Secondly, acquiring a node list managed by the governance contract, wherein the node list comprises node identifications of one or more nodes; after the target device is allocated with the first index value, the node identification of the target device is added into a node list managed by the governance contract; if the node list has the node identifier of the target device, deleting the node identifier of the target device and deleting the first index value in the node list so as to remove the target device from the block chain network, thereby reducing the occupation of the storage space in the block chain network.
(2) Signature information of the node exit request is sent to the target member node by the target device. Firstly, the target member node obtains the signature information of the node quitting request, and performs information verification on the signature information of the node quitting request, and after the signature information of the node quitting request passes the information verification, the node quitting request is analyzed from the signature information of the node quitting request, and the node quitting request can include the node identification of the target device. Then, the target member node acquires a node list from the block chain network, wherein the node list comprises node identifications of one or more nodes; after the target device is allocated with the first index value, the node identification of the target device is added into a node list managed by the governance contract; if the node list has the node identifier of the target device, deleting the node identifier of the target device and deleting the first index value in the node list so as to remove the target device from the block chain network, thereby reducing the occupation of the storage space in the block chain network.
In this way, the target device exits the blockchain network, and the first index value allocated to the target device is not retained in the blockchain network, so that the current value of the global index is not affected. If the target device rejoins the blockchain network, a new index value can be allocated to the target device through the governance contract allocation strategy.
In the embodiment of the application, in the process of allocating the first index value to the target device by adopting the node identification sorting strategy, the node identification sorting strategy can effectively avoid the dependence on the global index in the governance contract, and the allocated index value is unique in the blockchain network, so that the consensus committee in the blockchain network can be accurately managed. In addition, when a consensus node is newly added into the blockchain network, the consensus list in the blockchain network is adopted for reordering, and index values are redistributed so as to effectively manage the consensus committee. The dynamic joining process of the nodes and the dynamic quitting process of the nodes are recorded by the block chain, so that fairness, justness and transparency are ensured.
While the method of the embodiments of the present application has been described in detail above, to facilitate better implementation of the above-described aspects of the embodiments of the present application, the apparatus of the embodiments of the present application is provided below accordingly.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a node management apparatus based on a blockchain network according to the present application, where the node management apparatus 60 may be disposed in a node management device, and the node management device may be a target member node mentioned in the foregoing embodiment; node management apparatus 60 may be configured to perform the corresponding steps in the method embodiments shown in fig. 3 to 5, and node management apparatus 60 may include the following elements:
a processing unit 601, configured to respond to a node registration request for a target device, and perform consensus processing on the target device according to the node registration request;
an obtaining unit 602, configured to obtain, after the target device performs consensus processing, an index parameter, where the index parameter is determined according to node information of each member node in a consensus committee;
the processing unit 601 is further configured to allocate a first index value to the target device by using the index parameter according to the index allocation policy, and notify the target device to join the block chain network, where the first index value is in an unavailable state; and after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
In one implementation, the node information of any member node in the consensus committee includes an index value of any member node; the node registration request comprises contract hash of a governance contract, the governance contract comprises a current value of a global index, and the current value of the global index is determined according to the index value of each member node;
the obtaining unit 602 is configured to, when obtaining the index parameter, specifically perform the following steps: acquiring a current value of the global index from a governance contract corresponding to the contract hash, and taking the current value of the global index as an index parameter;
the processing unit 601 is configured to, when allocating a first index value to the target device by using the index parameter according to the index allocation policy, specifically execute the following steps: and allocating the index parameter as a first index value to the target device.
In one implementation, the current value of the global index is equal to: carrying out atomic auto-increment processing on the maximum index value determined based on the index value of each member node;
wherein the maximum index value is determined from the index values of the respective member nodes and the index values of the other nodes; the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the other nodes including: each of the plurality of consensus nodes other than the consensus committee, or each of the plurality of nodes other than the consensus committee in the blockchain network.
In one implementation, after allocating the global index value as the first index value to the target device, the processing unit 601 is further configured to perform the following steps:
carrying out atomic self-increment processing on the current value of the global index in the governance contract so as to update the current value of the global index;
and recording the updated current value into the block chain, wherein the updated current value is used for determining an index value for the next device which joins the block chain network.
In one implementation, the obtaining unit 602 is configured to, before obtaining a current value of the global index from a governance contract corresponding to a contract hash, perform the following steps:
if a deployment request about a governance contract is received, acquiring signature information of the governance contract, and performing information verification on the signature information, wherein the information verification comprises at least one of the following items: validity checking and format checking;
if the information passes the verification, calling a virtual machine to write the contract hash of the governance contract and the contract content of the governance contract into the intelligent contract of the block chain network in a correlation manner so as to update the intelligent contract;
and carrying out consensus processing on the updated intelligent contract, and storing the updated intelligent contract to the block chain after the updated intelligent contract is subjected to consensus processing.
In one implementation, the obtaining unit 602 is further configured to perform the following steps:
if a node quitting request about the target equipment is received, analyzing the node quitting request to obtain a contract hash;
acquiring a governance contract corresponding to the contract hash, wherein the governance contract also comprises a node exit strategy;
and removing the target equipment from the blockchain network according to the node exit strategy.
In one implementation, after the target device is assigned the first index value, the node identification of the target device is added to a node list managed by the governance contract; an obtaining unit 602, configured to, when removing a target device from a blockchain network according to a node exit policy, specifically execute the following steps:
acquiring a node list managed by a governance contract, wherein the node list comprises node identifications of one or more nodes;
deleting the node identification of the target device in the node list, and deleting the first index value to remove the target device from the blockchain network.
In one implementation, the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the node information of any member node in the consensus committee includes a node identifier of any member node, and the target device becomes the consensus node in the blockchain network after consensus processing;
the obtaining unit 602 is configured to, when obtaining the index parameter, specifically perform the following steps: arranging node identifications of all consensus nodes in the block chain network in sequence to obtain arrangement position information of target equipment; and using the arrangement position information as an index parameter;
the processing unit 601 is configured to, when allocating a first index value to the target device by using the index parameter according to the index allocation policy, specifically execute the following steps: and determining the node number of the common node positioned in front of the target equipment according to the arrangement position information, calculating a first index value according to the node number, and distributing the calculated first index value to the target equipment.
In one implementation, the target member node has a second index value, the second index value being in an available state; the processing unit 601 is further configured to perform the following steps:
if an update event for the consensus committee is detected, new committee information is acquired, the new committee information comprising: updating the index value of each member node in the consensus committee;
adopting a second index value of the target member node to perform index value hit processing on the new committee information;
if the hit fails, the second index value is set to an unavailable state to indicate that the target member node does not belong to the updated consensus committee.
In one implementation, the processing unit 601 is further configured to perform the following steps:
acquiring a consensus committee application request regarding the target device, the consensus committee application request requesting to join the target device to a consensus committee, the consensus committee application request including consensus committee evaluation information of the target device;
detecting accounting qualification of the target device according to the consensus committee evaluation information;
and if the target device is determined to have the accounting qualification, determining that the target device has the accounting authority.
In one implementation, the consensus committee elects from a plurality of consensus nodes in the blockchain network; the node registration request includes: the node registration request is used for indicating that the target equipment is to become a node under the node type; a processing unit 601, configured to perform the following steps when performing consensus processing on a target device according to a node registration request:
acquiring a node evaluation standard corresponding to the node type;
according to the node evaluation standard and the equipment evaluation information, carrying out capability detection on the target equipment to obtain a capability detection result of the target equipment;
and performing consensus processing on the target equipment according to the capability detection result.
In one implementation, the node registration request further includes a node identifier of the target device; the processing unit 601 is further configured to perform the following steps:
acquiring a node list and a blacklist list of a block chain network, wherein the node list comprises node identifications of one or more nodes;
searching the node identifier of the target equipment in the node list, and searching the node identifier of the target equipment in the blacklist;
and if the searching in the node list and the blacklist fails, executing a step of acquiring the node evaluation standard corresponding to the node type.
According to an embodiment of the present application, the units in the node management apparatus 60 shown in fig. 6 may be respectively or entirely combined into one or several other units to form the unit, or some unit(s) thereof may be further split into multiple units with smaller functions to form the unit(s), which may implement the same operation without affecting implementation of technical effects of the embodiment of the present application. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present application, the node management apparatus 60 may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of multiple units. According to another embodiment of the present application, the node management apparatus 60 shown in fig. 6 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods shown in fig. 3 to 5 on a general-purpose computing device including a general-purpose computer such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, and a storage element, and the node management method based on the blockchain network according to an embodiment of the present application may be implemented. The computer program may be embodied on a computer-readable storage medium, for example, and loaded into and executed by the above-described computing apparatus via the computer-readable storage medium.
In the embodiment of the application, after the target device to be added to the blockchain network is subjected to consensus processing, a first index value can be allocated to the target device by using the obtained index parameter, and the target device is notified to be added to the blockchain network, wherein the allocated first index value is in an unavailable state; the first index value of the unavailable state indicates that the target device does not belong to a consensus committee of the blockchain network; after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state; therefore, after the index value is distributed to the equipment joining the blockchain network, the consensus committee of the blockchain network can be effectively managed through different states (including an available state or an unavailable state) of the index value, and therefore the accounting authority of the blockchain network can be effectively managed.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a node management device based on a blockchain network according to an embodiment of the present disclosure, where the node management device 70 at least includes a processor 701, a computer-readable storage medium 702, and a communication interface 703. The processor 701, the computer-readable storage medium 702, and the communication interface 703 may be connected by a bus or other means. Communication interface 703 may be used to receive or transmit data. The computer-readable storage medium 702 may be stored in a memory, the computer-readable storage medium 702 for storing a computer program, the computer program comprising computer instructions. The processor 701 is configured to execute computer instructions. The processor 701 (or CPU) is a computing core and a control core of the node management device 70, and is adapted to implement one or more computer instructions, and specifically, adapted to load and execute the one or more computer instructions so as to implement a corresponding method flow or a corresponding function.
An embodiment of the present application also provides a computer-readable storage medium (Memory), which is a Memory device in the node management device 70 and is used for storing programs and data. It is understood that the computer-readable storage medium 702 herein may include both a built-in storage medium in the node management apparatus 70 and, of course, an extended storage medium supported by the node management apparatus 70. The computer-readable storage medium provides a storage space that stores an operating system of the node management device 70. Also stored in the memory space are one or more computer instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 701. It should be noted that the computer-readable storage medium 702 herein may be a high-speed RAM Memory, or a Non-Volatile Memory (Non-Volatile Memory), such as at least one disk Memory; and optionally at least one computer readable storage medium located remotely from the processor 701.
The node management device 70 may be the target member node mentioned in the above method embodiments, and the computer-readable storage medium 702 has stored therein a computer program comprising one or more computer instructions; one or more computer instructions are loaded and executed by the processor 701 to implement the corresponding steps in the method embodiments shown in fig. 3-5; in particular implementations, the computer instructions in the computer-readable storage medium 702 are loaded and executed by the processor 701 to perform the steps of:
responding to a node registration request about target equipment, and performing consensus processing on the target equipment according to the node registration request;
after the target equipment is subjected to consensus processing, acquiring index parameters, wherein the index parameters are determined according to node information of each member node in a consensus committee;
according to an index distribution strategy, distributing a first index value for the target equipment by adopting an index parameter, and informing the target equipment to join a block chain network, wherein the first index value is in an unavailable state;
after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
In one implementation, the node information of any member node in the consensus committee includes an index value of any member node; the node registration request comprises contract hash of a governance contract, the governance contract comprises a current value of a global index, and the current value of the global index is determined according to the index value of each member node;
the computer instructions in the computer-readable storage medium 702 are loaded and executed by the processor 701 when obtaining the index parameters, and are specifically configured to perform the following steps: acquiring a current value of the global index from a governance contract corresponding to the contract hash, and taking the current value of the global index as an index parameter;
the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and executed to, when allocating a first index value to a target device by using index parameters according to an index allocation policy, specifically perform the following steps: and allocating the index parameter as a first index value to the target device.
In one implementation, the current value of the global index is equal to: carrying out atomic auto-increment processing on the maximum index value determined based on the index value of each member node;
wherein the maximum index value is determined from the index values of the respective member nodes and the index values of the other nodes; the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the other nodes including: each of the plurality of consensus nodes other than the consensus committee, or each of the plurality of nodes other than the consensus committee in the blockchain network.
In one implementation, the computer instructions in the computer-readable storage medium 702 are loaded and executed by the processor 701 to, after assigning the global index value as the first index value to the target device, further perform the steps of:
carrying out atomic self-increment processing on the current value of the global index in the governance contract so as to update the current value of the global index;
and recording the updated current value into the block chain, wherein the updated current value is used for determining an index value for the next device which joins the block chain network.
In one implementation, the computer instructions in the computer-readable storage medium 702 are loaded and executed by the processor 701 to, prior to retrieving a current value of the global index from a governance contract corresponding to the contract hash, further perform the steps of:
if a deployment request about a governance contract is received, acquiring signature information of the governance contract, and performing information verification on the signature information, wherein the information verification comprises at least one of the following items: validity checking and format checking;
if the information passes the verification, calling a virtual machine to write the contract hash of the governance contract and the contract content of the governance contract into the intelligent contract of the block chain network in a correlation manner so as to update the intelligent contract;
and carrying out consensus processing on the updated intelligent contract, and storing the updated intelligent contract to the block chain after the updated intelligent contract is subjected to consensus processing.
In one implementation, the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and are further configured to perform the steps of:
if a node quitting request about the target equipment is received, analyzing the node quitting request to obtain a contract hash;
acquiring a governance contract corresponding to the contract hash, wherein the governance contract also comprises a node exit strategy;
and removing the target equipment from the blockchain network according to the node exit strategy.
In one implementation, after the target device is assigned the first index value, the node identification of the target device is added to a node list managed by the governance contract; the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and executed to perform the following steps when removing a target device from the blockchain network according to the node exit policy:
acquiring a node list managed by a governance contract, wherein the node list comprises node identifications of one or more nodes;
deleting the node identification of the target device in the node list, and deleting the first index value to remove the target device from the blockchain network.
In one implementation, the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the node information of any member node in the consensus committee includes a node identifier of any member node, and the target device becomes the consensus node in the blockchain network after consensus processing;
the computer instructions in the computer-readable storage medium 702 are loaded and executed by the processor 701 when obtaining the index parameters, and are specifically configured to perform the following steps: arranging node identifications of all consensus nodes in the block chain network in sequence to obtain arrangement position information of target equipment; and using the arrangement position information as an index parameter;
the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and executed to, when allocating a first index value to a target device by using index parameters according to an index allocation policy, specifically perform the following steps: and determining the node number of the common node positioned in front of the target equipment according to the arrangement position information, calculating a first index value according to the node number, and distributing the calculated first index value to the target equipment.
In one implementation, the target member node has a second index value, the second index value being in an available state; the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and are further operable to perform the steps of:
if an update event for the consensus committee is detected, new committee information is acquired, the new committee information comprising: updating the index value of each member node in the consensus committee;
adopting a second index value of the target member node to perform index value hit processing on the new committee information;
if the hit fails, the second index value is set to an unavailable state to indicate that the target member node does not belong to the updated consensus committee.
In one implementation, the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and are further configured to perform the steps of:
acquiring a consensus committee application request regarding the target device, the consensus committee application request requesting to join the target device to a consensus committee, the consensus committee application request including consensus committee evaluation information of the target device;
detecting accounting qualification of the target device according to the consensus committee evaluation information;
and if the target device is determined to have the accounting qualification, determining that the target device has the accounting authority.
In one implementation, the consensus committee elects from a plurality of consensus nodes in the blockchain network; the node registration request includes: the node registration request is used for indicating that the target equipment is to become a node under the node type; the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and executed when performing consensus processing on a target device according to a node registration request, to specifically perform the following steps:
acquiring a node evaluation standard corresponding to the node type;
according to the node evaluation standard and the equipment evaluation information, carrying out capability detection on the target equipment to obtain a capability detection result of the target equipment;
and performing consensus processing on the target equipment according to the capability detection result.
In one implementation, the node registration request further includes a node identifier of the target device; the computer instructions in the computer-readable storage medium 702 are loaded by the processor 701 and are further operable to perform the steps of:
acquiring a node list and a blacklist list of a block chain network, wherein the node list comprises node identifications of one or more nodes;
searching the node identifier of the target equipment in the node list, and searching the node identifier of the target equipment in the blacklist;
and if the searching in the node list and the blacklist fails, executing a step of acquiring the node evaluation standard corresponding to the node type.
In the embodiment of the application, after the target device to be added to the blockchain network is subjected to consensus processing, a first index value can be allocated to the target device by using the obtained index parameter, and the target device is notified to be added to the blockchain network, wherein the allocated first index value is in an unavailable state; the first index value of the unavailable state indicates that the target device does not belong to a consensus committee of the blockchain network; after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state; therefore, after the index value is distributed to the equipment joining the blockchain network, the consensus committee of the blockchain network can be effectively managed through different states (including an available state or an unavailable state) of the index value, and therefore the accounting authority of the blockchain network can be effectively managed.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the node management method based on the blockchain network provided in the above-mentioned various alternatives.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A node management method based on a block chain network is characterized in that the block chain network comprises a consensus committee, the consensus committee comprises one or more member nodes, and each member node has an accounting authority for a block chain; the method is performed by a target member node in the consensus committee, the method comprising:
responding a node registration request about target equipment, and performing consensus processing on the target equipment according to the node registration request;
after the target equipment passes through consensus processing, acquiring index parameters, wherein the index parameters are determined according to node information of each member node in the consensus committee;
according to an index allocation strategy, allocating a first index value to the target equipment by using the index parameter, and informing the target equipment of joining the block chain network, wherein the first index value is in an unavailable state;
after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
2. The method of claim 1, wherein the node information of any member node in the consensus committee comprises an index value of the any member node; the node registration request comprises contract hash of a governance contract, the governance contract comprises a current value of a global index, and the current value of the global index is determined according to the index value of each member node;
the obtaining of the index parameter includes: acquiring the current value of the global index from a governance contract corresponding to the contract hash, and taking the current value of the global index as the index parameter;
the allocating, according to the index allocation policy, a first index value to the target device by using the index parameter includes: and allocating the index parameter as the first index value to the target device.
3. The method of claim 2, wherein the current value of the global index is equal to: carrying out atomic auto-increment processing on the maximum index value determined based on the index value of each member node;
wherein the maximum index value is determined from the index values of the respective member nodes and the index values of the other nodes; the consensus commission is elected from a plurality of consensus nodes in the blockchain network, the other nodes comprising: each of the plurality of consensus nodes other than the consensus committee, or each of the plurality of nodes other than the consensus committee in the blockchain network.
4. The method of claim 2 or 3, wherein after assigning the index parameter as the first index value to the target device, the method further comprises:
performing atomic self-increment processing on the current value of the global index in the governance contract to update the current value of the global index;
and recording the updated current value into the block chain, wherein the updated current value is used for determining an index value for the next device added into the block chain network.
5. A method as claimed in claim 2 or 3, wherein before obtaining the current value of the global index from the governance contract to which the contract hash corresponds, the method further comprises:
if a deployment request about the governance contract is received, acquiring signature information of the governance contract, and performing information verification on the signature information, wherein the information verification comprises at least one of the following items: validity checking and format checking;
if the information is verified, calling a virtual machine to write the contract hash of the governance contract and the contract content of the governance contract into the intelligent contract of the block chain network in a correlation manner so as to update the intelligent contract;
and performing consensus processing on the updated intelligent contract, and storing the updated intelligent contract to the block chain after the updated intelligent contract is subjected to consensus processing.
6. The method of claim 2, wherein the method further comprises:
if a node quitting request about the target equipment is received, analyzing the node quitting request to obtain the contract hash;
acquiring a governance contract corresponding to the contract hash, wherein the governance contract also comprises a node exit strategy;
and removing the target equipment from the block chain network according to the node exit strategy.
7. The method of claim 6, wherein after the target device is assigned the first index value, the node identification of the target device is added to the list of nodes managed by the abatement contract; removing the target device from the blockchain network according to the node exit policy comprises:
acquiring a node list managed by the governance contract, wherein the node list comprises node identifications of one or more nodes;
deleting the node identification of the target device in the node list, and deleting the first index value to remove the target device from the blockchain network.
8. The method of claim 1, wherein the consensus committee is elected from a plurality of consensus nodes in the blockchain network, the node information of any member node in the consensus committee includes a node identification of the any member node, and the target device becomes a consensus node in the blockchain network after a consensus process;
the obtaining of the index parameter includes: arranging node identifications of all common identification nodes in the block chain network in sequence to obtain arrangement position information of the target equipment, and taking the arrangement position information as the index parameter;
the allocating, according to the index allocation policy, a first index value to the target device by using the index parameter includes: determining the number of nodes of the common node located in front of the target device according to the arrangement position information, calculating a first index value according to the number of the nodes, and distributing the calculated first index value to the target device.
9. The method of claim 1, wherein the target member node has a second index value, the second index value being in an available state; the method further comprises the following steps:
if an update event for the consensus committee is detected, acquiring new committee information, the new committee information comprising: updating the index value of each member node in the consensus committee;
performing index value hit processing on the new committee information by using the second index value of the target member node;
if the hit fails, the second index value is set to an unavailable state to indicate that the target member node does not belong to the updated consensus committee.
10. The method of claim 1, wherein the method further comprises:
obtaining a consensus committee application request regarding the target device, the consensus committee application request requesting to join the target device to the consensus committee, the consensus committee application request including consensus committee evaluation information of the target device;
detecting accounting qualification of the target device according to the consensus committee evaluation information;
and if the target device is determined to have the accounting qualification, determining that the target device has the accounting authority.
11. The method of claim 1, wherein the node registration request comprises: the node registration request is used for indicating that the target device is to become a node under the node type;
the performing consensus processing on the target device according to the node registration request includes:
acquiring a node evaluation standard corresponding to the node type;
according to the node evaluation standard and the equipment evaluation information, carrying out capability detection on the target equipment to obtain a capability detection result of the target equipment;
and performing consensus processing on the target equipment according to the capability detection result.
12. The method of claim 11, wherein the node registration request further includes a node identification of the target device; the method further comprises the following steps:
acquiring a node list and a blacklist list of the block chain network, wherein the node list comprises node identifications of one or more nodes;
searching the node identifier of the target device in the node list, and searching the node identifier of the target device in the blacklist;
and if the searching in the node list and the blacklist fails, executing a step of acquiring a node evaluation standard corresponding to the node type.
13. A node management apparatus based on a blockchain network, wherein the blockchain network comprises a consensus committee, the consensus committee comprises one or more member nodes, and each member node has an accounting authority for a blockchain; the apparatus disposed in a target member node of the consensus committee, the apparatus comprising:
the processing unit is used for responding to a node registration request of target equipment and performing consensus processing on the target equipment according to the node registration request;
an obtaining unit, configured to obtain, after the target device passes through consensus processing, an index parameter that is determined according to node information of each member node in the consensus committee;
the processing unit is further configured to allocate a first index value to the target device by using the index parameter according to an index allocation policy, and notify the target device to join the block chain network, where the first index value is in an unavailable state; and after determining that the target device has the accounting authority, setting the first index value to an available state, so that the target device participates in accounting processing of the block chain as a new member node in the consensus committee based on the first index value of the available state.
14. A node management device based on a blockchain network, wherein the blockchain network comprises a consensus committee, the consensus committee comprises one or more member nodes, and each member node has an accounting authority for a blockchain; the device is a target member node in the consensus committee, the device comprising:
a processor adapted to implement a computer program; and the number of the first and second groups,
computer readable storage medium, having stored thereon a computer program adapted to be loaded by said processor and to execute the method of node management based on a blockchain network according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a computer program adapted to be loaded by a processor and to perform the method for node management based on a blockchain network according to any one of claims 1 to 12.
CN202110329773.4A 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network Active CN112714196B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110581148.9A CN113286004B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network
CN202110329773.4A CN112714196B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110329773.4A CN112714196B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110581148.9A Division CN113286004B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network

Publications (2)

Publication Number Publication Date
CN112714196A CN112714196A (en) 2021-04-27
CN112714196B true CN112714196B (en) 2021-06-04

Family

ID=75550328

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110581148.9A Active CN113286004B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network
CN202110329773.4A Active CN112714196B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202110581148.9A Active CN113286004B (en) 2021-03-29 2021-03-29 Node management method, device, equipment and storage medium based on block chain network

Country Status (1)

Country Link
CN (2) CN113286004B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2023103033A (en) * 2022-01-13 2023-07-26 株式会社日立製作所 Communication management method and communication management system
CN114611155B (en) * 2022-03-15 2022-12-13 云粒智慧科技有限公司 Data management node verification method, device, equipment and medium
CN115314374B (en) * 2022-07-06 2024-02-06 京东科技信息技术有限公司 Block chain node deployment method, device, storage medium and program product

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018209542A1 (en) * 2017-05-16 2018-11-22 北京大学深圳研究生院 Consensus method for decentralized domain name system
US20200059369A1 (en) * 2017-05-16 2020-02-20 Peking University Shenzhen Graduate School Determining consensus by parallel proof of voting in consortium blockchain
US11271717B2 (en) * 2018-02-21 2022-03-08 Thunder Token Inc. Blockchain consensus methods and systems
US20200026699A1 (en) * 2018-07-20 2020-01-23 True Blockchain Technology Ltd. Highly Performant Decentralized Public Ledger with Hybrid Consensus
WO2020069411A1 (en) * 2018-09-28 2020-04-02 Thunder Token Inc. High throughput blockchain consensus systems and methods with low finalization time
CN111163148B (en) * 2019-12-24 2021-09-28 腾讯科技(深圳)有限公司 Synchronization method and related equipment for consensus state of block chain system
CN111461885B (en) * 2020-03-31 2024-03-19 财付通支付科技有限公司 Consensus network management method, device, computer and readable storage medium
CN111506656B (en) * 2020-04-20 2022-06-14 腾讯科技(深圳)有限公司 Consensus processing method and device for block chain system, intelligent device and storage medium
CN112398956B (en) * 2021-01-20 2021-04-13 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium

Also Published As

Publication number Publication date
CN113286004A (en) 2021-08-20
CN112714196A (en) 2021-04-27
CN113286004B (en) 2022-06-24

Similar Documents

Publication Publication Date Title
CN112714196B (en) Node management method, device, equipment and storage medium based on block chain network
CN110602217B (en) Block chain-based alliance management method, device, equipment and storage medium
CN113395363B (en) Data processing method, device and equipment based on block chain and storage medium
CN110310080B (en) Data streaming method, device, computer equipment and storage medium
CN110569251A (en) Data processing method, related equipment and computer readable storage medium
CN111400112B (en) Writing method and device of storage system of distributed cluster and readable storage medium
CN108848037A (en) Service request processing method, device, computer equipment and storage medium
CN111698094B (en) Common identification method based on block chain system and block chain system
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
CN109729068B (en) Security vulnerability auditing system based on block chain technology
CN110289999B (en) Data processing method, system and device
CN108769230A (en) Transaction data storage method, device, server and storage medium
CN109450685B (en) local link node offline consensus method and node
CN110968644A (en) Data processing method and equipment
CN110570311A (en) block chain consensus method, device and equipment
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN111488626A (en) Data processing method, device, equipment and medium based on block chain
US20220239668A1 (en) Blockchain-based message processing method and apparatus, device, and storage medium
CN113890739B (en) Cross-blockchain authentication method and device, electronic equipment and medium
US20190372825A1 (en) Communication apparatus, communication method, and recording medium
CN110855688A (en) Block chain information processing method and related equipment
CN107577700A (en) The processing method and processing device of database disaster tolerance
CN112040015B (en) Consensus node list generation method and related device
CN113645278A (en) Cross-chain message transmission method, device and storage medium of block chain
CN110071966B (en) Block chain networking and data processing method based on cloud platform

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40042473

Country of ref document: HK