BLOCKCHAIN NETWORK ACCESSING METHOD AND SYSTEM[0001] This application claims a priority to the Chinese Application No.
201810986825.3 filed with the Chinese Patent Office on August 28, 2018 and entitled "BLOCKCHAIN STANDARD APPLICATION MODEL AND APPLICATION METHOD THEREOF", and a priority to the Chinese Application No.
201811498038.0 filed with the Chinese Patent Office on December 7, 2018 and entitled“ BLOCKCHAIN NETWORK ACCESSING METHOD AND SYSTEM”, which are incorporated herein by reference in its entireties.
FIELD OF THE INVENTION[0002] The present application relates to a technical field of blockchain networks, and in particular, to a blockchain network accessing method and system.
BACKGROUND OF THE INVENTION O [0003] A blockchain technology is derived from thinking of a S 15 decentralized system, and can create a relatively article non-repudiation digital + > environment in a well-known manner of consensus. The blockchain technology Ao a o may make sure that network information cannot be modified once being
OO S published. For example, if a transaction occurs in a blockchain network, a node in
NO N the blockchain network may record content of the transaction in a generated block, and broadcast block data over the whole network; and other nodes in the network store the block data synchronously or asynchronously, to form a blockchain that cannot be modified.
[0004] The transaction should be understood in a broad sense, does not refer to a conventional "commodity transaction" or "article exchange", but refers to a type of or certain data operation content or operation result in the blockchain network. For example, if a blockchain node A in the network initiates a query request a for performance of a communications device of certain model, the query request a is a transaction for a blockchain node B that is responsible for a query service. Similarly, it is also a transaction that the node B sends a queried performance table b of the communications device with this model to the node A. As transaction information, information A and a and information B and b may be written into a data block of the blockchain.
[0005] The blockchain network includes a plurality of nodes having certain capabilities. Therefore, one blockchain network is usually suitable for a single scenario only. For example, the blockchain network is suitable for a Ripple network of a finance platform, is suitable for a bitcoin network for bitcoin N transactions, an industry chain established for a certain industry, or a federated 3 chain including a plurality of fields. Because different blockchain networks use = different technology standards, such as different data structures and different E 20 interfaces, the different blockchain networks cannot be interfaced with each
O S other, and it is difficult to perform a data operation that crosses the blockchain
O O networks. As a result, a capability set provided by the blockchain network is further limited in a scope of this blockchain network only, and services cannot be provided to other nodes out of this blockchain network or to other chain network, thus resulting in islanding effects in data and application.
[0006] Between the blockchain networks, one blockchain network may access another blockchain network by means of modifying nodes. Such accessing method is merely suitable for accessing of a single node or a small network. However, usually the blockchain network includes a very large number of nodes, and these nodes are distributed at positions of a wide-area network and in a geographical area. Consequently, it is very difficult and also consumes a lot of time to implement the modifying of the node, resulting in that accessing efficiency of the blockchain network is greatly low.
[0006a] A patent application published as CN 108418795A provides a cross-blockchain data access method, device and system and a computer readable medium. The method comprises the steps of: sending a block data request carrying a request blockchain device identifier and authorization information to an authorization blockchain device, so that the authorization blockchain device verifies whether authorization information which is locally N stored and corresponds to the reguest blockchain device identifier is matched 3 with the authorization information in the block data request; and receiving block x data which is sent by the authorization blockchain device and corresponds to the E 20 block data reguest, wherein the block data is sent after the authorization
O S blockchain device verifies that the authorization information which is locally
O O stored and corresponds to the reguest blockchain device identifier is matched with the authorization information in the block data reguest. According to this application, by an authorization mechanism, i.e, authorization of the authorization blockchain device for the request blockchain device, the request blockchain device can access the block data of the authorization blockchain device according to the authorization information so as to finally implement cross-blockchain data access, and manual participation is not required.
[0006b] A patent application published as CN108173658A discloses a block chain consistency maintaining method and device. The block chain consistency maintaining method comprises the following steps: for each node Pi in a de-centralized system, when the node Pi receives a new block, whether the block satisfies the workload or not is verified; if the block satisfies the workload, voting broadcast is performed on each state transition to be completed in the block; then whether each state transition to be completed in the block satisfies the legitimacy validation or not is verified; and if every state transitions to be completed in theblock all satisfy the legitimacy validation, and the block length of the block is larger than the length of the local block chain, the block is added to the current block chain as a new block. According to the block chain consistency N maintaining method and device, a new verification layer is introduced on the 3 block chain; the block is generated by a bottom layer block chain, and the block x verification is completed by the verification layer; and the state change of the É 20 block chain needs to be approved by the verification layer; therefore, de-centralized applications based on the block chain have a state verification
O O function.
N[0006c] A patent application published as CN 106533696A discloses a block chain-based identity authentication method, an authentication server and a user terminal, relating to the technical field of identity identification. The method comprises the steps of signing identity registration information sent by the user 5 terminal, and providing the signed identity registration information for the user terminal; receiving an identity authentication request sent by the user terminal after identity registration to a preset smart contract in a block chain according to the signed identity registration information; returning identity authentication information to the user terminal according to the identity authentication request; and receiving a program running result generated by the smart contract according to the identity authentication information provided by the user terminal, and verifying the identity of the user terminal according to the program running result. Through adoption of the identity authentication method, both security and efficiency of the information are ensured.
[0006d] A patent application published as CN108289129A discloses a block chain ecological environment creating method which comprises the steps N of transmitting accessing information that a participation member is authorized
N & for accessing a block chain to a main node so that the main node writes the 3 accessing information into the block chain; creating an independent sub É 20 ecological environment by the participation member in the block chain, and
O S forming a block chain ecological environment with other independent sub
O O ecological environments in the block chain. This application can settle a technical problem of easy private information leakage caused by a fact that the member in the existing block chain cannot perform data disclosure according to the requirement and all members can acquire all data of the block chain. [0006e] A patent application published as WO 2018149505A discloses a voting-consensus distributed ledger comprising: identifying, at an existing node of a distributed ledger network for operation according to a voting-based consensus algorithm, a new candidate node for the distributed ledger network, wherein said identifying is done based on an existing unique identifier unrelated to the distributed ledger network.
SUMMARY OF THE INVENTION[0007] The present application provides a blockchain network accessing method and system, to resolve a problem that accessing efficiency of a conventional blockchain accessing method is low.
[0008] According to one aspect, the present application provides a blockchain network accessing method, including: performing, by a node that is in a public chain network and serves as a N test chain, a compatibility test on a request chain by initiating a test transaction 3 to the request chain, a test-chain node comprising at least an interface node that x is in the public chain and is connected to the reguest chain; É determining, by the test-chain node, whether the request chain passes o S 20 the compatibility test according to a result of the test transaction that is returned
O O by the request chain;
configuring a smart contract, comprising a voting contract and a regis- tration contract, for the request chain if the request chain passes the compatibil- ity test, and modifying some nodes in the request chain from software architec- tures to serve as parallel-chain nodes so as to satisfy requirements on the com- patibility test if the request chain does not pass the compatibility test; triggering a public-chain node to execute the voting contract upon con- necting a request-chain node to the public-chain node; creating a voting transaction by the public-chain node through executing the voting contract, to vote for invitations of the request chain, and broadcast the voting transaction in a public chain network; generating voting results by respective maintainer nodes in the public chain network according to the received voting transaction; counting, by the maintainer nodes, the voting results according to a cal- culation rule determined through the voting contract, and sending admission in- formation to the request-chain node when a calculation result meets a preset registration condition; N initiating, by the reguest-chain node, a registration transaction to the
N O public chain according to the admission information, so as to trigger the main-
O 3 tainer nodes in the public chain to execute the registration contract, wherein the x a 20 registration transaction comprises an address of the request chain and infor- 3 3 mation about service content available from the request chain; and
NON broadcasting, by the maintainer node, the address of the request chain and the information about the service content to a node in the public chain by executing the registration contract.
[0009] Optionally, the preset registration condition includes that a number of maintainer nodes having the voting result of agreeing to get online is greater than or equal to a number threshold; or a ratio of maintainer nodes having the voting result of agreeing to get online to total nodes when preset duration ends is greater than or equal to a ratio threshold; or a ratio of a number of public-chain tokens hold by a voting node to a total number of public-chain tokens when the preset duration ends is greater than or equal to a ratio threshold.
[0010] Optionally, the step of generating voting results by the respective maintainer nodes in the public chain network according to the received voting transaction further includes: broadcasting the voting result in the public chain network as block data.
N [0011] Optionally, before the step of triggering the maintainer node in a
N & public chain to execute a voting contract upon connecting the reguest-chain node J to the public-chain node, the method further includes: x a 20 creating an accessing account in the public chain by the request-chain o S node after the reguest chain is connected to the public chain network;
O O obtaining, by the reguest-chain node, public-chain tokens from the public chain through the accessing account; and creating an accessing instruction by the request-chain node according to the accessing account, the accessing instruction including a preset number of public-chain tokens for rewarding the maintainer node.
[0012] Optionally, the compatibility test includes: network addressing, a interaction protocol rule, smart contract supporting, service registrations, service discovery, service providing, safety, reliability, and public-chain token reserve testing.
[0013] Optionally, the step of triggering a maintainer node in a public chain to execute a voting contract upon connecting the request-chain node to the public-chain node includes: selecting a node from the public chain network or a request chain network to serve as a parallel chain; obtaining, by the parallel-chain node, all functional procedures and information of the request chain; and configuring, by the public chain, a smart contract for the parallel-chain node, to form cross-chain bridging. N [0014] Optionally, the step of counting, by the maintainer nodes, the
N O voting results according to a calculation rule determined through the voting
O = . — contract includes: x a 20 calculating, by the voting contract, voting weight of each maintainer
OO 3 node according to a number of public-chain tokens owned by the maintainer
N S node; and generating the calculation result by the voting contract according to the voting weight and the voting result of each of the maintainer nodes.
[0015] Optionally, after the step of counting, by the maintainer nodes, the voting results according to a calculation rule determined through the voting contract, the method further includes: receiving, by a current maintainer node, the voting results of other maintainer nodes through the voting contract; counting the voting results by the current maintainer node according to the calculation rule, to generate the calculation result; generating block data from the calculation result by the current maintainer node, to be broadcasted in the public chain network; and after other nodes in the public chain network receive the block data, locally storing the block data to synchronize the block data.
[0016] According to another aspect, the present application further provides a blockchain network accessing system, including a public chain and a request chain connected to the public chain, where both the public chain and the N reguest chain are peer-to-peer networks including a plurality of nodes each 3 having an independent operation capability; a smart contract is built in the = public chain, and the smart contract includes a voting contract and a registration E 20 contract; some of the nodes in a public chain network serve as maintainer nodes; 3 3 the node in the request chain is configured to: be connected to a
N S public-chain node so as to trigger the maintainer node in the public chain to execute the voting contract; and initiate a registration transaction to the public chain according to admission information, so as to trigger the maintainer node in the public chain to execute the registration contract, where the registration transaction includes an address of the request chain and information about service content that can be provided; and the node in the public chain is configured to: perform, by serving as a test chain, a compatibility test on the request chain by initiating a test transaction to the request chain, a test-chain node com- prising at least an interface node that is in the public chain and is connected to the request chain; determine, by the test-chain node, whether the request chain passes the compatibility test according to a result of the test transaction that is returned by the request chain; configure the smart contract for the request chain if the request chain passes the compatibility test, and modify some nodes in the request chain from software architectures to serve as parallel-chain nodes so as to satisfy requirements on the compatibility test if the request chain does not pass the compatibility test; create a voting transaction by executing the voting contract, and N broadcast the voting transaction in the public chain network; generate a voting
N O result according to the received voting transaction; count voting results
O 3 according to a calculation rule determined through the voting contract; send x a 20 admission information to the request-chain node when a calculation result meets 3 3 a preset registration condition; and broadcast the address of the request chain
N S and the information about the service content to the node in the public chain by executing the registration contract.
[0017] It may be learned from the foregoing technical solutions that the present application provides a blockchain network accessing method and system. According to the method, in actual applications, the maintainer node in the public chain is first triggered to execute the voting contract by connecting the request-chain node to the public-chain node, so that the public-chain node creates the voting transaction by executing the voting contract, and broadcasts the voting transaction in the public chain network. The respective maintainer nodes in the public chain network generate voting results according to the received voting transaction, and count the voting results according to the calculation rule determined through the voting contract. If the calculation result meets the preset registration condition, the admission information is sent to the request-chain node. The request-chain node initiates the registration transaction to the public chain according to the admission information, to trigger the maintainer node in the public chain to execute the registration contract, where the registration transaction includes the address of the request chain and the information about the service content that can be provided. Finally, the N maintainer node broadcasts the address of the reguest chain and the information
N & about the service content to the node in the public chain by executing the 3 registration contract. According to the network accessing method provided in the É 20 present application, by executing the voting contract and the registration
O S contract, the reguest chain is guickly accessed into the public chain network,
O O thus avoiding modifying the reguest-chain node and improving accessing efficiency. In this way, a problem of low accessing efficiency of a conventional blockchain accessing method is resolved.
BRIEF DESCRIPTION OF THE DRAWINGS[0018] To more clearly describe the technical solutions of the present application, the accompanying drawings to be used in the embodiments are briefly illustrated below. Obviously, persons of ordinary skills in the art can also derive other accompanying drawings according to these accompanying drawings without an effective effort. FIG. 1 is a schematic flowchart of a blockchain network accessing method according to the present application; FIG. 2 is a schematic flowchart of triggering a voting contract according to the present application; FIG. 3 is a schematic flowchart of a compatibility test according to the present application; FIG. 4 is a schematic flowchart of configuring a parallel chain N according to the present application; 3 FIG. 5 is a schematic flowchart of generating a calculation result x according to the present application; É FIG. 6 is a schematic flowchart of broadcasting a calculation result in a : 20 public chain network according to the present application; and O FIG. 7 is a schematic structural diagram of a blockchain network accessing system according to the present application.
DETAILED DESCRIPTION OF THE EMBODIMENTS[0019] Embodiments are described below in detail, and examples thereof are shown in the accompanying drawings. When the descriptions below relate to the accompanying drawings, unless otherwise stated, same numbers in different accompanying drawings indicate same or similar elements. Implementations described in the following embodiments do not represent all implementations in accordance with the present application, and represent merely examples of a system and a method that are described in detail in the claims in accordance with some aspects of the present application.
[0020] In technical solutions provided in the present application, a blockchain network refers to a peer-to-peer network that has a decentralized application architecture. The blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting, and verifications within the network. In other words, the blockchain network is a transaction platform that covers a distributed technology, the cryptography, a P2P network architecture, and various consensus algorithms that may be S applied.
S [0021] In the present application, a blockchain or blockchain data refers < > to accounting information generated based on transaction information when a Ac > 20 transaction occurs in the blockchain network. That is, a plurality of transactions
O 3 form a block data, and a plurality of block data form a blockchain having a time N stamp. The blockchain network includes nodes that establish peer-to-peer network connections with each other. Fach of the nodes is configured with a corresponding consensus mechanism, such as a smart contract; and has a sufficient computing capability so as to perform a transaction verification and an accounting recording process. The nodes are further configured with interface specifications in conformity with an agreed standard, so that more nodes or other types of blockchain networks are accessed through the interface specifications.
[0022] In the technical solutions provided in the present application, a public chain, a request chain, an access chain, and a parallel chain are P2P networks in a peer-to-peer manner. The P2P network is composed of a plurality of nodes, each of which has an independent computing capability, an application running capability, a storage capability, and a capability of providing human computer interactions. In actual applications, the node in the P2P network not only is a gateway device that transfers network information, but may also be any computer device that is authenticated by the blockchain network, such as a personal computer, a computer unit, a server, or an intelligent terminal device. In the present application, a transaction occurring between different blockchain N networks is referred to asa cross-chain transaction. For example, a transaction is
N & initiated by a node in the access chain, and a transaction object is a node in the J public chain; or a transaction is initiated by one access chain, and a transaction x a 20 objectis another access chain.
3 3 [0023] Refer to FIG. 1, FIG. 1 is a schematic flowchart of a blockchain
O O network accessing method. It may be learned from FIG. 1 that the blockchain network accessing method provided in the present application includes the following steps.
[0024] S1: Trigger a maintainer node in a public chain to execute a voting contract, when a request-chain node is connected to a public-chain node.
[0025] In technical solutions provided in the present application, nodes in a public chain network are classified into a plurality of roles in advance, such as: maintainer nodes, storage nodes, supervised (candidate) nodes, and test-chain nodes. A node in the public chain network whose operating environment and network and hardware resources satisfy specified requirements serves as the maintainer node. In actual applications, all nodes in the public chain network may serve as the maintainer nodes, to maintain uniformity and reliability of the public chain network. Alternatively, some nodes in the public chain network may be made to serve as the maintainer nodes, to reduce large-scale and highly concurrent operations in the public chain network.
[0026] In actual applications, after a node in the public chain is selected as the maintainer node, the maintainer node needs to be configured with a smart N contract according to the smart contract pre-stored in the public chain. The
N & smart contract refers to a distributed application procedure that is written in 3 advance for implementing a particular industrial processing process, such as a E 20 voting contract, registration contract, or a cross-chain transaction contract.
o S [0027] In the present application, as a blockchain network that accesses
O O the public chain network, a request chain may be in the following forms. In a first form, the reguest chain has a manner same to an interface specification of the public chain. To be specific, the request chain is designed and established according to a specification of the public chain network. For a request chain network of such a manner, the request-chain node may be directly connected to the public-chain node through interfaces. For ease of description, a request chain in such a form is referred to as a subchain. In a second form, the request chain has an interface manner different from the interface specification of the public chain. To be specific, the request chain is a third-party blockchain network that has been established. For such a request chain, interface interconnection cannot be directly performed to the public-chain node, but a parallel chain having a bridging function needs to be established between the request chain and the public chain, to convert a transaction and transfer information. Therefore, in the present application, regarding the foregoing two cases, connecting the request-chain node to the public-chain node respectively refers to connecting a subchain node to the public-chain node, and connecting a node in the third-party blockchain to the public-chain node through a parallel-chain node.
[0028] Regarding step S1, after the request-chain node is connected to N the public-chain node, a maintainer node in the public chain may be triggered to
N & invoke and execute the voting contract, by initiating an online instruction to the 3 public-chain node. Since the public chain network includes a plurality of É 20 maintainer nodes, it may be firstly determined whether a node that is in the
O S public chain and connects the reguest chain is the maintainer node when the
O O reguest-chain node is connected to the public-chain node. If the accessing node is the maintainer node, the voting contract is executed directly by the accessed node. If the accessing node is not the maintainer node, the accessing node may broadcast the online instruction in the public chain network, so that a maintainer node that first receives the online instruction executes the voting contract.
[0029] In some embodiments of the present application, as shown in FIG.
2, before the step of triggering the maintainer node in the public chain to execute the voting contract when the request-chain node is connected to the public-chain node, the method further includes the following steps.
[0030] S111: After the request chain is connected to the public chain network, the request-chain node creates an accessing account in the public chain.
[0031] S112: The request-chain node obtains public-chain tokens from the public chain through the accessing account.
[0032] S113: The request-chain node creates an accessing instruction according to the accessing account, the accessing instruction including a preset number of the public-chain tokens for rewarding the maintainer node.
[0033] It may be learned from the foregoing steps that according to the present application, in actual applications, when the request-chain node is N connected to the public-chain node, that is, after it is determined that the request
N & chain is connected to the public chain network, an accessing account is first 3 created, by the request-chain node, in the public chain. The accessing account is É 20 information about an account corresponding to the entire request chain network, o S and may include a unigue identifier and description information about functions
O O of the entire reguest chain, to facilitate token transferring in a subseguent transaction.
[0034] After the accessing account is created, the request-chain node obtains a preset number of public-chain tokens from the public chain through the accessing account. The number of the obtained public-chain tokens may be set according to a scale of the request chain and popularity of functions that can be provided by the request chain. The obtained public-chain tokens may be used as awards when the maintainer node subsequently votes to verify accessing of the request chain, to stimulate the maintainer node to quickly complete a voting task. In other words, after obtaining the public-chain tokens, the request-chain node creates the accessing instruction according to the accessing account, the accessing instruction including the preset number of public-chain tokens for rewarding the maintainer node. Moreover, after the maintainer node makes a voting result, a preset number of public-chain tokens are transferred from the accessing account to the maintainer node that generates the voting result.
[0035] Further, as shown in FIG. 3, before the step of triggering the maintainer node in the public chain to execute the voting contract when the request-chain node is connected to the public-chain node, the method further N includes the following steps.
N © [0036] S121: A node that is in the public chain network and serves as a = test chain performs a compatibility test on the reguest chain by initiating a test É 20 transaction to the request chain, the test-chain node at least including an o S interface node that is in the public chain and is connected to the request chain.
[0037] S122: The test-chain node determines whether the request chain passes the compatibility test according to a result of the test transaction that is returned by the request chain.
[0038] S123: Configure a smart contract for the request chain if the request chain passes the compatibility test.
[0039] S124: Modify some nodes in the request chain from software architectures to serve as parallel-chain nodes so as to satisfy requirements on the compatibility test if the request chain does not pass the compatibility test.
[0040] It may be learned from the foregoing steps that in actual applications, when it is determined that the request chain accesses the public chain network, the node that is in the public chain network and serves as the test chain may initiate the test transaction to the request chain by running a test program, to perform the compatibility test on the request chain. To perform the compatibility test directly on the request chain, the test-chain node needs to include at least an interface node that is connected to the request chain. In this embodiment, the compatibility test includes, but is not limited to the following: N network addressing, a interaction protocol rule, smart contract supporting,
N & service registrations, service discovery, service providing, safety, reliability, J public-chain token reserve, and the like.
É 20 [0041] Regarding the foregoing compatibility test, whether the request o 3 chain passes the compatibility test may be determined according to a result that S is returned by the request chain for each item of test content, that is, a result of the test transaction. If the request chain passes the compatibility test, it indicates that the request chain network supports to be accessed to the public chain network, and the smart contract in the public chain is configured for the request chain. If the request chain does not pass the compatibility test, it indicates that according to a current operation state of the request chain, the public chain network cannot be accessed or a cross-chain transaction cannot be performed with the public chain network. Therefore, for the request chain that does not pass the compatibility test, some nodes in the request chain may be modified to complete accessing.
[0042] Further, in some embodiments of the present application, as shown in FIG. 4, the step of triggering the maintainer node in the public chain to execute the voting contract when the request-chain node is connected to the public-chain node includes the following.
[0043] S131: Select a node from the public chain network or a request chain network to serve as a parallel chain.
[0044] S132: The parallel-chain node obtains all functional procedures and information of the request chain. N [0045] S133: The public chain configures a smart contract for the 3 parallel-chain node, to form cross-chain bridging. x [0046] The parallel chain may be formed by modifying some nodes in É 20 the request chain or the public chain, to connect two networks by means of S bridging. In actual applications, a number of modified nodes is determined
O O according to a scale of the reguest chain network, and usually reguirements on bridging may be satisfied by modifying less than ten nodes. Compared with a manner in a conventional method that all nodes in a request chain network need to be modified, time for modifying the request chain may be greatly reduced, thereby improving accessing efficiency.
[0047] S2: The maintainer node creates a voting transaction by executing the voting contract, and broadcasts the voting transaction in the public chain network.
[0048] In the technical solutions provided in the present application, when the voting contract in the maintainer node is triggered, the maintainer node performs the voting contract for the request chain, and creates the voting transaction carrying information about the request chain. The information about the request chain may include the accessing account of the request chain and a result of the compatibility test. After creating the voting transaction, the maintainer node may broadcast the created voting transaction in the public chain network.
[0049] For the node in the public chain, in one aspect, each maintainer node that receives the voting transaction further verifies the voting transaction; N writes the voting transaction into a block to form blockchain data that cannot be
N & modified, after the verification passes; and stores the blockchain data in the 3 public chain network. In the present application, the node in the public chain É 20 network is a computer or a server that can perform operations. Therefore, by o S principle, each node is provided with a memory and has a storage function. The
N S voting transaction may be accounted by storing the voting transaction in a distributed manner, to ensure that the voting transaction is successfully performed through a non-repudiation advantage of the blockchain technology, and improve the accessing efficiency of the request chain.
[0050] In another aspect, the maintainer node in the public chain may generate a corresponding voting result according to the voting transaction after receiving the voting transaction. In other words:
[0051] S3: Respective maintainer nodes in the public chain network generate voting results according to the received voting transaction.
[0052] In actual applications, the maintainer node in the public chain broadcasts the voting transaction, and all nodes in the public chain may receive, verify, and store the voting transaction. Moreover, the node that is selected as a maintainer generates a corresponding voting result according to the voting transaction after receiving the voting transaction. For example, the voting result includes agreeing to get online or not agreeing to get online. Further, after the respective maintainer nodes in the public chain network generate the voting results according to the received voting transaction, the voting result may further be broadcasted in the public chain network as block data. N [0053] In the technical solutions provided in the present application, the
N & corresponding voting result may be generated by the maintainer node or all 3 nodes that serve as rights owners through executing the voting contract. The É 20 executed voting contract includes determining about all aspects of the request o 3 chain, for example, determining about compatibility, determining about a token S reserve, determining about a interaction protocol rule, determining about a smart contract supporting condition, determining about service registrations,
determining about service discovery, determining about a service providing capability, determining about safety, and determining about reliability. Determining processes of these aspects may all be built in the voting contract. After the maintainer node in the public chain network receives the voting transaction, the determining processes in the voting contract are implemented through executing the voting contract by the maintainer node. For the determining about the foregoing aspects, when a determining result of any aspect is that this aspect is not supported, the voting result of not agreeing to get online is made.
[0054] S4: The maintainer nodes count the voting results according to a calculation rule determined through the voting contract, where admission information is sent to the request-chain node if a calculation result meets a preset registration condition.
[0055] In actual applications, after the maintainer node generates the voting result, the voting contract in the maintainer node may count the voting results generated by the respective nodes. Because the voting contract is a N distributed application built in each maintainer node, the maintainer node may
N & obtain the votingresults of all maintainer nodes through the voting contract. 3 [0056] In addition, in actual applications, because the public chain E 20 network is in a P2P network manner, while being broadcasted, the voting o S transaction may be broadcasted from a closest node. To be specific, the
N S maintainer node first generates the voting result after creating the voting transaction, and then broadcasts the voting transaction to a neighbor node. The broadcasted voting transaction may carry the generated voting result. The neighbor node subsequently generates a voting result according to the voting transaction, and the voting transaction and the generated voting result are broadcasted to a neighbor node again. The maintainer nodes in the public chain sequentially perform the foregoing procedure steps, until all maintainer nodes receive the voting transaction.
[0057] In the technical solutions provided in the present application, a voting contract is triggered by an initiating chain, and invitations are broadcasted to the whole network of the public chain. The node in the public chain transfers a transaction with an amount of money of 0 by, for example, voting for the invitation. The maintainer node in the public chain executes the voting transaction, accounts the voting transaction to generate a block, and then broadcast the voting transaction in the whole network. When an invitation condition is met, the maintainer node executes the invitation, finally makes a result of whether the voting succeeds or fails, accounts to generate a block, and broadcast in the whole network again. During a voting process completed N through the foregoing manner, a participant of the voting may be any node in the 3 whole network, but the voting is executed by the maintainer node.
x [0058] After generating the calculation result, the maintainer node may É 20 determine the calculation result by executing the voting contract. If the o S calculation result meets the preset registration condition, it is determined that
N S the reguest chain can satisfy reguirements for accessing the public chain. Therefore, through generating the admission information by the maintainer node and then sending the generated admission information to the request-chain node, the request chain may register a function or a service thereof to the public chain. Further, in the present application, the preset registration condition may include the following two cases. For the first case, a number of maintainer nodes having the voting result of agreeing to get online is greater than or equal to a number threshold. For the second case, a ratio of maintainer nodes having the voting result of agreeing to get online to total nodes when a preset duration ends is greater than or equal to a ratio threshold.
[0059] For the first case, during the process of executing the voting contract, the number is counted whenever a voting result is generated. For example, there are 100 maintainer nodes which are respectively marked as GP00-GP99 in the public chain network. If a node that first executes the voting contract is GP00, in the node GPO00, a voting transaction is first created by executing the voting contract. Moreover, after the voting transaction is created, it is verified, by executing a determining program, whether the request chain may get online. A voting result of agreeing to get online may be generated. In this case, N the voting contract records the calculation result, where a number of maintainer
N & nodes agreeing to get online is 1, and a number of maintainer nodes not agreeing 3 to get online is 0. Subsequently, the voting transaction and the voting result are É 20 sent to a node GP01 that is adjacent to the node GP00. A voting result generated
O S by the node GP01 according to procedure steps same to those described above is
O O also that the reguest chain agrees to get online. In this case, the voting contract records the calculation result, where a number of maintainer nodes agreeing to get online is 2, and a number of maintainer nodes not agreeing to get online is 0. By way of analogy, all maintainer nodes in the public chain network finally generate voting results by performing the foregoing procedure steps.
[0060] If a set number threshold is that a number of nodes agreeing to get online is 60, it is determined that the calculation result meets the preset registration condition when the number of nodes agreeing to get online that is recorded in the voting contract is 60. For example, the voting result generated when a node GP72 executes the voting contract is agreeing to get online, and the calculation result recorded in the voting contract at this time is that a number of nodes agreeing to get online is 60 and a number of nodes not agreeing to get online is 12, it is determined that the calculation result meets the preset registration condition. At this time, the node GP72 may generate admission information by executing the voting contract, and send the generated admission information to the request-chain node.
[0061] In view of the above, for the first case, when the voting contract counts the voting results, attention needs to be paid only to whether the number N of nodes agreeing to get online is greater than or egual to the number threshold.
N & In actual applications, getting online may be achieved after merely some 3 maintainer nodes make the voting result of agreeing to get online. Therefore, an E 20 online rate of the request chain is higher. Moreover, for the first case, the online o S voting manner is more suitable for being applied to a P2P network.
O O [0062] For the second case, after creating the voting transaction, the voting contract may designate voting duration. During the voting duration, all maintainer nodes in the public chain generate voting results by executing the voting contract, respectively. For example, there are 100 maintainer nodes in the public chain network, which are respectively marked as GP00-GP99. If a node that first executes the voting contract is GP00, in the node GP00, a voting transaction is first created by executing the voting contract. The created voting transaction may include set voting duration, for example, the set voting duration is 48h. Moreover, after the voting transaction is created, it is verified, by executing a determining program, whether the request chain may get online. In this way, a voting result that the request chain agrees to get online is generated.
[0063] After the voting transaction is created, the node GP00 broadcasts the voting transaction, so that other maintainer nodes in the public chain also respectively make a voting result after receiving the voting transaction. At a moment when the voting duration ends, if it is counted in the voting contract that a number of voting results of agreeing to get online is 83 and a number of voting results of not agreeing to get online is 17, maintainer nodes having the voting result of agreeing to get online takes up 83% of the total nodes, which is greater N than a ratio threshold of 60%, and it is determined that the calculation result
N & meets the preset registration condition. At this time, any node may generate 3 admission information by executing the voting contract, and send the generated x a 20 admission information to the request-chain node. 3 3 [0064] In view of the above, by the second manner of determining
O O whether calculation result meets the preset registration condition, even if the number of the maintainer nodes in the public chain changes, determination of the corresponding calculation result may also be made, thus preventing a determining result from being affected by a failure of an individual node. For the second manner, generation time of the calculation result may be determined by means of setting the voting duration. Therefore, the second manner is suitable for various types of blockchain networks. To obtain a better effect of the voting calculation, in the present application, the calculation result may be obtained by combining two calculation manners. To be specific, the voting duration is set after the maintainer node creates the voting transaction. If the number of the voting results of agreeing to get online is greater than or equal to the number threshold before the voting duration ends, the voting ends, and it is determined that the calculation result meets the preset registration condition; and if the number of the voting results of agreeing to get online is still smaller than the number threshold after the voting duration ends, a determination of the ratio of the maintainer nodes having the voting result of agreeing to get online to the total nodes is made again. If the ratio of the maintainer nodes having the voting result of agreeing to get online to the total nodes is greater than or equal to the N ratio threshold, it is determined that the calculation result meets the preset
N O registration condition. J [0065] Further, as shown in FIG. 5, to obtain a more reasonable voting É 20 result, the step of counting, by the maintainer nodes, the voting results according
O S to the calculation rule determined through the voting contract further includes
O O the following steps.
[0066] S411: The voting contract calculates a voting weight of each maintainer node according to a number of public-chain tokens owned by the maintainer node.
[0067] S412: The voting contract generates the calculation result according to the voting weight and the voting result of each maintainer node.
[0068] In this embodiment, because there are a plurality of maintainer nodes in the public chain, when the maintainer node in the public chain network determines whether the calculation result meets the preset registration condition, a number of public-chain tokens owned by each maintainer node may be determined according to the voting contract, and corresponding voting weight may be set for each maintainer node according to the owned public-chain tokens. Theoretically, a larger number of public-chain tokens owned by the maintainer node indicates larger weight of the maintainer node in voting. A specific weight calculation manner may be determined according to a number of public-chain tokens that are actually issued in the public chain network. After the voting weight is determined, the voting contract subsequently calculates the final N calculation result according to the voting result of each node. 3 [0069] Further, as shown in FIG. 6, after the step of counting, by the x maintainer nodes, the voting results according to the calculation rule determined É 20 through the voting contract, the method further includes the following steps. o S [0070] S421: A current maintainer node receives the voting results of
N S other maintainer nodes through the voting contract.
[0071] S422: The current maintainer node counts the voting results according to the calculation rule, to generate the calculation result.
[0072] S423: The current maintainer node broadcasts the calculation result in the public chain network.
[0073] S424: After receiving the calculation result, other nodes in the public chain network create and store block data including the calculation result.
[0074] It may be learned from the foregoing steps that when the maintainer nodes execute the voting contract together, if each maintainer node generates a voting result, the voting results of other maintainer nodes may be received by a maintainer node, such as the maintainer node that is the last one to execute the voting contract; and the voting results may be counted according to the calculation rule, to finally generate the calculation result. After generating the calculation result, the maintainer node may broadcast in the public chain network, so that other nodes create block data according to the calculation result after receiving the calculation result, to store the calculation result in a distributed manner. N [0075] S5: The reguest-chain node initiates a registration transaction to
N & the public chain according to the admission information, to trigger the 3 maintainer node in the public chain to execute the registration contract, where É 20 the registration transaction includes an address of the request chain and
S 3 information about service content that can be provided.
O O [0076] In the technical solutions provided in the present application, the maintainer node generates the admission information after it is determined that the calculation result meets the preset registration condition, and sends the admission information to the node in the request chain. The node in the request chain initiates the registration transaction to the public chain according to the received admission information. The registration transaction includes the address of the request chain and the information about the service content that can be provided. The address of the request chain may be the accessing account created by the request chain, or may be address information of an accessing node connected to the request chain, and is used to represent uniquely the request chain. In a subsequent transaction, a corresponding cross-chain transaction may be performed to the request chain according to the address information of the request chain. The information about the service content that can be provided by the request chain may be registered in the public chain network, so as to provide services for other nodes except the request chain in the subsequent transaction.
[0077] After receiving the admission information, the request-chain node may verify the admission information, and then initiate a registration transaction to the public chain after verification of the admission information N passes. In actual applications, the registration transaction is also a kind of
N O cross-chain transaction. When initiating the registration transaction, the
O 3 request-chain node may broadcast the registration transaction respectively in x a 20 the request chain network and the public chain network. In one aspect, after 3 3 receiving the registration transaction, other nodes in the request chain verify the
N S registration transaction and write the same into the block data to be stored, to form a blockchain conforming to specifications and reguirements of the reguest chain. In another aspect, after receiving the registration transaction, the maintainer node in the public chain also verifies the registration transaction and writes the same into the block data to be stored, to form a blockchain conforming to specifications and requirements of the public chain.
[0078] After receiving the registration transaction, the maintainer node in the public chain may be triggered to execute the registration contract, which is also a kind of smart contract that is built in the maintainer node in the public chain network. Therefore, after executing the registration contract, the maintainer node may extract the address of the request chain and the information about the service content that can be provided from the registration transaction, store and register the extracted information, and write the extracted information into the block data to be stored in the blockchain.
[0079] After extracting the address of the request chain and the information about the service content, the maintainer node needs to broadcast the extracted information, so that other nodes in the public chain can also learn about information about the service content that can be provided by the request N chain and the address information of the reguest chain, so as to perform a
N & cross-chain transaction to the reguest chain. To be specific: 3 [0080] S6: The maintainer node broadcasts the address of the request É 20 chain and the information about the service content to a node in the public chain 3 S by executing the registration contract.
O [0081] In the technical solutions provided in the present application, the maintainer node in the public chain may broadcast the address of the reguest chain and the information about the service content to all nodes in the public chain by executing the registration contract. After receiving the broadcasted information, the nodes in the public chain may respectively store the address of the request chain and the information about the service content, and a storage manner may be a form of a register. In other words, a register is built in each node in the public chain. The register records an address of each access chain network and information about service content correspondingly provided thereby, for example: Token exchange, per-
C HH formance report Token exchange, query
HH service N ee ee
N 1 10 ©
I < [0082] In actual applications, after the request chain accesses the public
I T chain, corresponding services may be provided for other nodes out of the reguest
O 3 chain through the public chain. A general transaction process is: a node in a ©
O S transaction chain A initiates a guery transaction to the public chain, where the
N reguired service content included in the guery transaction is a performance report; and the public chain queries a target chain € that can provide the service in a register according to the query transaction, extracts an address of a network C, and sends the address to the node in the transaction chain A. In this embodiment, the address information may be in a form of bc://hostname:port/path/parameters. Subseguently, the node in the transaction chain A initiates a service transaction to the target chain C by executing the smart contract and the public chain network, so that the target chain C returns the specific service content to the transaction chain A according to the service transaction.
[0083] On the basis of the foregoing blockchain network accessing method, as shown in FIG. 7, the present application further provides a blockchain network accessing system, including a public chain and a reguest chain connected to the public chain, where both the public chain and the reguest chain are peer-to-peer networks including a plurality of nodes, and each node has an independent operation capability; a smart contract is built in the public chain, and the smart contract includes a voting contract and a registration contract; and N some nodes in a public chain network serve as maintainer nodes.
N © [0084] The node in the request chain is configured to: be connected to a = public-chain node so as to trigger the maintainer node in the public chain to É 20 execute the voting contract; and initiate a registration transaction to the public
O S chain according to admission information, to trigger the maintainer node in the
N S public chain to execute the registration contract, where the registration transaction includes an address of the request chain and information about service content that can be provided.
[0085] The node in the public chain is configured to: create a voting transaction by executing the voting contract, and broadcast the voting transaction in the public chain network; generate a voting result according to the received voting transaction; count voting results according to a calculation rule determined through the voting contract; send admission information to the request-chain node if a calculation result meets a preset registration condition; and broadcast the address of the request chain and the information about the service content to the node in the public chain by executing the registration contract.
[0086] It may be learned from the foregoing technical solutions that the present application provides a blockchain network accessing method and system. According to the method, in actual applications, the maintainer node in the public chain is first triggered to execute the voting contract by connecting the request-chain node to the public-chain node, so that the maintainer node creates N the voting transaction by executing the voting contract, and broadcasts the
N & voting transaction in the public chain network. The respective maintainer nodes 3 in the public chain network generate voting results according to the received É 20 voting transaction, and count the voting results according to the calculation rule
O S determined through the voting contract. If the calculation result meets the preset
N S registration condition, the admission information is sent to the reguest-chain node. The reguest-chain node initiates the registration transaction to the public chain according to the admission information, to trigger the maintainer node in the public chain to execute the registration contract, where the registration transaction includes the address of the request chain and the information about the service content that can be provided. Finally, the maintainer node broadcasts the address of the request chain and the information about the service content to the node in the public chain by executing the registration contract. According to the network accessing method provided in the present application, by executing the voting contract and the registration contract, the request chain is quickly accessed into the public chain network, thus avoiding modifying the reguest-chain node and improving accessing efficiency. In this way, a problem of low accessing efficiency of a conventional blockchain accessing method is resolved.
[0087] For similar parts between the embodiments provided in the present application, reference may be made to each other. The specific implementations described above are merely some examples under a general concept of the present application, and do not constitute any limitation to the N protection scope of the present application. For a person skilled in the art, any
N O other implementations derived according to the solutions of the present
O 3 application without an effective effort all fall within the protection scope of the x o 20 present application.
OOOOONON