Block chain operation method and device, medium and electronic equipment
By deploying multiple blockchain instances on the blockchain node and configuring different identifiers, the nodes are added to the corresponding subnetwork, the problem of resource waste and management complexity in the multi-chain operating environment is solved, and the blockchain node is realized multi-chain multiplexing and efficient resource utilization.
Patent Information
- Application Number
- CN202310815831.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-01-07
AI Technical Summary
In the multi-chain operating environment of blockchain, the increase in the number of nodes leads to waste of resources, and the existing technology is difficult to effectively utilize resources, and each blockchain node can only be used on one blockchain, resulting in waste of resources and management complexity .
By deploying multiple blockchain instances on a blockchain node and configuring different identifiers for each instance, the nodes are added to the corresponding subnetwork to realize multi-chain multiplexing of blockchain nodes and improve resource utilization.
It realizes the flexibility, reliability, resource isolation and independent application of blockchain nodes, reduces the complexity of node management, saves environmental resources, and improves the stability and resource utilization of blockchain parallel operation.
Smart Images

Figure CN119276880A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and specifically relates to a blockchain operation method, a blockchain operation device, a computer-readable medium, an electronic device, and a computer program product. Background Art
[0002] In actual use, blockchain will encounter the situation of multi-chain operation. That is, as the business changes, different chains need to be configured according to different businesses in the existing environment. If each blockchain contains several nodes, the number of nodes will increase sharply when multiple blockchains are running together. As the number of nodes increases, a large amount of machine resources will be occupied, resulting in the problem of resource waste. Summary of the invention
[0003] The present application provides a blockchain operation method, a blockchain operation device, a computer-readable medium, an electronic device, and a computer program product, the purpose of which is to improve the resource utilization of blockchain nodes.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a blockchain operation method is provided, the method comprising:
[0006] Obtaining blockchain identifiers of multiple blockchain instances deployed on a blockchain node, where the multiple blockchain instances have different blockchain identifiers;
[0007] Initialization information is sent to the blockchain network where the blockchain node is located according to the blockchain identifier, and the initialization information is used to instruct the blockchain node to join a sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
[0008] According to one aspect of an embodiment of the present application, a blockchain operation device is provided, the blockchain operation device comprising:
[0009] An acquisition module is configured to acquire blockchain identifiers of multiple blockchain instances deployed on a blockchain node, wherein the multiple blockchain instances have different blockchain identifiers;
[0010] The sending module is configured to send initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, wherein the initialization information is used to instruct the blockchain node to join a sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
[0011] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0012] A template acquisition module, configured to acquire a blockchain template for creating a new blockchain instance;
[0013] A parameter configuration module is configured to perform parameter configuration on the blockchain template according to business requirements to obtain a blockchain instance for realizing the business requirements;
[0014] The node refresh module is configured to dynamically refresh the blockchain node to obtain the blockchain instance deployed on the blockchain node.
[0015] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0016] A record table acquisition module is configured to acquire a node record table associated with the blockchain instance, wherein the node record table is used to record blockchain nodes in operation in a subnetwork maintaining the blockchain instance;
[0017] An identification acquisition module is configured to acquire a node identification of the blockchain node and a blockchain identification of the blockchain instance according to the initialization information;
[0018] The identification adding module is configured to add the node identification of the blockchain node to the node record table associated with the blockchain instance according to the blockchain identification of the blockchain instance.
[0019] In some embodiments of the present application, based on the above technical solution, the identification adding module is further configured to: in the subnetwork used to maintain the blockchain instance, perform consensus authentication on the initialization information; when the result of the consensus authentication is authentication passed, according to the blockchain identifier of the blockchain instance, add the node identifier of the blockchain node to the node record table associated with the blockchain instance.
[0020] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0021] The node exit module is configured to: when the blockchain node requests to exit the blockchain network, obtain the blockchain identifier of the blockchain instance running on the blockchain node; send exit information to the blockchain network according to the blockchain identifier, and the exit information is used to indicate that the blockchain node is moved out of the subnetwork used to maintain the blockchain instance; after the blockchain node exits each of the subnetworks, move the blockchain node out of the blockchain network.
[0022] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0023] The exit consensus module is configured to: perform consensus authentication on the exit information in the sub-network used to maintain the blockchain instance; when the result of the consensus authentication is authentication passed, move the blockchain node out of the sub-network used to maintain the blockchain instance.
[0024] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0025] The information sending module is configured to: when the blockchain node requests to send interactive information to the blockchain network, obtain the blockchain identifier of the blockchain instance that triggers the interactive information; and send the interactive information carrying the blockchain identifier to the blockchain network.
[0026] In some embodiments of the present application, based on the above technical solution, the interactive information sending module is further configured to: obtain a node record table associated with the blockchain instance, wherein the node record table is used to record the blockchain nodes in operation in the subnetwork that maintains the blockchain instance; and send interactive information carrying the blockchain identifier to the blockchain nodes in operation in the subnetwork.
[0027] In some embodiments of the present application, based on the above technical solution, the blockchain operation device further includes:
[0028] The information processing module is configured to: when receiving interaction information from the blockchain network, obtain the blockchain identifier carried in the interaction information; if a blockchain instance with the same blockchain identifier as the interaction information is deployed on the blockchain node, the interaction information is processed by the blockchain instance; if a blockchain instance with the same blockchain identifier as the interaction information is not deployed on the blockchain node, the interaction information is discarded.
[0029] In some embodiments of the present application, based on the above technical solution, the information processing module is further configured to: obtain the information type of the interaction information, the information type including global information broadcast on the blockchain network or local information broadcast on the sub-network; if the information type of the interaction information is the local information, then send node exit information to the blockchain network, and the node exit information is used to indicate that the blockchain node is moved out of the sub-network.
[0030] In some embodiments of the present application, based on the above technical solution, the multiple blockchain instances deployed on the blockchain node have the same communication port.
[0031] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the blockchain operation method in the above technical solution is implemented.
[0032] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement the blockchain operation method in the above technical solution.
[0033] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the blockchain operation method in the above technical solution is implemented.
[0034] In the technical solution provided in the embodiments of the present application, by deploying multiple blockchain instances on a blockchain node and configuring different blockchain identifiers for the multiple blockchain instances, initialization information can be sent to the blockchain network where the blockchain node is located according to the blockchain identifier, and then the blockchain node is added to the sub-network used to maintain the blockchain instance according to the initialization information; the sub-network is a network composed of blockchain instances with the same blockchain identifier, and the blockchain nodes in the sub-network are used to jointly maintain a blockchain; each blockchain node can maintain different blockchains in multiple different sub-networks, thereby realizing multi-chain reuse of blockchain nodes and improving resource utilization of blockchain nodes.
[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A schematic diagram of the system architecture implemented by applying the technical solution in the embodiments of the present application is shown.
[0038] Figure 2 The component structure of the blockchain maintained on the blockchain network is shown.
[0039] Figure 3 A flowchart of a blockchain operation method in one embodiment of the present application is shown.
[0040] Figure 4 A flow chart of a method for adding a blockchain instance based on a dynamic refresh mechanism in one embodiment of the present application is shown.
[0041] Figure 5 A schematic diagram of deploying a blockchain instance to a blockchain node in an application scenario according to an embodiment of the present application is shown.
[0042] Figure 6 A schematic diagram of parameter configuration of a blockchain instance in an application scenario of an embodiment of the present application is shown.
[0043] Figure 7 A schematic diagram of updating blockchain nodes managed based on updating a node record table in an application scenario according to an embodiment of the present application is shown.
[0044] Figure 8 A schematic diagram of implementing blockchain node reuse in an application scenario in an embodiment of the present application is shown.
[0045] Fig. 9 The structural block diagram of the blockchain operation device provided in an embodiment of the present application is schematically shown.
[0046] Fig.10 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0049] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0050] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0051] In the specific implementation of this application, data related to the user's blockchain account or blockchain transactions is involved. When the various embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0052] The following is an explanation of the technical terms in the related technologies of this application.
[0053] Blockchain: Blockchain is a new distributed infrastructure and computing method that uses a block chain data structure to verify and store data, a distributed node consensus algorithm to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script codes to program and operate data. The block chain data structure is a data structure that stores transactions that occur over a period of time in blocks and connects blocks into a chain in chronological order using a cryptographic algorithm. The ledger is distributed to all member nodes in the network, and the history of asset transactions between peer nodes in the network is permanently recorded in a sequential chain of blocks linked by a hash cryptographic algorithm. All confirmed and proven transactions are linked from the beginning of the chain to the latest block, hence the name blockchain. The blockchain can act as a single source of truth, and members of the blockchain network can only view transactions related to them.
[0054] Blockchain is generally divided into three types: public chain, private chain and consortium chain. Among them, the public chain has the highest degree of decentralization. Nodes / participants who join the public chain can read the data on the chain, publish transactions, and compete for the right to record new blocks, etc. Moreover, each node / participant can freely join and exit the public chain. On the contrary, the private chain's accounting authority is controlled by a certain organization or institution, and the data reading authority is also controlled by the organization or institution. There are few participants and they cannot join the private chain at will. They must be reviewed by the organization or institution. Consortium chain, also known as community blockchain, refers to a blockchain whose consensus process is controlled by pre-selected nodes. It is a mixture of public chain and private chain, which can achieve "partial decentralization". Each node on the chain usually has a corresponding entity or organization; participants join the network through authorization and form a stakeholder alliance to jointly maintain the operation of the blockchain. Through the consortium chain, new participants can join the established blockchain and share data without having to build it from scratch.
[0055] Blockchain node: usually refers to the computer in the blockchain network, that is, any computer connected to the blockchain network can be called a node. Nodes can be divided into light nodes and full nodes. A full node is a node that has all the transaction data of the entire network, and a light node is a node that only has transaction data related to itself. The more blockchain nodes are distributed and the more widespread they are, the more decentralized the blockchain network will be, and the safer the network operation will be.
[0056] Smart Contract: A smart contract is a contract that can be triggered by a transaction on a blockchain system and can be defined in the form of computer code. A smart contract is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. It is a program deployed in the nodes of a blockchain network, carries the business logic for executing transactions, and runs in an isolated operating environment (such as a container or virtual machine). The contract program automatically executed by each node in the blockchain system according to specific conditions can operate on the data stored on the chain. It is an important way for business entities to interact with the blockchain and use the blockchain to implement business logic. The purpose of a smart contract is to provide a security method that is superior to traditional contracts and reduce other transaction costs associated with contracts. It allows trusted transactions without a third party, and these transactions are traceable and irreversible.
[0057] Multi-chain: Multi-chain refers to multiple blockchains. There are currently a large number of active blockchains on the Internet. A multi-chain ecosystem refers to an ecosystem where multiple blockchains are interconnected, with the ultimate goal of improving user experience, increasing efficiency, and allowing for wider adoption. With the continuous development of blockchain, the original ecosystem with a single chain as the core has also transformed into an ecosystem with multiple chains coexisting.
[0058] In the related technologies of this application, the actual application of blockchain products usually requires the deployment of multiple blockchains. Since different blockchains involve different transaction processing logics during use, each blockchain node can generally only be used on one blockchain, which results in a large amount of blockchain node resources being occupied, resulting in a waste of resources.
[0059] In response to the problems existing in the related technologies, the embodiments of the present application provide a solution that can realize the reuse of blockchain nodes, which can ensure that multiple blockchains run in parallel without affecting each other, and can maximize the use of node resources. When multiple chains need to be deployed in the actual application of blockchain products, or when chains are dynamically added as the business changes, there is no need to repeatedly create nodes, save environmental resources, reduce node management, and ensure the parallel and stable operation of blockchains. The blockchain nodes can be flexible and reliable on different blockchains, with resource isolation, independent operation, and no impact on each other.
[0060] Figure 1 A schematic diagram of the system architecture implemented by applying the technical solution in the embodiments of the present application is shown.
[0061] like Figure 1 As shown, the system architecture includes a client 101, a server 102, a smart contract engine 103 and a blockchain network 104.
[0062] The client 101 may be a smart phone, tablet computer, laptop computer, desktop computer, smart wearable device, smart vehicle-mounted device, smart payment terminal or other electronic devices, and may provide a user interface for asset management, and may specifically provide functions such as user registration / logout, organization management, expense management, history query, notification, etc. The user interface provided by the client may be a web page, a hosted program running on a host program, an independently installed and run application, etc.
[0063] Server 102 can be an independent physical server, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server 102 is used to provide backend services for client 101, and integrates and calls basic smart contracts to complete payment, application for account movement, distributed approval, account movement, auditing, reporting and other functions.
[0064] The smart contract engine 103 provides the ability to orchestrate various smart contracts, and completes the functional orchestration through external authorization triggering or automatic triggering of associated smart contracts. The smart contract engine 103 can be an independently operated computer device, or can be deployed in the server 102 as a functional unit.
[0065] The blockchain network 104 includes at least one blockchain node, which can be a terminal device or server participating in data transactions. The client 101 can communicate data with each blockchain node in the blockchain network through the server 102 to implement corresponding blockchain application functions. In some optional implementations, the client 101 or the server 102 itself can also join the blockchain network as a blockchain node.
[0066] Each blockchain node can receive input information when performing normal work, and maintain shared data in the blockchain network based on the received input information. In order to ensure information intercommunication, information connections can exist between blockchain nodes, and each blockchain node can transmit information to each other through information connections. For example, when any blockchain node in the blockchain network receives input information and broadcasts the input information in the blockchain network, other node devices in the blockchain network can obtain the input information according to the consensus algorithm and store the input information as shared data.
[0067] Each blockchain node in the blockchain network has a corresponding node identifier, and each blockchain node in the blockchain network can store the node identifiers of other nodes in the same blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other blockchain nodes. A node identifier list can be maintained in the blockchain node, and the node name and node identifier are stored in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to uniquely identify a blockchain node.
[0068] Figure 2 The structure of the blockchain maintained on the blockchain network is shown. Figure 2 As shown in the figure, the blockchain consists of multiple sequentially connected blocks. Whenever new data needs to be written into the blockchain, the data will be aggregated into a newly generated block, which will be linked to the end of the blockchain. The consensus algorithm can ensure that the newly added blocks on each node device are exactly the same. The data of the current block is recorded in the block body of each block, and the hash value of the previous block connected to it is saved in its block header. If the transaction data in the previous block changes, the hash value of the current block will also change accordingly. Therefore, the data uploaded to the blockchain network is difficult to be tampered with, which can improve the reliability of shared data.
[0069] The following is a detailed description of the technical solutions such as the blockchain operation method, blockchain operation device, computer-readable medium, electronic device, and computer program product provided by the present application in combination with specific implementation methods.
[0070] Figure 3 A flowchart of a blockchain operation method in one embodiment of the present application is shown, and the blockchain operation method is executed by a blockchain node in a blockchain network. The blockchain node can be, for example, Figure 1 The client or server shown, or a node composed of a client and a server. The present application embodiment takes the blockchain operation method executed by the client as an example for explanation. Figure 3 As shown, the blockchain operation method may include the following steps S310 to S320.
[0071] S310: Obtain blockchain identifiers of multiple blockchain instances deployed on a blockchain node, where the multiple blockchain instances have different blockchain identifiers.
[0072] A blockchain instance is a collection of functional modules configured on a blockchain node for implementing blockchain services. Each blockchain instance has a blockchain identifier associated with it. Blockchain instances with the same blockchain identifier jointly maintain the same blockchain, and blockchain instances with different blockchain identifiers are used to maintain different blockchains.
[0073] In an embodiment of the present application, multiple blockchain instances can be deployed simultaneously on a blockchain node. When two blockchain instances have different blockchain identifiers, it means that the blockchain node is running two different blockchains at the same time.
[0074] S320: Send initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, where the initialization information is used to instruct the blockchain node to join the sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
[0075] A subnetwork is a node set consisting of some or all of the blockchain nodes in a blockchain network, and a blockchain runs in a subnetwork. After the current blockchain node sends initialization information to the blockchain network according to the blockchain identifier, other blockchain nodes in the blockchain network can determine the blockchain corresponding to the blockchain identifier based on the initialization information, so that the current blockchain node can be added to the subnetwork that maintains the blockchain.
[0076] Blockchain nodes can send initialization information to the blockchain network by broadcasting or point-to-point transmission. For example, when a blockchain node broadcasts initialization information on the blockchain network, any blockchain node on the blockchain network can obtain the initialization information by receiving the broadcast. Blockchain nodes can also send initialization information to several other nodes in the blockchain network that communicate with themselves by point-to-point transmission; after a blockchain node receives the initialization information, it can continue to forward it to other nodes in the blockchain network.
[0077] In some optional implementations, the initialization information may carry a single blockchain identifier, which is used to indicate that the blockchain node is added to a subnetwork that maintains the blockchain instance associated with the blockchain identifier. In other optional implementations, the initialization information may also carry multiple blockchain identifiers at the same time, which are used to indicate that the blockchain node is added to multiple subnetworks, each of which is used to maintain a subnetwork of the blockchain instance associated with one of the blockchain identifiers.
[0078] For example, two blockchain instances are deployed on blockchain node A, one of which is associated with a blockchain identifier Blockchain1, and the other is associated with a blockchain identifier Blockchain2. When the current blockchain node is started, initialization information carrying at least one of the blockchain identifiers Blockchain1 and Blockchain2 can be sent to the blockchain network.
[0079] When other blockchain nodes in the blockchain network receive the initialization information, they can determine whether the blockchain instance they deploy has the same blockchain identifier as the initialization information. If they have the same blockchain identifier, blockchain node A can be added to its own subnetwork.
[0080] For example, after parsing the initialization information, blockchain node B determines that it has the same blockchain identifier Blockchain1 as blockchain node A. Blockchain node B can add blockchain node A to its own subnetwork for maintaining blockchain Blockchain1.
[0081] After parsing the initialization information, blockchain node C determines that its own blockchain identifier is different from that of blockchain node A. Then blockchain node C can discard the initialization information, or blockchain node C can forward the initialization information to other nodes in the blockchain network.
[0082] In one embodiment of the present application, multiple blockchain instances deployed on a blockchain node have the same communication port. Each blockchain instance uses the same communication port to communicate data with other blockchain nodes in the blockchain network, which can ensure that the blockchain node has a unique communication positioning method in the blockchain network, avoiding the problem of trust crisis caused by a blockchain node using multiple communication ports.
[0083] In the technical solution provided in the embodiments of the present application, by deploying multiple blockchain instances on a blockchain node and configuring different blockchain identifiers for the multiple blockchain instances, initialization information can be sent to the blockchain network where the blockchain node is located according to the blockchain identifier, and then the blockchain node is added to the sub-network used to maintain the blockchain instance according to the initialization information; blockchain instances with the same blockchain identifier are deployed on each blockchain node in the sub-network, and the blockchain nodes in the sub-network are used to jointly maintain a blockchain; each blockchain node can maintain different blockchains in multiple different sub-networks, thereby realizing multi-chain reuse of blockchain nodes and improving resource utilization of blockchain nodes.
[0084] After the blockchain node is started, new blockchain instances can also be dynamically deployed according to business needs. Figure 4 The flowchart of a method for adding a blockchain instance based on a dynamic refresh mechanism in one embodiment of the present application is shown. The method is executed by a blockchain node in a blockchain network, for example, Figure 1 The client or server shown may be a node consisting of both a client and a server.
[0085] like Figure 4 As shown, the blockchain operation method based on the dynamic refresh mechanism may include the following steps S410 to S450.
[0086] S410: Obtain a blockchain template for creating a new blockchain instance.
[0087] S420: Parameters of the blockchain template are configured according to business requirements to obtain a blockchain instance for implementing the business requirements.
[0088] S430: Dynamically refresh the blockchain node to obtain the blockchain instance deployed on the blockchain node.
[0089] S440: Obtain blockchain identifiers of multiple blockchain instances deployed on a blockchain node, where the multiple blockchain instances have different blockchain identifiers.
[0090] S450: Send initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, where the initialization information is used to instruct the blockchain node to join the sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
[0091] The blockchain template can be saved locally on the client or on a remote server. Whenever new business needs arise, the blockchain template can be configured according to the business needs to obtain a blockchain instance for implementing the business needs. By dynamically refreshing the blockchain node, the newly added blockchain instance is deployed on the blockchain node. Dynamic refresh means starting the newly added blockchain instance without affecting the operation of other blockchain instances.
[0092] In one embodiment of the present application, a blockchain node can be configured with multiple virtual machines, and a blockchain instance is deployed separately in each virtual machine. Whenever a new blockchain instance is needed, the virtual machine where the newly added blockchain instance is located can be refreshed to start the newly added blockchain instance. During the startup process, the blockchain instances deployed in other virtual machines can run normally.
[0093] Figure 5 A schematic diagram of deploying a blockchain instance to a blockchain node in an application scenario according to an embodiment of the present application is shown.
[0094] like Figure 5 As shown, the blockchain node can form multiple blockchain instances deployed on the blockchain node by configuring the parameters of the blockchain template. The configuration parameters of each blockchain instance can be the same or different, and each blockchain instance has a different blockchain identifier and the same communication port network-port. For example, after starting the blockchain node, two blockchain instances can be initialized and deployed, and their blockchain identifiers are blockchain-1 and blockchain-2. During the operation of the blockchain node, new blockchain instances can also be added and deployed through dynamic refresh, for example Figure 5 In the blockchain network, the blockchain nodes with the blockchain identifier blockchain-1 jointly maintain the first blockchain, the blockchain nodes with the blockchain identifier blockchain-2 jointly maintain the second blockchain, and the blockchain nodes with the blockchain identifier blockchain-n jointly maintain the nth blockchain.
[0095] A blockchain instance can include multiple functional modules, such as virtual machine module vm, consensus module consensus, core module core, synchronization module sync, and so on.
[0096] The virtual machine module vm is a system that can understand the smart contract code and execute state transitions according to the rules defined in the code. The consensus module consensus is used to coordinate the mutually distrustful blockchain nodes through the consensus mechanism, thereby providing trusted decentralized services for upper-layer applications. The core module core contains the main logic of the blockchain, implementing functions such as P2P network protocol, transaction processing, and embedded database processing. The synchronization module sync is used to synchronize data between blockchain nodes and realize distributed storage of blockchain data.
[0097] In the embodiment of the present application, the blockchain operation initially requires two or more blockchains, and only one set of nodes needs to be generated, and the nodes are reused in different blockchains; as the business changes, the blockchain needs to be dynamically added, and the node reuse is realized on the existing nodes, without the need to open up additional resources to deploy nodes. By detecting the blockchain instance in each node, the nodes with the same instance can logically form a complete blockchain, and each blockchain instance will have its own configuration to guide the blockchain to run independently.
[0098] Figure 6 A schematic diagram of parameter configuration of a blockchain instance in an application scenario of an embodiment of the present application is shown.
[0099] like Figure 6 As shown, nodes 1, 2, 3, and 4 run two blockchain instances, blockchain-1 and blockchain-2, at the same time, but the two blockchains run independently without interfering with each other.
[0100] The parameter configurations in each blockchain instance can be the same or different. Figure 6 As shown in , the virtual machine module vm in blockchain1 can support running three different types of smart contracts: WASM, GASM, and EVM, and the consensus module consensus uses the BFT algorithm. The virtual machine module vm in blockchain2 can support running GASM-type smart contracts, and the consensus module consensus uses the RAFT algorithm.
[0101] WASM, the full name of which is WebAssembly, is a virtual machine with a stack structure based on binary operation instructions. WASM supports traditional languages such as Rust, C, and C++, and is also supported by the local JavaScript engine. GASM is a virtual machine written in the go language that is compatible with WASM. The full name of EVM is ETHereum Virtual Machine, which is a virtual machine that can use Solidity to write contract code.
[0102] Regardless of whether the configuration in the blockchain instance is the same, each blockchain instance uniquely corresponds to a blockchain identifier associated with it. The message data in the entire blockchain operation process is distinguished by the unique blockchain identifier to achieve independent operation of the blockchain.
[0103] In one embodiment of the present application, the blockchain node can be added to or removed from the sub-network maintaining the blockchain by maintaining a node record table.
[0104] When a blockchain node receives the initialization information transmitted on the blockchain network, it can add the node that sent the initialization information to the sub-network by updating the node record table.
[0105] The blockchain node that receives the initialization information can obtain a node record table associated with the blockchain instance, where the node record table is used to record the blockchain nodes that are in running state in the subnetwork that maintains the blockchain instance; obtain the node identifier of the blockchain node and the blockchain identifier of the blockchain instance according to the initialization information; and add the node identifier of the blockchain node to the node record table associated with the blockchain instance according to the blockchain identifier of the blockchain instance.
[0106] For example, blockchain node A sends initialization information carrying blockchain identifier blockchain-1 to the blockchain network. After receiving the initialization information, blockchain node B can obtain the node record table associated with the blockchain instance. Blockchain node B can obtain the node identifier of blockchain node A by parsing the received initialization information, and can also obtain the blockchain identifier blockchain-1 of the blockchain instance maintained by blockchain node A. By adding the node identifier of blockchain node A to the node record table corresponding to blockchain identifier blockchain-1, blockchain node A can be added to the subnetwork maintaining blockchain blockchain-1 on blockchain node B.
[0107] In one embodiment of the present application, in a subnetwork for maintaining a blockchain instance, consensus authentication is performed on initialization information; when the result of the consensus authentication is that the authentication is passed, the node identifier of the blockchain node is added to the node record table associated with the blockchain instance according to the blockchain identifier of the blockchain instance.
[0108] The consensus mechanisms used in blockchain networks may include, for example, POW (proof of work), POS (proof of stake), POC (proof of capacity), POA (proof of authority), and CPOC (conditional proof of capacity).
[0109] The POW consensus algorithm is to confirm the workload of network participants and give certain rewards. In the POW consensus algorithm, the initiator is required to perform a certain amount of calculations, which means that a certain amount of computing time is required. In the operation of this algorithm, network participants must first solve some complex computing problems when adding a transaction to the blockchain. This method ensures that network participants have spent a certain amount of time and money to complete the work, which shows that they will not damage the blockchain system, because damage to the system will lose their own interests.
[0110] POS is also known as proof of stake. Under this consensus algorithm, rewards are distributed according to the digital assets held by network participants and the length of time they have held them. The emergence of POS is actually to solve the problem of high energy consumption in POW, so it does not use computing functions. Network participants do not need to consume huge amounts of energy, but must have digital assets that represent this network. The more digital assets a network participant has and the longer they hold them, the more contributions the participant has made to the network, and the more trustworthy they are, and the greater the probability that the participant will receive the next block reward in the network.
[0111] POA is not an independent consensus algorithm, but a consensus algorithm that combines POW and POS. In the POA consensus algorithm, each active node first needs to continuously perform hash calculations according to the POW mechanism. When the node calculates the correct hash value and is successfully verified, it will use the block as the data source to export N random equity owners. These selected equity owners are the first recognized accounts, called validator nodes. The validator node must first authenticate its own identity. Here, it is necessary to use a widely recognized identity that exists in the public notary database. This is a mandatory process. At the same time, the POA algorithm requires all validator nodes to be online. If any validator node is not online, the generated new block will not be verified, resulting in the new block being discarded. The POA consensus algorithm will periodically count the number of discarded blocks and adjust the number of validator nodes based on this number. If the number of discarded blocks is large, the number of validator nodes will be reduced. Otherwise, the number of validator nodes will be increased.
[0112] POC is also known as proof of space. In the POC consensus algorithm, network participants use the computer's hard disk space to store pre-calculated hash values. The larger the hard disk capacity, the more hash values stored in the hard disk, and the easier it is to match the required hash values in the block network, thereby obtaining more block rewards. The POC consensus algorithm requires that the hash values be calculated in advance and stored in the hard disk, so network participants do not need to perform real-time calculations. They only need to scan the hard disk to find the hash value that matches the block to generate a new block. Compared with POW, the POC consensus algorithm can save a lot of computing time and energy consumption.
[0113] CPOC is a consensus algorithm that is upgraded on the POC consensus algorithm and adds a POS consensus mechanism. In the CPOC consensus algorithm, network participants also use hard disk space to store hash values to participate in the competition for block rewards. At the same time, network participants can also pledge their own digital assets to obtain more block rewards. CPOC uses hard disks to participate in the network. The node cost in the network is low, and idle hard disks can also be used to participate in it; digital assets held in the network can also participate in it and receive rewards, and generally speaking, the more digital assets pledged, the more block rewards network participants will receive.
[0114] In one embodiment of the present application, when a blockchain node requests to exit a blockchain network, a blockchain identifier of a blockchain instance running on the blockchain node is obtained; based on the blockchain identifier, exit information is sent to the blockchain network, where the exit information is used to instruct the blockchain node to be moved out of a subnetwork used to maintain the blockchain instance; after the blockchain node exits each subnetwork, the blockchain node is moved out of the blockchain network.
[0115] In one embodiment of the present application, in a sub-network for maintaining a blockchain instance, consensus authentication is performed on the exit information; when the result of the consensus authentication is that the authentication is passed, the blockchain node is removed from the sub-network for maintaining the blockchain instance.
[0116] The blockchain node that receives the exit information can obtain the node record table associated with the blockchain instance, and obtain the node identifier of the blockchain node and the blockchain identifier of the blockchain instance according to the exit information; and remove the node identifier of the blockchain node from the node record table according to the blockchain identifier of the blockchain instance.
[0117] Figure 7 A schematic diagram of updating blockchain nodes managed based on updating a node record table in an application scenario according to an embodiment of the present application is shown.
[0118] like Figure 7As shown in the figure, there are three blockchains, blockchain1, blockchain2 and blockchain3, in a blockchain network. Based on the node record table, the nodes actually participating in the operation of each blockchain in the current state can be recorded. For example, the sub-network maintaining blockchain blockchain1 includes nodes 1, node 2, node 3 and node 4; the sub-network maintaining blockchain blockchain2 includes nodes 1, node 2 and node 3; the sub-network maintaining blockchain blockchain3 includes nodes 1 and node 2.
[0119] When a node requests to join a sub-network, the node ID can be added to the node record table corresponding to the sub-network. For example, the initialization information sent by node 5 is received on the blockchain network, and the initialization information carries the node ID of node 5 and the blockchain ID blockchain1. According to the initialization information, node 5 can be added to the sub-network that maintains blockchain blockchain1.
[0120] When a node requests to exit a sub-network, the node ID of the node can be removed from the node record table corresponding to the sub-network. For example, if a node 2 receives an exit message on the blockchain network, the exit message carries the node ID of node 2 and the blockchain ID blockchain3. According to the exit message, node 2 can be removed from the sub-network that maintains blockchain3.
[0121] In the embodiment of the present application, although the blockchain node is reused in multiple blockchains, its network service only provides a unique communication port to the outside. In order for the blockchain nodes to isolate and not interfere with each other in the messages transmitted in different blockchains, some special processing needs to be done at the network layer. The network layer needs to logically create a node record table for each blockchain, which records the nodes actually involved in the operation of each blockchain in the current state. If a new node is triggered to join a blockchain or exit a blockchain through an external command, the network layer needs to strictly determine which blockchain the received message should act on based on the chain identifier and other information contained in the message, so as to achieve message isolation between different chains. If a node needs to exit the network, it is necessary to determine whether the node is in a node reuse state. In order not to affect the normal operation of other blockchains, it is necessary to determine that other blockchains are not in use or remove the node from other blockchains by calling SDK or other methods before the node shutdown operation can be performed.
[0122] In order to achieve message isolation between different blockchains, blockchain identifiers can be used to distinguish information from different sub-networks when interactive information is transmitted on the blockchain network.
[0123] In one embodiment of the present application, when a blockchain node requests to send interaction information to a blockchain network, a blockchain identifier of a blockchain instance that triggers the interaction information is obtained; and the interaction information carrying the blockchain identifier is sent to the blockchain network.
[0124] For example, two blockchain instances, blockchain1 and blockchain2, are deployed on blockchain node A. When blockchain node A sends interactive information to the blockchain network, if the interactive information is related to blockchain blockchain1, the interactive information needs to carry the corresponding blockchain identifier blockchain1; if the interactive information is related to blockchain blockchain2, the interactive information needs to carry the corresponding blockchain identifier blockchain2.
[0125] In one embodiment of the present application, a method for sending interactive information carrying a blockchain identifier to a blockchain network may include: obtaining a node record table associated with a blockchain instance, the node record table being used to record blockchain nodes in operation in a subnetwork that maintains the blockchain instance; and sending interactive information carrying a blockchain identifier to blockchain nodes in operation in the subnetwork.
[0126] The interactive information sent based on the node record table can realize point-to-point information transmission. In some other optional implementations, the blockchain can also broadcast and send interactive information on the blockchain network.
[0127] In one embodiment of the present application, when interaction information is received from a blockchain network, a blockchain identifier carried in the interaction information is obtained; if a blockchain instance with the same blockchain identifier as the interaction information is deployed on the blockchain node, the interaction information is processed by the blockchain instance; if a blockchain instance with the same blockchain identifier as the interaction information is not deployed on the blockchain node, the interaction information is discarded.
[0128] For example, when blockchain node B receives interactive information from blockchain node A in the blockchain network, it can parse the interactive information to obtain the blockchain identifier carried therein, for example, the blockchain identifier is blockchain1.
[0129] If a blockchain instance associated with blockchain1 is deployed on blockchain node B, it means that blockchain node B and blockchain A belong to a sub-network that jointly maintains blockchain blockchain1. At this time, the blockchain instance associated with blockchain identifier blockchain1 on blockchain node B can process the interaction information.
[0130] If the blockchain instance associated with blockchain1 is not deployed on blockchain node B, it means that blockchain node B and blockchain node A belong to different subnetworks. At this time, blockchain node B can discard the interaction information, or forward the interaction information to other blockchain nodes.
[0131] In one embodiment of the present application, after the blockchain node discards the interaction information, the information type of the interaction information can also be obtained, and the information type includes global information broadcast on the blockchain network or local information broadcast on the sub-network; if the information type of the interaction information is local information, the node exit information is sent to the blockchain network, and the node exit information is used to indicate that the blockchain node is removed from the sub-network.
[0132] When local information is discarded, it means that the blockchain node that receives the local information has withdrawn from the sub-network, but other blockchain nodes in the sub-network have failed to update the node record table in time. At this time, node withdrawal information can be sent to the blockchain network to instruct other blockchain nodes to move the current blockchain node out of the sub-network.
[0133] Figure 8 A schematic diagram of implementing blockchain node reuse in an application scenario in an embodiment of the present application is shown.
[0134] like Figure 8 As shown, in this application scenario, four nodes can be initialized, namely node 1, node 2, node 3 and node 4. Some of the blockchain nodes contain relevant configurations of two blockchain instances, blockchain1 and blockchain2.
[0135] After starting the nodes, the nodes of the same blockchain instance will exchange information to form a blockchain with a unique blockchain identifier; as shown in the figure, nodes 1, 2, 3, and 4 form blockchain 1 running according to the blockchain1 instance, and nodes 1, 2, and 3 form blockchain 2 running according to the blockchain2 instance. Nodes 1, 2, and 3 are reused in blockchains 1 and 2.
[0136] When the running blockchain nodes need to be reused, you can configure the parameters according to the blockchain template according to the actual business needs to create a new blockchain instance blockchain3; and use the refresh node command provided by the blockchain service to run the newly added blockchain instance.
[0137] like Figure 8As shown in the figure, after adding a new blockchain instance blockchain3, node 1 and node 2 will dynamically form a new blockchain 3. Node 1 and node 2 realize the reuse of blockchain 1, blockchain 2, and blockchain 3.
[0138] The communication between nodes is done by dynamically maintaining a table on the network to record the nodes included in each blockchain. The messages can be sent in a targeted manner based on the unique identifiers of different blockchains. When a node joins (or leaves) a blockchain, the record will be modified, and subsequent messages will be sent (no longer sent) to the node.
[0139] Based on the introduction of the above application scenarios, we can know that when the node is started, it will first determine whether it contains multiple blockchain instances. If there are multiple blockchain instances, the blockchain node will run in multiple blockchains at the same time; if you need to reuse it in a new blockchain, you need to create a new blockchain instance first, and run the newly added instance by dynamic refresh.
[0140] After the node is started, it can collect information such as the number of blockchain instances contained in a single node and the configuration parameters of each instance, in preparation for the subsequent running of multiple nodes on the same blockchain.
[0141] In the entire blockchain network, messages of the blockchain instance are sent and received by obtaining the information table of the running nodes of the same blockchain instance; different blockchain instances are distinguished by a unique identifier (blockchain ID).
[0142] When a node requests to be shut down, it determines whether multiple blockchain instances are running. If the node is in a state of multiple blockchain reuse, it needs to exit other blockchains, delete their related instances, and then shut down the node.
[0143] The embodiment of the present application reuses the node by creating a new blockchain instance on the running blockchain node. Each blockchain instance contains various modules required for the operation of the blockchain, and the module configurations between different instances can be the same or different; however, each node only occupies a unique communication port in the network, so multiple instances implement a sharing mode on network resources. After multiple nodes generate blockchain instances with the same configuration in this way, they can be dynamically combined into a new chain.
[0144] For example, first create a multi-node blockchain that contains only one blockchain instance. The instance of each node in the chain contains all the modules required for the operation of the blockchain, and start the blockchain.
[0145] Secondly, multiple blockchain instances are generated on a certain node. Each instance contains the same modules, but the configuration parameters can be different. Each instance exists as a separate individual. The newly added instance can be made effective by dynamically refreshing the node.
[0146] Finally, by identifying the number of blockchain instances contained in each node, the nodes of the same blockchain instance are added to the corresponding chain through the node addition operation (the same applies to deletion on the chain), so that a node can be reused in different blockchains.
[0147] It is universal for different blockchain nodes and can be operated regardless of the state of the node; different blockchain instances achieve mutual message and data isolation and do not affect each other; in the process of network resource sharing within a node, the isolation of network messages is guaranteed by maintaining the node lists in different blockchains; the running nodes can be dynamically refreshed to make new instances effective without affecting existing businesses; the node reuse method allows a node to be used in multiple blockchains, greatly improving the utilization rate of the node.
[0148] Through the embodiments of the present application, a node can be reused in multiple blockchains, saving resources for opening new nodes. The concept of table is used at the network layer to maintain node records in different blockchains, so that one node and one communication port can be reused. By loading different blockchain instances to run, the safe and effective isolation of data and message transmission is guaranteed without affecting each other.
[0149] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0150] The following introduces an embodiment of the device of the present application, which can be used to execute the blockchain operation method in the above embodiment of the present application. Fig. 9 The following schematically shows a block diagram of the blockchain operation device provided in the embodiment of the present application. Fig. 9 As shown, the blockchain operation device 900 includes:
[0151] The acquisition module 910 is configured to acquire blockchain identifiers of multiple blockchain instances deployed on a blockchain node, wherein the multiple blockchain instances have different blockchain identifiers;
[0152] The sending module 920 is configured to send initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, and the initialization information is used to instruct the blockchain node to join the sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
[0153] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0154] A template acquisition module, configured to acquire a blockchain template for creating a new blockchain instance;
[0155] A parameter configuration module is configured to perform parameter configuration on the blockchain template according to business requirements to obtain a blockchain instance for realizing the business requirements;
[0156] The node refresh module is configured to dynamically refresh the blockchain node to obtain the blockchain instance deployed on the blockchain node.
[0157] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0158] A record table acquisition module is configured to acquire a node record table associated with the blockchain instance, wherein the node record table is used to record blockchain nodes in operation in a subnetwork maintaining the blockchain instance;
[0159] An identification acquisition module is configured to acquire a node identification of the blockchain node and a blockchain identification of the blockchain instance according to the initialization information;
[0160] The identification adding module is configured to add the node identification of the blockchain node to the node record table associated with the blockchain instance according to the blockchain identification of the blockchain instance.
[0161] In some embodiments of the present application, based on the above technical solution, the identification adding module is further configured to: in the subnetwork used to maintain the blockchain instance, perform consensus authentication on the initialization information; when the result of the consensus authentication is authentication passed, according to the blockchain identifier of the blockchain instance, add the node identifier of the blockchain node to the node record table associated with the blockchain instance.
[0162] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0163] The node exit module is configured to: when the blockchain node requests to exit the blockchain network, obtain the blockchain identifier of the blockchain instance running on the blockchain node; send exit information to the blockchain network according to the blockchain identifier, and the exit information is used to indicate that the blockchain node is moved out of the subnetwork used to maintain the blockchain instance; after the blockchain node exits each of the subnetworks, move the blockchain node out of the blockchain network.
[0164] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0165] The exit consensus module is configured to: perform consensus authentication on the exit information in the sub-network used to maintain the blockchain instance; when the result of the consensus authentication is authentication passed, move the blockchain node out of the sub-network used to maintain the blockchain instance.
[0166] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0167] The information sending module is configured to: when the blockchain node requests to send interactive information to the blockchain network, obtain the blockchain identifier of the blockchain instance that triggers the interactive information; and send the interactive information carrying the blockchain identifier to the blockchain network.
[0168] In some embodiments of the present application, based on the above technical solution, the interactive information sending module is further configured to: obtain a node record table associated with the blockchain instance, wherein the node record table is used to record the blockchain nodes in operation in the subnetwork that maintains the blockchain instance; and send interactive information carrying the blockchain identifier to the blockchain nodes in operation in the subnetwork.
[0169] In some embodiments of the present application, based on the above technical solution, the blockchain operation device 900 further includes:
[0170] The information processing module is configured to: when receiving interaction information from the blockchain network, obtain the blockchain identifier carried in the interaction information; if a blockchain instance with the same blockchain identifier as the interaction information is deployed on the blockchain node, the interaction information is processed by the blockchain instance; if a blockchain instance with the same blockchain identifier as the interaction information is not deployed on the blockchain node, the interaction information is discarded.
[0171] In some embodiments of the present application, based on the above technical solution, the information processing module is further configured to: obtain the information type of the interaction information, the information type including global information broadcast on the blockchain network or local information broadcast on the sub-network; if the information type of the interaction information is the local information, then send node exit information to the blockchain network, and the node exit information is used to indicate that the blockchain node is moved out of the sub-network.
[0172] In some embodiments of the present application, based on the above technical solution, the multiple blockchain instances deployed on the blockchain node have the same communication port.
[0173] The specific details of the blockchain operation device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.
[0174] Fig.10 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0175] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0176] like Fig.10 As shown, the computer system 1000 includes a central processing unit 1001 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1002 (ROM) or the program loaded from the storage part 1008 to the random access memory 1003 (RAM). Various programs and data required for system operation are also stored in the random access memory 1003. The central processing unit 1001, the read-only memory 1002 and the random access memory 1003 are connected to each other through a bus 1004. The input / output interface 1005 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1004.
[0177] The following components are connected to the input / output interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0178] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processor 1001, various functions defined in the system of the present application are executed.
[0179] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0180] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0181] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0182] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0183] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0184] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A blockchain operation method, characterized in that: include: Obtaining blockchain identifiers of multiple blockchain instances deployed on a blockchain node, where the multiple blockchain instances have different blockchain identifiers; Initialization information is sent to the blockchain network where the blockchain node is located according to the blockchain identifier, and the initialization information is used to instruct the blockchain node to join a sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
2. The blockchain operation method according to claim 1, characterized in that: Before obtaining the blockchain identifiers of multiple blockchain instances deployed on a blockchain node, the method further includes: Get the blockchain template for creating a new blockchain instance; Parameter configuration is performed on the blockchain template according to business requirements to obtain a blockchain instance for realizing the business requirements; Dynamically refresh the blockchain node to obtain the blockchain instance deployed on the blockchain node.
3. The blockchain operation method according to claim 1, characterized in that: After sending initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, the method further includes: Obtain a node record table associated with the blockchain instance, wherein the node record table is used to record blockchain nodes in operation in a subnetwork maintaining the blockchain instance; Acquire a node identifier of the blockchain node and a blockchain identifier of the blockchain instance according to the initialization information; According to the blockchain identifier of the blockchain instance, the node identifier of the blockchain node is added to a node record table associated with the blockchain instance.
4. The blockchain operation method according to claim 3, characterized in that: According to the blockchain identifier of the blockchain instance, adding the node identifier of the blockchain node to the node record table associated with the blockchain instance includes: In a subnetwork for maintaining the blockchain instance, performing consensus authentication on the initialization information; When the result of the consensus authentication is that the authentication is passed, the node identifier of the blockchain node is added to the node record table associated with the blockchain instance according to the blockchain identifier of the blockchain instance.
5. The blockchain operation method according to claim 1, characterized in that: After sending initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, the method further includes: When the blockchain node requests to exit the blockchain network, obtaining a blockchain identifier of the blockchain instance running on the blockchain node; Sending exit information to the blockchain network according to the blockchain identifier, wherein the exit information is used to indicate that the blockchain node is moved out of the subnetwork used to maintain the blockchain instance; After the blockchain node exits each of the sub-networks, the blockchain node is removed from the blockchain network.
6. The blockchain operation method according to claim 5, characterized in that: After sending the exit information to the blockchain network, the method further includes: In a subnetwork for maintaining the blockchain instance, performing consensus authentication on the exit information; When the result of the consensus authentication is that the authentication is passed, the blockchain node is removed from the subnetwork used to maintain the blockchain instance.
7. The blockchain operation method according to any one of claims 1 to 6, characterized in that: After sending initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, the method further includes: When the blockchain node requests to send interaction information to the blockchain network, obtaining a blockchain identifier of the blockchain instance that triggers the interaction information; Sending interaction information carrying the blockchain identifier to the blockchain network.
8. The blockchain operation method according to claim 7, characterized in that: Sending interactive information carrying the blockchain identifier to the blockchain network includes: Obtain a node record table associated with the blockchain instance, wherein the node record table is used to record blockchain nodes in operation in a subnetwork maintaining the blockchain instance; Sending interaction information carrying the blockchain identifier to the blockchain nodes in operation in the subnetwork.
9. The blockchain operation method according to any one of claims 1 to 6, characterized in that: After sending initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, the method further includes: When receiving interaction information from the blockchain network, obtaining a blockchain identifier carried in the interaction information; If a blockchain instance having the same blockchain identifier as the interactive information is deployed on the blockchain node, the interactive information is processed by the blockchain instance; If a blockchain instance having the same blockchain identifier as the interactive information is not deployed on the blockchain node, the interactive information is discarded.
10. The blockchain operation method according to claim 9, characterized in that: After discarding the interaction information, the method further includes: Acquire an information type of the interaction information, where the information type includes global information broadcast on the blockchain network or local information broadcast on the subnetwork; If the information type of the interactive information is the local information, node exit information is sent to the blockchain network, where the node exit information is used to indicate that the blockchain node is moved out of the sub-network.
11. The blockchain operation method according to any one of claims 1 to 6, characterized in that: The multiple blockchain instances deployed on the blockchain node have the same communication port.
12. A blockchain operation device, characterized in that: include: An acquisition module is configured to acquire blockchain identifiers of multiple blockchain instances deployed on a blockchain node, wherein the multiple blockchain instances have different blockchain identifiers; The sending module is configured to send initialization information to the blockchain network where the blockchain node is located according to the blockchain identifier, wherein the initialization information is used to instruct the blockchain node to join a sub-network corresponding to the blockchain identifier, and the sub-network is a network composed of blockchain instances with the same blockchain identifier.
13. A computer readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is executed by the processor, the blockchain operation method described in any one of claims 1 to 11 is implemented.
14. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the executable instructions to implement the blockchain operation method as described in any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the blockchain operation method described in any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Physical security system having multiple server nodes
CN110598444A
Block chain message transmission method and device
CN113067902A
Blockchain message distribution method and device
CN113923227A
Block chain log generation method and device, electronic equipment and storage medium
CN114363162A
Block chain network management method, device, medium and electronic device
WO2019223469A1