CN113067899A - Method and device for starting/closing block link point service - Google Patents

Method and device for starting/closing block link point service Download PDF

Info

Publication number
CN113067899A
CN113067899A CN202110611553.0A CN202110611553A CN113067899A CN 113067899 A CN113067899 A CN 113067899A CN 202110611553 A CN202110611553 A CN 202110611553A CN 113067899 A CN113067899 A CN 113067899A
Authority
CN
China
Prior art keywords
node
block chain
plug
blockchain
network
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
CN202110611553.0A
Other languages
Chinese (zh)
Other versions
CN113067899B (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 CN202110611553.0A priority Critical patent/CN113067899B/en
Publication of CN113067899A publication Critical patent/CN113067899A/en
Application granted granted Critical
Publication of CN113067899B publication Critical patent/CN113067899B/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 
    • H04L67/1048Departure or maintenance 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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/44Star or tree networks
    • 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 disclosure provide a method for starting/closing a block chain node service, where the method is applied to a tree system in which a block chain main network is a root node and each block chain sub-network is other nodes, where any block chain sub-network in the tree system is managed by a block chain network corresponding to its parent node, and the method for starting the block chain node service includes: the method comprises the steps that first node equipment obtains starting control information of a block chain node service; the first node equipment determines the corresponding node branch of the block chain network to which each block chain link point belongs in the tree system according to the subnet management list respectively maintained by each locally deployed block chain link point; the block chain network management method comprises the following steps that a subnet management list maintained by any block chain node is used for recording a block chain subnet managed by a block chain network to which any block chain node belongs; and the first node equipment responds to the starting control information and sequentially starts the corresponding block chain link points of each node in the node branches on the first node equipment according to the direction from the root node to the leaf node.

Description

Method and device for starting/closing block link point service
Technical Field
One or more embodiments of the present disclosure relate to the field of blockchain technology, and more particularly, to a method and apparatus for enabling/disabling blockchain point services.
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 of establishing a new blockchain network based on an existing blockchain network system, multiple blockchain network nodes are often deployed and operated on the same node device, when a user wishes to start or close the node device, the user will start or close multiple blockchain network nodes having a management relationship with each other, and if the user cannot perform the operation according to a certain flow and rules, the node device is likely to crash.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for enabling/disabling a block link point service, where the 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 disclosure, a method for starting a blockchain node service is provided, where the method is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to a parent node of the blockchain sub-network, where the method includes:
the method comprises the steps that first node equipment obtains starting control information of a block chain node service;
the first node equipment determines the corresponding node branch of the block chain network to which each block chain link point belongs in the tree system according to the subnet management list respectively maintained by each locally deployed block chain link point; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the first node equipment responds to the starting control information and sequentially starts the corresponding block chain link points of each node in the node branches on the first node equipment according to the direction from the root node to the leaf node.
According to a second aspect of one or more embodiments of the present specification, there is provided a method for closing a blockchain link point service, where the method is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to its parent node, where the method includes:
the first node equipment acquires closing control information of a block chain node service;
the first node equipment determines the corresponding node branch of the block chain network to which each block chain link point belongs in the tree system according to the subnet management list respectively maintained by each locally deployed block chain link point; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the first node equipment responds to the closing control information and sequentially closes the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the leaf nodes to the root nodes.
According to a third aspect of one or more embodiments of the present specification, there is provided an apparatus for starting a blockchain node service, where the apparatus is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to a parent node of the blockchain sub-network, the apparatus including:
the control information acquisition module is used for enabling the first node equipment to acquire starting control information of the block chain node service;
a node branch determining module, configured to enable the first node device to determine, according to a subnet management list maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the node starting module is used for enabling the first node equipment to respond to the starting control information and sequentially starting the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the root node to the leaf nodes.
According to a fourth aspect of one or more embodiments of the present specification, there is provided an apparatus for closing a blockchain link point service, where the apparatus is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to a parent node of the blockchain sub-network, the apparatus including:
the control information acquisition module is used for enabling the first node equipment to acquire closing control information of the block chain node service;
a node branch determining module, configured to enable the first node device to determine, according to a subnet management list maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the node closing module is used for enabling the first node equipment to respond to the closing control information and sequentially close the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the leaf nodes to the root nodes.
According to a fifth aspect of one or more embodiments of the present specification, there is provided an electronic device including:
a processor; a memory for storing processor-executable instructions; the processor executes the executable instructions to implement the steps of the open/close block link point service method.
According to a sixth aspect of one or more embodiments of the present specification, there is provided a computer-readable storage medium having stored thereon executable instructions; wherein the instructions, when executed by the processor, implement the steps of the method for turning on/off block link point services described above.
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 initiating a blockchain node service according to an exemplary embodiment.
Fig. 6 is a flowchart of a method for turning off block-link point service according to an exemplary embodiment.
Fig. 7 is a schematic diagram of an apparatus according to an exemplary embodiment.
Fig. 8 is a block diagram of an apparatus for initiating a blockchain node service according to an exemplary embodiment.
Fig. 9 is a block diagram of an apparatus for shutting down block-link point service 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 subnet 1.
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-mentioned multi-level tree system scenario composed of a blockchain main network and a plurality of blockchain sub-networks, a plurality of blockchain nodes are often deployed on the same node device, for example, nodeA1, nodeA2 and nodeA3 in fig. 4 are deployed on the same node device 1, so that when a user such as an administrator wishes to start or close the blockchain node service of the node device 1, it is involved to start or close each blockchain node deployed in the node device 1, specifically, it is necessary to control the middle nodeA, nodeA1, nodeA2 and nodeA3 deployed in the node device 1 to start or close, while the middle nodeA, nodeA1, nodeA2 and nodeA3 respectively correspond to a sub 0, a sub 6338, a sub 2 and a sub 63 3 have a certain hierarchical relationship of a net, and the high network is managed by a sub-sublet of a neighboring network, such as a sub-network 0 and a sub-network 0, so that the subnet0 can control the activation or deactivation of subnet1 and subnet2 but cannot control subnet3, and therefore, if the activation or deactivation of each partition link point is not performed according to a certain flow sequence, some partition link points may not be managed normally, and even the node device may be crashed.
Therefore, the present specification provides a control method for starting/closing a block link point service, which can control a node device to sequentially start/close each block link point according to a management sequence of a block chain network to which each block link point is deployed, in a tree system in which any block chain subnet is managed by a block chain network corresponding to a parent node of the block chain subnet, thereby realizing safe and lossless starting/closing of the block link point service of the node device.
Fig. 5 is a flowchart of a method for initiating a blockchain node service according to an exemplary embodiment. As shown in fig. 5, the method is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to its parent node, and the method includes:
step 502, the first node device obtains start control information of the blockchain node service.
In this case, the first node device may obtain the start control information of the blockchain link point service in a manner of monitoring a receipt of the node service for starting the transaction, where it is noted that the blockchain link point service in this embodiment refers to a blockchain tree system formed by a predetermined blockchain main network and blockchain sub-networks, and therefore, although the first node device does not start a corresponding blockchain link point of the blockchain main network or blockchain sub-network before starting the blockchain node service, the first node device may have other blockchain network corresponding to other blockchain networks except the blockchain main network or the blockchain sub-network And the other blockchain nodes are in an open state, so that theoretically, the first node device can also obtain the starting control information of the blockchain node service by monitoring the receipt of the node service starting transaction executed on the other blockchain nodes under the condition that the blockchain node service is not started. In an embodiment, the node devices with the master network node are all deployed with other blockchain nodes corresponding to other blockchain networks, so that a node service start transaction can be initiated on the other blockchain networks, so that each node device can acquire start control information of a blockchain linked point service by monitoring a receipt of the transaction and control the start of the master network node and the subnet node, thereby implementing a start process of the whole blockchain tree system composed of the blockchain master network and the blockchain subnet.
The first node device may also obtain the start control information of the block link node service through multiple ways, for example, the start control information of the block link node service may be obtained directly by receiving a node service start message sent by an administrator of the tree system, or may be obtained by receiving a node service start message sent by an ordinary user of the tree system, which is not limited in this specification.
The start control information may include identity information corresponding to the first node device, for example, an IP address, a port number, or a held public key indicating an identity of the first node device. As described above, a receipt for starting a node transaction or a node service start message may include identity information, so that start control information of a block chain link point service acquired by a first node device includes the identity information, and when the first node device detects that the start control information includes the identity information of the first node device itself, a subsequent process for starting a block chain node service is further executed, so that a node service start transaction initiated on another block chain network or a node service start message broadcasted to each node device can control a specific node device to start the block chain link point service.
Step 504, the first node device determines, according to the subnet management lists respectively maintained by the locally deployed block link points, node branches corresponding to the block chain network to which the block link points belong in the tree system; and the subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs.
Determining the node branch corresponding to the block chain network to which each block chain link point belongs in the tree system in the present specification actually refers to determining which block chain nodes are locally deployed by the first node device and the management relationship among the block chain nodes, and this process needs to be implemented by searching a subnet management list respectively maintained by the first node device according to each locally deployed block chain link point. The first node device firstly checks a locally maintained master network management list, wherein the master network management list records identity information of each blockchain node in a blockchain master network, the first node device determines that a first master network node corresponding to the blockchain master network is locally deployed under the condition that the self-maintained identity information is included in the master network management list, and then searches a subnet management list maintained by the first master network node, wherein subnet information of all blockchain subnets managed by the blockchain master network, including subnet identification, operating state, node member identity information and the like, is recorded in the list, and the first node device determines that blockchain nodes corresponding to one or more blockchain subnets managed by the blockchain master network are locally deployed under the condition that the self-maintained identity information is included in the subnet management list, so as to determine whether the subnet management list maintained by the one or more blockchain nodes includes the first node device self-maintained by the first node device or not The identity information of the local deployment node is further determined, and so on, until the newly determined local deployment node does not maintain the corresponding subnet management list or the corresponding subnet management list does not contain the identity information maintained by the first node device itself, the process of searching and determining the local deployment node is stopped, and finally the block chain network to which each block node belongs is determined to be the corresponding node branch in the tree system, and the block chain network recorded in the subnet management list maintained by any block node corresponds to the sub-node of the block chain network to which any block chain node belongs.
In step 506, the first node device responds to the start control information, and sequentially starts the block link points corresponding to the nodes in the node branches on the first node device according to the direction from the root node to the leaf nodes.
In this embodiment, each block link point deployed on the first node device is substantially a different block chain instance running on the first node device and formed by a respective plug-in module, and meanwhile, the first node device is deployed with a plug-in manager corresponding to any block link point, which is used for managing a plug-in module on which any block chain node (a master network node or a sub network node) deployed on the first node device depends when running, that is, a plug-in module used for forming any block chain node. Therefore, the starting or closing of any blockchain node by the first node device in the embodiments of the present specification means that the first node device can start or close a plug-in module for constituting any blockchain node by controlling a plug-in manager corresponding to any blockchain node.
In this embodiment of the present description, the plug-in manager deployed on the first node device maintains the operating state of each block link node deployed on the first node device, and therefore, the first node device may obtain the operating state of each locally deployed block link point by checking the plug-in manager corresponding to each block link point, so as to determine whether the block link point has been started.
When the first node device sequentially starts the block chain nodes corresponding to the nodes in the node branch, it needs to wait for the block chain nodes corresponding to any block chain network to be started, and then starts to start the block chain nodes corresponding to the sub-nodes (the block chain subnets managed by any block chain network) of any block chain network. For example, when the node branch determined by the first node device includes a blockchain master network serving as a root node of the tree system, the first node device may first respond to the start control information and start a first master network node deployed on the first node device (it needs to be determined that the first node device is locally deployed with the first master network node), after the first master network node is started, the first master network node may automatically establish a network connection with other nodes in other blockchain master networks, and after all master network nodes in the blockchain master network are started, it may be considered that the blockchain master network is started, at this time, a transaction may be initiated on the blockchain master network, so that the transaction may be identified and executed normally, but for the first node device, after the first master network node is started, since the first master network node theoretically already carries information of all blockchain master networks, the first node device may obtain various types of information in the blockchain master network by initiating a local transaction, and the first node device can acquire the subnet information of the blockchain subnet managed by the blockchain main network by initiating a local transaction of subnet information query after the first main network node is started.
In an embodiment, the first node device locally pre-stores a subnet management list respectively maintained by each block link point, so that a node branch corresponding to the block chain network to which each block link point locally deployed by the first node device belongs in the tree system may be pre-determined, and after the start control information of the block chain node service is acquired, the block link points corresponding to each node in the pre-determined node branches on the first node device are sequentially started according to a direction from the root node to the leaf node.
Taking fig. 4 as an example, it is assumed that nodeA-nodeE on subnet0 are respectively deployed on node devices 1 to 5, and thus node device 1 is deployed with, in addition to primary network nodeA, also with subnet node nodeA1 belonging to subnet1, subnet node nodeA2 belonging to subnet2, and subnet node nodeA3 belonging to subnet3, and node device 1 therefore maintains locally already deployed identity information of nodeA, nodeA1, nodeA2, and nodeA3, and for node device 1, it may locally store in advance a total 4 subnet management list maintained by nodeA, nodeA1, nodeA2, and nodeA3, wherein the subnet management list maintained by nodeA records therein identities of nodeA1 and nodeA2 and identities of members thereof, and the sublea 1 includes sublea 2 belonging to sublea 368672, and 2, and 363672, and 2 include 2 identity information of the subnet member 2 and 2 belonging to sublea 2, and 2 of the subnet node device 2, and 2 belong to 2, and 2 of the sublea 2, the method is characterized in that nodeA1 and nodeA2 are locally deployed, and subnet1 and subnet2 to which nodeA1 and nodeA2 belong are managed by subnet0 respectively; a subnet identifier of subnet3 and identity information of node members contained in the subnet identifier are recorded in a subnet management list maintained by nodeA1, and the subnet identifier includes nodeA3 to nodeC3, wherein, because nodeA3 belongs to one of the identity information maintained by the node device 1, the node device 1 can determine the node members belonging to subnet3, and the nodeA3 is locally deployed, and the subnet3 to which the nodeA3 belongs is managed by subnet 1; the subnet management lists maintained by nodeA2 and nodeA3 are empty. According to the 4-piece subnet management list, node branches composed of subnet0, subnet1, subnet2 and subnet3 can be arranged, wherein subnet1 and subnet2 are sub-nodes of subnet0, subnet3 is a sub-node of subnet1, and therefore, the node device 1 determines the node activation sequence of "nodeA → nodeA1 → nodeA 3" and "nodeA → nodeA 2" according to the direction from the root node to the leaf node, wherein the activation process of "nodeA → nodeA1 → nodeA 3" and the activation process of "nodeA → nodeA 2" are independent of each other and are processed in parallel. Specifically, after acquiring the start control information of the blockchain node service and determining the start sequence of the above nodes, in response to the start control information, the node device 1 first checks whether a main network node nodeb is deployed by itself through the plugin manager, in the case of determining that nodeA is deployed, starts locally deployed nodeA in response to the start control information, then still checks whether nodeA is completely started through the plugin manager, in the case of completing the start of nodeA, controls the plugin managers corresponding to nodeA1 and nodeA2 to start nodeA1 and nodeA2, and in the case of completing the start of nodeA1, controls the plugin managers corresponding to nodeA3 to start nodeA 3.
For the node device 5, a nodeB 0 and a nodeB2 belonging to a subnet2 are locally deployed, so the node device 5 itself maintains identity information of a nodeB 0 and a nodeB2 which are locally deployed, and locally may store in advance 2 subnet management lists maintained by nodeB2 and nodeB 5838, respectively, where subnet identifications of subnet1 and subnet2 and membership of node members included in the subnet management list maintained by nodeB 39e, a subnet1 includes nodeA1 to nodeD1, a subnet2 includes nodeA2, nodeB b 8, nodeC2 and nodeE2, and since the nodeB2 therein belongs to identity information maintained by the node device 5 itself, the node device 5 may determine that its own member belongs to the node b2, locally deploys 36 24, and is managed by nodeB 0 of the nodeB 4642; the subnet management list maintained by node e2 is empty. According to the 2-piece subnet management list, node branches formed by subnet0 and subnet2 can be obtained by sorting, wherein subnet2 is a sub-node of subnet0, and therefore, the node device 5 determines a node start sequence of "nodeb → nodeb 2" according to a direction from a root node to a leaf node, and starts a corresponding blockchain node according to the node start sequence. Similarly, after acquiring the start control information of the blockchain node service, the node devices 2, 3, and 4 may also execute the above procedure to open the corresponding main network node and sub-network node, so that the node devices complete the process of opening the blockchain node service.
In another embodiment, the first node device needs to immediately acquire a subnet management list respectively maintained by each block link point, so as to determine a block link point which needs to be started subsequently while starting the block link node, and gradually determine a node branch of a block link network to which each block link point locally deployed by the first node device belongs in the tree system in the process of sequentially starting the block link nodes from the root node to the leaf nodes.
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 thus node device 1 is also deployed with subnet node nodeA1 belonging to subnet1, subnet node nodeA2 belonging to subnet2, and subnet node nodeA3 belonging to subnet3, in addition to the primary network node nodeA, and thus node device 1 itself maintains identity information of locally deployed nodeA, nodeA1, nodeA2, and nodeA 3. For the node device 1, after acquiring the start control information of the block link point service, in response to the start control information, first checking, by a plugin manager, whether a main network node nodeB a is deployed by itself, in a case where nodeA is determined to be deployed, starting, in response to the start control information, a locally deployed nodeB a, and then still checking, by the plugin manager, whether nodeA is completely started, in a case where nodeA is completely started, searching a subnet management list maintained by nodeB1 and subnet2, which records subnet identifications of subnet1 and subnet2 and membership of node members included in the list, subnet1 includes nodeB 1-nodd 1, subnet2 includes nodeB2, nodeB2, nodeB c2 and nodeB2, since both nodeB1 and nodeB2 of the node device 1 belong to identity information maintained by itself, the node device 1 can determine that both node device 1 and node device 1 belong to the deployment node nos 1, and 3642, and the subnet 4642 belong to node members of subnet 466 and 4642, and 2, which are managed by nodeB1 and 2 and node devices, which belong to subnet 466 and 2, thus, it is determined that subnet1 and sbenet 2 belong to a part of the node branch and are both child nodes corresponding to subnet0, then node apparatus 1 may concurrently start nodeA1 and nodeA2, and similarly, after the start of nodeA1 and nodeA2 is completed, node apparatus 1 may search for subnet management lists respectively maintained by nodeA1 and nodeA2, where the subnet identification of subnet3 and the identity information of the node members included in the subnet management list maintained by nodeA1 include nodeA 6384 to nodeC3, and since nodeA3 belongs to one of the identity information maintained by node apparatus 1 itself, node apparatus 1 may determine that node member belongs to its own subnet3, node apparatus 1 may locally deploy nodeA3 and nodeA3 to which nodeA 465 belongs to the management of bnet1, and node apparatus 2 locally deploys nodeA3 and thus determines that subnet1 belongs to a control node branch, and thus, node apparatus 599 starts a subnet 599 and responds to the node list, and starts the subnet management node apparatus 599, finally, since the subnet management list maintained by nodeA3 is empty, the process of searching and starting locally deployed blockchain nodes is stopped, and finally a node branch formed by subnet0, subnet1, subnet2 and subnet3 can be obtained through sorting, where subnet1 and subnet2 are child nodes of subnet0, subnet3 is child nodes of subnet1, and the above process also completes the process of starting corresponding blockchain link points of each node in the node branch on the first node device in the direction from the root node to the leaf node as a whole.
As described above, the subnet management list maintained by any blockchain node deployed by the first node device further records the operating state of the blockchain subnet corresponding to the subnode of the blockchain network to which any blockchain node locally deployed by the first node device belongs, and if the subnet management list maintained by any blockchain node records the subnet identifier corresponding to the blockchain subnet to which a certain subnet node belongs, the operating state corresponding to the blockchain subnet is the closed state, which means that under the management of the blockchain network to which any blockchain node belongs, the blockchain subnet to which the subnet node belongs is required to be set to the closed state, so that the subnet node may not be started, thereby ensuring that the actual operating state of the blockchain node is consistent with the management record of the blockchain network to which any blockchain node belongs, and if the operating state corresponding to the blockchain subnet to which the subnet node belongs is the open state, the block chain subnet to which the subnet node belongs is required to be set to the open state, and the subnet node can be started at this time. By starting the blockchain node in any blockchain network under the condition that the running state of any blockchain network is the starting state, the blockchain node service of the first node equipment can be ensured to be started correctly and in accordance with the requirement.
Taking the node device 1 in fig. 4 as an example, the nodeA, nodeA1, nodeA2, and nodeA3 locally deployed therein respectively maintain subnet management lists, where the subnet management lists maintained by the nodeA record the operating states of the subnet1 and the subnet2 in addition to the subnet identifications of the subnet1 and the subnet2 and the membership of the node members included in the subnet identifications; in addition to recording subnet identifications of subnet3 and identity information of node members contained in the subnet management list maintained by nodeA1, the subnet management list also records running states of subnet 3; the subnet management lists maintained by nodeA2 and nodeA3 are empty. The node device 1 may arrange node branches formed by subnet0, subnet1, subnet2, and subnet3 and operation states respectively corresponding to subnet0, subnet1, subnet2, and subnet3 according to the 4-piece subnet management list, where subnet1 and subnet2 are child nodes of subnet0, subnet3 is child nodes of subnet1, and it is assumed that the operation states of subnet0, subnet1, and subnet3 are on states and the operation state of subnet2 is off states, so that the node device 1 may start only the subnet0, subnet1, and subnet3 but not the subnet2 according to the anticipated start and stop requirements of the tree system, and determine the node start sequence of the node branch according to the destination → of the tree system, and start the node branch of the corresponding subnet 686a → node and start the corresponding node branch of the corresponding subnet3, subnet 63a → node start sequence; or, the node device 1 first determines that a main network node nodeb is locally deployed according to nodeA included in a node identity maintained by the node device 1, at this time, the node device 1 first starts nodeA, determines subnet identifiers, node member identity information, and an operation state of a subnet1 and a subnet2 managed by a subnet0 after determining that nodeA is started completely, thereby determining that nodeA1 and nodeA2 of a subnet2 are locally deployed, and if the operation state of a subnet1 is an open state and the operation state of a subnet2 is a closed state, the node device 1 only starts nodeA1 corresponding to the subnet1 in response to the start control information without performing any operation on nodeA2, so as to maintain a closed state of the subnet2, then, after the node identity maintained by itself includes nodeA, the node device 1 further determines that a subnet identifier 1 and a subnet member identifier 1 and a subnet 3985 manage the subnet member identity after determining that the subnet is started, therefore, the nodeA3 with the subnet3 locally deployed is judged, and if the running state of the subnet3 is the on state, the node device 1 responds to the start control information to start the nodeA3 corresponding to the subnet 3.
In this embodiment of the present specification, a subnet management list maintained by any blockchain node locally deployed by a first node device may be generated by the first node device querying a subnet management contract deployed on a blockchain network to which any blockchain node belongs, and specifically, the subnet management list maintained by any blockchain node deployed by the first node device may be obtained by the first node device monitoring a subnet information query event on the blockchain network to which any blockchain node belongs, where the subnet information query event is generated by any blockchain node executing a subnet information query transaction that invokes a subnet management contract on the blockchain network to which any blockchain node belongs, where the subnet information query event includes subnet information of each blockchain subnet managed by the blockchain network to which any blockchain node belongs, where the subnet information includes a subnet identifier, node member identity information, node identifier, node member identity information, node identifier, node member, Taking fig. 4 as an example, after the node device 1 is started up, it may initiate a subnet information query transaction (local transaction, but does not participate in consensus) to a subnet management contract on the subnet0, and monitor a subnet information query event generated after the subnet management contract executes the transaction, where a topic keyword is ListSubnet, a data field includes subnet information of each blockchain subnet managed by the subnet0, including subnet identifications of the subnet1 and the subnet2, node membership information, an operating state, plugin configuration information, and the like, and the subnet information query event may be represented as follows:
[topic: ListSubnet][data]
after being monitored by the node device 1, reading the content (only showing the subnet identification, node membership information and running state part of the blockchain subnet) in the data field as follows:
{subnet1:on;nodeA1,nodeB1,nodeC1,nodeD1;
subnet2:off;nodeA2,nodeB2,nodeC2,nodeE2;}
the prefixes subnet1 and subnet2 represent subnet identifiers of the blockchain subnet, the "on" or "off" after the colon represents an operating state, and the suffixes nodeA1 and the like represent node identity information of the subnet nodes, such as node public keys. The node device 1 may directly use the subnet information of each blockchain subnet in the data field as a subnet management list corresponding to the subnet0, or the node device 1 compares the identity information of each node maintained by itself with the content in the data field to find the blockchain subnet to which the subnet node deployed by itself belongs, for example, the node device 1 maintains the identity information of nodeA, nodeA1, nodeA2 and nodeA3, while the subnets of the blockchain subnet corresponding to the corresponding subnet nodes in the data field are identified as subnet1 and subnet2, so the node device 1 may determine that subnet nodes corresponding to subnet1 and subnet2 have been locally deployed, so that the subnet1 and subnet2 are added into the subnet management list, in another embodiment, the node device 1 may initiate the subnet information query transaction contract to the subnet management contract on the subnet0 in advance, thereby saving the subnet information of the blockchain subnet maintenance by the node device in advance, so that the subnet list is started after the node device 1 starts up the subnet management contract, there is no need to initiate a subnet information query transaction to a subnet management contract on subnet 0. The contract state of the Subnet management contract on any block chain network in the tree system maintains the Subnet contract state of each block chain Subnet managed by any block chain network, 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.
Or the first node device can read the contract state of the subnet management contract from a database corresponding to the blockchain network to which any locally deployed blockchain node belongs, and generates a subnet management list maintained by any blockchain node from the subnet information contained in the read contract status, for example, the node device 1 may directly read, from the database corresponding to any one of the blockchain nodes, the contract state of the subnet management contract deployed in the blockchain network to which the any one of the blockchain nodes belongs, because the contract state records the subnet information of each blockchain subnet under the management of the blockchain network to which any blockchain link point belongs, node apparatus 1 can thus manage the contract status of the contract and the identity information of nodeA1 and nodeA2 maintained by node apparatus 1 according to the subnet, thus, the subnet identifications and operating states corresponding to subnet1 and subnet2 respectively corresponding to nodeA1 and nodeA2 are added to the subnet management list maintained by nodeA respectively. The Subnet management contract may be the Subnet contract, or may be another intelligent contract deployed on the blockchain network to which any blockchain link point belongs.
As described above, the first node device may determine the subnet identifier and the operating state of the blockchain network managed by any locally deployed blockchain node by querying a subnet management list maintained by any locally deployed blockchain node, and in another embodiment, after acquiring the data field of the subnet information query event on the blockchain network to which any locally deployed blockchain node belongs, the first node device may also determine the subnet identifier and the operating state of the blockchain network managed by the blockchain network to which any locally deployed blockchain node belongs directly according to the subnet information of each blockchain subnet in the data field, without using or sorting out the subnet management list maintained by nodeA, for example, after the node device 1 acquires the start control information of the blockchain node service and starts nodeA, the node device 1 may directly query in the data field to obtain the identity information of the subnet node corresponding to the subnet1, which is nodeA1, or nodeA, The operation states of nodeB1, nodeC1 and nodeD1 are on states, the identity information of the subnet node corresponding to the subnet2 is nodeA2, nodeB2, nodeC2 and nodeE2, the operation state is off states, then the identity information nodeA1 and nodeA2 maintained by the node device are compared with each other, and the identity information maintained by the node device 1 is judged to be contained in both the subnet node member corresponding to the subnet1 and the subnet node member corresponding to the subnet2, so that the node device 1 can determine that the node device is locally deployed with the nodeA1 and nodeA2 corresponding to the subnet1 and the subnet2, respectively, the operation state of the subnet1 is on states, and the operation state of the subnet2 is off states.
Each blockchain sub-network under the management of the first blockchain network may include a blockchain sub-network established under the first blockchain network, and may also include a blockchain sub-network not established under the first blockchain network. Generally, a blockchain subnet established on any blockchain network is managed by the blockchain network, for example, a subnet3 is established on the basis of subnet1, so that subnet1 acquires the management right of subnet3, and can control the operating state of subnet3, while subnet0 cannot manage subnet3, in this scenario, a node device may adopt different authority management for different blockchain networks, and when a monitored event belongs to subnet0, the node device may only read a subnet management list of the authority corresponding to subnet0 when completing various operations in response to the event, where the subnet management list only includes the subnet identifiers of the blockchain subnets managed by subnet0, that is, includes subnet1 and subnet2, but not subnet 3.
However, by some means, cross-layer management of subnet0 may be achieved, enabling subnet0 to manage subnet 3. For example, subnet0 may add subnet information about subnet3 obtained from subnet1, which is a parent node of subnet3, to a contract state of a subnet management contract on subnet0 by a cross-chain technique, so that subnet0 acquires the management right of subnet3, and a subsequent master node on subnet0 may write subnet information of subnet3 into a subnet information query event by a subnet information query transaction, so that each node device adds subnet information of subnet3 to a subnet management list of corresponding rights 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 the subnet3 in the subnet management list of the authority corresponding to the subnet1 to the subnet management 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 the subnet3, the subnet information of the subnet3 may be read from the subnet management list of the authority corresponding to the subnet0 when the node device monitors an event occurring at the subnet0, and thus the subnet0 is substantially enabled to obtain the administrative right to the subnet 3.
As described above, by sending out a transaction for building a blockchain subnet based on an existing blockchain network, so as to build a blockchain subnet, a newly built blockchain network can be managed by the existing blockchain for building the blockchain network, however, in addition to the above-mentioned manner for sending and building a blockchain subnet transaction (hereinafter, referred to as transaction networking manner), the blockchain subnet can be built by other means and managed by the existing blockchain network. For example, a blockchain subnet may be established on an existing blockchain network through a registration method (hereinafter referred to as a registration networking method for short), subnet information of a blockchain subnet to be established is directly registered to the existing blockchain network, so that the existing blockchain subnet obtains relevant information of the blockchain subnet to be established, such as a subnet identifier and an operating state of the blockchain subnet to be established, wherein public keys and plug-in configuration information of each node member, IP addresses and port information of each node device, and the information is written into a contract state of a system contract corresponding to the existing blockchain network, and thus the existing blockchain network obtains a management right of the blockchain subnet to be established. Because the registration mode does not need to transmit information between the blockchain nodes of the existing blockchain network through transactions, the subnet nodes in the blockchain subnet constructed through the registration networking mode may be completely or partially different from the node devices deployed in each node in the existing blockchain network, for example, in fig. 4, subnet0 creates a subnet4 in the registration mode, and assuming that the main network nodes nodeA to nodeE included in subnet0 themselves are respectively deployed in node devices 1 to 5, the subnet node corresponding to subnet4 may be deployed in any node device other than node devices 1 to 5, or, subnet node a4 in subnet4 is deployed in node device 1, and subnet node f4 in subnet4 is deployed in node device 6, of course, subnet nodes in subnet4 may also be all deployed in node devices 1 to 5.
In an embodiment, when a blockchain node in a first blockchain network is deployed on a first node device, if the first node device determines that a second node device is deployed with a blockchain node in a second blockchain network managed by the first blockchain network and does not deploy a blockchain node in the first blockchain network, the first node device provides the start control information to the second node device to instruct the second node device to start the blockchain node in the second blockchain network in response to the start control information. As mentioned above, the first blockchain network is a blockchain network to which any blockchain link point locally deployed by the first node device belongs, and as described above, the first node device may monitor a subnet information query event generated after a subnet information query transaction is executed by a subnet management contract on the first blockchain network, obtain subnet information of all blockchain subnets under the management of the first blockchain network (but not a blockchain subnet to which a locally deployed subnet node belongs) included in the data field, so that the first node device determines the IP addresses of the node devices to which each subnet node in any blockchain subnet belongs according to the content in the data field, and compare the IP addresses with the IP addresses of the node devices to which each blockchain link point in the first blockchain network belongs (the IP addresses of each blockchain node in the first blockchain network are recorded in a subnet management list maintained by a blockchain node corresponding to a first blockchain parent network managing the first blockchain network) ) Thereby determining that the node device in which the specific subnet node in the specific blockchain subnet (second blockchain network) is located does not belong to the node device in which each blockchain node in the first blockchain network is located, that is, determining that the specific node device (second node device) is deployed with the blockchain node in the second blockchain network managed by the first blockchain network and is not deployed with the blockchain node in the first blockchain network, and that the specific blockchain subnet is constructed in a registration networking manner or is constructed in a transaction networking manner but includes a subnet node that is joined in a registration manner and is deployed in the second node device, in which case, the first node device may further provide the start control information to the second node device through the IP address of the second node device recorded in the data field, and instructing the second node device to start the subnet nodes in the blockchain subnet locally deployed by the second node device, so as to synchronously start the subnet nodes in the blockchain subnet networked in the registration mode.
As described above, the first node device may start or close the plug-in module for forming any blockchain node by controlling the plug-in manager corresponding to any blockchain node. In one case, the first node device may only deploy one shared plug-in manager for managing plug-in modules corresponding to all block link points deployed under the node device, specifically, the shared plug-in manager maintains plug-in configuration information of locally deployed block link nodes, 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, the first 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 any blockchain network (including the blockchain main network and each blockchain subnet) locally deployed by the first node device, and the plug-in configuration information of any blockchain network includes plug-in configuration information of each blockchain node under the blockchain network, so that the first node device may determine the plug-in configuration information of the locally deployed subnet node according to its own identity information, and therefore, each subnet management list maintained by the first node device may record plug-in configuration information of the blockchain subnet to which each locally deployed blockchain node belongs, and therefore, a plug-in manager deployed in the first node device may obtain the plug-in configuration information of each blockchain node locally deployed by the first node device by reading each subnet management list.
When the first node device starts any locally deployed blockchain node in response to the start/stop control information, the first node device controls a plug-in manager corresponding to any blockchain node to start or stop a plug-in module for forming any blockchain node. For example, when the node apparatus 1 starts nodeA in response to start control information of the tile link node service, in one case, the node apparatus 1 may control the independent plug-in manager of nodeA, which is a master network node corresponding to the subnet0, so that the independent plug-in manager of nodeA starts a plug-in module for constituting nodeA according to plug-in configuration information of nodeA; 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 a nodeA, which is a main network node corresponding to the subnet0, and starts a plugin module for forming the nodeA0 according to the plugin configuration information of the nodeA; similarly, when the node apparatus 1 closes nodeA in response to the closing control information of the block-link node service, similarly to the above starting process, only the start in the above process is changed to close; alternatively, when the node apparatus 1 activates the sub-network node nodeb1 in response to the activation control information of the block link node service, also similarly to the above-described activation procedure, only the card manager of nodeb is replaced with the card manager of nodeb1, and the card configuration information of nodeb is replaced with the card configuration information of nodeb 1.
Different blockchain nodes on the first node device may rely on the same plug-in module at runtime, and such plug-ins are in a shared state. 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. And the plug-in 2.0 is depended on and used by nodeA and nodeA1 at the same time, so that the plug-in module used by two or more blockchain nodes at the same time like the plug-in 2.0 is in a shared state, and correspondingly, the plug-in module depended on by only one blockchain node is in an independent state, for example, the plug-ins except the plug-in 2.0 are in an independent state.
On the other hand, if a specific plug-in module whose operation mode is the sharing mode may be run on the first node device, this means that, if the specific plug-in module is included in the configuration of the new blockchain node to be started on the first node device, and the operation requirement corresponding to the specific plug-in module in the plug-in configuration information corresponding to the new blockchain node is the sharing operation, in the process of starting the new blockchain node, the specific plug-in module will not be started, but the specific plug-in module that has already been run is directly shared to the new blockchain node for the new blockchain node to directly call. However, if the operation mode of the specific plug-in module is the exclusive mode, in the process of starting the new blockchain node, since the operation mode of the specific plug-in module is the exclusive mode and does not support the sharing operation, the specific plug-in module cannot be directly called by the new blockchain node, and a plug-in module having the same function needs to be restarted to be allocated to the new blockchain node to be called by the new blockchain node.
The plug-in manager deployed on the first node device maintains a plug-in information attribute list corresponding to each block chain node managed by the plug-in manager according to the plug-in configuration information and the running state of each locally deployed block chain node, and is used for marking the attribute information of each plug-in module required to be used, wherein the attribute information includes whether the running state is an open state or a closed state, whether the running mode is a sharing mode or an exclusive mode, whether the running mode is the sharing state or the exclusive state, the dependency relationship between the running mode and other plug-in modules, and the like. For example, after the plugin manager reads the subnet management list, it finds that only the subnet0 and the subnet1 exist in the blockchain subnet whose current operation state is the open state, then it further searches and obtains plugin configuration information of nodeA and nodeA1 respectively corresponding to the subnet0 and the subnet1 which are locally deployed, and then compares the plugin configuration information to obtain that the plugin module commonly used by the nodeA and the nodeA1 is the plugin 2.0, so that the plugin 2.0 in the plugin information attribute list is marked as the shared state, and after the subnet1 is closed, the plugin manager reads the subnet management list maintained by the nodeA again, finds that only the subnet0 exists in the blockchain subnet whose operation state is the open state, then it searches and obtains the plugin configuration information of the nodeA, because the plugin 2.0 is currently only dependent on the nodeA, the plugin 2.0 in the plugin information attribute list is changed from the shared state to the open state, and is used for changing the plugin configuration information of the plugins except the open state 360 State. In addition to obtaining the plug-in configuration information and the running state of each locally deployed block chain node through the subnet information of each block chain network in the subnet management 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 completing the control of the running state of the corresponding subnet node, so that the attribute information of each plug-in module in the plug-in information attribute list can be updated more timely and accurately.
Because a plug-in a sharing state and a plug-in with a sharing mode in an operation mode exist, when the first node device starts a plug-in module for forming any blockchain node, the repeated starting of the plug-in with the sharing mode in the operation mode needs to be avoided, so that the sharing requirement of each plug-in module in any blockchain node is correctly met, and the normal operation of any blockchain node is further ensured; when the plug-in module for forming any block chain node is closed, the plug-in module in the shared state needs to be prevented from being closed, so that the normal operation of other block chain nodes except the first subnet node is prevented from being influenced. That is, when the first node device starts a plug-in module for forming any block chain node, the following procedure is required:
and determining the plug-in description information of each plug-in module for forming any block chain node and the operation requirement of each plug-in module. In this embodiment, plug-in description information and operation requirements of each plug-in module forming any block chain node may be found by querying a plug-in information attribute list corresponding to any block chain node, where the plug-in description information includes at least one of a plug-in type, a plug-in name, and a plug-in function, and is used for pointing to a specific plug-in module.
Under the condition that the operation requirement of any plug-in module is shared operation, if an opened plug-in module matched with the plug-in description information of any plug-in module exists and the operation mode of the opened plug-in module is a sharing mode, sharing the opened plug-in module to any block chain node. The operation requirement of each plug-in module is defined in the plug-in configuration information corresponding to any block chain point, if the operation requirement of any plug-in module in the plug-in configuration information is shared operation, it indicates that any plug-in module needs to be operated in a shared mode, and if the first node device finds an opened plug-in module corresponding to the plug-in description information of any plug-in module through the plug-in information attribute list before starting any plug-in module, the opened plug-in module is further shared to the block chain node to which the any plug-in module belongs under the condition that the operation mode of the opened plug-in module is determined to be the shared mode.
And under the condition that the operation requirement of any plug-in module is shared operation, if no started plug-in module which is matched with the plug-in description information and has the operation mode of the shared mode exists, starting the plug-in module. If the operation requirement of any plug-in module in the plug-in configuration information is shared operation, it indicates that it is necessary to operate the any plug-in module in the shared mode, and if, before starting the any plug-in module, the first node device already finds, through the plug-in information attribute list, an opened plug-in module corresponding to the plug-in description information that does not exist in the plug-in module, or the operation mode of the opened plug-in module is not the shared mode although the opened plug-in module exists, it is determined that an opened plug-in module matching the plug-in description information and having the operation mode being the shared mode does not exist at this time, and therefore the any plug-in module needs to be started, and at the same time, when starting the plug-in module corresponding to the plug-in description information, the operation mode of the started plug-in module is also set based on the operation requirement, for example, because the shared requirement of, therefore, the running mode of any started plug-in module can be set to be the sharing mode, so that any plug-in module can be shared to the block chain node which is started subsequently when the block chain node which needs to use any plug-in module is started.
And starting any plug-in module under the condition that the operation requirement of any plug-in module is independent operation. If the operation requirement of any plug-in module in the plug-in configuration information is independent operation, it indicates that any plug-in module needs to be operated in an exclusive mode, so that any plug-in module can be directly started and the operation mode of any plug-in module is set to the exclusive mode, so that any plug-in module cannot be shared to a subsequently started block chain node by a block chain node which needs to use any plug-in module subsequently when the block chain node is started, the operation mode of the exclusive mode is met, and the operation requirement of independent operation of any plug-in module in the plug-in configuration information is ensured.
Under the above condition, the operation requirement of each plug-in module is defined in the plug-in configuration information corresponding to any block chain link point, and the plug-in configuration information corresponding to different block chain link points may be different, so that different plug-in sharing strategies may be allocated to different block chain link points, and this differentiated management for different block chain nodes can flexibly meet various actual requirements of users. In another case, the operation requirement of each plug-in module is global predefined information, so that the operation requirement of each plug-in module does not need to be recorded in the plug-in configuration information corresponding to any block chain node, and the plug-in configurator maintains the operation requirement of each plug-in module according to different plug-in description information, so that when the plug-in modules are started in the above manner, the preset plug-in modules always operate in a sharing mode, and when the plug-in modules for forming any block chain node need to be started, if the plug-in description information of the plug-in modules indicates that the plug-in modules have the sharing requirement, the started plug-in modules corresponding to the plug-in description information can be directly shared to any block chain node, thereby providing a uniform sharing strategy.
Specifically, when the node device 1 starts the first master network node nodeA, the node device 1 may check the plug-in configuration information of the nodeA through the plug-in manager, obtain the plug-in description information of the plug-in modules for constituting the nodeA, where the plug-in description information includes the plug-ins 1, 2, 3, and 4, and at this time, since there is no other blockchain node, directly allocate the plug-ins 1.0, 2.0, 3.0, and 4.0, which are obtained by starting the plug-in modules corresponding to the above plug-in description information, to the nodeA so as to start the nodeA, and after it is further determined through the plug-in configuration information that the operation requirements of the plug-ins 1, 3, and 4 are independent operations and the operation requirement of the plug-in 2 is a shared operation, set the operation modes of the plug-ins 1.0, 3.0, and 4.0 to be an independent mode, and set the operation mode of the plug-in 2.0 to be a shared mode. After the nodeA is started, assuming that the node device 1 determines that nodeA1 and nodeA2 are locally deployed, and the running state of the subnet1 to which the nodeA1 belongs is an open state, and the running state of the subnet2 to which the nodeA2 belongs is a closed state, at this time, the node device will check the plugin configuration information of the nodeA1 through the plugin manager, and obtain the plugin description information of the plugin modules forming the nodeA1, including the plugins 1, 2, 3, 4 and 5, at this time, the node device 1 already runs the plugins 1.0, 2.0, 3.0 and 4.0 having the same plugin description information, and further check the running requirements of each plugin module, and it can be known through the plugin configuration information of the nodeA1 that the sharing requirements of the plugins 1, 3 and 4 are all independently running, and the sharing requirements of the plugins 2 and 5 are shared running requirements, so that the plugins 1.0 directly start the plugins are shared by the shared running requirements of the plugins 1.0 The plug-ins 3.1 and 4.1 are distributed to the nodeA1, meanwhile, because the operation mode of the started plug-in 2.0 corresponding to the description information of the plug-in 2 is the sharing mode, the plug-in 2.0 used by the nodeA is directly shared to the nodeA1 without restarting the new plug-in corresponding to the description information of the plug-in 2, and the sharing requirement of the plug-in 5 is sharing operation, but the node device 1 does not have the started plug-in corresponding to the description information of the plug-in 5 at present, so the plug-in 5.1 needs to be started and the operation mode thereof is set to the sharing mode, and the plug-ins 1.1, 3.1, 4.1 and 5.1 which are set to the independent modes with the plug-in 2.0 and other operation modes jointly form the nodeA 1. After the nodeA1 is started, assuming that the node device 1 determines that the nodeA3 is locally deployed and the running state of the subnet3 to which the nodeA3 belongs is an open state, at this time, the node device 1 checks the plugin configuration information of the nodeA3 through the plugin manager, and obtains the plugin description information of the plugin modules forming the nodeA3, including the plugins 1, 2 and 5, at this time, the node device 1 already runs the plugins 1.0, 1.1, 2.0 and 5.1 having the same plugin description information, it needs to further check the running requirements of each plugin module, and it can be known through the plugin configuration information of the nodeA3 that the sharing requirements of the plugin 1 are all independent running, and the sharing requirements of the plugins 2 and 5 are shared running, so that the plugin 1.2 is directly started according to the sharing requirements and is distributed to the nodeA3, and at the running mode of the started plugin 2.0 corresponding to the plugin description information of the plugin 2 is a sharing mode, the plug-in 5 describes the started plug-in 5.1 corresponding to the information, so that the plug-in 2 or a new plug-in corresponding to the plug-in 5 description information does not need to be restarted, but the plug-in 2.0 commonly used by the nodeA and the nodeA1 is directly shared to the nodeA3, the plug-in 5.1 used by the nodeA1 is shared to the nodeA3, and the plug-in 1.2 with the operation mode set to the independent mode and the operation mode form the nodeA1 together.
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 64678DEST_PATH_IMAGE001
When the first node device starts or closes the plug-in modules for forming any block chain 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 any block chain node; 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 any block chain 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 sequence is the same as the dependency sequence, 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 acquires the shutdown control information of the blockchain node service, the node device 1 may acquire, by the plug-in manager, that the subnet node nodeb1 corresponding to the subnet1 is composed of the plug-ins 1.1, 2.0, 3.1, 4.1, and 5.1, and the corresponding dependency is "plug-in 1.1 → plug-in 3.1 → 2.0", "plug-in 4.1 → plug-in 5.1", and since the nodeb1 needs to be closed, the shutdown order of "plug-in 1.1 → plug-in 3.1 → 2.0", "plug-in 4.1 → plug-in 5.1" is determined according to the aforementioned rule, wherein the plug-ins 1.1, 3.1, and 2.0 are closed according to "plug-ins 1.1 → 3.1 → plug-ins 2.0", and the plug-ins 4.1, 5.1 and 5.1 are closed according to "plug-ins 4.1 → plug-ins 5.1", and the node device 1 plays a role of closing the plug-ins 4.1, so that the corresponding plug-ins are shared, and the corresponding shutdown order is, and thus, the plug-ins 2 is not damaged, the closing sequence of "plug-in 1.1 → plug-in 3.1 → plug-in 2.0" may be replaced with "plug-in 1.1 → plug-in 3.1", i.e. plug-in 2.0 as a shared plug-in is not closed, so as not to affect the normal operation of other subnet nodes.
Fig. 6 is a flowchart of a method for turning off block-link point service according to an exemplary embodiment. As shown in fig. 6, the method is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to its parent node, and the method includes:
step 602, a first node device obtains control information for closing a block chain node service;
step 604, the first node device determines, according to a subnet management list respectively maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
in step 606, the first node device responds to the closing control information, and sequentially closes the block link points corresponding to the nodes in the node branches on the first node device according to the direction from the leaf node to the root node.
Optionally, the closing control information includes identity information corresponding to the first node device.
Optionally, the closing, by the first node device, a block link point in any block chain network includes:
and the first node equipment closes the block chain nodes in any block chain network under the condition that the running state of any block chain network is an open state.
Optionally, the method further includes:
and the first node equipment determines the running state of any block chain network by inquiring a subnet management list maintained by the block chain network corresponding to the father node of any block chain network.
Optionally, the method further includes:
under the condition that the first node device is deployed with the blockchain node in the first blockchain network, if the first node device determines that the second node device is deployed with the blockchain node in the second blockchain network managed by the first blockchain network and is not deployed with the blockchain node in the first blockchain network, the first node device provides the closing control information to the second node device so as to instruct the second node device to close the blockchain node in the second blockchain network in response to the closing control information.
Optionally, the closing, by the first node device, any blockchain node includes:
and the first node equipment closes the plug-in modules for forming any block chain node.
Optionally, the closing a plug-in module for forming any blockchain node includes: and closing the plug-in modules used for forming any block chain node through the plug-in manager corresponding to any block chain node.
Alternatively to this, the first and second parts may,
the plug-in manager is a global plug-in manager corresponding to all block link points deployed on the first node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager which is independently applied to any blockchain node.
Optionally, the closing a plug-in module for forming any blockchain node includes:
determining plug-in description information of plug-in modules for forming any block chain node;
and if the operation mode of the opened plug-in module which is matched with the plug-in description information of any plug-in module is an independent mode or the operation mode is a sharing mode and is not shared to other block chain nodes except any block chain node, closing the opened plug-in module. As described above, if the operation mode of a certain plugin module is the shared mode but is not shared to other blockchain nodes except any blockchain node, it indicates that the plugin module is not in the shared state although the operation mode is the shared mode, so that the plugin module can be directly turned off without considering interference to other blockchain nodes when the plugin is turned off, because the plugin module is not dependent on other blockchain nodes at this time, it can be regarded as a plugin module operating in an independent mode.
Optionally, the operation mode of any plug-in module is determined by the operation requirement of any plug-in module.
Optionally, the operation requirement of any plug-in module is defined in the plug-in configuration information corresponding to any block link point.
Optionally, the operation requirement of any plug-in module is global predefined information.
Optionally, the closing a plug-in module for forming any blockchain node includes: and sequentially closing the plug-in modules for forming any block chain node according to the dependency relationship among the plug-in modules for forming any block chain node.
The present specification also provides embodiments of an apparatus, an electronic device, and a storage medium, corresponding to embodiments of the foregoing method.
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 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 subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 8, fig. 8 is a block diagram of an apparatus for starting a blockchain node service according to an exemplary embodiment of the present disclosure, where the apparatus for starting a blockchain node service may be applied to a device as shown in fig. 7 to implement the technical solution of the present disclosure, and the apparatus is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, and any blockchain sub-network in the tree system is managed by a blockchain network corresponding to its parent node, where the apparatus includes:
a control information obtaining module 801, configured to enable a first node device to obtain start control information of a blockchain node service;
a node branch determining module 802, configured to enable the first node device to determine, according to a subnet management list respectively maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
a node starting module 803, configured to enable the first node device to respond to the start control information, and sequentially start, according to a direction from the root node to the leaf node, the block link point corresponding to each node in the node branch on the first node device.
Optionally, the start control information includes identity information corresponding to the first node device.
Optionally, the node starting module 803 is configured to enable a first node device to start a block link point in any block chain network, and includes:
and the first node equipment starts the block chain nodes in any block chain network under the condition that the running state of any block chain network is the opening state.
Optionally, the method further includes:
an operation state determining module 804, configured to enable the first node device to determine an operation state of any blockchain network by querying a subnet management list maintained by the blockchain network corresponding to the parent node of the any blockchain network.
Optionally, the method further includes:
a control information providing module 805, configured to enable a first node device to, when a first node device deploys a blockchain node in a first blockchain network on the first node device, if the first node device determines that a second node device deploys a blockchain node in a second blockchain network managed by the first blockchain network and does not deploy a blockchain node in the first blockchain network, provide start control information to the second node device to instruct the second node device to start the blockchain node in the second blockchain network in response to the start control information.
Optionally, the starting, by the first node device, of any blockchain node includes:
the first node device starts a plug-in module for constituting any block chain node.
Optionally, the starting a plug-in module for forming any blockchain node includes: and starting a plug-in module for forming any block chain node through the plug-in manager corresponding to any block chain node.
Alternatively to this, the first and second parts may,
the plug-in manager is a global plug-in manager corresponding to all block link points deployed on the first node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager which is independently applied to any blockchain node.
Optionally, the starting a plug-in module for forming any blockchain node includes:
determining plug-in description information of plug-in modules for forming any block chain node and operation requirements of the plug-in modules;
under the condition that the operation requirement of any plug-in module is shared operation, if an opened plug-in module matched with the plug-in description information of any plug-in module exists and the operation mode of the opened plug-in module is a sharing mode, sharing the opened plug-in module to any block chain node;
under the condition that the operation requirement of any plug-in module is shared operation, if an opened plug-in module which is matched with the plug-in description information and has an operation mode of a shared mode does not exist, starting the plug-in module;
and starting any plug-in module under the condition that the operation requirement of any plug-in module is independent operation.
Optionally, the operation requirement of each plug-in module is defined in the plug-in configuration information corresponding to any block link point.
Optionally, the operation requirement of each plug-in module is global predefined information.
Optionally, the method further includes: and an operation mode setting module 806, configured to, when the first node device starts a plug-in module corresponding to the plug-in description information, set an operation mode of the started plug-in module based on the operation requirement.
Optionally, the starting a plug-in module for forming any blockchain node includes: and sequentially starting the plug-in modules for forming any block chain node according to the dependency relationship among the plug-in modules for forming any block chain node.
Referring to fig. 9, fig. 9 is a block diagram of an apparatus for closing a blockchain link point service according to an exemplary embodiment, where the apparatus for closing a blockchain link point service may be applied to a device as shown in fig. 7 to implement the technical solution of the present specification, and the apparatus is applied to a tree system in which a blockchain main network is a root node and each blockchain sub-network is respectively another node, where any blockchain sub-network in the tree system is managed by a blockchain network corresponding to its parent node, and the apparatus includes:
a control information obtaining module 901, configured to enable a first node device to obtain closing control information of a blockchain node service;
a node branch determining module 902, configured to enable the first node device to determine, according to a subnet management list respectively maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
a node closing module 903, configured to enable the first node device to respond to the closing control information, and sequentially close, according to a direction from the leaf node to the root node, the block link points corresponding to the nodes in the node branch on the first node device.
Optionally, the closing control information includes identity information corresponding to the first node device.
Optionally, the node closing module 903 is configured to cause the first node device to close a block link point in any block chain network, and includes:
and the first node equipment closes the block chain nodes in any block chain network under the condition that the running state of any block chain network is an open state.
Optionally, the method further includes:
an operation state determining module 904, configured to enable the first node device to determine an operation state of any blockchain network by querying a subnet management list maintained by the blockchain network corresponding to the parent node of the any blockchain network.
Optionally, the method further includes:
a control information providing module 905, configured to enable a first node device to deploy a blockchain node in a first blockchain network on the first node device, if the first node device determines that a second node device deploys a blockchain node in a second blockchain network managed by the first blockchain network and does not deploy a blockchain node in the first blockchain network, provide closing control information to the second node device, so as to instruct the second node device to close the blockchain node in the second blockchain network in response to the closing control information.
Optionally, the closing, by the first node device, any blockchain node includes:
and the first node equipment closes the plug-in modules for forming any block chain node.
Optionally, the closing a plug-in module for forming any blockchain node includes: and closing the plug-in modules used for forming any block chain node through the plug-in manager corresponding to any block chain node.
Alternatively to this, the first and second parts may,
the plug-in manager is a global plug-in manager corresponding to all block link points deployed on the first node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager which is independently applied to any blockchain node.
Optionally, the closing a plug-in module for forming any blockchain node includes:
determining plug-in description information of plug-in modules for forming any block chain node;
and if the operation mode of the opened plug-in module which is matched with the plug-in description information of any plug-in module is an independent mode or the operation mode is a sharing mode and is not shared to other block chain nodes except any block chain node, closing the opened plug-in module.
Optionally, the operation mode of any plug-in module is determined by the operation requirement of any plug-in module.
Optionally, the operation requirement of any plug-in module is defined in the plug-in configuration information corresponding to any block link point.
Optionally, the operation requirement of any plug-in module is global predefined information.
Optionally, the closing a plug-in module for forming any blockchain node includes: and sequentially closing the plug-in modules for forming any block chain node according to the dependency relationship among the plug-in modules for forming any block chain node.
Correspondingly, the present specification also provides an apparatus comprising a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method for enabling/disabling block-linked point services provided by all of the above method embodiments.
Accordingly, the present specification also provides a computer readable storage medium having executable instructions stored thereon; wherein the instructions, when executed by the processor, implement the steps of the method for enabling/disabling block-link point services provided in all of the above method embodiments.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
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 (30)

1. A method for starting block chain node service is applied to a tree system which takes a block chain main network as a root node and each block chain sub-network as other nodes, wherein any block chain sub-network in the tree system is managed by a block chain network corresponding to a father node of the block chain sub-network, and the method comprises the following steps:
the method comprises the steps that first node equipment obtains starting control information of a block chain node service;
the first node equipment determines the corresponding node branch of the block chain network to which each block chain link point belongs in the tree system according to the subnet management list respectively maintained by each locally deployed block chain link point; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the first node equipment responds to the starting control information and sequentially starts the corresponding block chain link points of each node in the node branches on the first node equipment according to the direction from the root node to the leaf node.
2. The method of claim 1, wherein the start control information includes identity information corresponding to the first node device.
3. The method of claim 1, the first node device initiating a block link point in any block chain network, comprising:
and the first node equipment starts the block chain nodes in any block chain network under the condition that the running state of any block chain network is the opening state.
4. The method of claim 3, further comprising:
and the first node equipment determines the running state of any block chain network by inquiring a subnet management list maintained by the block chain network corresponding to the father node of any block chain network.
5. The method of claim 1, further comprising:
under the condition that the first node device is deployed with the blockchain node in the first blockchain network, if the first node device determines that the second node device is deployed with the blockchain node in the second blockchain network managed by the first blockchain network and is not deployed with the blockchain node in the first blockchain network, the first node device provides the starting control information for the second node device to instruct the second node device to start the blockchain node in the second blockchain network in response to the starting control information.
6. The method of claim 1, the first node device initiating any blockchain node, comprising:
the first node device starts a plug-in module for constituting any block chain node.
7. The method of claim 6, said initiating a plug-in module for forming said any blockchain node, comprising: and starting a plug-in module for forming any block chain node through the plug-in manager corresponding to any block chain node.
8. The method of claim 7, wherein the first and second light sources are selected from the group consisting of,
the plug-in manager is a global plug-in manager corresponding to all block link points deployed on the first node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager which is independently applied to any blockchain node.
9. The method of claim 6, said initiating a plug-in module for forming said any blockchain node, comprising:
determining plug-in description information of plug-in modules for forming any block chain node and operation requirements of the plug-in modules;
under the condition that the operation requirement of any plug-in module is shared operation, if an opened plug-in module matched with the plug-in description information of any plug-in module exists and the operation mode of the opened plug-in module is a sharing mode, sharing the opened plug-in module to any block chain node;
under the condition that the operation requirement of any plug-in module is shared operation, if an opened plug-in module which is matched with the plug-in description information and has an operation mode of a shared mode does not exist, starting the plug-in module;
and starting any plug-in module under the condition that the operation requirement of any plug-in module is independent operation.
10. The method of claim 9, wherein the operating requirements of each plug-in module are defined in the plug-in configuration information corresponding to any one of the block link points.
11. The method of claim 9, wherein the operational requirements of each plug-in module are global predefined information.
12. The method of claim 9, further comprising: and when the plug-in module corresponding to the plug-in description information is started, setting the running mode of the started plug-in module based on the running requirement.
13. The method of claim 6, said initiating a plug-in module for forming said any blockchain node, comprising: and sequentially starting the plug-in modules for forming any block chain node according to the dependency relationship among the plug-in modules for forming any block chain node.
14. A method for closing block chain link point service is applied to a tree system which takes a block chain main network as a root node and each block chain sub-network as other nodes, wherein any block chain sub-network in the tree system is managed by a block chain network corresponding to a father node of the block chain sub-network, and the method comprises the following steps:
the first node equipment acquires closing control information of a block chain node service;
the first node equipment determines the corresponding node branch of the block chain network to which each block chain link point belongs in the tree system according to the subnet management list respectively maintained by each locally deployed block chain link point; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the first node equipment responds to the closing control information and sequentially closes the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the leaf nodes to the root nodes.
15. The method of claim 14, wherein the shutdown control information includes identity information corresponding to the first node device.
16. The method of claim 14, the first node device turning off a block link point in any block chain network, comprising:
and the first node equipment closes the block chain nodes in any block chain network under the condition that the running state of any block chain network is an open state.
17. The method of claim 16, further comprising:
and the first node equipment determines the running state of any block chain network by inquiring a subnet management list maintained by the block chain network corresponding to the father node of any block chain network.
18. The method of claim 14, further comprising:
under the condition that the first node device is deployed with the blockchain node in the first blockchain network, if the first node device determines that the second node device is deployed with the blockchain node in the second blockchain network managed by the first blockchain network and is not deployed with the blockchain node in the first blockchain network, the first node device provides the closing control information to the second node device so as to instruct the second node device to close the blockchain node in the second blockchain network in response to the closing control information.
19. The method of claim 14, the first node device shutting down any blockchain node, comprising:
and the first node equipment closes the plug-in modules for forming any block chain node.
20. The method of claim 19, said shutting down plug-in modules used to form said any blockchain node, comprising: and closing the plug-in modules used for forming any block chain node through the plug-in manager corresponding to any block chain node.
21. The method of claim 20, wherein the first and second portions are selected from the group consisting of,
the plug-in manager is a global plug-in manager corresponding to all block link points deployed on the first node equipment; alternatively, the first and second electrodes may be,
the plug-in manager is an independent plug-in manager which is independently applied to any blockchain node.
22. The method of claim 19, said shutting down plug-in modules used to form said any blockchain node, comprising:
determining plug-in description information of plug-in modules for forming any block chain node;
and if the operation mode of the opened plug-in module which is matched with the plug-in description information of any plug-in module is an independent mode or the operation mode is a sharing mode and is not shared to other block chain nodes except any block chain node, closing the opened plug-in module.
23. The method of claim 22, the operating mode of any of the plug-in modules being determined by the operating requirements of the any of the plug-in modules.
24. The method of claim 23, wherein the operating requirements of any one plug-in module are defined in the plug-in configuration information corresponding to any one block link point.
25. The method of claim 23, wherein the operational requirements of any plug-in module are global predefined information.
26. The method of claim 19, said shutting down plug-in modules used to form said any blockchain node, comprising: and sequentially closing the plug-in modules for forming any block chain node according to the dependency relationship among the plug-in modules for forming any block chain node.
27. A device for starting block chain node service is applied to a tree system which takes a block chain main network as a root node and each block chain sub-network as other nodes, wherein any block chain sub-network in the tree system is managed by a block chain network corresponding to a father node of the block chain sub-network, and the device comprises:
the control information acquisition module is used for enabling the first node equipment to acquire starting control information of the block chain node service;
a node branch determining module, configured to enable the first node device to determine, according to a subnet management list maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the node starting module is used for enabling the first node equipment to respond to the starting control information and sequentially starting the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the root node to the leaf nodes.
28. A device for closing block chain link point service is applied to a tree system which takes a block chain main network as a root node and each block chain sub-network as other nodes respectively, any block chain sub-network in the tree system is managed by a block chain network corresponding to a father node of the block chain sub-network, and the device comprises:
the control information acquisition module is used for enabling the first node equipment to acquire closing control information of the block chain node service;
a node branch determining module, configured to enable the first node device to determine, according to a subnet management list maintained by each locally deployed block link point, a node branch corresponding to the block chain network to which each block link point belongs in the tree system; a subnet management list maintained by any block chain node is used for recording the block chain subnet managed by the block chain network to which the block chain node belongs;
and the node closing module is used for enabling the first node equipment to respond to the closing control information and sequentially close the block chain link points corresponding to the nodes in the node branches on the first node equipment according to the direction from the leaf nodes to the root nodes.
29. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-26 by executing the executable instructions.
30. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 26.
CN202110611553.0A 2021-06-02 2021-06-02 Method and device for starting/closing block link point service Active CN113067899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110611553.0A CN113067899B (en) 2021-06-02 2021-06-02 Method and device for starting/closing block link point service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110611553.0A CN113067899B (en) 2021-06-02 2021-06-02 Method and device for starting/closing block link point service

Publications (2)

Publication Number Publication Date
CN113067899A true CN113067899A (en) 2021-07-02
CN113067899B CN113067899B (en) 2021-07-30

Family

ID=76568495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110611553.0A Active CN113067899B (en) 2021-06-02 2021-06-02 Method and device for starting/closing block link point service

Country Status (1)

Country Link
CN (1) CN113067899B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363336A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Method and device for starting/closing block link point service
CN114363349A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Starting method and device of block chain subnet

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180121909A1 (en) * 2016-10-28 2018-05-03 International Business Machines Corporation System and method to dynamically setup a private sub-blockchain based on agility of transaction processing
CN108200210A (en) * 2018-02-12 2018-06-22 众安信息技术服务有限公司 The method, apparatus and computer-readable medium of chain management based on block chain
CN109639550A (en) * 2018-12-06 2019-04-16 北京磁云数字科技有限公司 A kind of multi-tiling chain network network-building method, apparatus and system
CN111355780A (en) * 2020-02-18 2020-06-30 杭州云象网络技术有限公司 Block chain-based Internet of things monitoring management method and system
CN112887160A (en) * 2021-04-29 2021-06-01 杭州链城数字科技有限公司 Block chain all-in-one machine, multi-node deployment method and device thereof, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180121909A1 (en) * 2016-10-28 2018-05-03 International Business Machines Corporation System and method to dynamically setup a private sub-blockchain based on agility of transaction processing
CN108200210A (en) * 2018-02-12 2018-06-22 众安信息技术服务有限公司 The method, apparatus and computer-readable medium of chain management based on block chain
CN109639550A (en) * 2018-12-06 2019-04-16 北京磁云数字科技有限公司 A kind of multi-tiling chain network network-building method, apparatus and system
CN111355780A (en) * 2020-02-18 2020-06-30 杭州云象网络技术有限公司 Block chain-based Internet of things monitoring management method and system
CN112887160A (en) * 2021-04-29 2021-06-01 杭州链城数字科技有限公司 Block chain all-in-one machine, multi-node deployment method and device thereof, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谷宁静: "基于区块链的电子政务数据共享设计研究", 《信息安全与通信保密》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363336A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Method and device for starting/closing block link point service
CN114363349A (en) * 2021-12-31 2022-04-15 支付宝(杭州)信息技术有限公司 Starting method and device of block chain subnet
CN114363349B (en) * 2021-12-31 2024-04-02 支付宝(杭州)信息技术有限公司 Block chain sub-network starting method and device

Also Published As

Publication number Publication date
CN113067899B (en) 2021-07-30

Similar Documents

Publication Publication Date Title
CN113067904B (en) Method for building block chain sub-network and block chain system
CN113259455A (en) Cross-subnet interaction method and device
CN113067894B (en) Method for node to exit block chain sub-network
CN113067895B (en) Method for building block chain sub-network and block chain system
CN113067899B (en) Method and device for starting/closing block link point service
CN113098983B (en) Task execution method and device based on intelligent contract
CN113067897B (en) Cross-chain interaction method and device
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
CN113326290B (en) Cross-network query control method
CN113259117B (en) Method for synchronizing node information lists
CN113055190B (en) Access control method for client
CN113259466B (en) Block chain subnet operation state control method and block chain system
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
CN113259119B (en) Block chain message distribution method and device
CN114363162A (en) Block chain log generation method and device, electronic equipment and storage medium
CN115086338A (en) Block chain subnet building method and device
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
CN114363336A (en) Method and device for starting/closing block link point service

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