CN113259466A - Block chain subnet operation state control method and block chain system - Google Patents

Block chain subnet operation state control method and block chain system Download PDF

Info

Publication number
CN113259466A
CN113259466A CN202110611569.1A CN202110611569A CN113259466A CN 113259466 A CN113259466 A CN 113259466A CN 202110611569 A CN202110611569 A CN 202110611569A CN 113259466 A CN113259466 A CN 113259466A
Authority
CN
China
Prior art keywords
subnet
node
blockchain
network
plug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110611569.1A
Other languages
Chinese (zh)
Other versions
CN113259466B (en
Inventor
陶友贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110611569.1A priority Critical patent/CN113259466B/en
Publication of CN113259466A publication Critical patent/CN113259466A/en
Application granted granted Critical
Publication of CN113259466B publication Critical patent/CN113259466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1048Departure or maintenance mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

One or more embodiments of the present specification provide a method for controlling an operation state of a blockchain subnet and a blockchain system; the method can comprise the following steps: a main network node in a block chain main network acquires a transaction for controlling the operation state of a block chain sub-network, and control information and a target sub-network identifier contained in the transaction are transmitted to a sub-network state control event generated by triggering after the transaction is executed; and the node equipment deploying the first main network node extracts the control information and the target subnet identification from the subnet state control event, and controls the running state of the first subnet node according to the control information under the condition that the first subnet node in the first block chain subnet corresponding to the target subnet identification is determined to be deployed locally.

Description

Block chain subnet operation state control method and block chain system
Technical Field
One or more embodiments of the present disclosure relate to the field of blockchain technologies, and in particular, to a method for controlling an operation state of a blockchain subnet and a blockchain system.
Background
The blockchain technique is built on top of a transport network, such as a point-to-point network. Nodes in the blockchain network utilize a chained data structure to validate and store data and employ a distributed node consensus algorithm to generate and update data. In a scenario where a new blockchain network is established based on an existing blockchain network system, multiple blockchain network nodes are often deployed and operated on the same node device, and therefore, in actual application, a user may want to start or close only a single blockchain network without interfering with normal operation of other blockchain networks.
Disclosure of Invention
In view of the above, one or more embodiments of the present disclosure provide a method for controlling an operation state of a blockchain subnet and a blockchain system.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, there is provided a method for controlling an operation state of a blockchain subnet, including:
a main network node in a block chain main network acquires a transaction for controlling the operation state of a block chain sub-network, and control information and a target sub-network identifier contained in the transaction are transmitted to a sub-network state control event generated by triggering after the transaction is executed;
and the node equipment deploying the first main network node extracts the control information and the target subnet identification from the subnet state control event, and controls the running state of the first subnet node according to the control information under the condition that the first subnet node in the first block chain subnet corresponding to the target subnet identification is determined to be deployed locally.
According to a second aspect of one or more embodiments herein, there is provided a blockchain system, comprising:
the block chain main network comprises a main network node in a block chain main network, a block chain sub-network state control event trigger and a block chain sub-network state control event trigger, wherein the main network node is used for acquiring a transaction for controlling the operation state of the block chain sub-network, and control information and a target sub-network identifier contained in the transaction are transmitted to the sub-network state control event generated after the transaction is executed;
and the node equipment which deploys the first main network node is used for extracting the control information and the target subnet identification from the subnet state control event, and controlling the running state of the first subnet node according to the control information under the condition that the first subnet node in the first block chain subnet corresponding to the target subnet identification is determined to be deployed locally.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
FIG. 1 is a schematic diagram of creating an intelligent contract, provided by an exemplary embodiment.
FIG. 2 is a schematic diagram of a calling smart contract provided by an exemplary embodiment.
FIG. 3 is a schematic diagram of creating and invoking an intelligent contract according to an exemplary embodiment.
Fig. 4 is a schematic diagram of building a blockchain subnet based on a blockchain master network according to an exemplary embodiment.
Fig. 5 is a flowchart of a method for controlling an operation state of a blockchain subnet according to an exemplary embodiment.
Fig. 6 is a schematic structural diagram of a blockchain system according to an exemplary embodiment.
Fig. 7 is a schematic diagram of an apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Blockchains are generally divided into three types: public chain (Public Blockchain), Private chain (Private Blockchain) and alliance chain (Consortium Blockchain). In addition, there are various types of combinations, such as private chain + federation chain, federation chain + public chain, and other different combinations. The most decentralized of these is the public chain. The public chain is represented by bitcoin and ether house, and the participators joining the public chain can read the data record on the chain, participate in transaction, compete for accounting right of new blocks, and the like. Furthermore, each participant (i.e., node) is free to join and leave the network and perform related operations. Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain can be a weakly centralized system with strictly limited and few participating nodes. This type of blockchain is more suitable for use within a particular establishment. A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; participants jointly maintain blockchain operation by authorizing to join the network and forming a benefit-related alliance.
Whether public, private, or alliance, may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed on a blockchain system triggered by a transaction. An intelligent contract may be defined in the form of code.
Taking the ethernet as an example, the support user creates and invokes some complex logic in the ethernet network, which is the biggest challenge of ethernet to distinguish from bitcoin blockchain technology. The core of the ethernet plant as a programmable blockchain is the ethernet plant virtual machine (EVM), each ethernet plant node can run the EVM. The EVM is a well-behaved virtual machine, which means that a variety of complex logic can be implemented through it. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, what the virtual machine directly runs is virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"). The intelligent contracts deployed on the blockchain may be in the form of bytecodes.
For example, as shown in fig. 1, after Bob sends a transaction containing information to create an intelligent contract to the ethernet network, the EVM of node 1 may execute the transaction and generate a corresponding contract instance. The "0 x6f8ae93 …" in fig. 1 represents the address of the contract, the data field of the transaction holds the byte code, and the to field of the transaction is empty. After agreement is reached between the nodes through the consensus mechanism, this contract is successfully created and can be invoked in subsequent procedures. After the contract is created, a contract account corresponding to the intelligent contract appears on the blockchain and has a specific address, and the contract code is stored in the contract account. The behavior of the intelligent contract is controlled by the contract code. In other words, an intelligent contract causes a virtual account to be generated on a blockchain that contains a contract code and an account store (Storage).
As shown in fig. 2, still taking an ethernet house as an example, after Bob sends a transaction for invoking an intelligent contract to the ethernet house network, the EVM of a certain node may execute the transaction and generate a corresponding contract instance. The from field of the transaction in FIG. 2 is the address of the account of the initiator of the transaction (i.e., Bob), the "0 x6f8ae93 …" in the to field represents the address of the smart contract being invoked, and the value field is the value in EtherFang that is kept in the data field of the transaction as the method and parameters for invoking the smart contract. After invoking the smart contract, the value of balance may change. Subsequently, a client can view the current value of balance through a blockchain node (e.g., node 6 in fig. 2). The intelligent contract is independently executed at each node in the blockchain network in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is completed, transaction certificates which cannot be tampered and cannot be lost are stored on the blockchain.
A schematic diagram of creating an intelligent contract and invoking the intelligent contract is shown in fig. 3. To create an intelligent contract in an ethernet workshop, the intelligent contract needs to be compiled, compiled into byte codes, deployed to a block chain and the like. The intelligent contract is called in the Ethernet workshop, a transaction pointing to the intelligent contract address is initiated, and the intelligent contract codes are distributed and run in the virtual machine of each node in the Ethernet workshop network.
It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. Such contracts are generally referred to as foundational contracts. In general, the data structure, parameters, attributes and methods of some blockchain networks may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply referred to as a system contract). In addition to EVM in the ethernet, different blockchain networks may employ various virtual machines, which is not limited herein.
After executing a transaction that invokes a smart contract, a node in the blockchain network generates a corresponding receipt (receipt) for recording information related to executing the smart contract. In this way, information about the contract execution results may be obtained by querying the receipt of the transaction. The contract execution result may be represented as an event (event) in the receipt. The message mechanism can implement message passing through events in the receipt to trigger the blockchain node to execute corresponding processing. The structure of the event may be, for example:
Event:
[topic][data]
[topic][data]
......
in the above example, the number of events may be one or more; wherein, each event respectively comprises fields of a subject (topic) and data (data). The tile chain node may perform the preset process by listening to topic of the event, in case that predefined topic is listened to, or read the related content from the data field of the corresponding event, and may perform the preset process based on the read content.
In the event mechanism, it is equivalent to that there is a client with a monitoring function at a monitoring party (e.g. a user with a monitoring requirement), for example, an SDK or the like for implementing the monitoring function is run on the client, and the client monitors events generated by the blockchain node, and the blockchain node only needs to generate a receipt normally. The passage of transaction information may be accomplished in other ways than through the event mechanism described above. For example, the monitoring code can be embedded in a blockchain platform code running at blockchain nodes, so that the monitoring code can monitor one or more data of transaction content of blockchain transactions, contract states of intelligent contracts, receipts generated by contracts and the like, and send the monitored data to a predefined monitoring party. Since the snoop code is deployed in the blockchain platform code, rather than at the snooper's client, this implementation based on snoop code is relatively more proactive than the event mechanism. The above monitoring code may be added by a developer of the blockchain platform in the development process, or may be embedded by the monitoring party based on the own requirement, which is not limited in this specification.
The blockchain technology is different from the traditional technology in one of decentralization characteristics, namely accounting is performed on each node, or distributed accounting is performed, and the traditional centralized accounting is not performed. To be a difficult-to-defeat, open, non-falsifiable data record decentralized honest and trusted system, the blockchain system needs to be secure, unambiguous, and irreversible in the shortest possible time for distributed data records. In different types of blockchain networks, in order to keep the ledger consistent among the nodes recording the ledger, a consensus algorithm is generally adopted to ensure that the consensus mechanism is the aforementioned mechanism. For example, a common mechanism of block granularity can be implemented between block nodes, such as after a node (e.g., a unique node) generates a block, if the generated block is recognized by other nodes, other nodes record the same block. For another example, a common mechanism of transaction granularity may be implemented between the blockchain nodes, such as after a node (e.g., a unique node) acquires a blockchain transaction, if the blockchain transaction is approved by other nodes, each node that approves the blockchain transaction may add the blockchain transaction to the latest block maintained by itself, and finally, each node may be ensured to generate the same latest block. The consensus mechanism is a mechanism for the blockchain node to achieve a global consensus on the block information (or called blockdata), which can ensure that the latest block is accurately added to the blockchain. The current mainstream consensus mechanisms include: proof of Work (POW), Proof of stock (POS), Proof of commission rights (DPOS), Practical Byzantine Fault Tolerance (PBFT) algorithm, HoneyBadgerBFT algorithm, etc.
Due to the decentralized characteristic of the blockchain network, all blockchain nodes in the blockchain network can maintain the same blockchain data, and the special requirements of part of nodes cannot be met. Taking a federation chain as an example, all federation members (i.e., node members in a federation) may form a blockchain network, and all federation members respectively have corresponding blockchain nodes in the blockchain network, and may obtain all transactions and related data occurring on the blockchain network through the corresponding blockchain nodes. In some cases, however, there may be some security-required transactions that some coalition members wish to complete, which may both wish to be able to verify on the blockchain or to take advantage of other advantages of blockchain technology, and avoid other coalition members from viewing the transactions and associated data. Although the federating members can additionally build a new blockchain network in a manner similar to the blockchain network including all federating members described above, the new blockchain network is built from scratch, which consumes a lot of resources and is time-consuming in both the building process and the post-building configuration process. The demand between the members of the federation is often temporary or has a certain timeliness, so that the newly-built blockchain network can quickly lose significance due to the disappearance of the demand, thereby further increasing the link establishment cost of the blockchain network. The demands among the federation members often change, and the federation members corresponding to each demand often differ, so that a new blockchain network may need to be established whenever a change occurs in a federation member, thereby causing a great waste of resources and time.
For this purpose, the established blockchain network may be used as a blockchain master network, and a blockchain sub-network may be established on the basis of the blockchain master network. Then, in a federation chain scenario such as that described above, federation members can build the required blockchain subnets on a blockchain master basis based on their own needs, already participating in the blockchain master. Because the block chain sub-networks are established on the basis of the block chain main network, compared with the process of completely and independently establishing a block chain network, the block chain sub-networks are greatly reduced in consumed resources, required time consumption and the like, and are extremely high in flexibility.
The process of quickly establishing the block chain sub-network based on the block chain main network comprises the following steps: each main network node in the block chain main network respectively acquires transactions for building a block chain sub-network so as to reveal configuration information, and when the configuration information contains identity information of a node member corresponding to a first main network node, a node device of the first main network node is deployed based on the creation block containing the configuration information and starts a first sub-network node belonging to the block chain sub-network.
The transaction for establishing the blockchain sub-network can be initiated by an administrator of the blockchain main network, that is, the administrator is only allowed to establish the blockchain sub-network on the basis of the blockchain main network, and the establishment permission of the blockchain sub-network is prevented from being opened to a common user, so that the security problem caused by the establishment permission can be prevented. In some cases, a common user of the blockchain main network may also be allowed to initiate a transaction for building the blockchain sub-network, so as to meet networking requirements of the common user, and the common user can still quickly build the blockchain sub-network under the condition that an administrator is not convenient to initiate the transaction.
For example, as shown in fig. 4, the main network of the blockchain is subnet0, and the subnet0 includes blockchain link points nodeA, nodeB, nodeC, nodeD, and nodeE. Assume nodeA, nodeB, nodeC, and nodeD wish to build a blockchain subnet: if nodeA is an administrator and only allows the administrator to initiate a transaction to build a blockchain subnet, the transaction to build the blockchain subnet can be initiated by nodeA to subnet 0; if the nodeb is an administrator and only the administrator is allowed to initiate a transaction for building the blockchain subnet, nodeb a to nodeb d need to make a request to nodeb, so that nodeb initiates the transaction for building the blockchain subnet to subnet 0; if the node E is an administrator but allows a common user to initiate the transaction of building the blockchain sub-network, the node A-node E can initiate the transaction of building the blockchain sub-network to the subnet 0. Of course, the blockchain link point initiating the transaction for building the blockchain subnet does not necessarily participate in the built blockchain subnet, regardless of the administrator or the general user, for example, although the blockchain subnet is finally built by nodeA, nodeB, nodeC and nodeD, the transaction for building the blockchain subnet may be initiated by nodeE to subnet0, but the transaction for building the blockchain subnet is not necessarily initiated by nodeA to nodeD.
When the blockchain sub-network is constructed on the basis of the blockchain main network, it is easy to understand that a logical hierarchical relationship exists between the blockchain sub-network and the blockchain main network. For example, when a blockchain subnet1 is established on the subnet0 shown in fig. 4, it can be considered that the subnet0 is at the first layer, the subnet1 is at the second layer, the subnet0 is the parent network of the subnet1, and the subnet1 is the subnet 0. And the blockchain sub-network may also constitute a corresponding blockchain sub-network, for example, another blockchain sub-network bnet3 may be further constituted on the basis of the sub-net 1 in fig. 4, at this time, it may be considered that the sub-net is in the third layer, the sub-net 1 is the parent network corresponding to the sub-net 3, the sub-net 3 is the subnet of the sub-net 1, and the sub-net 3 is the grandchild network of the sub-net 0, similarly, the sub-net 3 may still newly constitute the blockchain sub-network on the basis thereof, so that such a multi-level tree structure is formed between the blockchain networks, and in this specification, any blockchain network is managed by its corresponding parent network, that is, managed by the blockchain network constituting any blockchain network of the blockchain network, so that in the blockchain sub-network as shown in fig. 4, the main level of the blockchain is the root network, and each blockchain sub-network is the corresponding tree node sub-chain sub-network of the other blockchain sub-network, and its corresponding system is represented by any blockchain sub-chain sub-network of the blockchain system, as a specific example, when the block chain master network is a bottom layer block chain network, the block chain master network is managed by the block chain master network itself. The block chain master network in this specification may be a bottom layer block chain network, where the bottom layer block chain network refers to a block chain sub-network that is not established on the basis of other block chain networks, and therefore there is no other block chain network except the block chain master network and the block chain master network can manage the block chain master network, for example, the subnet0 in fig. 4 may be considered as a block chain master network belonging to a bottom layer block chain network type, and the subnet0 manages the subnet0 itself, and of course, the block chain master network may also be a sub-network of another block chain network, which is not limited in this specification. The block chain network tree system realizes layer-by-layer management by managing the corresponding child nodes through the father nodes, reduces the management pressure of the block chain main network, and simultaneously avoids exposing subnet information of an upper network to a lower network, thereby realizing the secret management of networks at all levels.
After the transaction for establishing the blockchain sub-network is sent to the blockchain main network, the consensus nodes in the blockchain main network perform consensus, and after the consensus is passed, each main network node executes the transaction to complete establishment of the blockchain sub-network. The consensus process depends on the consensus mechanism employed, such as any of the consensus mechanisms described above, and is not limited by the present specification.
The configuration information is included in the transaction of the block chain sub-network, and the configuration information can be used for configuring the block chain sub-network, so that the block chain sub-network meets networking requirements. For example, by including the identity information of the node members in the configuration information, it is possible to specify which blockchain nodes the constructed blockchain subnet includes.
The identity information of the node member may include a public key of the node, or other information capable of representing the node identity, such as a node ID, which is not limited in this specification. Taking a public key as an example, each blockchain node has one or more corresponding sets of public-private key pairs, and the private key is held by the blockchain node and the public key is public and uniquely corresponds to the private key, so that the identity of the corresponding blockchain node can be characterized by the public key. Therefore, for blockchain nodes that are desired to be node members of a blockchain subnet, the public keys of these blockchain nodes can be added to the transaction of the building blockchain subnet as the identity information of the node members. The public and private key pair described above may be used in the process of signature verification. For example, in a signed consensus algorithm, such as the sub net1, the above-mentioned nodeA1 signs a message with its own private key, and broadcasts the signed message in the sub net1, while nodeB1, nodeC1 and nodeD1 can verify that the received message is signed with the public key of nodeA1 to confirm that the received message is indeed from nodeA1 and has not been tampered with.
The first master network node may be a blockchain node on the blockchain master network that belongs to a node member indicated by the configuration information. When the blockchain subnet is constructed, the first master network node does not directly participate in the construction of the blockchain subnet and becomes a node member thereof, but the first subnet node needs to be generated by the node device for deploying the first master network node and becomes a node member in the blockchain subnet by the first subnet node. The first main network node and the first sub-network node correspond to the same blockchain member, for example, correspond to the same alliance chain member in an alliance chain scene, but the first main network node belongs to a blockchain main network and the first sub-network node belongs to a blockchain sub-network, so that the blockchain member can participate in the transaction of the blockchain main network and the blockchain sub-network respectively; moreover, because the blockchain main network and the blockchain sub-network belong to two mutually independent blockchain networks, the blocks generated by the first main network node and the blocks generated by the first sub-network node are respectively stored in different storages (the adopted storages can be databases, for example) on the node device, so that mutual isolation between the storages used by the first main network node and the first sub-network node respectively is realized, and thus, data generated by the blockchain sub-network can only be synchronized among the node members of the blockchain sub-network, so that the blockchain members only participating in the blockchain main network cannot obtain the data generated by the blockchain sub-network, the data isolation between the blockchain main network and the blockchain sub-network is realized, and the transaction requirements between partial blockchain members (namely, the blockchain members participating in the blockchain sub-network) are met.
It can be seen that the first master network node and the first sub-network node are logically divided block chain link points, and from the perspective of physical devices, the node devices which are equivalent to the first master network node and the first sub-network node are deployed to participate in both the block chain master network and the block chain sub-network. Since the blockchain main network and the blockchain sub-network are independent from each other, so that the identity systems of the two blockchain networks are also independent from each other, even though the first main network node and the first sub-network node may adopt the same public key, the first main network node and the first sub-network node should be regarded as different blockchain nodes. For example, in fig. 4, the nodeA in subnet0 corresponds to a first master network node, and the node device deploying the nodeA generates nodeA1 belonging to subnet1, and the nodeA1 corresponds to a first sub-network node. It can be seen that, since the identity systems are independent of each other, even if the public key adopted by the first subnet node is different from that of the first master network node, the implementation of the solution in this specification is not affected.
Of course, the node members of the blockchain sub-network are not necessarily only part of the node members of the blockchain main network. In some cases, the node members of the blockchain subnet may be completely consistent with the node members of the blockchain main network, and at this time, all the blockchain members may obtain data on the blockchain main network and the blockchain subnet, but data generated by the blockchain main network and the blockchain subnet may still be isolated from each other, for example, one type of service may be implemented on the blockchain main network, and another type of service may be implemented on the blockchain subnet, so that service data generated by the two types of services may be isolated from each other.
In addition to the identity information of the node members described above, the configuration information may include at least one of: the network identifier of the blockchain subnet, the identity information of an administrator of the blockchain subnet, the attribute configuration for the blockchain platform code, and the like, which are not limited in this specification. The network identifier is used to uniquely characterize the blockchain subnet, and thus the network identifier of the blockchain subnet should be distinguished from the blockchain main network and other blockchain subnets established on the blockchain main network. Identity information of an administrator of the blockchain subnet, such as a public key of a node member as the administrator; the administrators of the blockchain main network and the blockchain sub-network may be the same or different.
One of the advantages of building the blockchain subnet by using the blockchain master network is that since the first master network node is already deployed on the node device generating the first subnet node, the blockchain platform code used by the first master network node can be multiplexed on the first subnet node, so that repeated deployment of the blockchain platform code is avoided, and the building efficiency of the blockchain subnet is greatly improved. Then, if the configuration information does not include the attribute configuration for the blockchain platform code, the first subnet node may reuse the attribute configuration adopted on the first master network node; if the configuration information includes the attribute configuration for the blockchain platform code, the first subnet node may adopt the attribute configuration, so that the attribute configuration adopted by the first subnet node is not limited by the attribute configuration of the first main network node and is not related to the first main network node. The attribute configuration for blockchain platform code may include at least one of: code version number, whether consensus is required, type of consensus algorithm, block size, etc., which is not limited in this specification.
The transactions that make up the blockchain subnet include transactions that invoke contracts. The address of the invoked smart contract, the method invoked and the incoming parameters may be specified in the transaction. For example, the contract invoked may be the aforementioned startup contract or system contract, the method invoked may be a method that builds a blockchain subnet, and the incoming parameters may include the configuration information described above. In one embodiment, the transaction may contain the following information:
from:Administrator
to:Subnet
method:AddSubnet(string)
string:genesis
the from field is information of the initiator of the transaction, such as administeror indicating that the initiator is an Administrator; the to field is the address of the intelligent contract being called, for example, the intelligent contract may be a Subnet contract, and the to field is specifically the address of the Subnet contract; the method field is a called method, for example, the method used in the Subnet contract to build the blockchain Subnet may be AddSubnet (string), and string is a parameter in the AddSubnet () method, and the value of the parameter is represented by the aforementioned example, which is specifically the aforementioned configuration information.
Take the example that nodes nodeA-nodeS on Subnet0 execute a transaction that invokes the AddSubnet () method in the Subnet contract. After the transaction passes the consensus, nodeA-nodeE respectively execute the AddSubnet () method and transmit configuration information to obtain corresponding execution results.
The execution result of the contract may include the configuration information, and the execution result may be in the receipt as described above, and the receipt may contain the event related to the execution of the adsubnet () method, i.e., the networking event. The topoc of a networking event may contain a predefined networking event identification to distinguish it from other events. For example, in an event related to the execution of the AddSubnet () method, the content of topic is a keyword subnet, and the keyword is distinguished from topic in the event generated by other methods. Then, nodeA to nodeE can determine to monitor the event related to executing the AddSubnet () method, that is, the networking event, when the topic including the keyword subnet is monitored by monitoring topic included in each event in the generated receipt. For example, the events in the receipt are as follows:
Event:
[topic:other][data]
[topic:subnet][data]
......
then, when the nodeA-nodeE monitors the 1 st event, the event is determined to be irrelevant to the AddSubnet () method because the contained topic content is other; and when the 2 nd event is monitored by the nodeA to nodeE, determining that the event is related to the AddSubnet () method because the contained topic content is subnet, and further reading a data field corresponding to the event, wherein the data field comprises the configuration information. Taking the example that the configuration information includes the public key of the node member of the blockchain subnet, the content of the data field may include, for example:
{subnet1;
the public key of nodeA, the IP of nodeA, port number … of nodeA;
public key of nodeB, IP of nodeB, port number … of nodeB;
public key of nodeC, IP of nodeC, port number … of nodeC;
the public key of nodeD, the IP of nodeD, port number … of nodeD;
}
where subnet1 is the network identification of the blockchain subnet that one wishes to create. Each blockchain link point in the blockchain master network may record network identifiers of all blockchain subnets that have been created on the blockchain master network, or other information related to the blockchain subnets, which may be maintained in the Subnet contract, for example, and may specifically correspond to values of one or more contract states included in the Subnet contract. Then, nodeA-nodeE can determine whether the subnet1 already exists according to the recorded network identifiers of all the created subnet block chains; if not, subnet1 is the new blockchain subnet that needs to be created currently, and if so, subnet1 is already present.
In addition to the network identifier of the new blockchain subnet that is desired to be created, a predefined new network identifier may be used, which indicates that the corresponding networking event is used to create the new blockchain subnet. For example, the subnet1 may be replaced by newsbnet, where newsbnet is a predefined new network identifier, and when the nodeA to nodeE recognize that the data field includes newsbnet, it may be determined that an event including newsbnet is a networking event and a new blockchain subnet needs to be created.
Besides the network identification subnet1, the data field also contains the identity information of each node member. The node device deploying the first master network node may monitor the generated receipt, and obtain, by the node device deploying the first master network node, configuration information or an innovation block included in the networking event when the networking event is monitored and the content of the networking event indicates that the first master network node belongs to the node member. For example, when determining that subnet1 is a blockchain subnet that needs to be newly built, nodeA to nodeE further identify the identity information of the node members included in the data field to determine their own processing methods. For example, the nodeA to nodeD may find that the data field includes identity information such as their own public key, IP address, and port number, and assume that nodeA to nodeD are respectively deployed on node devices 1 to 4, taking nodeA and node device 1 as an example: the nodeA triggers the node device 1, so that the node device 1 obtains the configuration information from the data field based on the message mechanism and generates a created block containing the configuration information, and the node device 1 deploys the nodeA1 locally, and then loads the generated created block by the nodeA1, so as to form 1 node member in subnet 1; similarly, nodeB will trigger NodeB1 to be generated by node device 2, nodeC will trigger NodeC1 to be generated by node device 3, and nodeD will trigger NodeD1 to be generated by node device 4. And the nodeE finds that the identity information contained in the data field is not matched with the nodeE, and if the nodeE is deployed on the node device 5, the node device 5 does not generate a creation block according to the configuration information in the data field, and does not generate a node in the subnet1.
As mentioned above, the first master network node and the first subnet node do not necessarily adopt the same identity information. Therefore, in the above embodiment, the data field may include the identity information previously generated for nodeA 1-nodeD 1, and is different from the identity information of nodeA-nodeD. Taking nodeA and node device 1 as an example: if identity information of nodeA1 is found in the data field, node device 1 may generate a created block, deploy nodeA1, and load the created block by nodeA1, or if identity information of nodeA1 is found in the data field, nodeA may trigger node device 1 to generate a created block, deploy nodeA1, and load the created block by nodeA 1; the nodeB-nodeD processing modes are similar, and are not described in detail here.
In addition to configuration information, the execution results of the contract may include a foundational block. In other words, in addition to the configuration information contained in the data field, the created block containing the configuration information may be directly generated in the process of executing the contract call, so that the created block is contained in the data field, and for the nodeA to nodeD described above, the corresponding node devices 1 to 4 may directly obtain the created block from the data field through a message mechanism without self-generation, so that the deployment efficiency of nodeA1 to nodeD1 may be improved.
In this specification, the transaction for creating the blockchain subnet may not be a transaction for calling an intelligent contract, so that the blockchain network that does not support the intelligent contract may also implement the technical solution of this specification, thereby quickly creating the blockchain subnet on the basis of the blockchain main network. For example, a group network transaction type identifier may be predefined, and when a transaction includes the group network transaction type identifier, it indicates that the transaction is used for building a new blockchain subnet, that is, the transaction is a transaction for building a blockchain subnet. The blockchain platform code may include related processing logic for component blockchain subnets, so that when a first master network node running the blockchain platform code performs a transaction, if the transaction is found to include the above networking transaction type identifier, and the first master network node belongs to a node member indicated by configuration information in the transaction, a node device deploying the first master network node may be triggered to generate an innovation block including the configuration information and start the first subnet node based on the above processing logic, and the innovation block is loaded by the first subnet node to form a blockchain node in the blockchain subnet.
The node device realizes the deployment of a blockchain node on the node device by creating an instance of running blockchain platform codes in the process. For the first master network node, a first instance is created by the node device in the above process and formed by the first instance running blockchain platform code. Similarly, for the first subnet node, a second instance different from the first instance is created by the node device in the above process, and is formed by the second instance running the blockchain platform code. For example, the node device may first create a first instance in a process to form a first blockchain node in a blockchain master network; when the node member corresponding to the node device wishes to participate in building the blockchain subnet, a second instance may be created in the process, where the second instance is different from the first instance, and forms a second blockchain node in the blockchain subnet. When the first instance and the second instance are located in the same process, the cross-process interaction is not involved, so that the deployment difficulty of the first subnet node can be reduced, and the deployment efficiency can be improved. Of course, the second instance may be in a different process on the node device than the first instance, and this specification does not limit this. In fact, each block link point deployed on any node device referred to in the embodiments of this specification is a different block chain instance running on any node device, blocks generated by each block link point deployed on any node device are respectively stored in different storages (for example, a database) on any node device, and the storages used by each block link point deployed on any node device are mutually isolated; for example, the node device may create a first instance in a first process to form a first blockchain node in a blockchain master network; when the node member corresponding to the node device wishes to participate in building the blockchain subnet, a second process different from the first process may be started, and a second instance different from the first instance may be created in the second process, so that the second blockchain node in the blockchain subnet is formed by the second instance.
By the method, the block chain sub-network can be created on the block chain main network. Taking fig. 4 as an example, the subnet0 originally includes nodeA to nodeE, and can construct subnet1 on the basis of subnet0, where subnet1 includes nodeA1 to nodeD1, and nodeA1, nodeB and nodeB1, nodeC and nodeC1, and nodeD1 are respectively disposed on the same node device. Similarly, a subnet2 or more block chain subnets can be constructed on subnet0, where subnet2 includes nodeA2, nodeB2, nodeC2, and nodeE2, and nodeA1, nodeA2, nodeB1, nodeB2, nodeC1, nodeD1, and nodeE2 are respectively deployed on the same node device. And, subnet1, subnet2, etc. may be used as a blockchain main network, and a blockchain subnet is further constructed on the basis, for example, a blockchain subnet3 is constructed on the basis of subnet1, the process is similar to the construction of subnet1 or subnet2, only the blockchain is replaced by a main blockchain subnet1, which is not described herein, and finally, the subnet3 includes nodeA3, nodeB3 and nodeC3, so that nodeA and nodeA1, nodeA2, nodeA3, nodeB and nodeB1, nodeB2, nodeB3, nodeC and nodeC1, nodeC2 and nodeC3 are respectively deployed on the same node device.
In this way, a blockchain subnet is established, and the node members included in the blockchain subnet are determined by the configuration information described above. Therefore, in the above scenario of building a blockchain subnet based on a blockchain main network, a plurality of blockchain nodes are often deployed on the same node device, for example, nodeA1, and nodeA2 in fig. 4 are deployed on the same node device, so that when a user, such as an administrator, wishes to control the operation state of subnet1, it is related to starting or closing the blockchain link point corresponding to subnet1 in each node device, and specifically, it is necessary to control the starting or closing of nodeA1 to D1 respectively corresponding to node devices 1 to 4. Therefore, how to independently control the operation state of a specific blockchain subnet and how to control the specific blockchain subnet without interfering with the normal operation of other blockchain subnets is a necessary requirement in this scenario.
Therefore, the present specification provides a method for controlling an operation state of a blockchain subnet, which can independently control an operation state of a specific blockchain subnet without interfering with normal operations of other blockchain subnets under the condition that a blockchain subnet is established and managed by a blockchain main network.
Fig. 5 is a flowchart of a method for controlling an operation state of a blockchain subnet according to an exemplary embodiment. As shown in fig. 5, the method includes:
step 502, a master network node in a blockchain master network acquires a transaction for controlling the operation state of a blockchain subnet, and control information and a target subnet identifier contained in the transaction are transmitted to a subnet state control event generated by triggering after the transaction is executed.
Similar to the transaction for establishing the blockchain subnet, the transaction for controlling the operation state of the blockchain subnet may be initiated by an administrator of the blockchain main network, or may allow an ordinary user of the blockchain main network to initiate the transaction for establishing the blockchain subnet.
The transactions that control the operational state of the blockchain subnet include transactions that invoke contracts. The address of the invoked smart contract, the method invoked and the incoming parameters may be specified in the transaction. For example, the called contract may be the aforementioned startup contract or system contract, the called method may be a method that controls the running state of the blockchain subnet, and the incoming parameters may include the control information and the target subnet identification described above. In one embodiment, the transaction may contain the following information:
from:Administrator
to:Subnet
method:ControlSubnet(string)
the from field is information of the initiator of the transaction, such as administeror indicating that the initiator is an Administrator; the to field is the address of the intelligent contract being called, for example, the intelligent contract may be a Subnet contract, and the to field is specifically the address of the Subnet contract; the method field is a called method, for example, a method used in a Subnet contract for building a blockchain Subnet may be control Subnet (string), and string is a parameter in a ControlSubnet () method, including the above-mentioned control information and target Subnet identification, the control information may include Subnet start, Subnet close, and Subnet switch, where a Subnet switch refers to switching the operating state of a specific blockchain Subnet from a current state to another state.
Take the example that nodes nodeA to nodeE on Subnet0 in fig. 4 execute a transaction that invokes the ControlSubnet () method in the Subnet contract. After the transaction passes the consensus, nodeA-nodeE respectively execute a ControlSubnet () method and transmit a parameter string to obtain a corresponding execution result.
The contract execution result may include the receipt as described above, where the receipt may include an event related to executing the ControlSubnet () method, that is, a subnet state control event, and the corresponding topic is a keyword ControlSubnet, so that the nodeA-nodeE or the node devices 1 to 5 deploying the nodeA-nodeE may determine to monitor the event related to executing the ControlSubnet () method, that is, the subnet state control event, by monitoring the topic included in each event in the generated receipt, in the case that the topic including the keyword ControlSubnet is monitored. For example, the events in the receipt are as follows:
Event:
[topic:other][data]
[topic: ControlSubnet][data]
......
then, when the 1 st event is monitored, the event is determined to be irrelevant to a ControlSubnet () method because the contained content of topic is other; and when the 2 nd event is monitored, determining that the event is related to a ControlSubnet () method because the contained topic content is ControlSubnet, and further reading a data field corresponding to the event, wherein the data field comprises the control information and the target subnet identification. Taking the subnet identification corresponding to the subnet identification 1 as the target subnet identification and the subnet shutdown with the control information as the subnet, the data field may include, for example:
{stop;subnet1}
here, stop is control information, and subnet1 is a subnet identifier of a subnet of the blockchain that is desired to be controlled, and thus the subnet state control event corresponds to a control task of "closing subnet 1". In the process of executing the transaction and generating the above-mentioned Subnet state control event, each host node in the blockchain host may update the Subnet contract state of the Subnet1 recorded in the Subnet contract, and update the running state of the Subnet1, so that the running state of the Subnet1 in the contract state can correctly reflect the running state of the Subnet1 after the completion of the current control, for example, in this example, a field indicating the running state in the Subnet contract state corresponding to the Subnet1 is updated to "Subnet state close", which represents that the Subnet1 will be in a closed state after the completion of the current control process. The subnet contract state includes, in addition to the running state of subnet1, various types of subnet information of subnet1, including subnet identification, public key and consensus type information of node members, plugin configuration information, creation block, etc., and is recorded in the world state of subnet 0.
The transaction of the control block chain sub-network is not necessarily executed after being sent to the block chain main network, before the transaction is executed, each main network node in the block chain main network can firstly check whether the first block chain sub-network corresponding to the target sub-network identifier is under the management of the block chain main network according to the target sub-network identifier contained in the transaction, and when the first block chain sub-network can be determined to be under the management of the block chain main network, the transaction can be executed.
For example, each master node in the blockchain master network may search whether a target subnet identifier is included in a subnet list corresponding to the blockchain master network, and when the subnet list includes the target subnet identifier, the transaction is executed, otherwise the transaction is not executed, where the subnet list corresponding to the blockchain master network records information such as subnet identifiers, operating states, node members, and the like of each blockchain subnet managed by the blockchain master network, and the subnet list may be maintained in a blockchain platform code of each master node, or may be maintained in a contract state of a system contract. By performing the preliminary inspection on the transaction configuration information, the transaction can be avoided from being executed when the block chain sub-network corresponding to the transaction is determined not to be under the management of the block chain main network, so that the computing resource and the time resource of the block chain system are saved. Furthermore, in the process of the above-mentioned preliminary check, a check of the control information contained in the transaction may be added, for example, when it is determined that the first blockchain subnet is under the management of the blockchain main network, it may be further checked whether the control information matches with the operation state of the first blockchain subnet, and the transaction is finally approved to be executed only if the control information matches with the operation state of the first blockchain subnet. The matching of the control information and the operation state of the first blockchain subnet means that when the control information is used for switching the first blockchain subnet from the first operation state to the second operation state and the first blockchain subnet is in the first operation state, the control information is confirmed to be matched with the operation state of the first blockchain subnet, for example, when the first operation state is an open state, the second operation state is a closed state; when the first operation state is the closed state, the second operation state is the open state. More specifically, the matching of the control information with the operation state includes any one of the following cases: the control information is subnet startup and the operation state of the block chain subnet is a closed state, the control information is subnet shutdown and the operation state of the block chain subnet is an open state, and the control information is subnet switching.
The preliminary verification process described above may occur prior to the consensus on the transaction, where the transaction is directly discarded without participating in the consensus mechanism; or may occur after a consensus mechanism for the transaction, in which case the transaction may be tagged with an illegal tag and not executed by the respective primary network node; still alternatively, it may occur during a pre-processing stage of transaction execution, where although the transaction has been executed, it is checked out that it is illegal, thereby immediately abandoning execution of subsequent processes and recording the result and reason of the failure of the execution of the transaction in a receipt generated after the execution of the transaction.
When the transaction received by each main network node in the block chain main network does not contain control information, the control information is defaulted as preset control information; and when the target subnet identification is not contained in the transaction of the control block chain subnet operation state, the target subnet identification is defaulted as a preset subnet identification. In this embodiment of the present specification, when detecting that a method field of a received transaction includes controlsubnet (string), each primary network node can determine that the transaction is a transaction for controlling an operation state of a block chain subnet, so as to further read specific parameters in the string, and if there is a lack of control information or a target subnet identifier in the string, fill preset control information or the target subnet identifier in the string of the transaction, thereby ensuring that execution of subsequent transactions and a control process do not have errors. The preset control information or the target subnet identifier may be preset, or may be obtained by each master network node according to a unified algorithm, for example, each master network node is provided with the following logic in a blockchain platform code or an intelligent contract called by the transaction: if the method field in the received transaction is controlsubnet (string) and the parameter string is empty or partially missing, when the control information in the string is missing, the method is defaulted to be subnet switching; and when the target subnet identification in string is missing, defaulting the target subnet identification as the subnet identification of the first blockchain subnet constructed by the blockchain main network.
Step 504, the node device deploying the first master network node extracts the control information and the target subnet identification from the subnet state control event, and controls the operation state of the first subnet node according to the control information under the condition that it is determined that the first subnet node in the first block chain subnet corresponding to the target subnet identification is deployed locally.
The node device deploying the first master network node may directly monitor a receipt generated after a contract is executed, and extract the control information and the target subnet identification from the subnet status control event when it is monitored that the receipt includes the subnet status control event. Or, the first master network node may monitor a receipt generated after the contract is executed, and trigger the node device deploying the first master network node to extract the control information and the target subnet identifier from the subnet state control event when it is monitored that the receipt contains the subnet state control event.
Each node device deployed with a master network node maintains a respective local subnet list, each local subnet list records a subnet identifier of a blockchain subnet to which each subnet node locally deployed by the corresponding node device belongs, and then a subnet identifier of a blockchain subnet to which each subnet node locally deployed by the node device belongs is recorded in a local subnet list maintained by the node device deployed with a first master network node, so that the node device can determine whether the first subnet node in the first blockchain subnet corresponding to the target subnet identifier has been locally deployed by inquiring whether the local subnet list maintained by the node device itself contains the target subnet identifier.
Taking fig. 4 as an example, it is assumed that nodeA to nodeE on subnet0 are respectively deployed on node devices 1 to 5, and therefore, in addition to a main network node nodeA, node device 1 is also deployed with subnet nodes nodeA1 belonging to subnet1 and subnet nodes nodeA2 belonging to subnet2, for node device 1, subnet identifiers of subnet1 and subnet2 are recorded in a local subnet list locally maintained, and if a target subnet identifier extracted by node device 1 through a subnet state control event is subnet1 and is included in a local subnet list maintained by the node device 1, node device 1 may determine that a nodeA1 corresponding to subnet1 is locally deployed, and at this time, node device 1 may control an operating state of nodeA1 according to control information; for the node device 5, a node e belonging to subnet0 and a node e2 belonging to subnet2 are locally deployed, so that a subnet identifier of subnet2 is recorded in a local subnet list maintained by the node device 5, and a target subnet identifier, subnet1 is not included in the local subnet list maintained by the node device 5, so that the node device 1 may determine that a blockchain node corresponding to subnet1 is not locally deployed, and at this time, the node device 5 does not perform any operation. Similarly, after completing the above-mentioned flow, the node devices 2, 3, and 4 respectively control the operation states of nodeB1, nodeB1, and nodeB1 in subnet1 according to the control information, thereby jointly completing the control of the operation states of all subnet nodes in subnet1 under the cooperation of each node device, that is, completing the process of controlling the operation state of the subnet1, which is a block chain subnet.
The subnet identification included in the local subnet list can be obtained by monitoring a subnet information query event through the node device, the subnet information query event is generated by executing a subnet information query transaction for calling a subnet management contract on the block chain master network through the first master network node, the subnet information query event includes subnet information of each block chain subnet under the management of the block chain master network, and the subnet information includes subnet identification and node member identity information. For example, after extracting the target subnet identifier from the subnet state control event, the node device 1 may initiate a subnet information query transaction to a subnet management contract on the blockchain main network, and monitor a subnet information query event generated after the subnet management contract executes the transaction, where a topic keyword of the subnet information query transaction is ListSubnet, a data field includes subnet information of each blockchain subnet managed by the blockchain main network, including subnet identifiers of each blockchain subnet, node member identity information, an operating state, plug-in configuration information, and the subnet information query event may be expressed in the following form:
[topic: ListSubnet][data]
after being monitored by the node device 1, reading the content in the data field (only showing the subnet identification and the node membership information part) as follows:
{subnet1:nodeA1,nodeB1,nodeC1,nodeD1;
subnet2:nodeA2,nodeB2,nodeC2,nodeE2;}
the prefixes subnet1 and subnet2 represent subnet identifiers of the blockchain subnet, and the suffixes nodeA1 and the like represent node identity information of subnet nodes, such as node public keys. The node device 1 compares the identity information of each node maintained by itself with the content in the data field, finds the blockchain subnet to which the subnet node deployed by itself belongs, for example, the node device 1 maintains the identity information of nodeA1 and nodeA2, and the subnet identifications of the block chain subnet corresponding to the corresponding subnet node in the data field are subnet1 and subnet2, therefore, the node device 1 can determine that subnet nodes corresponding to subnet1 and subnet2 have been locally deployed, and join subnet1 and subnet2 into the local subnet list, in another embodiment, the node device 1 may initiate the subnet information inquiry transaction to the subnet management contract in advance, thus a list of local subnets containing subnet1 and subnet2 has been maintained, when the target subnet id extracted by the node device 1 through the subnet state control event is subnet1, it is not necessary to initiate a subnet information query transaction to the subnet management contract. The contract state of each block chain Subnet managed by the block chain main network is maintained in the contract state of the Subnet management contract, and the Subnet contract state corresponding to each block chain Subnet records the Subnet identification of the corresponding block chain Subnet, the public key and common identification type information of the node member, the plug-in configuration information, the creation block and the like.
As described above, the node device may determine whether the first subnet node in the first blockchain subnet corresponding to the target subnet identifier has been deployed locally by querying a local subnet list maintained by the node device, and in another embodiment, after obtaining the data field of the above-mentioned subnet information query event, the node device may also determine whether the first subnet node in the first blockchain subnet corresponding to the target subnet identifier is deployed locally directly according to the subnet information of each blockchain subnet in the data field, without using or sorting out the local subnet list, for example, the node device 1 extracts the target subnet identifier of the subnet1 through the subnet state control event, in this case, the node device 1 may query directly according to the target subnet identifier in the above-mentioned data field, and obtain the identity information of the subnet node corresponding to the subnet1 as nodeB1, nodeB1, nodeB1, nodeB1, then comparing the self-maintained identity information nodeA1 and nodeA2 with the self-maintained identity information, and judging whether the self-maintained identity information contains the self-maintained identity information, wherein if the self-maintained identity information contains the self-maintained identity information, the local deployment can be determined to have the target subnet identification.
Each block chain sub-network under the management of the block chain main network can comprise a block chain sub-network established under the block chain main network, and can also comprise a block chain sub-network which is not established under the block chain main network. Generally, a blockchain subnet established on any blockchain network is managed by any blockchain network, for example, if a subnet1.1 with nodeA3 and nodeB3 as node members is created on the basis of subnet1, subnet1 acquires the management right of subnet1.1, and can control the operation state of subnet1.1, while subnet0 cannot manage subnet1.1, in this scenario, a node device may use different rights management for different blockchain networks, for example, when a monitored event belongs to subnet0, the node device may only read a local subnet list corresponding to subnet0 when completing various operations in response to the event, and the local subnet list only includes the identifier of the blockchain subnet managed by subnet0, that is, subnet1 and subnet2, and subnet 1.539 does not include subnet1.
However, by some means, cross-layer management of subnet0 may be achieved, enabling subnet0 to manage subnet 1.1. For example, subnet0 may add subnet information about subnet1.1 obtained from parent network subnet1 of subnet1.1 to the contract state of subnet management contract on subnet0 through cross-chain technology, so that subnet0 obtains the management right of subnet1.1, and a subsequent host network node on subnet0 may write subnet information of subnet1.1 into a subnet information query event through a subnet information query transaction, so that each node device adds subnet information of subnet1.1 to the local subnet list of the corresponding right of subnet 0; alternatively, an administrative right transfer transaction may be issued on the subnet1, so that after monitoring an administrative right transfer event generated after the administrative right transfer transaction is executed, each node device adds subnet information of subnet1.1 in the local subnet list of the authority corresponding to the subnet1 to the local subnet list of the authority corresponding to the subnet0 at the node device level, so that although the contract state of the subnet management contract on the subnet0 does not record subnet information of subnet1.1, the subnet information of subnet1.1 may be read from the local subnet list of the authority corresponding to the subnet0 when the node device monitors an event occurring in the subnet0, and thus the subnet0 is substantially enabled to obtain the administrative right to subnet 1.1.
In addition to determining whether the first subnet node in the first blockchain subnet corresponding to the target subnet identifier is locally deployed, the node device deployed with the first master network node may determine whether to control the operating state of the first subnet node through other checking manners, for example, when it is determined that the first subnet node is locally deployed, it is further determined whether the control information extracted in the subnet state control event matches the operating state of the first blockchain subnet, and when it is determined that the control information matches the operating state of the first blockchain subnet, the operating state of the first subnet node is finally controlled according to the control information. As described above, the subnet state query event includes not only the subnet identifier and the node member identity information of each blockchain subnet, but also the operating state of each blockchain subnet, so that the local subnet list corresponding to the node device deployed with the first master network node records the operating state of the blockchain subnet to which each subnet node belongs, in addition to the subnet identifier of the blockchain subnet to which each subnet node belongs, in the local subnet list, and therefore, the node device deployed with the first master network node can query whether the operating state of the blockchain subnet corresponding to the target subnet identifier in the local subnet list matches with the control information extracted in the subnet state control event, so that when the control information matches with the operating state of the first subnet node, the operating state of the first subnet node is controlled according to the control information. The foregoing has explained various cases regarding the control information matching the operating state of the first subnet node, and is not described here in detail. In this embodiment of the present specification, before controlling the first subnet node, the node device needs to perform multiple checking manners to check whether the node device can normally execute the control task indicated by the subnet state control event currently, and control the operating state of the first subnet node according to the control information, so as to ensure that no error occurs in the control process. When the node device is not deployed with the first subnet node corresponding to the first blockchain subnet indicated by the subnet state control event, it is described that the operation state of controlling the first blockchain subnet is irrelevant to the node device, so that the node device does not need to do any operation, and only needs to keep normal operation of itself, or when the node device is deployed with the first subnet node corresponding to the first blockchain subnet, but the operation state corresponding to the first blockchain subnet is not matched with the control information indicated by the subnet state control event, for example, when the first blockchain subnet is already in a closed state and the control information is also the subnet closed, no operation is needed at this time, thereby avoiding performing meaningless control process in advance.
After passing through the above verification process, the node device confirms that it can normally execute the control task corresponding to the subnet state control event, and controls the operating state of the first subnet node according to the control information, which is described in detail below.
In the blockchain network system referred to in this specification, each blockchain link point deployed on a node device is substantially a different blockchain instance running on the node device and formed by respective plug-in modules, and each node device is deployed with a corresponding plug-in manager for managing the plug-in modules on which each blockchain node (including a master network node and a sub network node) deployed on the corresponding node device depends during running, that is, the plug-in modules for forming each blockchain link point. Therefore, the node device may control the plug-in manager corresponding to the first subnet node to start or close the plug-in module for forming the first subnet node according to the control information, for example, when the control information is subnet shutdown, the node device controls the plug-in manager to close the plug-in module for forming the first subnet node; when the control information is subnet starting, the node equipment control plug-in manager starts a plug-in module for forming a first subnet node; when the control information is subnet switching, the node device control plug-in manager switches the plug-in module for forming the first subnet node to another operation state according to the current operation state of the first subnet node.
In one case, only one shared plug-in manager is deployed in a certain node device, and is used to manage plug-in modules corresponding to all block link points deployed under the node device, specifically, plug-in configuration information of each locally deployed block link node is maintained in the shared plug-in manager, and since plug-in modules of different block link nodes in the same block link network are often the same, the plug-in configuration information of a block link node is generally the same as the plug-in configuration information of the block link network to which the block link node belongs, and certainly, the plug-in modules of different block link nodes in the same block link network may also be different. The plug-in configuration information of the blockchain node is used to indicate a specific plug-in module constituting the certain blockchain node, and may include: a business network plug-in, a service plug-in, a P2P (peer-to-peer) plug-in, a blockchain subnet management plug-in, a Cache plug-in, a verification plug-in, an event management plug-in, a consensus plug-in, a synchronization plug-in, an execution plug-in, a blockchain plug-in, a storage plug-in, etc., which are not limited in this specification.
In another case, a certain node device may individually allocate a corresponding independent plug-in manager according to each blockchain node deployed by the node device, so that the independent plug-in manager only maintains plug-in configuration information of the corresponding blockchain node, and is specially responsible for managing plug-in modules of the corresponding blockchain node, such as a plug-in module that opens, closes, and replaces the corresponding blockchain node.
As described above, the subnet state query event may include plug-in configuration information of each blockchain subnet, and the plug-in configuration information of each blockchain subnet includes plug-in configuration information of each subnet node under the blockchain subnet, so that the node device may determine the plug-in configuration information of the locally deployed subnet node according to the identity information of the node device itself, and therefore, the local subnet list corresponding to the node device may record the plug-in configuration information of the blockchain subnet to which each locally deployed subnet node belongs, and therefore, the plug-in manager deployed in the node device can obtain the plug-in configuration information of each blockchain node locally deployed by the node device by reading the local subnet list.
After confirming that the node device can normally execute the control task corresponding to the subnet state control event, the node device controls the plug-in manager corresponding to the first subnet node so as to start or close the plug-in module for forming the first subnet node according to the control information. For example, when the node device 1 extracts, from the subnet control event, that the control information is subnet shutdown and the target subnet identifier is the subnet identifier corresponding to subnet1, in one case, the node device 1 may control the subnet node corresponding to subnet1, that is, the independent plug-in manager of nodeA1, so that the independent plug-in manager of nodeA1 closes the plug-in module for constituting nodeA1 according to the plug-in configuration information of nodeA 1; in another case, the node device 1 may control the shared plugin manager, so that the shared plugin manager searches for plugin configuration information of the subnet node corresponding to the subnet1, that is, the nodeA1, and closes the plugin modules used for forming the nodeA1 according to the plugin configuration information of the nodeA 1.
Different blockchain nodes on a node device may rely on the same plug-in module at runtime, and such plug-ins are shared plug-ins. For example, the currently opened tile link node on node device 1 includes nodeA and nodeA1, the plug-in modules for forming nodeA include plug-in 1.0, plug-in 2.0, plug-in 3.0 and plug-in 4.0, and the plug-in modules for forming nodeA1 include plug-in 1.1, plug-in 2.0, plug-in 3.1, plug-in 4.1 and plug-in 5.1, where plug-in 1.0 and plug-in 1.1, plug-in 3.0 and plug-in 3.1, plug-in 4.0 and plug-in 4.1 are of the same type and have the same plug-in function, but two different plug-in modules are still embedded in different tile link nodes respectively and do not share information with each other, and are essentially of different plug-in modules. The plug-in 2.0 is depended on by nodeA and nodeA1 at the same time, so that a plug-in module used by two or more blockchain nodes at the same time like the plug-in 2.0 belongs to a shared plug-in under the node device 1, and a corresponding plug-in module depended on by only one blockchain node independently belongs to an independent plug-in under the node device 1, for example, the above-mentioned plug-ins except the plug-in 2.0 all belong to independent plug-ins.
The plug-in manager deployed on the node device maintains a plug-in information attribute list according to the plug-in configuration information and the running state of each locally deployed blockchain node, and is used for marking attribute information of all plug-in modules, including whether the plug-ins are shared plug-ins or independent plug-ins, dependency relationships with other plug-in modules and the like. For example, after the plugin manager reads the local subnet list, it finds that only the subnet0 and subnet1 are plug-in configuration information of the nodeA and nodeA1 respectively corresponding to the subnet0 and subnet1 which are currently in an open state, and then compares the plug-in configuration information with the plugin 2.0 commonly used by the nodeA and nodeA1, so that the plug-in 2.0 in the plugin information attribute list is marked as a shared plug-in, and after the subnet1 is closed, the plugin manager reads the local subnet list again to find that only the subnet0 is the subnet of the subnet in the open state, and only the obtained plugin configuration information of the nodeA can be found, so that no shared plug-in exists at this time, and the plug-in 2.0 in the plugin information attribute list is changed from the shared plug-in to an independent plug-in. In addition to obtaining the plug-in configuration information and the running state of each locally deployed subnet node through the subnet information of each block chain subnet in the local subnet list, the plug-in manager can also separately maintain the plug-in configuration information and the running state of each locally deployed main network node and each subnet node, and automatically update the maintained running state and other information after the control of the corresponding subnet node is completed, so that the attribute information of each plug-in module in the plug-in information attribute list can be updated more timely and accurately.
Due to the existence of the shared plug-in, when the node device starts or closes the plug-in module for forming the first subnet node according to the control information, the node device needs to avoid closing or repeatedly starting the shared plug-in, so as to prevent the normal operation of the first subnet node or other block chain nodes from being influenced. That is, the node device may start or close, according to the control information, a plug-in module other than the shared plug-in module in the first subnet node, where the shared plug-in module is used by the first subnet node and at least one other blockchain node deployed in the node device, and the other blockchain node is in use. Specifically, when the node device 1 extracts, from the subnet control event, that the control information is subnet shutdown and the target subnet identifier is the subnet identifier corresponding to subnet1, the node device 1 may obtain, by using the plugin manager, plugin configuration information of the subnet node nodeb1 corresponding to subnet1 and exclude shared plugins in the plugin configuration information, for example, plugin configuration information of nodeb1 is "plugin 1.1, plugin 2.0, plugin 3.1, plugin 4.1, and plugin 5.1", and a plugin information attribute list maintained by the plugin manager indicates that the plugin 2.0 is a shared plugin, so that the node device excludes the plugin configuration information from plugin 2.0 to obtain final plugin configuration information of "plugin 1.1, plugin 3.1, plugin 4.1, and plugin 5.1", and close corresponding plugin module plugins 1.1, plugin 3.1, plugin 4.1, and plugin 5.1 according to the final plugin configuration information.
The plug-in manager maintains the dependency relationship between the plug-in modules. If normal operation of plug-in A necessarily requires that plug-in B already be operational, then it can be assumed that there is a dependency between plug-in A and plug-in B, and that plug-in A depends on plug-in B, which can be denoted as "plug-in A → plug-in B". The dependency relationship between the plug-in modules related in the plug-in manager may be pre-established or predefined by the system, and recorded in the plug-in information attribute list, as shown in table 1, according to the dependency relationship between the plug-ins, two dependency relationships may be obtained by sorting: "insert A → insert B → insert D", "insert C → insert D and insert E".
Figure 186779DEST_PATH_IMAGE001
When the node device starts or closes the plug-in modules for forming the first subnet node according to the control information, the plug-in modules of the first subnet node can be started or closed according to the start-stop sequence among the plug-in modules forming the first subnet node according to the control information; and the start-stop sequence is related to the dependency relationship among all the plug-in modules. Specifically, assuming that the plug-in modules constituting the first subnet node are plug-in a, plug-in B, and plug-in D, and the dependency relationship is "plug-in a → plug-in B → plug-in D", in the case of closing the plug-in modules constituting the first subnet node, the closing order is the same as the dependency order, and is also "plug-in a → plug-in B → plug-in D", by closing the upper layer plug-in module having dependency first and then closing the lower layer plug-in module having no dependency; in the case of starting the plug-in modules for forming the first subnetwork node, the starting sequence will be opposite to the dependency sequence, i.e. "plug-in D → plug-in B → plug-in a", so that the upper-layer plug-in module which is not dependent on itself is started first, and then the upper-layer plug-in module which is dependent on itself is started. In the scheme, the start-stop sequence is determined according to the dependency relationship among the plug-in modules, so that the situation that the plug-in modules run wrongly due to lack of the dependent plug-ins in the start-stop process can be avoided, data loss and even node crash can be avoided, and meanwhile, the memory resources are fully used and released.
For example, when the node device 1 extracts, from the subnet control event, that the control information is subnet shutdown and the target subnet identification is subnet identification corresponding to subnet1, the node device 1 may obtain, by the plugin manager, that the plugin configuration information of the subnet node nodeb1 corresponding to subnet1 is "plugin 1.1, plugin 2.0, plugin 3.1, plugin 4.1, and plugin 5.1", and that the corresponding dependency is "plugin 1.1 → plugin 3.1 → plugin 2.0", "plugin 4.1 → plugin 5.1", since the control information is subnet shutdown, it is determined to obtain a shutdown order of "plugin 1.1 → 3.1 → 2.0", "plugin 4.1 → plugin 5.1", where the plugins 1.1, plugin 3.1, and plugin 2.0 are shutdown in the order of "plugin 1.1 → 3.1 → plugin 2.0", and the corresponding node shutdown modules are shutdown in the order of "plugins 1.1 → plugin 5.1", "5.1 → plugins 4.1", "5.0", thus, the lossless shutdown effect is achieved, and of course, when the plug-in 2.0 is a shared plug-in, the shutdown sequence of the plug-in 1.1 → the plug-in 3.1 → the plug-in 2.0 "may be replaced by the plug-in 1.1 → the plug-in 3.1", that is, the plug-in 2.0 as the shared plug-in is not shut down, so that the normal operation of other subnet nodes is not affected.
Fig. 6 is a schematic block diagram of a blockchain system according to an exemplary embodiment. As shown in fig. 6, the blockchain system includes:
a master network node in the block chain master network 600, configured to acquire a transaction for controlling an operation state of a block chain subnet, where control information and a target subnet identifier included in the transaction are transmitted to a subnet state control event generated by triggering after the transaction is executed;
the node device deployed with the first master network node 601 is configured to extract the control information and the target subnet identifier from the subnet state control event, and control the operating state of the first subnet node according to the control information when it is determined that the first subnet node in the first block chain subnet corresponding to the target subnet identifier is locally deployed.
Optionally, the method further includes:
the node equipment determines whether a first subnet node is deployed locally or not by inquiring a local subnet list maintained by the node equipment;
the local subnet list is used for recording subnet identifications of block chain subnets to which each subnet node belongs, wherein the subnet nodes are locally deployed by the node device.
Optionally, the controlling the operation state of the first subnet node according to the control information includes:
and under the condition that the control information is determined to be matched with the running state of the first block chain sub-network, controlling the running state of the first sub-network node according to the control information.
Optionally, the determining that the control information matches the operating state of the first subnet node includes:
and when the control information is matched with the running state of the first blockchain subnet corresponding to the target subnet identification in a local subnet list, determining that the control information is matched with the running state of the first blockchain subnet, wherein the local subnet list comprises the subnet identifications and the running states of the blockchain subnets to which the subnet nodes locally deployed by the node equipment belong.
Optionally, the method further includes:
the master node in the block chain master network 600 agrees to execute the transaction if it is determined that the first block chain sub-network is under the management of the block chain master network 600 and the control information matches with the operating state of the first block chain sub-network.
Optionally, when the control information is used to switch the first blockchain subnet from the first operating state to the second operating state, and the first blockchain subnet is in the first operating state, the control information is determined to be matched with the operating state of the first blockchain subnet.
Alternatively to this, the first and second parts may,
when the first running state is an opening state, the second running state is a closing state; when the first operation state is the closed state, the second operation state is the open state.
Optionally, the controlling, by the node device, the operating state of the first subnet node according to the control information includes:
and the node equipment controls a plug-in manager corresponding to the first subnet node so as to start or close a plug-in module for forming the first subnet node according to the control information.
Alternatively to this, the first and second parts may,
the plug-in manager is a shared plug-in manager corresponding to all block link points deployed on the node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager that is applied to the first subnet node separately.
Optionally, the node device starts or closes a plug-in module for forming the first subnet node according to the control information, including:
and the node equipment determines plug-in configuration information corresponding to the first subnet node through the plug-in manager, and starts or closes a plug-in module corresponding to the plug-in configuration information and used for forming the first subnet node according to the control information.
Optionally, the node device starts or closes a plug-in module for forming the first subnet node according to the control information, including:
and the node equipment starts or closes plug-in modules except for the shared plug-in the first subnet node according to the control information, wherein the shared plug-in is a plug-in module which is commonly used by the first subnet node and at least one other block chain node deployed in the node equipment and is used by the other block chain nodes.
Optionally, a dependency relationship between plug-in modules is maintained in a plug-in manager deployed by the node device; the node device starts or closes a plug-in module for forming a first subnet node according to the control information, and the method comprises the following steps:
the node equipment starts or closes the plug-in modules of the first subnet node according to the control information according to the start-stop sequence among the plug-in modules forming the first subnet node; and the start-stop sequence is related to the dependency relationship among all the plug-in modules.
Optionally, the method further includes:
and when the control information is not contained in the transaction of the control block chain subnet operation state, the control information is defaulted as the preset control information.
And when the target subnet identification is not contained in the transaction of the control block chain subnet operation state, the target subnet identification is defaulted as a preset subnet identification.
Optionally, the transaction controlling the operation state of the blockchain subnet comprises a transaction invoking a contract.
Optionally, the contracts include startup contracts or system contracts.
Optionally, an operating state of the first block chain subnet is maintained in the contract state of the contract; wherein the transaction controlling the operational state of the blockchain subnet further triggers the contract to update the operational state of the first blockchain subnet in the contract state.
Optionally, the extracting, by the node device, the control information and the target subnet identifier from the subnet state control event includes:
the first master network node 601 monitors a receipt generated after the contract is executed, triggers the node device to acquire the subnet state control event contained in the receipt, and extracts the control information and the target subnet identifier from the subnet state control event; alternatively, the first and second electrodes may be,
and the node equipment acquires the subnet state control event contained in the receipt by monitoring the receipt generated after the contract is executed, and extracts the control information and the target subnet identification from the subnet state control event.
Alternatively to this, the first and second parts may,
the transaction controlling the operational state of the blockchain subnetwork is initiated by the administrator of the blockchain main network 600; alternatively, the first and second electrodes may be,
the transaction that controls the operational state of the blockchain subnetwork is initiated by the normal user of the blockchain main network 600.
Optionally, each blockchain node deployed on the node device is a different blockchain instance running on the node device.
Optionally, the blocks generated by the link points of each block deployed by the node device are respectively stored in different storages on the node device.
Optionally, the storages respectively used by the link points of each block deployed by the node device are isolated from each other.
Optionally, the storage is a database.
Optionally, the block chain main network 600 is a bottom layer block chain network; alternatively, the blockchain main network 600 is a subnet managed by other blockchain networks.
Fig. 7 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 7, at the hardware level, the apparatus includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile storage 710, but may also include hardware required for other services. One or more embodiments of the present description can be implemented in software, such as by the processor 702 reading corresponding computer programs from the non-volatile storage 710 into the memory 708 and then executing. Of course, besides the software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution main body of the processing flow in the above scheme is not limited to each logic unit, and may also be hardware or a logic device.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (24)

1. A control method for operation state of a block chain subnet comprises the following steps:
a main network node in a block chain main network acquires a transaction for controlling the operation state of a block chain sub-network, and control information and a target sub-network identifier contained in the transaction are transmitted to a sub-network state control event generated by triggering after the transaction is executed;
and the node equipment deploying the first main network node extracts the control information and the target subnet identification from the subnet state control event, and controls the running state of the first subnet node according to the control information under the condition that the first subnet node in the first block chain subnet corresponding to the target subnet identification is determined to be deployed locally.
2. The method of claim 1, further comprising:
the node equipment determines whether a first subnet node is deployed locally or not by inquiring a local subnet list maintained by the node equipment;
the local subnet list is used for recording subnet identifications of block chain subnets to which each subnet node belongs, wherein the subnet nodes are locally deployed by the node device.
3. The method of claim 1, the controlling an operational state of the first subnet node according to the control information, comprising:
and under the condition that the control information is determined to be matched with the running state of the first block chain sub-network, controlling the running state of the first sub-network node according to the control information.
4. The method of claim 3, the determining that the control information matches an operational state of the first subnet node, comprising:
and when the control information is matched with the running state of the first blockchain subnet corresponding to the target subnet identification in a local subnet list, determining that the control information is matched with the running state of the first blockchain subnet, wherein the local subnet list comprises the subnet identifications and the running states of the blockchain subnets to which the subnet nodes locally deployed by the node equipment belong.
5. The method of claim 1, further comprising:
and the master network node in the block chain master network agrees to execute the transaction when determining that the first block chain sub-network is under the management of the block chain master network and the control information is matched with the running state of the first block chain sub-network.
6. The method of any of claims 3-5, wherein the control information is determined to match the operational state of the first blockchain subnet when the control information is used to switch the first blockchain subnet from the first operational state to the second operational state and the first blockchain subnet is in the first operational state.
7. The method of claim 6, wherein the first and second light sources are selected from the group consisting of,
when the first running state is an opening state, the second running state is a closing state; when the first operation state is the closed state, the second operation state is the open state.
8. The method of claim 1, the node device controlling an operational state of the first subnet node according to the control information, comprising:
and the node equipment controls a plug-in manager corresponding to the first subnet node so as to start or close a plug-in module for forming the first subnet node according to the control information.
9. The method of claim 8, wherein the first and second light sources are selected from the group consisting of,
the plug-in manager is a shared plug-in manager corresponding to all block link points deployed on the node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager that is applied to the first subnet node separately.
10. The method according to claim 8, wherein the node device starts or closes a plug-in module for constituting the first subnet node according to the control information, comprising:
and the node equipment determines plug-in configuration information corresponding to the first subnet node through the plug-in manager, and starts or closes a plug-in module corresponding to the plug-in configuration information and used for forming the first subnet node according to the control information.
11. The method according to claim 8, wherein the node device starts or closes a plug-in module for constituting the first subnet node according to the control information, comprising:
and the node equipment starts or closes plug-in modules except for the shared plug-in the first subnet node according to the control information, wherein the shared plug-in is a plug-in module which is commonly used by the first subnet node and at least one other block chain node deployed in the node equipment and is used by the other block chain nodes.
12. The method of claim 8, wherein a dependency relationship between plug-in modules is maintained in a plug-in manager of the node device deployment; the node device starts or closes a plug-in module for forming a first subnet node according to the control information, and the method comprises the following steps:
the node equipment starts or closes the plug-in modules of the first subnet node according to the control information according to the start-stop sequence among the plug-in modules forming the first subnet node; and the start-stop sequence is related to the dependency relationship among all the plug-in modules.
13. The method of claim 1, further comprising:
when the control information is not contained in the transaction of the control block chain subnet operation state, the control information is defaulted as the preset control information;
and when the target subnet identification is not contained in the transaction of the control block chain subnet operation state, the target subnet identification is defaulted as a preset subnet identification.
14. The method of claim 1, the transaction that controls the state of operation of the blockchain subnet comprising a transaction that invokes a contract.
15. The method of claim 14, the contract comprising a startup contract or a system contract.
16. The method of claim 14, wherein an operational state of a first blockchain subnet is maintained in a contract state of the contract; wherein the transaction controlling the operational state of the blockchain subnet further triggers the contract to update the operational state of the first blockchain subnet in the contract state.
17. The method of claim 14, the node device extracting the control information and the target subnet identification from the subnet state control event, comprising:
the first main network node monitors a receipt generated after the contract is executed, triggers the node equipment to acquire the subnet state control event contained in the receipt, and extracts the control information and the target subnet identification from the subnet state control event; alternatively, the first and second electrodes may be,
and the node equipment acquires the subnet state control event contained in the receipt by monitoring the receipt generated after the contract is executed, and extracts the control information and the target subnet identification from the subnet state control event.
18. The method of claim 1, wherein the first and second light sources are selected from the group consisting of,
the transaction controlling the operational state of the blockchain subnetwork is initiated by an administrator of the blockchain main network; alternatively, the first and second electrodes may be,
the transaction controlling the operational state of the blockchain subnetwork is initiated by an ordinary user of the blockchain primary network.
19. The method of claim 1, each blockchain node deployed on the node device being a different blockchain instance running on the node device.
20. The method of claim 1, wherein the blocks generated by the link points of the blocks deployed by the node device are stored in different storages on the node device.
21. The method of claim 20, wherein the storage used by each block link point of the node device deployment is isolated from each other.
22. The method of claim 20, said storing being a database.
23. The method of claim 1, the block chain master network being an underlay block chain network; or, the blockchain main network is a subnet managed by other blockchain networks.
24. A blockchain system, comprising:
the block chain main network comprises a main network node in a block chain main network, a block chain sub-network state control event trigger and a block chain sub-network state control event trigger, wherein the main network node is used for acquiring a transaction for controlling the operation state of the block chain sub-network, and control information and a target sub-network identifier contained in the transaction are transmitted to the sub-network state control event generated after the transaction is executed;
and the node equipment which deploys the first main network node is used for extracting the control information and the target subnet identification from the subnet state control event, and controlling the running state of the first subnet node according to the control information under the condition that the first subnet node in the first block chain subnet corresponding to the target subnet identification is determined to be deployed locally.
CN202110611569.1A 2021-06-02 2021-06-02 Block chain subnet operation state control method and block chain system Active CN113259466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110611569.1A CN113259466B (en) 2021-06-02 2021-06-02 Block chain subnet operation state control method and block chain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110611569.1A CN113259466B (en) 2021-06-02 2021-06-02 Block chain subnet operation state control method and block chain system

Publications (2)

Publication Number Publication Date
CN113259466A true CN113259466A (en) 2021-08-13
CN113259466B CN113259466B (en) 2021-10-15

Family

ID=77185890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110611569.1A Active CN113259466B (en) 2021-06-02 2021-06-02 Block chain subnet operation state control method and block chain system

Country Status (1)

Country Link
CN (1) CN113259466B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710350A (en) * 2022-03-31 2022-07-05 蚂蚁区块链科技(上海)有限公司 Allocation method and device for callable resources

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108900549A (en) * 2018-08-15 2018-11-27 深圳区块大陆科技有限公司 A kind of safe block chain networking technology
CN109508968A (en) * 2018-10-25 2019-03-22 常州唯康信息科技有限公司 Block catenary system and its control method
US20190190896A1 (en) * 2017-12-18 2019-06-20 International Business Machines Corporation Protecting sensitive data in a distributed ledger system using a blockchain channel hierarchy
CN110298755A (en) * 2019-06-21 2019-10-01 普洛斯科技(重庆)有限公司 A kind of block chain method of commerce and device
CN110602096A (en) * 2019-09-12 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment in block chain network
CN112163950A (en) * 2020-09-25 2021-01-01 湖南和信安华区块链科技有限公司 Block chain network construction method and system convenient for expansion and node resource reuse and terminal equipment
US20210144017A1 (en) * 2019-09-12 2021-05-13 Tencent Technology (Shenzhen) Company Limited Method and apparatus for replacing identity certificate in blockchain network, storage medium, and computer device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190190896A1 (en) * 2017-12-18 2019-06-20 International Business Machines Corporation Protecting sensitive data in a distributed ledger system using a blockchain channel hierarchy
CN108900549A (en) * 2018-08-15 2018-11-27 深圳区块大陆科技有限公司 A kind of safe block chain networking technology
CN109508968A (en) * 2018-10-25 2019-03-22 常州唯康信息科技有限公司 Block catenary system and its control method
CN110298755A (en) * 2019-06-21 2019-10-01 普洛斯科技(重庆)有限公司 A kind of block chain method of commerce and device
CN110602096A (en) * 2019-09-12 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment in block chain network
US20210144017A1 (en) * 2019-09-12 2021-05-13 Tencent Technology (Shenzhen) Company Limited Method and apparatus for replacing identity certificate in blockchain network, storage medium, and computer device
CN112163950A (en) * 2020-09-25 2021-01-01 湖南和信安华区块链科技有限公司 Block chain network construction method and system convenient for expansion and node resource reuse and terminal equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李聪,雷波,解冲锋,李云鹤: "基于区块链技术的可信网络", 《电信科学》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710350A (en) * 2022-03-31 2022-07-05 蚂蚁区块链科技(上海)有限公司 Allocation method and device for callable resources
CN114710350B (en) * 2022-03-31 2024-04-02 蚂蚁区块链科技(上海)有限公司 Method and device for distributing callable resources, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113259466B (en) 2021-10-15

Similar Documents

Publication Publication Date Title
CN113067904B (en) Method for building block chain sub-network and block chain system
CN113067894B (en) Method for node to exit block chain sub-network
CN113067895B (en) Method for building block chain sub-network and block chain system
CN113067902B (en) Block chain message transmission method and device
CN113067897B (en) Cross-chain interaction method and device
CN113098982B (en) Block chain message transmission method and device
CN113067899B (en) Method and device for starting/closing block link point service
CN113259458B (en) Method and device for starting/closing block link point service
CN113259457B (en) Information synchronization method and device for block chain sub-network
CN113067914B (en) Method and device for distributing subnet identification, electronic equipment and storage medium
CN113067896B (en) Method for adding node in block chain sub-network and block chain system
CN113259120B (en) Method for synchronizing node information lists
CN113259117B (en) Method for synchronizing node information lists
CN113326290B (en) Cross-network query control method
CN113055190B (en) Access control method for client
CN113259464B (en) Method for building block chain sub-network and block chain system
CN113259466B (en) Block chain subnet operation state control method and block chain system
CN113259118A (en) Method for synchronizing node information lists
CN113259459B (en) Block chain subnet operation state control method and block chain system
CN113259236B (en) Transaction forwarding method between block chain networks
CN113067774B (en) Transaction forwarding method between block chain networks
CN113259237B (en) Transaction forwarding method between block chain networks
CN114363162A (en) Block chain log generation method and device, electronic equipment and storage medium
CN114363349B (en) Block chain sub-network starting method and device
CN113098984B (en) Method for forming multi-layer block chain system based on registration mechanism and block chain system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant