Processing Method, Device, System and Electronic Device of Blockchain Node
Through the blockchain node processing method, BaaS is used to realize the rapid exit mechanism of nodes, solving the problem of low node exit efficiency, improving management efficiency, and in line with the decentralization idea.
Patent Information
- Application Number
- CN202010818301.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2040-08-14
AI Technical Summary
In the prior art, blockchain node exit efficiency is low and inconsistent with the decentralization idea. It usually requires manual operation by administrators to affect node management efficiency.
A blockchain node processing method is provided, which requests exit from other nodes in the blockchain through the second node, and determines whether to perform a back-chain operation based on the response information, and uses BaaS to realize a fast exit mechanism.
It realizes the rapid and automated exit of blockchain nodes, reduces manual operations, improves node management efficiency, and conforms to the decentralization idea.
Smart Images

Figure CN114124943B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of the Internet. Specifically, it relates to a method, apparatus, system, and electronic device for processing blockchain nodes. Background Art
[0002] With the update of information technology, blockchain, as an emerging storage technology, has gradually become a hot topic in development. A blockchain system is a data network system that uses cryptography to ensure the security of data transmission and access and generates a distributed ledger that cannot be tampered with or forged. Blockchains can be divided into public blockchains, consortium blockchains, and private blockchains. Among them, a consortium blockchain refers to a blockchain jointly managed by multiple organizations, where each member runs one or more nodes. The consortium blockchain allows nodes in the members to read and send transactions and jointly record transaction data.
[0003] There is no central institution in the blockchain, and the consistency of information of each node is ensured by the consensus mechanism of the blockchain. In recent years, during the research process of the blockchain's consensus mechanism, more and more technologies have emerged to improve the consensus consistency and availability of the consensus mechanism. However, there has been little research on the joining or exiting of nodes from the consortium blockchain. Among them, the research on the mechanism for nodes to exit the consortium blockchain is even in a vacant state, and currently, it can only be achieved by manual operation of the administrator. At present, the applications of blockchains such as consortium blockchains are becoming more and more extensive, and the number of blockchain nodes is also increasing, and the operation of nodes exiting the blockchain has become more and more frequent.
[0004] The inventors analyzed the related technologies and realized that there is no node exit function in the current consensus mechanism of the blockchain. In many blockchain applications, there is an embarrassing situation where nodes cannot exit after joining the blockchain, or the blockchain system administrator needs to configure relevant files to manually delete the nodes to be exited, which is not consistent with the idea of blockchain decentralization. It can be seen that there is currently a lack of a standardized, reasonable, safe, and fast consortium blockchain exit mechanism.
[0005] To address the above problems, no effective solution has been proposed yet. Summary of the Invention
[0006] Embodiments of this application provide a method, apparatus, system, and electronic device for processing blockchain nodes to at least solve the technical problem of low efficiency of node exit in the related art blockchain.
[0007] According to one aspect of the embodiments of the present application, a processing method for a blockchain node is provided, including: sending a first request to a first node, where the first request is for a second node to request to withdraw from the blockchain, and the first node is a node different from the second node in the blockchain; obtaining first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain; and determining whether to perform a chain withdrawal operation according to the first response information, where the chain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0008] According to another aspect of the embodiments of the present application, a processing method for a blockchain node is further provided, including: obtaining a first request of a second node, where the first request is for the second node to request to withdraw from the blockchain; generating first response information according to the node information of the second node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain, and the first node is a node different from the second node in the blockchain; and returning the first response information to the second node, where the second node is used to determine whether to perform a chain withdrawal operation of withdrawing from the blockchain according to the first response information.
[0009] According to another aspect of the embodiments of the present application, a processing device for a blockchain node is further provided, including: a sending unit, configured to send a first request to a first node, where the first request is for a second node to request to withdraw from the blockchain, and the first node is a node different from the second node in the blockchain; a first obtaining unit, configured to obtain first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain; and a processing unit, configured to determine whether to perform a chain withdrawal operation according to the first response information, where the chain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0010] According to another aspect of the embodiments of the present application, a processing device for a blockchain node is further provided, including: a second obtaining unit, configured to obtain a first request of a second node, where the first request is for the second node to request to withdraw from the blockchain; a generating unit, configured to generate first response information according to the node information of the second node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain, and the first node is a node different from the second node in the blockchain; and a returning unit, configured to return the first response information to the second node, where the second node is used to determine whether to perform a chain withdrawal operation of withdrawing from the blockchain according to the first response information.
[0011] According to another aspect of the embodiments of the present application, a processing system for a blockchain node is further provided, including: a first node, configured to return generated first response information to a second node when receiving a first request sent by the second node, where the first request is used for the second node to request to withdraw from the blockchain, and the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain, and the first node is a node different from the second node in the blockchain; a second node, configured to determine whether to perform a chain withdrawal operation according to the received first response information after sending the first request to the first node, where the chain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0012] According to another aspect of the embodiments of the present application, a storage medium is further provided, and the storage medium includes a stored program, and the program executes the above method when running.
[0013] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the above method through the computer program.
[0014] In the embodiments of the present application, the second node to be withdrawn from the blockchain can directly request to withdraw from the blockchain to other first nodes in the blockchain, and then determine whether to perform a chain withdrawal operation according to the response information, without the administrator manually determining whether to withdraw the second node, which can solve the technical problem of low efficiency of node withdrawal in the related art of the blockchain, and further achieve the technical effect of improving the management efficiency of blockchain nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0016] Figure 1 is a flowchart of an optional method for processing a blockchain node according to an embodiment of the present application;
[0017] Figure 2 is a flowchart of an optional method for processing a blockchain node according to an embodiment of the present application;
[0018] Figure 3 is a flowchart of an optional method for processing a blockchain node according to an embodiment of the present application;
[0019] Figure 4 is a schematic diagram of an optional device for processing a blockchain node according to an embodiment of the present application;
[0020] Figure 5It is a schematic diagram of a processing device of an optional blockchain node according to an embodiment of the present application; and,
[0021] Figure 6 It is a structural block diagram of a terminal according to an embodiment of the present application. Detailed implementation manners
[0022] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] First, some nouns or terms that appear in the process of describing the embodiments of the present application are applicable to the following explanations:
[0025] Blockchain technology: Blockchain is a new type of decentralized distributed ledger technology that can securely store digital currency transactions or other data. The characteristic is that the information stored on the blockchain cannot be forged or tampered with. The blockchain consensus algorithm drives each node on the blockchain to participate in the verification process of transactions, ensuring that the transactions on the blockchain are all confirmed and credible. Each node on the blockchain maintains a public ledger for storing the balances of all users and smart contract data on the blockchain network. Any modification to the ledger maintained by a node itself will not be recognized by other nodes, thus ensuring that the public ledger cannot be forged or tampered with.
[0026] BaaS (Blockchain as a Service): It is a new type of cloud service, a cloud service that combines blockchain technology. Compared with ordinary nodes and transaction nodes, the main uses of BaaS nodes are: quickly establishing the development environment required by oneself, providing a series of operation services such as blockchain-based search queries, transaction submissions, and data analysis. These services can be either centralized or decentralized, used to help developers verify their concepts and models faster. BaaS provides supporting services and can serve as an incubator for blockchain developers and entrepreneurs.
[0027] Digital Digest: Digital digest is one of the important uses of the Hash algorithm. As the name implies, a digital digest performs a Hash operation on the original digital content to obtain a unique digest value. Utilizing the anti-collision property of the Hash function, the digital digest can detect whether the content has been tampered with.
[0028] Digital Signature: Also known as public key digital signature and electronic signature, it is a kind of physical signature similar to an ordinary signature written on paper, but implemented using technologies in the field of public key cryptography, and is a method for authenticating digital information. A set of digital signatures usually defines two complementary operations, one for signing and the other for verification. The information data of the sending node is hashed and encrypted to generate a digest, and then the private key of the sending node is used to digitally sign the digest. The sending node broadcasts the information data, digital signature, and the public key of the sending node to the receiving node across the network. It is a digital string that can only be generated by the sender of the information and cannot be forged by others. This digital string is also a valid proof of the authenticity of the information sent by the sender of the information. Specifically, it includes the RSA algorithm, DSA algorithm, and ECDSA elliptic curve digital signature algorithm.
[0029] In current blockchains, many nodes face the embarrassing situation of being unable to withdraw after joining the consortium blockchain; or the relevant files need to be configured by the system administrator of the consortium blockchain to manually delete the nodes to be withdrawn. The efficiency of nodes withdrawing from the consortium blockchain is low, and it goes against the idea of blockchain decentralization. In addition, if there are unfinished operations on the nodes to be withdrawn, it may also interfere with the normal operation of other nodes on the chain. Similarly, similar problems exist in public blockchains and private blockchains.
[0030] According to one aspect of the embodiments of the present application, a method embodiment of a processing method for blockchain nodes is provided to solve the above problems. Figure 1 is a flowchart of an optional processing method for blockchain nodes according to the embodiments of the present application, as Figure 1 shown. This method is applied to the second node and may include the following steps:
[0031] Step S102, the second node sends a first request to the first node. The first request is for the second node to request to withdraw from the blockchain. The first node is a node different from the second node in the blockchain.
[0032] The above-mentioned second node is a node to be withdrawn from the blockchain (which can be a public chain, a private chain, or a consortium chain. Hereinafter, the consortium chain will be used as an example for illustration). The first node is other nodes in the blockchain except the second node.
[0033] Step S104, the second node obtains the first response information returned by the first node. The first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain.
[0034] Step S106, the second node determines whether to perform the chain withdrawal operation according to the first response information. The chain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0035] Through the above steps, the second node to be withdrawn from the blockchain can directly request to withdraw from the blockchain to other first nodes in the blockchain, and then determine whether to perform the chain withdrawal operation according to the response information, without the administrator manually determining whether to withdraw the second node, which can solve the technical problem of low efficiency of node withdrawal in the related art, and then achieve the technical effect of improving the management efficiency of blockchain nodes. The following further details the technical solution of the present application in combination with Figure 1 the steps shown.
[0036] In the technical solution provided in step S102, the second node sends a first request to the first node.
[0037] The nodes in the present application can be implemented based on BaaS. BaaS is a service that combines blockchain technology to help users create, manage, and maintain enterprise-level blockchain networks and applications. Using BaaS, the required blockchain application environment can be quickly established, and a series of operation services such as search query, transaction, and data analysis based on the blockchain network can be provided.
[0038] In the above embodiment, the second node sending a first request to the first node can be implemented through the following steps 1 - step 4:
[0039] Step 1, the target terminal sends a second request to the cloud server of BaaS through the local BaaS client. The second request is for the target account to request to withdraw the second node from the blockchain. The second node belongs to the target account, and the target account is logged in the client of the target terminal.
[0040] Optionally, when creating the second node, the target account can also be implemented on the local BaaS client. After the cloud receives the request to create a node, corresponding resources are allocated to the second node in the cloud to create the second node.
[0041] Step 2: The cloud receives the second request. The cloud hosts the second node.
[0042] Step 3: Authenticate the second request.
[0043] Optionally, authenticating the second request includes at least one of the following: determining whether the account name (which can also be called the user name) carried in the second request is the account name of the second node; determining whether the account identifier (which can also be called the user identifier) carried in the second request is the account identifier of the second node; determining whether the node identifier carried in the second request is the node identifier of the second node; determining whether the blockchain name carried in the second request is the name of the blockchain where the second node is located; and determining whether the blockchain identifier carried in the second request is the blockchain identifier of the blockchain where the second node is located.
[0044] If any of this information is incorrect, a prompt can be sent to the user, prompting the user to make modifications and resend the request.
[0045] Step 4: In the case where the authentication of the second request passes, the second node sends the first request signed with the private key of the second node to the first node.
[0046] In the technical solution provided in step S104, the second node obtains the first response information returned by the first node.
[0047] After receiving the first request from the second node, the first node verifies the source of the request using the public key certificate. After verification passes, the first node generates the first response information based on the node information of the second node. The first response information indicates whether the first node agrees that the second node exits the blockchain. For example, after confirming the identity of the node, according to the identity identifier of the second node, query the corresponding transaction information of the node on the chain, such as whether there are unfinished transactions or unfulfilled node obligations and other abnormal situations. If there are, it does not agree to exit; if not, it agrees to exit.
[0048] In the technical solution provided in step S106, the second node determines whether to perform the operation of exiting the chain according to the first response information.
[0049] Optionally, determining whether to perform the operation of exiting the chain according to the first response information includes the following two situations: First, in the case where the number of received first response messages indicating agreement reaches the target threshold, perform the operation of exiting the chain, where the target threshold is a positive integer less than or equal to the number of nodes of the first node; Second, in the case where the number of received first response messages indicating agreement does not reach the target threshold, do not perform the operation of exiting the chain.
[0050] The above-mentioned target threshold can be a fixed value, such as 100, or a value determined according to a certain ratio, such as determined according to 90%. If the total number of nodes in the blockchain is 1000, then as long as 900 nodes agree to the withdrawal of the second node, the second node can withdraw.
[0051] Optionally, the above-mentioned execution of the chain withdrawal operation includes: the second node sends a chain withdrawal instruction to the sorting node of the blockchain, and the chain withdrawal instruction is used to instruct the sorting node to notify the first node of the chain withdrawal operation, and the first node is used to record the chain withdrawal operation in the ledger; the second node obtains the second response information returned by the sorting node, and the second response information is used to indicate that the first node reaches a consensus on the chain withdrawal operation of the second node. At this time, the connection between the second node and the first node will be disconnected.
[0052] According to another aspect of the embodiments of the present application, a method embodiment of a processing method of a blockchain node is further provided. Figure 2 It is a flowchart of an optional processing method of a blockchain node according to the embodiments of the present application, as Figure 2 shown. The method is applied to the first node and may include the following steps:
[0053] Step S202, the first node obtains the first request of the second node, and the first request is used for the second node to request to withdraw from the blockchain.
[0054] Step S204, the first node generates the first response information according to the node information of the second node, and the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain. The first node is a node different from the second node in the blockchain.
[0055] Step S206, the first node returns the first response information to the second node, and the second node is used to determine whether to execute the chain withdrawal operation of withdrawing from the blockchain according to the first response information.
[0056] Optionally, after returning the first response information to the second node, wait for the notification of the final consensus result:
[0057] Step 1, the second node obtains the notification message sent by the sorting node of the blockchain, and the notification message is used to notify the first node of the chain withdrawal operation of the second node.
[0058] Step 2, record the chain withdrawal operation in the ledger of the first node.
[0059] Optionally, after recording the chain withdrawal operation in the ledger of the first node, disconnect the communication connection between the first node and the second node.
[0060] Optionally, after recording the de-link operation in the ledger of the first node, the node identifier of the second node in the communication permission list of the first node is deleted, wherein the communication permission list is used to store the node identifiers of nodes allowed to communicate with the first node; and the public key certificate of the second node stored by the first node is deleted.
[0061] In the above technical solution, the node to be exited sends a request to exit the alliance chain, and BaaS verifies the parameters of the node; after the parameter verification is completed, the node private key is used to perform a digital signature operation on the request to generate signature information; the request is broadcast to all nodes on the chain, and the nodes on the chain verify the identity of the node to be exited and confirm whether it has any unfinished transactions. After confirmation, a consensus is reached, and other nodes interrupt communication with the node to be exited. After that, the node to be exited cannot access the alliance chain. At this time, the exit operation is completed.
[0062] By adopting the above technical solution, a rapid exit mechanism for alliance chain nodes is implemented, manual operations are reduced, the impact of the exit of individual nodes on the alliance chain is minimized, and the operating efficiency of the alliance chain is ensured; by implementing a BaaS-based alliance chain exit mechanism, the technical gap in the node exit mechanism of the alliance chain is filled, providing support for a healthy and benign blockchain ecosystem; the entire process of the alliance chain node exit mechanism is visualized through BaaS, so that the running status and operation results of the exit process can be understood in real time and intuitively.
[0063] As an optional embodiment, the following continues to take the application of the technical solution of the present application to the alliance chain as an example, combined with Figure 3 Further explanation.
[0064] Step S302, the user logs in to BaaS and initiates a request to "exit the alliance chain" on BaaS. The user initiates a request to exit the alliance chain. This request is a signed request (signed using the node's private key), and BaaS accepts this request.
[0065] The request content includes exit instructions and node characteristics; the exit instruction is used to inform the alliance chain that a node requests to exit the alliance chain so that the alliance chain can process the exit request; the node characteristic attributes include but are not limited to node identification, physical address, network address and other information.
[0066] Step S304: BaaS performs parameter verification on the request sent by the user, including signature and other information.
[0067] BaaS verifies whether the request sent by the user is legal. The verification content includes one or more of the user name, user ID, node ID, alliance chain name, alliance chain ID, etc. If the verification meets the standard, a node configuration file is generated, otherwise a prompt message is issued to prompt the user to modify the relevant parameters. If the verification meets the standard, the node private key is used to perform a digital signature operation on the request to generate signature information (the private key is stored in the database associated with BaaS and managed by the user through BaaS. The encryption signature process is implemented by the user through BaaS and running in the node); BaaS sends the signed information to the alliance chain.
[0068] Step S306, BaaS sends the signed request to each node on the blockchain network.
[0069] Step S308: The on-chain node authenticates the identity of the node to be exited and confirms whether it has any unfinished transactions.
[0070] After receiving the "exit request" from the node to be exited, other nodes on the alliance chain use the public key certificate of the node to be exited to verify the identity of the source node of the "exit request", and compare it with the initial information in the ledger data to verify the legitimacy of the request data; after confirming the identity of the node, based on the identity of the node to be exited, query the transaction information corresponding to the node on the chain, such as whether there are any abnormal situations such as unfinished transactions or unfulfilled node obligations.
[0071] In step S310, the alliance chain uses the consensus mechanism for node exit events to reach a consensus on this behavior, and returns the consensus result to BaaS, and each node interrupts communication with the node to be exited.
[0072] After executing step S308, each node on the chain independently simulates the exit behavior of the node to be exited, generates an execution result (the result is not written into the local account book), observes the impact of the execution result on the business of its own node, independently judges and generates a proposal result, and endorses the proposal result, that is, adds a digital signature to the result (signs the result with its own private key). Then these nodes send their endorsement results to the BaaS of the node to be exited. After the BaaS of the node to be exited collects the endorsement results that meet the threshold number (or meets the requirements of the PBFT consensus algorithm), it initiates an event of exiting the alliance chain to the sorting node in the alliance chain. The sorting node performs sorting services on it to ensure the consistency of the transaction order, submits records and generates new blocks. Each node on the alliance chain verifies the legitimacy of the block and writes the block into the account book. At this point, the alliance chain reaches a consensus on the exit behavior of the node and returns the consensus result to the BaaS corresponding to the node to be exited.
[0073] After that, each node deletes the identifier of the node to be exited from the local communication permission list, deletes the public key certificate of this node, and interrupts the communication with the node to be exited. The node to be exited cannot participate in the consensus process of the next transaction. Thus, the node to be exited finally exits the consortium blockchain.
[0074] In the consensus algorithm in use, consensus refers to the process in which multiple nodes in a distributed system reach a consistent view on something (such as the chain exit event mentioned above). Achieving a certain consensus does not mean ensuring consistency. In practice, to ensure that the system meets different degrees of consistency, it is often necessary to achieve it through a consensus algorithm. The consensus algorithm solves the process in which most nodes in a distributed system reach a consensus on a certain proposal. The meaning of a proposal is very broad in a distributed system, such as the order of multiple events occurring, the value corresponding to a certain key, who is the master node, etc. It can be considered that any information that can reach a consensus is a proposal. For a distributed system, each node is usually the same deterministic state machine model (also known as the state machine replication problem, State-Machine Replication). Starting from the same initial state and receiving the same order of instructions, the same result state can be guaranteed. Therefore, the most crucial thing for multiple nodes in the system is to reach a consensus on the order of multiple events, that is, sorting.
[0075] According to whether the scenario to be solved allows Byzantine error situations, consensus algorithms can be divided into two categories: Crash Fault Tolerance (CFT) and Byzantine Fault Tolerance (BFT). For non-Byzantine error situations, classic algorithms such as Paxos and Raft can be used. Such fault-tolerant algorithms often have better performance, faster processing, and can tolerate no more than half of the faulty nodes. For situations that can tolerate Byzantine errors, it includes deterministic series algorithms represented by PBFT (Practical Byzantine Fault Tolerance), probabilistic algorithms represented by PoW, etc. Once the deterministic algorithm reaches a consensus, it is irreversible, that is, the consensus is the final result; while the consensus result of the probabilistic algorithm is temporary. As time goes by or with a certain strengthening, the probability of the consensus result being overturned becomes smaller and smaller, and finally becomes the de facto result. Byzantine fault-tolerant algorithms often have poor performance and can tolerate no more than 1 / 3 of the faulty nodes. In addition, recently proposed improved algorithms such as XFT (Cross Fault Tolerance) can provide a processing response speed similar to CFT and can provide BFT guarantee when most nodes are working properly. The Algorand algorithm is an improvement based on PBFT. By introducing a verifiable random function, it solves the problem of proposal selection and can theoretically achieve better performance (1000+ TPS) under the premise of tolerating Byzantine errors.
[0076] Step S312: Return the request result of "exiting the consortium blockchain" to the user for display.
[0077] The consortium blockchain returns the final result to the BaaS of the node to be exited, notifying the node that it has successfully exited the consortium blockchain. If the node fails to exit the consortium blockchain, the user will be prompted with the corresponding node status information, and the communication with other nodes on the consortium blockchain will continue.
[0078] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0079] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
[0080] According to another aspect of the embodiments of this application, there is also provided a processing device for a blockchain node for implementing the above-mentioned processing method of the blockchain node. Figure 4 It is a schematic diagram of an optional processing device for a blockchain node according to an embodiment of this application, as Figure 4 shown. The device may include:
[0081] A sending unit 401, configured to send a first request to a first node, where the first request is used for a second node to request to exit from the blockchain, and the first node is a node different from the second node in the blockchain.
[0082] A first obtaining unit 403, configured to obtain first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node exits from the blockchain.
[0083] A processing unit 405, configured to determine whether to perform a chain exit operation according to the first response information, where the chain exit operation is an operation for the second node to exit from the blockchain.
[0084] It should be noted that the sending unit 401 in this embodiment can be used to execute step S102 in the embodiment of the present application, the first obtaining unit 403 in this embodiment can be used to execute step S104 in the embodiment of the present application, and the processing unit 405 in this embodiment can be used to execute step S106 in the embodiment of the present application.
[0085] Through the above modules, the second node to be withdrawn from the blockchain can directly request to withdraw from the blockchain from other first nodes in the blockchain, and then determine whether to perform the chain withdrawal operation according to the response information, without the administrator manually determining whether to withdraw the second node, which can solve the technical problem of low efficiency of node withdrawal in the related art of the blockchain, and further achieve the technical effect of improving the management efficiency of blockchain nodes.
[0086] Optionally, the above processing unit includes: a first processing module, configured to perform a chain withdrawal operation when the number of received first response messages indicating consent reaches a target threshold, where the target threshold is a positive integer less than or equal to the number of nodes of the first node; a second processing module, configured to cancel the execution of the chain withdrawal operation when the number of received first response messages indicating consent does not reach the target threshold.
[0087] Optionally, the above first processing module may further be configured to: send a chain withdrawal instruction to the sorting node of the blockchain, where the chain withdrawal instruction is used to instruct the sorting node to notify the first node of the chain withdrawal operation, and the first node is used to record the chain withdrawal operation in the ledger; obtain a second response message returned by the sorting node, where the second response message is used to indicate that the first node reaches a consensus on the chain withdrawal operation of the second node.
[0088] Optionally, the device of the present application may further include: an authentication unit, configured to receive a second request in the cloud before sending a first request to the first node, where the cloud is used to carry the second node, the second request is for a target account to request to withdraw the second node from the blockchain, and the second node belongs to the target account; authenticate the second request, and when the authentication of the second request passes, execute the step of sending the first request to the first node.
[0089] Optionally, the authentication unit may further be configured to perform at least one of the following: determine whether the account name carried in the second request is the account name of the second node; determine whether the account identifier carried in the second request is the account identifier of the second node; determine whether the node identifier carried in the second request is the node identifier of the second node; determine whether the blockchain name carried in the second request is the name of the blockchain where the second node is located; and determine whether the blockchain identifier carried in the second request is the blockchain identifier of the blockchain where the second node is located.
[0090] According to another aspect of the embodiments of the present application, there is also provided a processing device for a blockchain node for implementing the above-mentioned processing method of the blockchain node. Figure 5 is a schematic diagram of an optional processing device for a blockchain node according to an embodiment of the present application, as Figure 5 shown, the device may include:
[0091] A second acquisition unit 501, configured to acquire a first request of a second node, where the first request is used by the second node to request to withdraw from the blockchain.
[0092] A generation unit 503, configured to generate first response information according to the node information of the second node, where the first response information is used to indicate whether a first node agrees that the second node withdraws from the blockchain, and the first node is a node different from the second node in the blockchain.
[0093] A return unit 505, configured to return the first response information to the second node, and the second node is used to determine whether to perform a chain withdrawal operation of withdrawing from the blockchain according to the first response information.
[0094] It should be noted that the second acquisition unit 501 in this embodiment may be used to execute step S202 in the embodiments of the present application, the generation unit 503 in this embodiment may be used to execute step S204 in the embodiments of the present application, and the return unit 505 in this embodiment may be used to execute step S206 in the embodiments of the present application.
[0095] Optionally, the device of the present application may further include: a consensus unit, configured to, after returning the first response information to the second node, acquire a notification message sent by an ordering node of the blockchain, where the notification message is used to notify the first node of the chain withdrawal operation of the second node; and record the chain withdrawal operation in the ledger of the first node.
[0096] Optionally, the device of the present application may further include: a disconnection unit, configured to disconnect the communication connection between the first node and the second node after recording the chain withdrawal operation in the ledger of the first node.
[0097] Optionally, the device of the present application may further include: a deletion unit, configured to, after recording the chain withdrawal operation in the ledger of the first node, delete the node identifier of the second node in the communication permission list of the first node, where the communication permission list is used to save the identifiers of the nodes allowed to communicate with the first node; and / or delete the public key certificate of the second node saved by the first node.
[0098] According to another aspect of the embodiments of the present application, there is also provided a processing system for a blockchain node for implementing the above-mentioned processing method of the blockchain node. The system includes: a first node and a second node. The first node is configured to return generated first response information to the second node when receiving a first request sent by the second node, where the first request is for the second node to request to withdraw from the blockchain, and the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain. The first node is a node different from the second node in the blockchain. The second node is configured to determine whether to perform a chain withdrawal operation according to the received first response information after sending the first request to the first node, where the chain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0099] It should be noted here that the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as a part of the device, can run in the corresponding hardware environment, can be implemented by software, or can be implemented by hardware, where the hardware environment includes a network environment.
[0100] According to another aspect of the embodiments of the present application, there is also provided a server or a terminal for implementing the above-mentioned processing method of the blockchain node.
[0101] Figure 6 is a structural block diagram of a terminal according to an embodiment of the present application. As Figure 6 shown, the terminal may include: one or more ( Figure 6 only one is shown in Figure 6 ) processors 601, a memory 603, and a transmission device 605. As
[0102] shown, the terminal may further include an input / output device 607.
[0103] The above-mentioned transmission device 605 is used to receive or send data via a network, and can also be used for data transmission between the processor and the memory. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 605 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, so as to communicate with the Internet or a local area network. In one example, the transmission device 605 is a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0104] Specifically, the memory 603 is used to store application programs.
[0105] The processor 601 can call the application program stored in the memory 603 through the transmission device 605 to execute the following steps:
[0106] Send a first request to the first node, where the first request is used to request the second node to withdraw from the blockchain, and the first node is a node different from the second node in the blockchain;
[0107] Obtain the first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain; and,
[0108] Determine whether to perform a blockchain withdrawal operation according to the first response information, where the blockchain withdrawal operation is an operation for the second node to withdraw from the blockchain.
[0109] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments, and will not be elaborated here.
[0110] Those of ordinary skill in the art can understand that Figure 6 The structure shown is only for illustration. The terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Devices (MID), a PAD and other terminal devices. Figure 6 It does not limit the structure of the above-mentioned electronic device. For example, the terminal may further include more or fewer components (such as a network interface, a display device, etc.) than those shown Figure 6 in it, or have a different configuration from that shown Figure 6 in it.
[0111] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, and the storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0112] An embodiment of the present application also provides a storage medium. Optionally, in this embodiment, the above storage medium can be used to execute the program code of the processing method of the blockchain node.
[0113] Optionally, in this embodiment, the above storage medium can be located on at least one of the multiple network devices in the network shown in the above embodiment.
[0114] Optionally, in this embodiment, the storage medium is set to store program code for performing the following steps:
[0115] Send a first request to the first node, where the first request is used for the second node to request to exit the blockchain, and the first node is a node different from the second node in the blockchain;
[0116] Obtain the first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node exits the blockchain; and,
[0117] Determine whether to perform the operation of exiting the chain according to the first response information, where the operation of exiting the chain is the operation of the second node exiting the blockchain.
[0118] Optionally, the specific examples in this embodiment can refer to the examples described in the above embodiments, and this embodiment will not be elaborated here.
[0119] Optionally, in this embodiment, the above storage medium can include but is not limited to: a USB flash drive, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk, or an optical disc, etc., various media that can store program code.
[0120] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0121] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage media. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
[0122] In the above embodiments of this application, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0123] In the several embodiments provided by this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.
[0124] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] In addition, the functional units in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0126] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. A processing method for a blockchain node, characterized in that, Including: Sending a first request to a first node, where the first request is for a second node to request to withdraw from a blockchain, and the first node is other nodes in the blockchain except the second node; Obtaining first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain. The first node is used to verify the source of the first request using a public key certificate after receiving the first request from the second node, and generate the first response information according to the node information of the second node after passing the verification. The node information includes transaction information of the second node, and the transaction information is used to indicate whether there are abnormal situations where the second node has unfinished transactions or unfulfilled node obligations; and, Determining whether to perform a chain withdrawal operation according to the first response information, where the chain withdrawal operation is an operation for the second node to withdraw from the blockchain; Before sending the first request to the first node, the method further includes: Receiving a second request in the cloud, where the cloud is used to host the second node, and the second request is for a target account to request to withdraw the second node from the blockchain. The second node belongs to the target account, and the second node is created by the target account request in the cloud; and, Authenticating the second request, where in the case of passing the authentication of the second request, using the node private key to perform a digital signature on the first request to generate signature information, and sending the first request with the signature information to the first node; Performing the chain withdrawal operation includes: Sending a chain withdrawal instruction to an ordering node of the blockchain, where the chain withdrawal instruction is used to instruct the ordering node to notify the first node of the chain withdrawal operation, and the first node is used to record the chain withdrawal operation in the ledger; and, Obtaining second response information returned by the ordering node, where the second response information is used to indicate that the first node reaches a consensus on the chain withdrawal operation of the second node.
2. The method according to claim 1, characterized in that, Determining whether to perform a chain withdrawal operation according to the first response information includes: Performing the chain withdrawal operation when the number of received first response information indicating consent reaches a target threshold, where the target threshold is a positive integer less than or equal to the number of nodes of the first node; and, Canceling the execution of the chain withdrawal operation when the number of received first response information indicating consent does not reach the target threshold.
3. The method according to claim 1, wherein Authenticating the second request includes at least one of the following: Determining whether the account name carried in the second request is the account name of the second node; Determining whether the account identifier carried in the second request is the account identifier of the second node; Determining whether the node identifier carried in the second request is the node identifier of the second node; Determining whether the blockchain name carried in the second request is the name of the blockchain where the second node is located; And, Determining whether the blockchain identifier carried in the second request is the identifier of the blockchain where the second node is located.
4. A processing method for a blockchain node, characterized in that, Including: Obtain a first request of a second node, where the first request is for the second node to request to withdraw from the blockchain. Before the second node sends the first request to a first node, the second node receives a second request in the cloud, where the cloud is used to host the second node, and the second request is for a target account to request to withdraw the second node from the blockchain, and the second node belongs to the target account; and authenticate the second request. Wherein, in the case that the authentication of the second request passes, use the node private key to perform digital signature on the first request to generate signature information, and send the first request with the signature information to the first node; The second node performing a chain withdrawal operation includes: sending a chain withdrawal instruction to an ordering node of the blockchain, where the chain withdrawal instruction is used to instruct the ordering node to notify the first node of the chain withdrawal operation, and the first node is used to record the chain withdrawal operation in the ledger; and obtain second response information returned by the ordering node, where the second response information is used to indicate that the first node reaches a consensus on the chain withdrawal operation of the second node; Verify the source of the first request using a public key certificate. After the verification passes, generate first response information according to the node information of the second node, where the first response information is used to indicate whether the first node agrees that the second node withdraws from the blockchain. The first node is other nodes in the blockchain except the second node, and the node information includes transaction information of the second node, and the transaction information is used to indicate whether there are abnormal situations where the second node has unfinished transactions or unfulfilled node obligations; and, Return the first response information to the second node, where the second node is used to determine whether to perform a chain withdrawal operation to withdraw from the blockchain according to the first response information.
5. The method according to claim 4, characterized in that, After returning the first response information to the second node, the method further includes: Obtain a notification message sent by an ordering node of the blockchain, where the notification message is used to notify the first node of the chain withdrawal operation of the second node; and, Record the chain withdrawal operation in the ledger of the first node.
6. The method according to claim 5, characterized in that, After recording the chain withdrawal operation in the ledger of the first node, the method further includes: Disconnect the communication connection between the first node and the second node.
7. The method according to claim 5, characterized in that After recording the chain withdrawal operation in the ledger of the first node, the method further includes: Delete the node identifier of the second node in the communication permission list of the first node, where the communication permission list is used to save the identifiers of nodes allowed to communicate with the first node; and / or, Delete the public key certificate of the second node saved by the first node.
8. A processing device for a blockchain node, characterized in that, Includes: A sending unit, configured to send a first request to a first node, where the first request is for a second node to request to withdraw from the blockchain, and the first node is other nodes in the blockchain except the second node; A first acquisition unit, configured to acquire first response information returned by the first node, where the first response information is used to indicate whether the first node agrees that the second node exits from the blockchain. The first node is configured to, after receiving a first request from the second node, verify the source of the first request using a public key certificate, and generate the first response information according to node information of the second node after the verification passes. The node information includes transaction information of the second node, and the transaction information is used to indicate whether there are abnormal situations where the second node has unfinished transactions or unfulfilled node obligations; and, A processing unit, configured to determine whether to perform a blockchain exit operation according to the first response information, where the blockchain exit operation is an operation for the second node to exit from the blockchain; Before sending the first request to the first node, the sending unit is further configured to: Receive a second request in the cloud, where the cloud is used to host the second node, and the second request is for a target account to request that the second node exit from the blockchain, and the second node belongs to the target account; and, Authenticate the second request, where, when the authentication of the second request passes, use a node private key to perform digital signature on the first request to generate signature information, and send the first request with the signature information to the first node; Performing the blockchain exit operation includes: Sending a blockchain exit instruction to an ordering node of the blockchain, where the blockchain exit instruction is used to instruct the ordering node to notify the first node of the blockchain exit operation, and the first node is used to record the blockchain exit operation in a ledger; and, Acquiring second response information returned by the ordering node, where the second response information is used to indicate that the first node reaches a consensus on the blockchain exit operation of the second node.
9. A control device for a blockchain node, characterized in that, Including: A second acquisition unit, configured to acquire a first request of a second node, where the first request is for the second node to request to exit from the blockchain. Before the second node sends the first request to the first node, receive a second request in the cloud, where the cloud is used to host the second node, and the second request is for a target account to request that the second node exit from the blockchain, and the second node belongs to the target account; and authenticate the second request, where, when the authentication of the second request passes, use a node private key to perform digital signature on the first request to generate signature information, and send the first request with the signature information to the first node; the second node performing the blockchain exit operation includes: sending a blockchain exit instruction to an ordering node of the blockchain, where the blockchain exit instruction is used to instruct the ordering node to notify the first node of the blockchain exit operation, and the first node is used to record the blockchain exit operation in a ledger; and, acquiring second response information returned by the ordering node, where the second response information is used to indicate that the first node reaches a consensus on the blockchain exit operation of the second node; A generating unit, configured to verify the source of the first request by using a public key certificate, and after the verification is passed, generate first response information according to the node information of the second node, where the first response information is used to indicate whether a first node agrees that the second node exits from the blockchain, the first node is other nodes in the blockchain except the second node, the node information includes transaction information of the second node, and the transaction information is used to indicate whether there are abnormal situations where transactions of the second node are not completed or node obligations are not fulfilled; and, A returning unit, configured to return the first response information to the second node, where the second node is configured to determine whether to perform an operation of exiting from the blockchain according to the first response information.
10. A processing system for a blockchain node, characterized in that, It includes a first node and a second node, The first node is configured to, when receiving a first request sent by a second node, verify the source of the first request by using a public key certificate, and after the verification is passed, generate first response information according to the node information of the second node, and return the generated first response information to the second node, where the first request is used for the second node to request to exit from the blockchain, the first response information is used to indicate whether the first node agrees that the second node exits from the blockchain, the first node is other nodes in the blockchain except the second node, the node information includes transaction information of the second node, and the transaction information is used to indicate whether there are abnormal situations where transactions of the second node are not completed or node obligations are not fulfilled; The second node is configured to, after sending the first request to the first node, determine whether to perform an operation of exiting from the blockchain according to the received first response information, where the operation of exiting from the blockchain is an operation for the second node to exit from the blockchain. Before the second node sends the first request to the first node, it receives a second request in the cloud, where the cloud is used to host the second node, the second request is used for a target account to request to exit the second node from the blockchain, and the second node belongs to the target account; and authenticate the second request, where, when the authentication of the second request is passed, a node private key is used to perform a digital signature on the first request to generate signature information, and the first request with the signature information is sent to the first node; performing the operation of exiting from the blockchain includes: sending an instruction to exit from the blockchain to an ordering node of the blockchain, where the instruction to exit from the blockchain is used to instruct the ordering node to notify the first node of the operation of exiting from the blockchain, and the first node is configured to record the operation of exiting from the blockchain in a ledger; and obtaining second response information returned by the ordering node, where the second response information is used to indicate that the first node reaches a consensus on the operation of exiting from the blockchain of the second node.
11. A storage medium, characterized in that, The storage medium includes a stored program, where the program, when running, executes the method described in any one of claims 1 to 7 above.
12. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, The processor executes the method described in any one of claims 1 to 7 above through the computer program.
Citation Information
Patent Citations
Dynamic node management method realized based on BFT consensus algorithm
CN107171829A
Cross-block-chain interaction method based on notary group
CN110689434A
Blockchain multi-chain management method and device
CN111010394A