Cross-chain configuration method, device, equipment, system and medium based on multiple blockchains
Through the cross-chain configuration lock mechanism, the problem of inconsistent configuration information in multi-blockchain systems is solved, the synchronous effectiveness and reliability of configuration information are achieved, and the strict execution of business logic and consistency of information are ensured.
Patent Information
- Application Number
- CN202211298596.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-10-20
AI Technical Summary
In a multi-blockchain system, the independence of each blockchain makes it difficult to maintain consistency and reliability of configuration information, especially when the configuration information on each chain differs under different business needs.
A cross-chain configuration lock mechanism is introduced. When the first consensus node receives a configuration transaction, it generates a configuration transaction identifier and obtains a blocking or non-blocking chain configuration lock through a cross-chain relay to ensure that the business status of the target chain is locked or unlocked, thereby achieving consistency and reliability of configuration information.
It achieves the synchronous effectiveness and strict execution of cross-chain configuration information, ensures the consistency and reliability of configuration information on each blockchain, and improves the auditability and traceability of the configuration.
Smart Images

Figure CN117951217B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a cross-chain configuration method, device, equipment, system and medium based on multiple blockchains. Background Art
[0002] In a multi-blockchain application scenario, due to the independence of each blockchain in the multi-blockchain, the consensus nodes on each blockchain need to independently configure some basic data information of their own chain.
[0003] For example, for independent blockchains A and B, the consensus nodes on blockchain A can independently configure their own chain's block time, block size, and business logic rules, and other configuration information. Consensus nodes on blockchain B can also independently configure their own chain's block time, block size, and business logic rules, and other configuration information. Obviously, for the consensus nodes on these two chains (i.e., blockchain A and blockchain B), the configuration information will differ due to the different businesses that each chain needs to execute, making it difficult to ensure the consistency of the configuration information on the independent chains. Summary of the Invention
[0004] The embodiments of the present application provide a cross-chain configuration method, apparatus, device, system, and medium based on multiple blockchains. By introducing a configuration mechanism such as a configuration lock between mutually independent blockchains, the consistency and reliability of configuration information on mutually independent blockchains can be ensured.
[0005] On one hand, an embodiment of the present application provides a cross-chain configuration method based on multiple blockchains. The method is executed by a first consensus node. The multiple blockchains include a first chain associated with the first consensus node and a target chain to be cross-chain configured. The first chain network corresponding to the first chain and the target chain network corresponding to the target chain are isolated through a cross-chain relay. The method includes:
[0006] Upon receiving a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction, determining the transaction type of the configuration transaction;
[0007] When the transaction type of the configuration transaction is a blocking transaction type, the chain management configuration contract on the first chain is called to execute the configuration transaction, and a first configuration transaction identifier corresponding to the configuration transaction is generated; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0008] Receive the first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the first business lock state;
[0009] When it is determined based on the first lock declaration transaction that the state of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state, first transaction locking information corresponding to the first lock declaration transaction is generated, and the first transaction locking information is written into the first chain;
[0010] When a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain is obtained, the first cross-chain configuration item in the configuration modification transaction is obtained, and the first cross-chain configuration item is cross-chain configured to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0011] Among them, when there are multiple target chains and the configuration resources indicated by the configuration transaction belong to global configuration resources, the chain management configuration contract corresponding to the global configuration resources is the platform configuration contract on the first chain;
[0012] Call the chain management configuration contract on the first chain to execute the configuration transaction and generate the first configuration transaction identifier corresponding to the configuration transaction, including:
[0013] Write the configuration transaction into the platform configuration contract, call the blocking transaction configuration method in the platform configuration contract, execute the configuration transaction, and obtain the chain identifiers of multiple target chains indicated by the configuration transaction;
[0014] Based on the identifiers of the multiple target chains, a first configuration transaction identifier corresponding to the configuration transaction is generated.
[0015] Among them, the multi-blockchain includes a business main chain managed by the first consensus node through the first chain and a business sub-chain independent of the business main chain; the business main chain includes one or more of the second chain and the third chain independent of the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly formed by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through the authorization of the first consensus node; one target business corresponds to one business sub-chain; multiple target chains include business sub-chains and business main chains.
[0016] Among them, the multi-blockchain includes a business sub-chain and a second chain and a third chain managed by the first consensus node through the full-platform configuration contract on the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly established by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through authorization by the first consensus node; one target business corresponds to one business sub-chain; when the target chain is a business sub-chain, a second chain or a third chain, and the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract includes a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a sub-chain management configuration contract for configuring the business sub-chain.
[0017] Wherein, when there are multiple target chains and the configuration resource indicated by the configuration transaction is a global configuration resource, the chain management configuration contract corresponding to the global configuration resource is a platform configuration contract on the first chain; the configuration transaction includes a second cross-chain configuration item associated with the configuration transaction; and the method further includes:
[0018] When the transaction type of the configuration transaction is a non-blocking transaction type, the platform configuration contract on the first chain is called to execute the configuration transaction, and a second configuration transaction identifier corresponding to the configuration transaction is generated; the second configuration transaction identifier is used to instruct the cross-chain relay to send a second configuration lock acquisition transaction to the target consensus node associated with the target chain; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0019] Receive the second lock declaration transaction sent by the cross-chain relay; the second lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the second business lock state;
[0020] When it is determined based on the second lock declaration transaction that the state of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state, second transaction locking information corresponding to the second lock declaration transaction is generated, and the second transaction locking information is written into the first chain.
[0021] The platform configuration contract on the first chain is called to execute the configuration transaction, and a second configuration transaction identifier corresponding to the configuration transaction is generated, including:
[0022] Write the configuration transaction with the second cross-chain configuration item into the platform configuration contract, call the non-blocking transaction configuration method in the platform configuration contract on the first chain, execute the configuration transaction, and obtain the chain identifier of the target chain indicated in the configuration transaction and the second cross-chain configuration item;
[0023] Based on the chain identifier of the target chain and the second cross-chain configuration item, a second configuration transaction identifier corresponding to the configuration transaction is generated.
[0024] In one aspect, an embodiment of the present application provides a cross-chain configuration method based on multiple blockchains, wherein the multiple blockchains include a first chain and a target chain; the method is executed by a cross-chain relay; the cross-chain relay is used to isolate the first chain network corresponding to the first chain from the target chain network corresponding to the target chain; the method includes:
[0025] When a first configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a first configuration lock acquisition transaction is sent to the target consensus node in the target chain network; the first configuration transaction identifier is generated by the first consensus node in the first chain network calling the chain management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0026] When detecting that the target chain is in the first business lock state, sending a first lock declaration transaction to the first consensus node; the first lock declaration transaction is used to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain when determining that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state based on the first lock declaration transaction;
[0027] Upon detecting a configuration modification transaction on the first chain, obtaining a first cross-chain configuration item in the configuration modification transaction; the configuration modification transaction is sent by the management object based on the first transaction lock information on the first chain;
[0028] The first cross-chain configuration item is cross-chain configured to the target chain, so that the target consensus node unlocks the target chain in the first business locked state through the blocking chain configuration lock.
[0029] The first cross-chain configuration item is configured to the target chain, including:
[0030] A first lock release transaction is constructed based on the first cross-chain configuration item; the first lock release transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock when writing the first cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the first business locked state to the business unlocked state;
[0031] Send the first release lock transaction to the target consensus node.
[0032] The method further includes:
[0033] The chain lock duration of the target chain detected to be in the first business lock state is accumulated. When the accumulated chain lock duration reaches the accumulated lock duration threshold of the blocking chain configuration lock, a timeout release lock transaction is sent to the target consensus node. The timeout release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock, and change the business state of the target chain from the first business lock state to the business unlock state.
[0034] The method further includes:
[0035] When it is detected that the target chain is not in the first business lock state, a first lock failure transaction is sent to the first consensus node, and a first lock failure release lock transaction is sent to the target consensus node. The first lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock.
[0036] The configuration transaction includes a second cross-chain configuration item associated with the configuration transaction; and the method further includes:
[0037] When a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a second configuration lock acquisition transaction is sent to the target consensus node in the target chain network. The second configuration transaction identifier is generated by the first consensus node in the first chain network calling the management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a non-blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0038] When it is detected that the target chain is in the second business lock state, a second lock declaration transaction is sent to the first consensus node; the second lock declaration transaction is used to instruct the first consensus node to generate second transaction lock information corresponding to the second lock declaration transaction for writing into the first chain when the state of the configuration transaction corresponding to the configuration transaction identifier is determined to be the second transaction lock state based on the second lock declaration transaction;
[0039] The second cross-chain configuration item is cross-chain configured to the target chain, so that the target consensus node unlocks the target chain in the second business lock state through a non-blocking chain configuration lock.
[0040] The second cross-chain configuration item is configured to the target chain, including:
[0041] A second lock release transaction is constructed based on the second cross-chain configuration item, and the second lock release transaction is sent to the target consensus node; the second lock release transaction is used to instruct the target consensus node in the target chain to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock when writing the second cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the second business locked state to the business unlocked state.
[0042] Among them, the second configuration lock acquisition transaction is also used to instruct the target consensus node to obtain the block buffer height from the chain configuration contract on the target chain. The block buffer height is used to represent the maximum interval height of the blocks obtained on the target chain before the business state of the target chain is configured to the second business lock state through the non-blocking chain configuration lock.
[0043] The method further includes:
[0044] When it is detected that the target chain is not in the second business lock state, a second lock failure transaction is sent to the first consensus node, and a second lock failure release lock transaction is sent to the target consensus node. The second lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock.
[0045] In one aspect, an embodiment of the present application provides a cross-chain configuration device based on multiple blockchains. The device runs on a first consensus node. The multiple blockchains include a first chain associated with the first consensus node and a target chain to be cross-chain configured. The first chain network corresponding to the first chain and the target chain network corresponding to the target chain are isolated via a cross-chain relay. The device includes:
[0046] A determination module, configured to determine the transaction type of a configuration transaction upon receiving a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction;
[0047] A calling module is configured to, when the transaction type of the configuration transaction is a blocking transaction type, call the chain management configuration contract on the first chain to execute the configuration transaction and generate a first configuration transaction identifier corresponding to the configuration transaction; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0048] A receiving module receives a first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the first business lock state;
[0049] a generating module configured to, when determining based on the first lock declaration transaction that the state of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state, generate first transaction locking information corresponding to the first lock declaration transaction, and write the first transaction locking information into the first chain;
[0050] A first acquisition module is configured to, upon acquiring a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, acquire a first cross-chain configuration item in the configuration modification transaction;
[0051] The first configuration module is used to cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0052] Among them, when there are multiple target chains and the configuration resources indicated by the configuration transaction belong to global configuration resources, the chain management configuration contract corresponding to the global configuration resources is the platform configuration contract on the first chain;
[0053] The calling module includes:
[0054] The calling sub-unit is used to write the configuration transaction into the platform configuration contract, call the blocking transaction configuration method in the platform configuration contract, execute the configuration transaction, and obtain the chain identifiers of multiple target chains indicated by the configuration transaction;
[0055] The generating subunit is configured to generate a first configuration transaction identifier corresponding to the configuration transaction based on identifiers of multiple target chains.
[0056] Among them, the multi-blockchain includes a business main chain managed by the first consensus node through the first chain and a business sub-chain independent of the business main chain; the business main chain includes one or more of the second chain and the third chain independent of the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly formed by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through the authorization of the first consensus node; one target business corresponds to one business sub-chain; multiple target chains include business sub-chains and business main chains.
[0057] Among them, the multi-blockchain includes a business sub-chain and a second chain and a third chain managed by the first consensus node through the full-platform configuration contract on the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly established by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through authorization by the first consensus node; one target business corresponds to one business sub-chain; when the target chain is a business sub-chain, a second chain or a third chain, and the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract includes a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a sub-chain management configuration contract for configuring the business sub-chain.
[0058] Wherein, when there are multiple target chains and the configuration resource indicated by the configuration transaction belongs to a global configuration resource, the chain management configuration contract corresponding to the global configuration resource is the platform configuration contract on the first chain; the configuration transaction includes a second cross-chain configuration item associated with the configuration transaction;
[0059] The calling module is further used to call the platform configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction is a non-blocking transaction type, and generate a second configuration transaction identifier corresponding to the configuration transaction; the second configuration transaction identifier is used to instruct the cross-chain relay to send a second configuration lock acquisition transaction to the target consensus node associated with the target chain; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0060] The receiving module is further configured to receive a second lock declaration transaction sent by the cross-chain relay; the second lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the second business lock state;
[0061] The generation module is further used to generate second transaction locking information corresponding to the second lock declaration transaction when it is determined based on the second lock declaration transaction that the state of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state, and write the second transaction locking information into the first chain.
[0062] The calling module includes:
[0063] A calling submodule is used to write a configuration transaction with the second cross-chain configuration item into the platform configuration contract, call the non-blocking transaction configuration method in the platform configuration contract on the first chain, execute the configuration transaction, and obtain the chain identifier of the target chain indicated in the configuration transaction and the second cross-chain configuration item;
[0064] The generation submodule is used to generate a second configuration transaction identifier corresponding to the configuration transaction based on the chain identifier of the target chain and the second cross-chain configuration item.
[0065] In one aspect, an embodiment of the present application provides a cross-chain configuration device based on multiple blockchains, wherein the multiple blockchains include a first chain and a target chain. The device runs on a cross-chain relay, which is used to isolate the first chain network corresponding to the first chain from the target chain network corresponding to the target chain. The device includes:
[0066] A sending module, configured to send a first configuration lock acquisition transaction to a target consensus node in a target chain network upon detecting a first configuration transaction identifier corresponding to a configuration transaction on the first chain; the first configuration transaction identifier is generated by the first consensus node in the first chain network invoking the chain management configuration contract on the first chain to execute a configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type, and the configuration transaction is sent by the management object requesting execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to a first business lock state through the blocking chain configuration lock;
[0067] The sending module is further configured to send a first lock declaration transaction to the first consensus node when detecting that the target chain is in the first business lock state; the first lock declaration transaction is configured to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain when determining, based on the first lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state;
[0068] A second acquisition module is configured to, upon detecting a configuration modification transaction on the first chain, acquire a first cross-chain configuration item in the configuration modification transaction; the configuration modification transaction is sent by the management object based on the first transaction locking information on the first chain;
[0069] The second configuration module is used to cross-chain configure the first cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0070] The second configuration module includes:
[0071] A construction unit is configured to construct a first lock release transaction based on the first cross-chain configuration item; the first lock release transaction is configured to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock when writing the first cross-chain configuration item to the chain configuration contract, and to change the business state of the target chain from the first business locked state to the business unlocked state;
[0072] The sending subunit is used to send the first lock release transaction to the target consensus node.
[0073] Among them, the sending module is also used to: accumulate the chain lock time of the target chain detected to be in the first business lock state, and when the accumulated chain lock time reaches the accumulated lock time threshold of the blocking chain configuration lock, send a timeout release lock transaction to the target consensus node. The timeout release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock, and change the business state of the target chain from the first business lock state to the business unlock state.
[0074] Among them, the sending module is also used to: when it is detected that the target chain is not in the first business locking state, send a first lock failure transaction to the first consensus node, and send a first lock failure release lock transaction to the target consensus node. The first lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock.
[0075] The configuration transaction includes a second cross-chain configuration item associated with the configuration transaction;
[0076] The sending module is further configured to send a second configuration lock acquisition transaction to the target consensus node in the target chain network when a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected. The second configuration transaction identifier is generated by the first consensus node in the first chain network calling the management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a non-blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0077] The sending module is further configured to send a second lock declaration transaction to the first consensus node when detecting that the target chain is in the second business lock state; the second lock declaration transaction is configured to instruct the first consensus node to generate second transaction lock information corresponding to the second lock declaration transaction for writing into the first chain when determining, based on the second lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the second transaction lock state;
[0078] The second configuration module is further used to cross-chain configure the second cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the second business lock state through a non-blocking chain configuration lock.
[0079] The second configuration module includes:
[0080] A construction unit, configured to construct a second lock release transaction based on the second cross-chain configuration item;
[0081] The sending subunit is used to send the second lock release transaction to the target consensus node; the second lock release transaction is used to instruct the target consensus node in the target chain to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock when writing the second cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the second business locked state to the business unlocked state.
[0082] Among them, the second configuration lock acquisition transaction is also used to instruct the target consensus node to obtain the block buffer height from the chain configuration contract on the target chain. The block buffer height is used to represent the maximum interval height of the blocks obtained on the target chain before the business state of the target chain is configured to the second business lock state through the non-blocking chain configuration lock.
[0083] The sending module is also used to:
[0084] When it is detected that the target chain is not in the second business lock state, a second lock failure transaction is sent to the first consensus node, and a second lock failure release lock transaction is sent to the target consensus node. The second lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock.
[0085] On the one hand, an embodiment of the present application provides a cross-chain configuration system based on multiple blockchains, the system comprising: a first consensus node in a first chain network, a target consensus node in a target chain network, and a cross-chain relay; the first chain network and the target chain network are isolated by a cross-chain relay;
[0086] The first consensus node is used to determine the transaction type of the configuration transaction when receiving the configuration transaction for cross-chain configuration of the target chain sent by the management object based on the configuration transaction, and when the transaction type of the configuration transaction is a blocking transaction type, call the chain management configuration contract on the first chain to execute the configuration transaction and generate a first configuration transaction identifier corresponding to the configuration transaction;
[0087] The cross-chain relay is used to send a first configuration lock acquisition transaction to a target consensus node in a target chain network when detecting a first configuration transaction identifier corresponding to the configuration transaction on the first chain;
[0088] The target consensus node is used to obtain the blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0089] The cross-chain relay is used to send a first lock declaration transaction to the first consensus node when detecting that the target chain is in the first business lock state;
[0090] The first consensus node is further configured to, when determining based on the first lock declaration transaction that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction locked state, generate first transaction locking information corresponding to the first lock declaration transaction of the first chain, and write the first transaction locking information into the first chain;
[0091] The first consensus node is further configured to, upon obtaining a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, obtain the first cross-chain configuration item in the configuration modification transaction;
[0092] The cross-chain relay is also used to cross-chain configure the first cross-chain configuration item to the target chain when a configuration modification transaction on the first chain is detected.
[0093] In one aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in the above aspect of the embodiment of the present application.
[0094] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded and executed by a processor, so that a computer device with a processor executes the method provided in the above aspect of the embodiment of the present application.
[0095] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the above aspect.
[0096] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain, and when the transaction type of the configuration transaction is a blocking transaction type, execute the above configuration transaction to generate a first configuration transaction identifier corresponding to the configuration transaction; then, through the first configuration transaction identifier, the target consensus node can obtain a blocking chain configuration lock corresponding to the blocking transaction type, and lock the business state of the target chain through the blocking chain configuration lock, and after locking the business state of the target chain, the cross-chain configuration items configured for the target chain on the first chain are configured to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application can uniformly manage the configuration information of other chains through the first consensus node on the first chain to ensure the consistency of the configuration information on the chain. At the same time, when the business state of the target chain is locked, the first consensus node can generate corresponding transaction lock information and write it to the first chain, which can also effectively ensure the auditability and traceability of the configuration of the target chain; in addition, the introduction of a configuration mechanism such as a blocking chain configuration lock can achieve synchronous effectiveness of the configuration, ensure the strict execution of the business logic, and also ensure the consistency and reliability of the configuration information on each independent blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0098] Figure 1 This is a schematic diagram of the hierarchical structure of a blockchain network provided in an embodiment of the present application;
[0099] Figure 2 This is a schematic diagram of a scenario of a blockchain electronic bill platform based on multiple blockchains provided in an embodiment of the present application;
[0100] Figure 3 This is a schematic diagram of a cross-chain configuration based on multiple blockchains provided in an embodiment of the present application;
[0101] Figure 4This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0102] Figure 5 This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0103] Figure 6 This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0104] Figure 7 This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0105] Figure 8 This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0106] Figure 9 This is a flowchart of a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application;
[0107] Figure 10 This is a schematic diagram of the structure of a cross-chain configuration device based on multiple blockchains provided by this application;
[0108] Figure 11 This is a schematic diagram of the structure of a cross-chain configuration device based on multiple blockchains provided by this application;
[0109] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application;
[0110] Figure 13 This is a schematic diagram of a cross-chain configuration system based on multiple blockchains provided in an embodiment of the present application. DETAILED DESCRIPTION
[0111] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0112] See Figure 1 , Figure 1 This is a schematic diagram of the hierarchical structure of a blockchain network provided by an embodiment of the present application. Figure 1The hierarchical structure shown is applied to the blockchain system corresponding to the multi-business collaborative processing platform. The blockchain network corresponding to the blockchain system includes a business network deployed in the public network and multiple consensus networks deployed in the private cloud. Figure 1 As shown, the business network here can be Figure 1 The business network 400a shown, and the multiple consensus networks here can specifically include Figure 1 Consensus network 100a, consensus network 200a, and consensus network 300a are shown.
[0113] In such Figure 1 In the service network 400a shown, multiple service nodes are deployed. The multiple service nodes here may specifically include Figure 1 The service nodes shown are 110a, 110b, 110c, 110d, 110e, 110f, 110g, ..., 110n. It should be noted that the number of service nodes deployed in the service network 400a is not limited. It should be understood that the service nodes in the service network 400a do not need to participate in accounting. In addition, Figure 1 As shown, each business node running in the business network 400a can access one or more of the aforementioned consensus networks through network communication. There is no limit on the number of consensus networks that each business object can access through a corresponding business node. It is understood that data can also be exchanged between consensus networks through network communication.
[0114] It should be understood that in Figure 1 In the consensus network 100a shown, multiple consensus nodes are deployed. The multiple consensus nodes here can specifically include Figure 1 The consensus nodes 10a, 10b, 10c and 10d are shown. It should be noted that the number of consensus nodes deployed in the consensus network 100a is not limited. Figure 1 As shown, for multiple consensus nodes running in the consensus network 100a, the blockchain they jointly maintain is specifically Figure 1 Blockchain 10e is shown.
[0115] Similarly, in Figure 1 In the consensus network 200a shown, multiple consensus nodes are deployed. The multiple consensus nodes here can specifically include Figure 1 The consensus nodes 11a, 11b, 11c and 11d are shown. It should be noted that the number of consensus nodes deployed in the consensus network 200a is not limited here. Figure 1 As shown, for multiple consensus nodes running in the consensus network 200a, the blockchain maintained together is specifically Figure 1 Blockchain 11e is shown.
[0116] Similarly, in Figure 1 In the consensus network 300a shown, multiple consensus nodes are deployed. The multiple consensus nodes here can specifically include Figure 1 The consensus nodes 12a, 12b, 12c and 12d are shown. It should be noted that the number of consensus nodes deployed in the consensus network 300a is not limited here. Figure 1 As shown, for multiple consensus nodes running in the consensus network 300a, the blockchain maintained together is specifically Figure 1 Blockchain 12e is shown.
[0117] For ease of understanding, the embodiments of the present application may collectively refer to the business nodes and consensus nodes located in the above-mentioned blockchain system as blockchain nodes (referred to as nodes for short), and may collectively refer to the consensus network 100a, consensus network 100b and consensus network 100c participating in the above-mentioned blockchain system as the core consensus network, and may collectively refer to the various nodes in the above-mentioned core consensus network as core nodes.
[0118] It should be understood that in the above-mentioned blockchain system, the blockchain stored on each node in consensus network 100a (e.g., core nodes such as consensus node 10a, consensus node 10b, consensus node 10c, and consensus node 10d) is blockchain 10e. Blockchain 10e here may be the first chain, and the consensus network corresponding to the first chain (i.e., consensus network 100a) may be the first chain network. The consensus nodes in the first chain network may be collectively referred to as first consensus nodes. The blockchain stored on each node in consensus network 200a (e.g., core nodes such as consensus node 11a, consensus node 11b, consensus node 11c, and consensus node 11d) is blockchain 11e. Blockchain 11e here may be the second chain, and the consensus network corresponding to the second chain (i.e., consensus network 200a) may be the second chain network. The consensus nodes in the second chain network may be collectively referred to as second consensus nodes. The blockchain stored on each node in the consensus network 300a (for example, core nodes such as consensus node 12a, consensus node 12b, consensus node 12c and consensus node 12d) is blockchain 12e. The blockchain 12e here can be a third chain, and the consensus network corresponding to the third chain (i.e., consensus network 300a) can be a third chain network. The consensus nodes in the third chain network can be collectively referred to as third consensus nodes.
[0119] It should be understood that in order to cope with some special scenarios (such as some temporary business scenarios that require real-time processing of large amounts of data), this application is implemented in the three-chain system involved in the aforementioned blockchain system (i.e., the three-chain system constructed by the first chain, the second chain and the third chain). One or more sub-chain consensus networks based on the aforementioned temporary tasks can be temporarily created, and the blockchains corresponding to these constructed sub-chain consensus networks can be called business sub-chains.
[0120] It is understood that the sub-chain consensus nodes in the sub-chain consensus network can come from the second consensus nodes in the second chain network and the third consensus nodes in the third chain network. In other words, the sub-chain consensus network corresponding to the target business is the consensus node selected by the management consensus node from the second chain network (as mentioned above). Figure 1 Consensus nodes 11a and 11b in the network) and consensus nodes voted from the third chain network (as mentioned above Figure 1 It is jointly constructed by the consensus node 12a and the consensus node 12b).
[0121] It should be understood that each business subchain corresponds to a temporary business. For example, taking the blockchain system as a blockchain electronic invoice system, in the blockchain electronic invoice system, the temporary business corresponding to the business subchain is to verify whether the invoice template used by 100 invoices is the latest invoice template. In this case, the subchain consensus node in the business subchain can verify whether the invoice template used by these 100 invoices is the latest invoice template and then return the verification result. For another example, in the blockchain electronic invoice system, the temporary business corresponding to the business subchain is to verify whether the tax calculation rules in the electronic invoice are correct. The subchain consensus node in the business subchain can verify whether the tax calculation in the invoice is correct based on the asset mapping relationship and return the verification result. For ease of understanding, the embodiments of this application may collectively refer to the aforementioned temporary businesses as target businesses. It should be understood that the embodiments of this application do not limit the number of business subchains. For example, two business subchains, five business subchains, 40 business subchains, etc. can be created based on the temporary business form, and business subchains can be closed according to business needs.
[0122] It is understood that the second and third chains in the aforementioned three-chain system can be referred to as the main business chain. The main business chain and the business sub-chain are independent of each other, and the first chain can exchange data with the main business chain and the business sub-chain through the corresponding cross-chain relay. The cross-chain relay can be an independent service device that can detect data on the main business chain or the business sub-chain.
[0123] It should be understood that the blockchain involved in the embodiments of this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It is primarily used to organize data in chronological order and encrypt it into a ledger to prevent tampering and forgery, while also enabling data verification, storage, and updates. Blockchain is essentially a decentralized database in which each node stores an identical blockchain.
[0124] In the above-mentioned blockchain system, the core node can be responsible for the consensus in the core consensus network where the corresponding blockchain is located, that is, the core node can be the consensus node in the core consensus network where the corresponding blockchain is located. For any of the three core consensus networks mentioned above, the specific process of writing transaction data in the core consensus network into the corresponding blockchain ledger (e.g., a distributed database) can be that the user client sends the transaction data to a certain business node, and then the transaction data is passed between the business nodes in the business network within the above-mentioned blockchain network in a relay manner until the consensus node in the corresponding core consensus network within the above-mentioned blockchain network (e.g., consensus node 11b in consensus network 200a) receives the transaction data. At this time, the consensus node (e.g., consensus node 11b in consensus network 200a) then packages the transaction data into a block so that it can subsequently reach consensus with other consensus nodes, so that after the consensus is passed, the consensus-passed block can be written into the distributed database of its own core consensus network (e.g., consensus network 200a).
[0125] Optionally, it is understandable that, after consensus is passed, the embodiment of the present application can also write the block carrying the transaction data and multiple other blocks associated with the block into a distributed database in parallel through the storage layer of its own core consensus network (for example, consensus network 200a). This can fundamentally break through the limitations of the blockchain structure of the blockchain, and thus effectively improve the storage efficiency of data storage.
[0126] It is understood that in the aforementioned blockchain system, smart contracts can be deployed on the blockchain of the corresponding core consensus network. In the blockchain system, such smart contracts can be understood as a code executed by each blockchain node (i.e., each consensus node). Through such smart contracts, arbitrary logic can be executed and results can be obtained. For example, a user can initiate a transaction request through a user client to call a smart contract that has been deployed on the blockchain (e.g., the aforementioned blockchain 11e) of the corresponding core consensus network (e.g., the aforementioned consensus network 200a).
[0127] Specifically, the business node in the business network can send the transaction business request to the consensus node in the corresponding core consensus network (for example, Figure 1The consensus node 11a shown in the figure authenticates the user who sent the transaction request through the chain entrance of the corresponding core consensus network, and allows the transaction request sent by the user to be sent to other consensus nodes in the corresponding core consensus network (for example, Figure 1 Consensus nodes 11b shown) to call these consensus nodes (e.g., Figure 1 The smart contracts running in the consensus nodes 11a and 11b shown execute the transaction business requested by the user.
[0128] It should be understood that one or more smart contracts can be deployed on the blockchain (e.g., the blockchain 11e) of the core consensus network (e.g., the consensus network 200a). These smart contracts can be distinguished by the contract call address, contract identification number (ID) or contract name. The transaction service request initiated by the user client can also carry the contract call address, contract identification number or contract name of the smart contract to specify the smart contract to be run. Alternatively, when the management object client initiates a configuration transaction for a certain blockchain, the smart contract to be run can be determined based on the configuration resources indicated by the configuration transaction. In the above-mentioned blockchain system, a full-platform configuration contract can be deployed in the management chain, and the full-platform configuration contract can include a chain management configuration contract. The chain management configuration contract includes a smart contract corresponding to a global configuration resource (global configuration resources can be for all blockchains in the blockchain system) and a smart contract corresponding to an independent configuration resource (independent configuration resources are only for a certain blockchain in the blockchain system). According to the configuration resource indicated by the configuration transaction, the smart contract corresponding to the global configuration resource or the smart contract corresponding to the independent configuration resource can be called to execute the configuration transaction corresponding to the configuration transaction, thereby obtaining the configuration transaction identifier corresponding to the configuration transaction. Then, according to the configuration transaction identifier, the cross-chain configuration items for chain configuration of the blockchain will be mutually verified by each consensus node in the blockchain and stored in the local cache and local storage of each node, and the execution result of the above-mentioned configuration transaction can be returned to the client.
[0129] Note that the local cache here refers to the system memory created in the storage layer, and the local storage here refers to the hard disk space created in the storage layer for data storage. This way, when a consensus node in the core consensus network experiences a downtime (i.e., a system failure), data in the system memory will not be lost and data will not be unavailable for reading. In other words, the consensus node can still read data through the local storage created in the storage layer.
[0130] It should be understood that in the above-mentioned blockchain system, any two blockchain nodes in any consensus network (e.g., consensus network 100a, consensus network 200a, or consensus network 300a) can form a peer-to-peer (P2P) network. This peer-to-peer network can adopt the P2P protocol, wherein the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP). Blockchain nodes do not require a central node to maintain the network status. Instead, each blockchain node maintains the node status of the entire network or the connection status of its adjacent blockchain nodes through broadcast interaction with adjacent blockchain nodes. In a distributed system, any device such as a server or terminal can join and become a blockchain node, wherein each blockchain node can include a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0131] It should be understood that the specific application scenarios of the multi-service collaborative processing platform can include electronic invoice circulation scenarios within a blockchain electronic invoice platform, blockchain medical prescription circulation scenarios, and so on. In the electronic invoice circulation scenario within a blockchain electronic invoice platform, the first chain can be the management chain within the blockchain electronic invoice platform, the second chain can be the invoice chain within the blockchain electronic invoice platform, and the third chain can be the application contract chain within the blockchain electronic invoice platform. When the blockchain system is applied to the blockchain electronic invoice platform, a secure and reliable blockchain electronic invoice three-chain network can be constructed based on the first, second, and third chains. Within this blockchain electronic invoice three-chain network, when businesses are independently executed within the three consensus networks, the business execution results obtained from the independent executions can be stored in the blockchain ledgers of the corresponding blockchains. For another example, in the blockchain medical prescription circulation scenario, the first chain can be the management chain within the blockchain medical prescription platform, the second chain can be the prescription chain within the blockchain electronic medical prescription platform, and the third chain can be the prescription application contract chain within the blockchain medical prescription platform. When the above-mentioned blockchain system is applied to the blockchain medical prescription platform, a safe and reliable blockchain electronic medical prescription three-chain network can be constructed based on the above-mentioned first chain, second chain and third chain. In the blockchain electronic medical prescription three-chain network, when business is executed independently in the above-mentioned three consensus networks, the business execution results obtained by the independent execution of the business can be stored in the blockchain ledger of the corresponding blockchain respectively.
[0132] For ease of understanding, the following is an explanation of the electronic bill circulation scenario under the blockchain electronic bill platform. Figure 2 , Figure 2This is a scenario diagram of a blockchain electronic bill platform based on multiple blockchains provided by an embodiment of the present application. The blockchain electronic bill platform can be a specific business platform in the above-mentioned blockchain system. It should be understood that in the blockchain electronic bill platform, in order to reduce the complexity of the data storage on the chain, a multi-chain system based on blockchain electronic bills is proposed, and the multi-chain system mainly involves Figure 2 The blockchain electronic bill three-chain network shown. Figure 2 As shown, the blockchain electronic bill triple-chain network deploys a management chain, a bill chain, and an application contract chain. The management chain can be the aforementioned first chain, and its corresponding management chain network is the aforementioned first chain network. The bill chain can be the aforementioned second chain, and its corresponding bill chain network is the aforementioned second chain network. The application contract chain can be the aforementioned third chain, and its corresponding application contract chain network is the aforementioned third chain network.
[0133] It is understood that in business scenarios where blockchain is used to circulate electronic invoices, the collaboration between the management chain, the invoice chain, and the application contract chain can provide the entire blockchain electronic invoice platform with the functionality to independently execute different business operations. This allows for the construction of a secure and efficient business flow system based on the collaboration of the three chains. It should be understood that, using a three-chain system as an example, within this multi-chain system, the management chain, the invoice chain, and the application contract chain are all independently constructed. That is, the consensus node used to maintain the management chain is different from the consensus node used to maintain the invoice chain, and different from the consensus node used to maintain the application contract chain. The management chain can provide management functionality for the entire blockchain electronic invoice platform, while the invoice chain can provide invoice business functionality with different business permission types. It is understood that consensus nodes deployed in the invoice chain network can maintain the business logic of electronic invoices throughout their entire lifecycle through the invoice chain. For example, the invoice chain can manage the entire lifecycle of all issued electronic invoices. For example, the entire lifecycle of an electronic invoice includes the issuance, circulation, and reimbursement of electronic invoices. It should be understood that in the blockchain network corresponding to the overall business, the bill chain maintained by the consensus nodes has the characteristics of high performance and low latency.
[0134] It should be understood that in the embodiment of the present application, in order to ensure the security and independence of the electronic bill written into the bill chain, the embodiment of the present application proposes that another blockchain (i.e. Figure 2The application contract chain shown in the figure) can provide more standardized, flexible and fully functional derivative business, that is, the application contract chain here can provide the electronic bills provided by the entire blockchain electronic bill platform to carry out the functional characteristics of the derivative business. It can be understood that the consensus node deployed in the application contract chain network can carry the derivative business corresponding to the variable bill business through the application contract chain. For example, the derivative business here can specifically include the above-mentioned credit investigation business, the above-mentioned qualification identification business, etc. It should be understood that in the blockchain network corresponding to the overall business, the application contract chain maintained by the second consensus node can support Figure 2 The government cooperation departments and alliance chain partners shown (i.e. Figure 2 business related departments shown), through Figure 2 The tax application contract (open contract deployment contract) shown above obtains the application contract template on the cross-chain management to develop smart contracts related to derivative business (for example, Figure 2 ) and can be deployed on the application contract chain after review by the tax administration department. It should be understood that smart contracts deployed on the application contract chain can be flexibly upgraded and changed through virtual machine compatible contracts. It should be understood that compared to the management chain and bill chain, the application contract chain has the highest degree of openness and supports complex smart contract logic, with a large number of participants and constant dynamic changes, resulting in relatively lower performance than the bill chain.
[0135] like Figure 2 As shown in the figure, the management chain deployed in the blockchain electronic bill three-chain network is independent of the bill chain and the application contract chain, that is, the three independently built blockchains are independent of each other, but the three independently built blockchains can exchange data through cross-chain relay, that is, the three chains can interact across chains.
[0136] Among them, it should be understood that the consensus algorithm adopted by the management chain is different from the consensus algorithm adopted by the bill chain and the consensus algorithm adopted by the application contract chain.
[0137] Specifically, 1.1) the consensus algorithm associated with the management chain is an immediate deterministic consensus algorithm, for example, the immediate deterministic consensus algorithm here can be a PBFT (Practical Byzantine Fault Tolerance) consensus algorithm, through which the status of a proposed block to be put on the chain can be immediately determined. It should be understood that the management chain is the blockchain in the above-mentioned management chain network, and the management consensus node in the management chain network (i.e., the above-mentioned first consensus node) can be Figure 2 The tax administration departments shown are involved in management.
[0138] It is understood that the aforementioned tax administration department can exercise management responsibilities through the management consensus node deployed in the management chain network. For example, these management responsibilities may include managing internal government information (e.g., information on tax administration personnel), managing the business logic rules of the overall business (e.g., the derivative business contracts running on the application contract chain that execute the business logic of the derivative business), managing the metadata information of the overall business (e.g., access traffic at the entrances of each chain in the three-chain system), and managing the identities and permissions of participants in the overall business (e.g., individual users, corporate users, tax business participants, and other business objects). It should be understood that within the blockchain network corresponding to the overall business, the management chain maintained by the management consensus node is a relatively stable blockchain with the smallest data size and the highest security.
[0139] It should be understood that the internal parties associated with this management chain can be Figure 2 For example, when the tax management department participates in the management chain as an internal participant, it can manage some of its internal states through the internal management contract on the management chain. For example, it can manage the various personnel in the tax management department. For example, it can assign specific tax management personnel, tax development personnel, tax auditors, etc. to these personnel in the tax management department. In addition, when the tax management department participates in the management chain as an internal participant, it can also manage some parameters in the three-chain system through the internal management contract on the management chain. For example, when the tax management department participates in the management chain as an internal participant, it can also use the internal management contract on the management chain to limit the node quantity parameter corresponding to the number of consensus nodes on each chain participating in the consensus.
[0140] 1.2) The consensus algorithm associated with the bill chain is another instantaneous deterministic consensus algorithm. For example, the instantaneous deterministic consensus algorithm here can be the TBFT (Tower Byzantine Fault Tolerance) consensus algorithm. This TBFT consensus algorithm is a Byzantine fault-tolerant algorithm that can ensure the secure operation of the entire bill chain network system when the number of Byzantine nodes (i.e., the number of malicious nodes in the bill chain network) is less than one-third of the total number of nodes in the bill chain network. This TBFT consensus algorithm can instantly determine the status of a proposed block to be uploaded to the blockchain, resulting in higher performance, a smaller number of blockchain nodes, and continuous block generation. It should be understood that the consensus nodes in the bill chain network can be managed by the aforementioned tax administration department. For example, specific tax officials within the tax administration department can control the number of consensus nodes in the bill chain network through internal management contracts within the aforementioned management chain. For another example, the tax bureau terminal corresponding to a specific tax official within the tax administration department can participate in the formation of the bill chain network.
[0141] It should be understood that the biggest difference between the TBFT consensus algorithm and the PBFT consensus algorithm is that the PBFT consensus algorithm has a fixed leader node (i.e., the master node) for packaging transactions in the transaction pool. When the leader node fails, the view-change subprotocol (i.e., a master node switching subprotocol) is used to replace the leader node. In the TBFT consensus algorithm, the leader node is rotated based on a rotation mechanism. For example, when the current node is the leader node, it will automatically rotate to the next node after submitting X blocks (the value of X is configurable). This means that the consensus nodes in the bill chain network corresponding to the bill chain can be used to continuously produce blocks.
[0142] 1.3) The consensus algorithm associated with the application contract chain is another instant deterministic consensus algorithm. For example, the instant deterministic consensus algorithm here can be a PoS (proof-of-stake) consensus algorithm. Through this proof-of-stake consensus algorithm, the network security of the application contract chain network where the application contract chain is located can be maintained, and the status of a proposed block to be put on the chain can be immediately determined through this proof-of-stake consensus algorithm. It is understandable that the consensus nodes in the application contract chain network can be composed of Figure 2 The tax administration departments and government cooperation departments and large participating institutions (i.e. the large enterprises in the aforementioned alliance chain, which are the aforementioned Figure 2 The business-related departments shown in the figure) and others participate in the management.
[0143] It should be understood that the following differences exist with respect to smart contracts in the blockchain electronic bill triple-chain network:
[0144] 2.1) It should be understood that Figure 2 The management chain shown can support a specific language smart contract engine. The above management consensus node can deploy a specific language smart contract on the management chain through the specific language smart contract engine. For example, the above Figure 2 The object rights management contract, object identity management contract, metadata management contract, internal management contract, and full-platform configuration contract are shown. It should be understood that these smart contracts can be developed and managed by specific tax management personnel within the tax administration department. The object rights management contract can be used to manage the management rights of managed objects and the business access rights of business objects; the object identity management contract can be used to manage the identity information of managed objects or business objects; the metadata management contract can be used to manage metadata on the blockchain; and the full-platform configuration contract can be used to manage cross-chain configurations.
[0145] 2.2) If Figure 2 The bill chain shown has built-in smart contracts for specific bill business logic. These smart contracts (for example, Figure 2 The electronic bill issuance contract, electronic bill circulation contract, electronic bill redemption contract, and electronic bill archiving contract shown in the figure can be upgraded as the bill business is updated. For example, the embodiment of the present application can update the bill business logic in the electronic bill issuance contract through the metadata information read from the management chain, and then update and process the above-mentioned bill business according to the updated electronic bill issuance contract. This means that the bill chain does not support an independent smart contract engine, and naturally does not support the deployment of other contracts unrelated to the bill business on the bill chain. The advantage of doing this is that the bill chain only runs the business logic related to the electronic bill and is not affected by other smart contracts, thereby making the operation of the bill chain more independent, stable, and more resistant to attacks.
[0146] 2.3) The application contract chain supports multi-language, Turing-complete smart contracts for developers, such as Figure 2 As shown, when developers access the application contract chain through the application contract chain entrance, they can use the virtual machine compatibility contract to be compatible with mainstream EVM virtual machines, so that they can deploy and run various new business contracts on compatible virtual machines. For example, a derivative business contract associated with a derivative business (for example, the above-mentioned lottery business) can be deployed on the application contract chain. For another example, a derivative application contract associated with another derivative business (for example, the above-mentioned tax refund business) can be deployed on the application contract chain.
[0147] It should be understood that Figure 2 As shown, in the blockchain electronic bill three-chain network, the public network participants associated with the management chain can be Figure 2 Individual users and corporate users as shown. Figure 2 As shown, the public network participants associated with the bill chain can be Figure 2 The local electronic bill flow system shown here specifically includes local electronic bill business issuance systems (for example, local tax bureau systems), electronic bill issuance service providers, large enterprise finance and taxation related systems, etc. Figure 2 As shown, the public network participants associated with the application contract chain can be Figure 2 Tax business participants and developers shown.
[0148] Specifically, 3.1) the chain entry associated with the management chain can be Figure 2 The management chain entry is shown. Figure 2 When individual users (e.g., user A) and corporate users (e.g., corporate B) are participants in the public network, they can access the management chain through the management chain entrance, and then perform identity registration and identity authorization services through the management chain. 3.2) The chain entrance associated with the bill chain can be Figure 2 The bill chain entry shown. Figure 2 When the local electronic bill flow systems (for example, large enterprise users) shown in the figure act as public network participants, they can access the bill chain through the bill chain entrance, and then perform electronic bill issuance, electronic bill circulation, electronic bill redemption and electronic bill archiving services through the bill chain. 3.3) The chain entrance associated with the application contract chain can be Figure 2 The application contract chain entry shown. Figure 2 When the tax business participants and developers shown are public network participants, they can access the application contract chain through the application contract chain entrance, and then deploy derivative business contracts on the application contract chain to execute derivative businesses related to electronic invoices through the deployed derivative business contracts.
[0149] Among them, it is understandable that Figure 2 The management chain entrance shown may specifically be a tax administration department entrance, through which the identity identification and business guidance of individuals, legal persons, and entities that need to access the management chain can be performed.
[0150] Among them, it is understandable that Figure 2The bill chain entry shown can specifically be an electronic bill business entry, through which the transaction business data (also referred to as transaction data) of an electronic bill requested by a business object (such as Enterprise B) can be received. In this way, when the above-mentioned bill consensus node receives the transaction data through the electronic bill business entry, it will check whether the access identity and access permissions of the sender of the transaction data (i.e., the aforementioned Enterprise B) meet the identity and permission contract status requirements in the management chain. If the verification is passed, the corresponding electronic bill can be issued based on the transaction data.
[0151] Among them, it is understandable that Figure 2 The application contract chain entry shown may specifically be a tax derivative business entry, through which a business object (eg Figure 2 The derivative business associated with the bill business requested by the tax business participant shown in the figure. Figure 2 The tax business participants and developers shown can, after obtaining the business participation license certificate of the authorized object issued by the tax management department, verify the business participation license certificate submitted by the business object (for example, the tax business participant or developer) through the application contract chain entrance, and then allow the business object to access the application contract chain when the verification is successful, so as to execute derivative business related to the aforementioned bill business on the application contract chain.
[0152] Among them, such as Figure 2 As shown, the internal participants in the maintenance management chain can be Figure 2 The tax management department shown here is mainly used to configure and manage internal status parameters on the management chain. It can also be used to change the above metadata information (for example, tax metadata) on the chain (such as updating electronic invoice templates, updating tax calculation rules, etc.), and manage the identities and permissions of various business participants maintained on the management chain (such as freezing the company's invoicing qualifications, limiting the company's invoicing quota, etc.).
[0153] Among them, such as Figure 2 As shown, the internal participants involved in maintaining the bill chain can be Figure 2 The electronic bill data center shown here can specifically be an electronic invoice data center. The electronic bill data center (for example, the electronic invoice data center) can be used to perform off-chain backup, statistics, data analysis and review of the massive amount of ledger data recorded on the bill chain.
[0154] Among them, such as Figure 2 As shown, the internal participants involved in maintaining the application contract chain can be Figure 2It should be understood that, in addition to the tax administration department, other internal participants in maintaining the application contract chain, including other departments (i.e., the aforementioned government cooperation departments) and participants (i.e., the aforementioned business-related departments) in the system alliance chain, can further execute corresponding derivative businesses through the derivative business contracts on the application contract chain when accessing the application contract chain. It is understandable that Figure 2 The government cooperation departments and business-related departments shown in the figure are tax business participants. The benefit of accessing the application contract chain is that they can flexibly run various scalable derivative businesses in a complete smart contract declaration cycle to ensure the flexibility of business changes.
[0155] Among them, it is understandable that Figure 2 The three blockchain electronic bill networks shown can all have built-in corresponding smart contracts.
[0156] Among them, 4.1) for the smart contract built into the management chain, such as Figure 2 As shown in Figure 1, the object identity management contract built into the management chain can be specifically a user management contract, through which the identities of accessors (e.g., public network participants) and participants (e.g., internal participants) in the entire three-chain system can be managed. It should be understood that accessors and participants here can specifically include tax management personnel, government cooperation departments, local tax bureaus, invoicing service providers, reimbursement service providers, tax audit departments, etc. Among them, 4.2) for the smart contract built into the bill chain, such as Figure 2 As shown, the smart contract built into the bill chain can include the bill chain configuration contract and the bill business contract associated with the electronic bill life cycle. The bill business contract here can specifically include Figure 2 The electronic bill issuance contract, shown here, provides electronic bill issuance services; the electronic bill circulation contract provides electronic bill circulation services; the electronic bill redemption contract provides electronic bill redemption services; and the electronic bill archiving contract provides electronic bill archiving services. The bill chain configuration contracts described above are used to record configuration items on this chain.
[0157] Among them, 4.3) for the smart contract built into the application contract chain, such as Figure 2 As shown, the smart contract built into the bill chain can include the application chain configuration contract, and can also include the tax derivative business participants (i.e., derivative business objects, for example, Figure 2 The tax business participants shown in the figure) participate in the deployment of various contracts (for example, Figure 2(See the virtual machine compatibility contract, tax application contract, and derivative business contract shown). For example, a derivative business contract could be a credit reporting contract based on electronic invoices, which can be used to analyze a company's credit data. Another example of a derivative business contract could be an on-chain lottery contract, talent incentive contract, or tax refund contract deployed to encourage invoicing. The application contract chain configuration contract is used to record configuration items on this chain.
[0158] It should be understood that for the above Figure 2 As for the management chain shown, it is mainly used to process management business flows with small data volume and relatively constant status. The openness of the entire management chain is relatively low and can be used for internal management of some tax data. Figure 2 As for the bill chain shown, it can be used to process some real-time bill business flows with a high-frequency request state for a long time. The entire bill chain is relatively open and can allow relevant authoritative institutions in the life cycle of the electronic bill to participate in the corresponding bill business. For example, the consensus node corresponding to the agent service provider can be allowed to issue an electronic bill for a user who is currently requesting an invoice. In addition, for Figure 2 For the application contract chain shown, the data volume can be unlimited, and the frequency of business changes fluctuates relatively widely. This application contract chain can primarily handle various cooperative businesses, derivative businesses, exploratory businesses, and so on. It should be understood that this application contract chain has the highest degree of openness, allowing participants authorized by the management chain to deploy smart contracts on the application contract chain and run exploratory derivative businesses, etc.
[0159] Further, see Figure 3 , this embodiment of the application provides a schematic diagram of cross-chain configuration for the target chain. Figure 3 As shown, the blockchain system may include a first chain, a second chain, a third chain, a business subchain 1, and a business subchain 2. It should be understood that the second chain to be configured, the third chain to be configured, the business subchain 1 to be configured, and the business subchain 2 to be configured may be referred to as target chains, and the consensus nodes of the chains related to the target chains may be referred to as target consensus nodes. In addition, the second chain and the third chain may also be referred to as business main chains. In the embodiment of the present application, a cross-chain relay may be used to isolate the first chain network corresponding to the first chain and the target chain network corresponding to the target chain. It should be understood that the number of business subchains in the embodiment of the present application is not limited.
[0160] For ease of understanding, the core consensus network where the first chain is located (i.e. the first chain network mentioned above) is used as the Figure 1 Taking the consensus network 100a shown as an example, the consensus node participating in maintaining the first chain can be the first consensus node mentioned above. Figure 3As shown, multiple smart contracts for cross-chain configuration are deployed on the aforementioned first chain, and these smart contracts can run on the first consensus node. A full-platform configuration contract is deployed on the first chain, and calling this full-platform configuration contract can implement basic configuration of the business main chain and business sub-chain. This full-platform configuration contract can implement global configuration and separate configuration of the business main chain or business sub-chain. Figure 3 In [1], the full platform configuration contract includes the chain management configuration contract, which includes the platform configuration contract for global configuration and the target chain management configuration contract for configuring a specific chain. The target chain management configuration contract can include the chain management configuration contract of the secondary chain, the chain management configuration contract of the tertiary chain, or the sub-chain management configuration contract of the business sub-chain.
[0161] It is understood that when the platform configuration contract is called, global configuration can be performed on both the business main chain (i.e., the second and third chains) and the business sub-chains. It should be understood that calling the platform configuration contract can perform cross-chain configuration of metadata and basic information (such as the chain names of certain chains, the management objects that manage certain chains, the time of block generation, etc.) in the second and third chains, business sub-chains 1 and 2. For example, taking the first chain as the management chain of a blockchain electronic invoice platform as an example, calling the platform configuration contract can perform cross-chain configuration of certain tax metadata (such as changes in tax calculation rules, etc.) and basic information (such as the chain name of the application contract chain, the chain name of the invoice chain, the management objects that manage certain chains, the time of block generation, etc.).
[0162] It should be understood that when the chain management configuration contract of the second chain, the chain management configuration contract of the third chain, and the sub-chain management configuration contract of the business sub-chain are respectively invoked, they are independently configured for the first chain, the second chain, and the business sub-chain, respectively. This independent configuration can include generating block sizes and certain business rules on the chain. For example, if the first chain is the management chain of a blockchain electronic invoice platform and the target chain is the invoice chain, invoicing the chain management configuration contract of the invoice chain can upgrade invoicing on the invoice chain, modify invoice flow on the invoice chain, and so on. For another example, if the first chain is the management chain of a blockchain medical prescription platform and the target chain is the prescription chain, invoicing the chain management configuration contract of the prescription chain can configure prescription templates on the prescription chain and modify prescription flow on the prescription chain, and so on.
[0163] For ease of understanding, the core consensus network where the second chain is located (i.e. the second chain network mentioned above) is used as the above Figure 1 Taking consensus network 200a as an example, a chain configuration contract is deployed on the second chain. The chain configuration contract on the second chain can be run on the second consensus node that participates in maintaining the second chain. The chain configuration contract of the second chain records the configuration items of the chain (such as the size of the generated block, the bill template, etc.).
[0164] Similarly, for ease of understanding, the core consensus network where the third chain is located (that is, the third chain network mentioned above) is used as the above Figure 1 Taking the consensus network 300a shown as an example, a chain configuration contract is deployed on the third chain. The chain configuration contract on the third chain can be specifically run on the consensus nodes participating in maintaining the third chain. It should be understood that the chain configuration contract of the third chain records the configuration items of the chain (such as the size of the generated block, the bill template, etc.). It can also be understood that in Figure 3 In the example, subchain configuration contracts can also be deployed on business subchain 1 and business subchain 2. The subchain configuration contracts of the business subchains can be specifically run on the subchain consensus nodes that participate in maintaining the corresponding business subchains.
[0165] Among them, it can be understood that Figure 3 In the aforementioned chain configuration contract for the second chain, the chain configuration contract for the third chain, the subchain configuration contract in business subchain 1, and the subchain configuration contract in business subchain 2, all contain two types of contract locks: blocking chain configuration locks and non-blocking chain configuration locks. Taking the blockchain to be cross-chain configured as the target chain as an example, the target chain can be one or more of the second chain, the third chain, or the business subchain. When a blocking chain configuration lock is obtained, the target chain is locked, preventing normal operations until the blocking chain configuration lock is unlocked. When a non-blocking chain configuration lock is obtained, a block buffer height (e.g., N) is provided. Before the target chain's business state is configured to the second business lock state, N blocks can still be generated on the target chain. After N blocks are generated, the target chain ceases normal operations and cannot generate new blocks until the non-blocking chain configuration lock is unlocked. Normal operations can then resume on the target chain.
[0166] For example, the management object can send a configuration transaction for cross-chain configuration of the target chain to the first consensus node in the first chain based on the configuration transaction. The first consensus node determines the transaction type of the configuration transaction, and when the transaction type is a blocking transaction type, the first consensus node can generate a first configuration transaction identifier corresponding to the configuration transaction based on the above-mentioned chain management configuration contract. When the cross-chain relay detects the first configuration transaction identifier on the first chain, it can send a first lock acquisition transaction to the target consensus node associated with the target chain. Then, the target chain can obtain the blocking chain configuration lock corresponding to the blocking transaction type of the above-mentioned configuration transaction from the chain configuration contract on the target chain according to the first lock acquisition transaction. The target consensus node can configure the business state of the target chain to the first business lock state through the above-mentioned blocking chain configuration lock, at which time normal business on the target chain is stopped.
[0167] It should be understood that the configuration transaction involved in the embodiments of the present application refers to the cross-chain configuration of the target chain, and the configuration transaction may include at least one of the following: the chain identifier of the target chain to be cross-chain configured, and the cross-chain configuration items for configuring the target chain. For example, in a blockchain electronic invoice platform, the target chain is the invoice chain, and the above-mentioned management object may be the administrator who manages the invoice chain. The above-mentioned configuration transaction may include the chain identifier of the invoice chain, updating the invoice template in the invoice chain, configuring the tax calculation rules, etc. For another example, in a blockchain electronic invoice platform, the target chain is the application contract chain, and the above-mentioned management object may be the government cooperation department, business-related department, etc. that manages the application contract chain. The above-mentioned configuration transaction may include the chain identifier of the application contract chain, updating the application development rules in the application contract chain, etc.
[0168] Further, it can be understood that when it is detected that the target chain is in the first business lock state, the cross-chain relay can send a first lock declaration transaction to the first consensus node, so that the first consensus node on the first chain generates the first transaction lock information corresponding to the first lock declaration transaction when determining that the status of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction lock state based on the first lock declaration transaction, and generates a block for the first transaction lock information, and writes it to the first chain after other consensus nodes in the first chain network reach consensus on the block. Then, the management object sends a configuration modification transaction based on the first transaction lock information on the first chain. The first consensus node in the first chain can obtain the first cross-chain configuration item in the configuration modification transaction, and cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0169] It should be understood that when the transaction type is a non-blocking transaction type, the first consensus node can generate a second configuration transaction identifier corresponding to the configuration transaction based on the above-mentioned chain management configuration contract. When the cross-chain relay detects the second configuration transaction identifier on the first chain, it can send a second lock acquisition transaction to the target consensus node associated with the target chain. The target chain obtains the non-blocking chain configuration lock and block buffer height corresponding to the above-mentioned non-blocking transaction type from the chain configuration contract on the target chain according to the second lock acquisition transaction. When the interval height of the blocks generated on the target chain reaches the block buffer height, the target consensus node can configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock, and normal business is stopped on the target chain.
[0170] Further, it can be understood that when it is detected that the target chain is in the second business lock state, the cross-chain relay sends a second lock declaration transaction to the second consensus node, so that the first consensus node on the first chain determines that the status of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction lock state based on the second lock declaration transaction. It generates the second transaction lock information corresponding to the second lock declaration transaction, generates a block for the second transaction lock information, and writes it to the second chain after consensus on the block. Then, the management object sends a configuration modification transaction based on the second transaction lock information on the first chain. The first consensus node in the first chain can obtain the second cross-chain configuration item in the configuration modification transaction, and cross-chain configure the second cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the second business lock state through the non-blocking chain configuration lock.
[0171] It can be understood that the consensus node involved in the embodiments of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0172] It should be noted that when the management object performs cross-chain configuration on the target chain, a prompt interface or pop-up window may be displayed when obtaining data such as the management permission certificate of the management object. The prompt interface or pop-up window is used to prompt the management object that it is currently collecting management permission certificates. Only after the management object issues a confirmation operation on the prompt interface or pop-up window, the relevant steps for data acquisition will be started, otherwise it will end.
[0173] In addition, it can be understood that in the specific implementation of this application, the identity information of management objects such as users, enterprises, and institutions may be involved. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of business objects such as users, enterprises, and institutions, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0174] The specific process of cross-chain configuration of the target chain on the management chain can be found as follows: Figures 4 to 9 The corresponding embodiment.
[0175] For further information, see Figure 4 , Figure 4 This is a cross-chain configuration method based on multiple blockchains provided by the embodiment of the present application. Figure 4 As shown, the method can be executed by the first consensus node associated with the first chain, for example, the first consensus node can be the Figure 1Any consensus node in the consensus network 100a shown. The method may specifically include the following steps S401-S405.
[0176] Step S401: upon receiving a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction, determine the transaction type of the configuration transaction.
[0177] The management object involved in the embodiments of this application may be the management user of the target chain (e.g., if the target chain is the application contract chain in the aforementioned blockchain electronic invoice platform, the management object may be a government collaboration department, a business-related department, etc.), and the configuration transaction includes the chain identifier of the target chain. It is understood that the aforementioned multi-blockchain may include a first chain, a business main chain managed by a first consensus node through the first chain, and a business sub-chain independent of the business main chain, wherein the business main chain includes one or more of a second chain and a third chain independent of the first chain.
[0178] It should be understood that the second chain network corresponding to the aforementioned second chain is independent of the third chain network corresponding to the third chain. The first chain network corresponding to the first chain and the target chain network corresponding to the target chain can be isolated through a cross-chain relay, that is, the first chain network and the target chain network exchange data through the cross-chain relay. For example, in the aforementioned blockchain electronic bill platform, when the target chain is the second chain (such as the aforementioned bill chain), the first chain network (i.e., the management chain network) and the second chain network (bill chain network) corresponding to the second chain can be isolated through a cross-chain relay, and the first chain network and the second chain network exchange data through the cross-chain relay. For another example, when the target chain is the third chain (such as the aforementioned application contract chain), the first chain network and the third chain network (application contract chain network) corresponding to the third chain can be isolated through a cross-chain relay, and the first chain network and the third chain network exchange data through the cross-chain relay. For another example, when the target chain is a business sub-chain, the first chain network and the sub-chain consensus network corresponding to the business sub-chain can be isolated through a cross-chain relay, and the first chain network and the sub-chain consensus network exchange data through the cross-chain relay.
[0179] The subchain consensus network corresponding to the business subchain is jointly established by the consensus nodes in the second-chain network corresponding to the second chain and the consensus nodes in the third-chain network corresponding to the third chain. The business subchain is created by the business object requesting to execute the target business through the authorization of the first consensus node. Each target business corresponds to one business subchain. In other words, when a temporary business (i.e., the target business) occurs, the business object (such as enterprise A, individual user, etc.) can request to execute the target business in the first-chain network corresponding to the first chain. After the first consensus node in the first-chain network verifies the authorization of the business object, a subchain consensus network for processing the target business can be jointly created based on the consensus nodes voted from the consensus nodes in the second-chain network and the consensus nodes voted from the consensus nodes in the third-chain network. At this time, the consensus nodes in the subchain consensus network can also be called verification nodes.
[0180] For example, in a blockchain electronic invoice platform, the target business is to verify whether the format of 100 invoices is correct. At this time, the business object can request the first consensus node in the management chain network (i.e., the first chain network) to execute the target business. The first consensus node can perform authorization verification on the business object. After the authorization verification, the consensus nodes voted by the bill consensus nodes in the bill chain network and the consensus nodes voted by the consensus nodes in the application contract chain network will form a sub-chain consensus network for verifying the format of the 100 invoices. The consensus nodes in this sub-chain consensus network can verify whether the format of the 100 invoices is correct and return the final execution result to the business object.
[0181] It is understood that the number of target chains can be one or more, and this embodiment of the present application does not limit this. When the number of target chains is one, the target chain can be a business subchain or a business main chain. For example, the above-mentioned blockchain electronic bill platform can include a management chain (i.e., the first chain), a business main chain including a bill chain (i.e., the second chain), an application contract chain (i.e., the third chain), business subchain 1, and business subchain 2. The target chain can be a bill chain, an application contract chain, or a business subchain. When the number of target chains is multiple, multiple target chains can include business subchains and business main chains. For example, the above-mentioned blockchain electronic bill platform can include a business main chain (i.e., including a bill chain and an application contract chain independent of the management chain) and two business subchains independent of the business main chain (i.e., business subchain 1 and business subchain 2). Multiple target chains can include the above-mentioned bill chain, application contract chain, and business subchain 1; or multiple target chains can include the above-mentioned bill chain and business subchain 2.
[0182] Among them, it is understandable that when the business object wants to perform cross-chain configuration on a certain blockchain (i.e., the target chain), it can send a configuration transaction for cross-chain configuration of the target chain to the first consensus node in the first chain network based on the configuration transaction. When the first consensus node receives the configuration transaction for cross-chain configuration of the target chain sent by the management object based on the configuration transaction, it can obtain the management permission certificate of the management object and verify the management permission certificate of the management object. If the verification is successful, the transaction type of the configuration transaction is determined. It is understandable that the transaction type of the configuration transaction can also be specified in the above-mentioned configuration transaction, and the first consensus node can directly determine the transaction type of the configuration transaction in the configuration transaction.
[0183] The transaction types involved in the embodiments of the present application can be divided into blocking transaction types and non-blocking transaction types. Different configuration transaction identifiers corresponding to the configuration transaction can be generated based on the different blocking transaction types and non-blocking transaction types. When the transaction type is a blocking transaction type, step S402 can be executed to generate a first configuration transaction identifier.
[0184] Step S402: When the transaction type of the configuration transaction is a blocking transaction type, the chain management configuration contract on the management chain is called to execute the configuration transaction, and a first configuration transaction identifier corresponding to the configuration transaction is generated; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock.
[0185] It can be understood that the first configuration transaction identifier is used to represent the transaction identifier of the above-mentioned configuration transaction. The first configuration transaction identifier can be a number, a character, or a string consisting of data and characters. For example, for configuration transaction x, calling the chain management configuration contract on the management chain to execute the configuration transaction corresponding to configuration transaction x can generate a configuration transaction identifier ID-x corresponding to configuration transaction x.
[0186] When the transaction type of the configuration transaction is a blocking transaction type, the first consensus node can call the chain management configuration contract on the management chain to execute the configuration transaction. The generation of the first configuration transaction identifier corresponding to the configuration transaction can include the following two methods:
[0187] (1) When there are multiple target chains, the above configuration transaction is for cross-chain configuration of multiple target chains. In this case, the configuration resources indicated by the above configuration transaction belong to global configuration resources, and the chain management configuration contract corresponding to the global configuration resources is the platform configuration contract on the first chain. It should be understood that global configuration resources are resources configured for all blockchains, and global configuration resources can include cross-chain configuration items. The cross-chain configuration items in the global configuration resources will be configured on multiple target chains. For example, the cross-chain configuration items can be for modifying the chain names on multiple target chains or the block times on multiple target chains.
[0188] It should be understood that the platform configuration contract includes two configuration methods: a blocking transaction configuration method and a non-blocking transaction configuration method. The above transaction type can be used to determine the configuration method to be called by the first consensus node when performing cross-chain configuration. When the transaction type of the configuration transaction is a blocking transaction type, the first consensus node writes the configuration transaction into the platform configuration contract, and then determines that the configuration method to be executed is the blocking transaction configuration method in the platform configuration contract based on the blocking transaction type, and calls the blocking transaction configuration method to execute the configuration transaction, obtaining the chain identifiers of the multiple target chains indicated by the configuration transaction. Then, based on the chain identifiers of the multiple target chains, the first configuration transaction identifier corresponding to the configuration transaction can be generated.
[0189] (2) It is understood that the target chain can be a second chain, a third chain or a business sub-chain. The second chain and the third chain can be managed by the first consensus node through the full platform configuration contract on the first chain, and the full platform configuration contract includes a chain management configuration contract. When the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract can include a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a sub-chain management configuration contract for configuring the business sub-chain. The independent configuration resources here refer to resources that are configured separately for a certain blockchain, such as configuring the block size of the target chain separately, upgrading the business on the target chain, etc.
[0190] It should be understood that when the target chain is the second chain, the target chain management configuration contract includes a chain management configuration contract for configuring the second chain. When the transaction type of the configuration transaction is a blocking transaction type, the configuration transaction can be written into the chain management configuration contract of the second chain, and then the blocking transaction configuration method in the chain management configuration contract of the second chain is called to execute the configuration transaction, obtain the chain identifier of the second chain indicated by the configuration transaction, and generate the first configuration transaction identifier corresponding to the configuration transaction based on the chain identifier of the second chain.
[0191] When the target chain is a third chain, the target chain management configuration contract includes a chain management configuration contract for configuring the third chain. When the transaction type of the configuration transaction is a blocking transaction type, the configuration transaction can be written into the chain management configuration contract of the third chain, and then the blocking transaction configuration method in the chain management configuration contract of the third chain is called to execute the configuration transaction, obtain the chain identifier of the third chain indicated by the configuration transaction, and generate a first configuration transaction identifier corresponding to the configuration transaction based on the chain identifier of the third chain.
[0192] When the target chain is a business subchain, the target chain management configuration contract includes a subchain management configuration contract for configuring the business subchain. When the transaction type of the configuration transaction is a blocking transaction type, the configuration transaction can be written into the subchain management configuration contract, and then the blocking transaction configuration method in the subchain management configuration contract is called to execute the configuration transaction. The chain identifier of the business subchain indicated by the configuration transaction is obtained, and based on the chain identifier of the business subchain, the first configuration transaction identifier corresponding to the configuration transaction is generated.
[0193] Step S403: Receive the first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the first business lock state.
[0194] Among them, it should be understood that when the cross-chain relay detects that the target chain is in the first business lock state, it can generate a first lock declaration transaction based on the first business lock state and send the first lock declaration transaction to the cross-chain relay. Correspondingly, the first consensus node can receive the first lock declaration transaction sent by the cross-chain relay. The first lock declaration transaction can be used to declare that the target chain has been successfully locked and normal business cannot be carried out on the target chain, or to declare that the first configuration transaction identifier is locked successfully, that is, to allow the first consensus node associated with the first chain to determine that the status of the configuration transaction corresponding to the first configuration transaction identifier is in the first transaction lock state.
[0195] Step S404: When it is determined based on the first lock declaration transaction that the state of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state, first transaction locking information corresponding to the first lock declaration transaction is generated, and the first transaction locking information is written into the management chain.
[0196] Among them, it can be understood that the first consensus node can determine that the status of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state based on the first lock declaration transaction, and when determining that the status of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state, it generates the first transaction lock information corresponding to the first lock declaration transaction, and packages the first transaction lock information into a block, and conducts consensus through other consensus nodes in the first chain network, and then writes the block to the first chain after the consensus is passed. The first transaction lock information can be used to indicate that the resources associated with the configuration transaction have been locked on the target chain, and the target chain is temporarily unable to conduct normal business. Among them, it should be understood that the first cross-chain configuration item indicates the configuration resources that need to be configured for the target chain. For example, if the target chain is a bill chain, the first cross-chain configuration item can indicate the update of the bill template resource for the bill chain; for example, the first cross-chain configuration item indicates the configuration of the block size resource for the bill chain.
[0197] Step S405: When obtaining the configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, obtain the first cross-chain configuration item in the configuration modification transaction, and cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0198] It should be understood that the management object obtains the first transaction lock information from the first chain, knows that the current target chain has been successfully locked, and can send a configuration modification transaction for the target chain to the first consensus node associated with the first chain, and the configuration modification transaction includes the first cross-chain configuration item; the first consensus node receives the above configuration modification transaction, and obtains the first cross-chain configuration item from the configuration modification transaction, and then cross-chain configures the first cross-chain configuration item to the target chain through the cross-chain relay.
[0199] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain, and when the transaction type of the configuration transaction is a blocking transaction type, execute the above configuration transaction to generate a first configuration transaction identifier corresponding to the configuration transaction; then, the target consensus node can obtain a blocking chain configuration lock corresponding to the blocking transaction type through the first configuration transaction identifier, and lock the business state of the target chain through the blocking chain configuration lock, and after locking the business state of the target chain, configure the cross-chain configuration items configured for the target chain on the first chain to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application is through the first consensus node on the first chain (for example, the aforementioned Figure 110a) shown in the can centrally manage the configuration information of other chains to ensure the consistency of the configuration information on the chain. At the same time, when the business status of the target chain is locked, the first consensus node can generate corresponding transaction lock information and write it to the first chain. This can also effectively ensure the auditability and traceability of the target chain's configuration. In addition, the introduction of a configuration mechanism such as a blocking chain configuration lock can achieve synchronous configuration effectiveness, ensuring the strict execution of business logic, while also ensuring the consistency and reliability of configuration information on each independent blockchain.
[0200] For further information, see Figure 5 , Figure 5 This is a cross-chain configuration method based on multiple blockchains provided by the embodiment of the present application. Figure 5 As shown, the method can be executed by the first consensus node associated with the first chain, for example, the first consensus node can be the Figure 1 Any consensus node in the consensus network 100a shown. The method may specifically include the following steps S501-S508.
[0201] Step S501: upon receiving a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction, determine the transaction type of the configuration transaction.
[0202] Step S502: When the transaction type of the configuration transaction is a blocking transaction type, the chain management configuration contract on the first chain is called to execute the configuration transaction, and a first configuration transaction identifier corresponding to the configuration transaction is generated; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0203] Step S503: Receive a first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the first business lock state;
[0204] Step S504: When it is determined based on the first lock declaration transaction that the state of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state, first transaction locking information corresponding to the first lock declaration transaction is generated, and the first transaction locking information is written into the first chain;
[0205] Step S505: When obtaining the configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, obtain the first cross-chain configuration item in the configuration modification transaction, and cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0206] The specific implementation of the above steps S501-S505 can refer to the specific implementation of the above steps S401-S405, which will not be repeated here.
[0207] Step S506: When the transaction type of the configuration transaction is a non-blocking transaction type, the chain management configuration contract on the first chain is called to execute the configuration transaction, and a second configuration transaction identifier corresponding to the configuration transaction is generated; the second configuration transaction identifier is used to instruct the cross-chain relay to send a second configuration lock acquisition transaction to the target consensus node associated with the target chain; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock.
[0208] It can be understood that the configuration transaction includes the chain identifier of the target chain and the second cross-chain configuration item associated with the configuration transaction. The second configuration transaction identifier is used to represent the transaction identifier of the above configuration transaction. The second configuration transaction identifier can be a number, a character, or a string consisting of data and characters. For example, for configuration transaction x, calling the chain management configuration contract on the management chain to execute the configuration transaction corresponding to configuration transaction x can generate a configuration transaction identifier ID-x corresponding to configuration transaction x.
[0209] Among them, when the transaction type of the configuration transaction is a non-blocking transaction type, the first consensus node can call the chain management configuration contract on the management chain to execute the configuration transaction. The second configuration transaction identifier corresponding to the configuration transaction can be generated in the following two ways:
[0210] (1) It can be understood that the multi-blockchain involved in this application includes a business main chain managed by the first consensus node through the first chain and a business sub-chain independent of the business main chain; the business main chain includes one or more of the second chain and the third chain independent of the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly established by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through the authorization of the first consensus node; one target business corresponds to one business sub-chain.
[0211] When there are multiple target chains, each of which includes a business sub-chain and a business main chain, the configuration transaction performs cross-chain configuration for the multiple target chains. In this case, the configuration resource indicated by the configuration transaction is a global configuration resource, and the chain management configuration contract corresponding to the global configuration resource is the platform configuration contract on the first chain. It should be understood that the platform configuration contract includes two configuration methods: a blocking transaction configuration method and a non-blocking transaction configuration method. The transaction type can be used to determine the configuration method to be called by the first consensus node when performing cross-chain configuration. When the configuration transaction is of a non-blocking transaction type, the first consensus node can write the configuration transaction into the platform configuration contract, then determine, based on the non-blocking transaction type, that the configuration method to be executed is the non-blocking transaction configuration method in the platform configuration contract, and call the non-blocking transaction configuration method to execute the configuration transaction, obtaining the chain identifiers of the multiple target chains indicated by the configuration transaction and the second cross-chain configuration item. Subsequently, based on the chain identifiers of the multiple target chains and the second cross-chain configuration item, a second configuration transaction identifier corresponding to the configuration transaction can be generated.
[0212] (2) It is understandable that the target chain can be a second chain, a third chain or a business sub-chain. The above-mentioned second chain and third chain can be managed by the first consensus node through the full platform configuration contract on the first chain. The full platform configuration contract includes a chain management configuration contract. When the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract includes a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a sub-chain management configuration contract for configuring the business sub-chain. The independent configuration resources here refer to resources that are configured separately for a certain blockchain, such as configuring the block size of the target chain separately, upgrading the business on the target chain, etc.
[0213] It should be understood that when the target chain is the second chain, the target chain management configuration contract includes a chain management configuration contract for configuring the second chain. When the transaction type of the configuration transaction is a non-blocking transaction type, the configuration transaction can be written into the chain management configuration contract of the second chain, and then the non-blocking transaction configuration method in the chain management configuration contract of the second chain is called to execute the configuration transaction, and the chain identifier and second cross-chain configuration item of the second chain indicated by the configuration transaction are obtained, and based on the chain identifier and second cross-chain configuration item of the second chain, the second configuration transaction identifier corresponding to the configuration transaction is generated.
[0214] When the target chain is a third chain, the target chain management configuration contract includes a chain management configuration contract for configuring the third chain. When the transaction type of the configuration transaction is a non-blocking transaction type, the configuration transaction can be written into the chain management configuration contract of the third chain, and then the non-blocking transaction configuration method in the chain management configuration contract of the third chain is called to execute the configuration transaction, thereby obtaining the chain identifier of the third chain and the second cross-chain configuration item indicated by the configuration transaction, and generating a second configuration transaction identifier corresponding to the configuration transaction based on the chain identifier of the third chain and the second cross-chain configuration item.
[0215] When the target chain is a business subchain, the target chain management configuration contract includes a subchain management configuration contract for configuring the business subchain. When the transaction type of the configuration transaction is a non-blocking transaction type, the configuration transaction can be written into the subchain management configuration contract, and then the non-blocking transaction configuration method in the subchain management configuration contract is called to execute the configuration transaction. The chain identifier of the business subchain indicated by the configuration transaction is obtained, and based on the chain identifier of the business subchain, a second configuration transaction identifier corresponding to the configuration transaction is generated.
[0216] Step S507: Receive the second lock declaration transaction sent by the cross-chain relay; the second lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the second business lock state.
[0217] It should be understood that when the cross-chain relay detects that the target chain is in the second business lock state, it can generate a second lock declaration transaction based on the second business lock state and send the second lock declaration transaction to the cross-chain relay. Accordingly, the first consensus node can receive the second lock declaration transaction sent by the cross-chain relay. The second lock declaration transaction can be used to declare that the target chain has been successfully locked and the target chain cannot conduct normal business, or to declare that the second configuration transaction identifier is locked successfully, that is, to allow the first consensus node associated with the first chain to determine that the status of the configuration transaction corresponding to the second configuration transaction identifier is in the second transaction lock state.
[0218] Step S508: When it is determined based on the second lock declaration transaction that the state of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state, second transaction locking information corresponding to the second lock declaration transaction is generated, and the second transaction locking information is written into the first chain.
[0219] It is understood that the first consensus node can determine that the status of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state based on the second lock declaration transaction, and when determining that the status of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state, generate the second transaction lock information corresponding to the second lock declaration transaction, and package the second transaction lock information into a block, and then reach consensus through other consensus nodes in the first chain network, and then write the block to the first chain after the consensus is passed. The second transaction lock information can be used to indicate that the resources associated with the configuration transaction have been locked on the target chain, and normal business cannot be carried out on the target chain temporarily. It should be understood that the second cross-chain configuration item indicates the configuration resources that need to be configured on the target chain.
[0220] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain, and generate a corresponding configuration transaction identifier according to the transaction type of the configuration transaction (such as generating a first configuration transaction identifier according to a blocking transaction type, and generating a second configuration transaction identifier according to a non-blocking transaction type). Subsequently, the cross-chain relay allows the target consensus node to obtain a corresponding configuration lock (a blocking chain configuration lock or a non-blocking chain configuration lock) through the corresponding configuration transaction identifier. The business state on the target chain can be locked through the corresponding configuration lock, and after locking the business state of the target chain, the cross-chain configuration items configured for the target chain on the first chain are configured to the target chain through the cross-chain relay. It can be seen from this that the embodiment of the present application is configured through the first consensus node on the first chain (for example, the aforementioned Figure 1 10a) shown in the figure can centrally manage the configuration information of other chains to ensure the consistency of the configuration information on the chain. At the same time, when the business status of the target chain is locked, the first consensus node can generate corresponding transaction lock information and write it to the first chain. This can also effectively ensure the auditability and traceability of the target chain's configuration. In addition, the introduction of a configuration mechanism such as configuration lock can ensure the consistency and reliability of the configuration information on each independent blockchain.
[0221] For further information, see Figure 6 , Figure 6 This embodiment of the present application provides a cross-chain configuration method based on multiple blockchains, including a first chain and a target chain. The method is executed by a cross-chain relay, which is used to isolate the first chain network corresponding to the first chain from the target chain network corresponding to the target chain. The method may specifically include the following steps S601-S604.
[0222] Step S601: When a first configuration transaction identifier corresponding to a configuration transaction on the first chain is detected, a first configuration lock acquisition transaction is sent to a target consensus node in the target chain network; the first configuration transaction identifier is generated by the first consensus node in the first chain network calling the management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type, and the configuration transaction is sent by the management object requesting the execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock.
[0223] It is understood that the configuration transaction includes the chain identifier of the target chain. The number of cross-chain relays involved in the embodiment of the present application can be multiple, and one cross-chain relay can correspond to one or more configuration transaction identifiers, that is, one cross-chain relay can forward transactions associated with the corresponding configuration transaction. For example, in the embodiment of the present application, the cross-chain relay can send the first configuration lock acquisition transaction to the target chain based on the first configuration transaction identifier. It should be understood that only the cross-chain relay corresponding to the first configuration transaction identifier can forward transactions associated with the first configuration transaction identifier.
[0224] Specifically, when the cross-chain relay detects the first configuration transaction identifier corresponding to the configuration transaction on the first chain, it can generate a first configuration lock acquisition transaction based on the first configuration transaction identifier, and send the first configuration lock acquisition transaction to the target consensus node in the target chain network. The target consensus node in the target chain network can obtain the blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain based on the first configuration lock acquisition transaction, and then configure the business state of the target chain to the first business lock state through the blocking chain configuration lock.
[0225] It is understood that the target chain's chain configuration contract may include both blocking and non-blocking chain configuration locks. Using the blocking chain configuration lock, the target chain's business state can be configured to the first business lock state. While in the first business lock state, the target chain cannot continue normal business operations or generate new blocks. Normal business operations can only be resumed when the first cross-chain configuration item configured for the target chain is configured on the target chain. Therefore, when the first cross-chain configuration item is subsequently cross-chain configured on the target chain, the blocking chain configuration lock ensures that the first cross-chain configuration item to be configured is fully and synchronously configured on the target chain.
[0226] It is understood that the use of a non-blocking chain configuration lock can provide a block buffer height, which can be used to represent the maximum interval height of blocks generated on the target chain before the non-blocking chain configuration lock configures the target chain's business state to the second business lock state. In other words, before the target chain's business state is configured to the second business lock state, normal business operations and new block generation are allowed on the target chain. The target chain's business state is configured to the second business lock state only when the interval height of blocks generated on the target chain reaches the block buffer height. For example, if the block buffer height is 100, when the interval height of new blocks generated on the target chain (for example, if the target chain generates blocks 1, 2, and 3 in sequence, the interval height refers to the height between blocks 1 and 3) reaches 100, the target chain's business state can be configured to the second business lock state. At this point, the target chain stops normal business operations and does not allow new blocks to be generated. Only after the cross-chain configuration items configured on the target chain are configured on the target chain can business on the target chain resume. Through non-blocking chain configuration locks, seamless configuration modifications can be achieved, which is imperceptible to users and provides a better user experience.
[0227] It should be understood that configuring the business state on the target chain to a business lock state (such as the first business lock state) refers to locking the resources or parameters associated with the configuration transaction on the target chain. When the target chain network acquires a blocking chain configuration lock based on the first configuration lock acquisition transaction, other configuration transaction identifiers will not be able to acquire any configuration locks (i.e., they will not be able to acquire blocking chain configuration locks or non-blocking chain configuration locks). Only when the blocking chain configuration lock is released can other configuration transaction identifiers acquire configuration locks.
[0228] Optionally, a cumulative lock duration threshold is set for the blocking chain configuration lock. The cumulative lock duration threshold can be set as needed, such as 1 hour, 30 minutes, two days, etc. This cumulative lock duration threshold can prevent the blocking chain configuration lock from being constantly occupied by the target chain and unavailable for other configuration transactions. Specifically, the cross-chain relay can accumulate the chain lock duration of the target chain detected to be in the first business lock state. When the accumulated chain lock duration reaches the cumulative lock duration threshold for the blocking chain configuration lock, it sends a timeout release lock transaction to the target consensus node. The timeout release lock transaction can be used to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock and change the business state of the target chain from the first business lock state to the business unlock state. It is understood that the cross-chain relay begins accumulating chain lock duration when it detects that the target chain is in the first business lock state, and can send a timeout release lock transaction to the target consensus node when the accumulated chain lock duration reaches the cumulative lock duration threshold. It should be understood that the use of the above-mentioned other configuration transaction identifiers will not be able to obtain any configuration locks and timeout mechanisms. This can ensure the consistency of configuration modifications under multi-chain concurrency and ensure the security of on-chain metadata.
[0229] Step S602: When it is detected that the target chain is in the first business lock state, a first lock declaration transaction is sent to the first consensus node; the first lock declaration transaction is used to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain when the state of the configuration transaction corresponding to the configuration transaction identifier is determined to be the first transaction lock state based on the first lock declaration transaction.
[0230] Among them, it should be understood that the target chain in the first business lock state cannot conduct normal business, while the target chain that is not in the first business lock state can conduct normal business. In this case, the cross-chain relay can continuously send transaction data to the target consensus node. If the target consensus node in the target chain cannot package the transaction data into blocks and does not return the execution result of the transaction data to the cross-chain relay, the cross-chain relay can detect that the target chain is in the first business lock state. If the target consensus node in the target chain packages the transaction data into blocks and writes them to the target chain after consensus with other consensus nodes on the target chain, and also returns the execution result of the transaction data to the cross-chain relay, the cross-chain relay can detect that the target chain is not in the first business lock state.
[0231] Among them, it can be understood that when it is detected that the target chain is not in the first business lock state, the cross-chain relay can send a first lock failure transaction to the first consensus node. The first lock failure transaction can be used to declare that the first configuration transaction identifier has failed to lock, so that the first consensus node in the first chain network generates a first transaction lock failure information corresponding to the first lock failure transaction written to the first chain when it determines based on the first lock failure transaction that the status of the configuration transaction corresponding to the first configuration transaction identifier is not the first transaction lock state. It should be understood that the first transaction lock failure information is used to indicate that the target chain has failed to lock, and the management object can obtain the first transaction lock failure information from the first chain, so as to know that the configuration modification transaction cannot be submitted to achieve synchronous configuration.
[0232] Optionally, when it is detected that the target chain is not in the first business lock state, the cross-chain relay can send a first lock failure release lock transaction to the target consensus node, wherein the first lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock.
[0233] Step S603: When a configuration modification transaction on the first chain is detected, obtain the first cross-chain configuration item in the configuration modification transaction; the above configuration modification transaction is sent by the management object based on the first transaction locking information on the first chain.
[0234] Among them, it can be understood that the management object can send a configuration modification transaction to the first consensus node in the first chain network based on the first transaction lock information, and the cross-chain relay can detect whether there is a configuration modification transaction on the first chain. When a configuration modification transaction on the first chain is detected, the first cross-chain configuration item in the configuration modification transaction can be obtained.
[0235] Step S604: Cross-chain configure the first cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0236] It can be understood that cross-chain configuration of the first cross-chain configuration item to the target chain means that the cross-chain relay relays the first cross-chain configuration item to the target chain, and then the target chain can write the first cross-chain configuration item into the chain configuration contract of the target chain, and after writing the chain configuration contract of the target chain, unlock the target chain in the first business lock state through the blocking chain configuration lock, thereby restoring normal business on the target chain.
[0237] Optionally, cross-chain configuration of the first cross-chain configuration item to the target chain may be performed in the form of a transaction. Specifically, the cross-chain relay may construct a first lock release transaction based on the first cross-chain configuration item. The first lock release transaction (Commit & Unclock) includes the first cross-chain configuration item. The first lock release transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock when writing the first cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the first business locked state to the business unlocked state. The target chain in the business unlocked state can conduct normal business.
[0238] Among them, it should be noted that only the cross-chain relay corresponding to the first configuration transaction identifier can unlock the blocking chain configuration lock in the target chain, that is, when sending the first lock release transaction to the target consensus node, the first configuration transaction identifier can be carried in the first lock release transaction, so that the target consensus node can write the first lock release transaction into the chain configuration contract in the target chain based on the first configuration transaction identifier, and call the lock release method in the chain configuration contract to release the blocking chain configuration lock.
[0239] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain, and when the transaction type of the configuration transaction is a blocking transaction type, execute the above configuration transaction to generate a first configuration transaction identifier corresponding to the configuration transaction; then, the target consensus node can obtain the blocking chain configuration lock corresponding to the blocking transaction type through the first configuration transaction identifier, and lock the business state of the target chain through the blocking chain configuration lock, and after locking the business state of the target chain, the cross-chain configuration items configured for the target chain on the first chain are configured to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application can uniformly manage the configuration information of other chains through the first consensus node on the first chain to ensure the consistency of the configuration information on the chain. In addition, the introduction of a configuration mechanism such as a blocking chain configuration lock can achieve the synchronous effectiveness of the configuration, ensure the strict execution of the business logic, and also ensure the consistency and reliability of the configuration information on each independent blockchain.
[0240] For further information, see Figure 7 , Figure 7 This embodiment of the present application provides a cross-chain configuration method based on multiple blockchains, including a first chain and a target chain. The method is executed by a cross-chain relay, which is used to isolate the first chain network corresponding to the first chain from the target chain network corresponding to the target chain. The method may specifically include the following steps S701-S703.
[0241] Step S701: Upon detecting a second configuration transaction identifier corresponding to a configuration transaction on the first chain, a second configuration lock acquisition transaction is sent to the target consensus node in the target chain network. The second configuration transaction identifier is generated by the first consensus node in the first chain network when the configuration transaction in the configuration transaction is of a non-blocking transaction type and the management configuration contract on the first chain is called to execute the configuration transaction. The configuration transaction is sent by the management object requesting the execution of the configuration transaction. The second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and to configure the target chain's business state to the second business lock state using the non-blocking chain configuration lock. The configuration transaction includes the target chain's chain identifier and a second cross-chain configuration item associated with the aforementioned configuration transaction. The second cross-chain configuration item includes content that needs to be configured for the target chain, such as configuring the block size generated for the first chain.
[0242] Specifically, when the cross-chain relay detects the second configuration transaction identifier corresponding to the configuration transaction on the first chain, it can generate a second configuration lock acquisition transaction based on the second configuration transaction identifier, and send the second configuration lock acquisition transaction to the target consensus node in the target chain network. The target consensus node in the target chain network can obtain the non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain based on the second configuration lock acquisition transaction, and then use the non-blocking chain configuration lock to configure the business state of the target chain to the second business lock state.
[0243] It can be understood that the chain configuration contract of the target chain may include two types of contract locks: a blocking chain configuration lock and a non-blocking chain configuration lock. The blocking chain configuration lock can be used to configure the business status on the target chain to the first business lock state. The target chain in the first business lock state cannot generate new blocks and stops normal business. Normal business can only be restored when the first cross-chain configuration item configured for the target chain is configured to the target chain.
[0244] It is understandable that the use of a non-blocking chain configuration lock can provide a block buffer height. That is, the target consensus node in the target chain needs to obtain the block buffer height at the same time as obtaining the non-blocking chain configuration. This block buffer height can be used to represent the maximum interval height of blocks obtained on the target chain before the business state of the target chain is configured to the second business lock state through the non-blocking chain configuration lock. In other words, before the business state of the target chain is configured to the second business lock state, normal business can be carried out on the target chain. When the interval height of the blocks obtained on the target chain reaches the block buffer height, the business state of the target chain is configured to the second business lock state. Normal business can only be resumed after the second cross-chain configuration item configured by the target chain is configured on the target chain. The non-blocking chain configuration lock can achieve seamless configuration changes and provide a better user experience.
[0245] It should be understood that configuring the business state on the target chain to a business lock state (such as the second business lock state) refers to locking the resources or parameters associated with the configuration transaction on the target chain. When the target chain network acquires a non-blocking chain configuration lock based on the second configuration lock acquisition transaction, other configuration transaction identifiers will not be able to acquire any configuration locks (i.e., they will not be able to acquire blocking chain configuration locks or non-blocking chain configuration locks). Only after the non-blocking chain configuration lock is released can other configuration transaction identifiers acquire configuration locks.
[0246] It should be understood that before the business state of the target chain is configured to the second business state through the non-blocking chain configuration lock, the cross-chain relay can send transaction data to the target consensus node in the target chain network. The target consensus node can package the received transaction data into blocks and reach consensus through other consensus nodes in the target chain. After the consensus is passed, the block is written into the target chain and the execution result of the transaction data is returned to the cross-chain relay. The target consensus node can continuously determine the interval height of the blocks obtained on the target chain. When the interval height of the blocks obtained on the target chain reaches the block buffer height, the business state of the target chain can be configured to the second business lock state through the non-blocking chain configuration lock.
[0247] Step S702: When it is detected that the target chain is in the second business lock state, a second lock declaration transaction is sent to the first consensus node; the second lock declaration transaction is used to instruct the first consensus node to generate second transaction lock information corresponding to the second lock declaration transaction for writing into the first chain when the state of the configuration transaction corresponding to the configuration transaction identifier is determined to be the second transaction lock state based on the second lock declaration transaction.
[0248] It should be understood that the target chain in the second business lock state is temporarily unable to conduct normal business, while the target chain that is not in the second business lock state can conduct normal business. In this case, the cross-chain relay still sends transaction data to the target consensus node. If the target consensus node is unable to package the received transaction data into blocks and return the execution results of the transaction data to the cross-chain relay, it can be detected that the target chain is in the second business lock state. If the target consensus node in the target chain can still execute the packaging of the transaction data into blocks and return the execution results of the transaction data to the cross-chain relay, it can be detected that the target chain is not in the second business lock state.
[0249] Among them, it can be understood that when it is detected that the target chain is not in the second business lock state, the cross-chain relay can send a second lock failure transaction to the first consensus node. The second lock failure transaction can be used to declare that the second configuration transaction identifier has failed to lock, so that the first consensus node in the first chain network generates a second transaction lock failure information corresponding to the second lock failure transaction written to the first chain when it determines based on the second lock failure transaction that the status of the configuration transaction corresponding to the second configuration transaction identifier is not the second transaction lock state. It should be understood that the second transaction lock failure information is used to indicate that the target chain has failed to lock. The management object can obtain the second transaction lock failure information from the first chain and determine based on the second transaction lock failure information that cross-chain configuration of the target chain is currently unavailable.
[0250] Optionally, when it is detected that the target chain is not in the second business lock state, the cross-chain relay can send a second lock failure release lock transaction to the target consensus node, wherein the second lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock.
[0251] Step S703: Cross-chain configure the second cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the second business lock state through a non-blocking chain configuration lock.
[0252] It is understood that the cross-chain relay does not need to detect whether there is a configuration modification transaction on the management chain. When it is detected that the target chain is in the second business lock state, the second cross-chain configuration item associated with the configuration transaction is included in the configuration transaction, and the cross-chain relay can directly cross-chain configure the second cross-chain configuration item to the target chain. Specifically, the cross-chain relay can cross-chain relay the second cross-chain configuration item to the target chain, and the target chain can write the second cross-chain configuration item into the chain configuration contract of the target chain. After writing the second cross-chain configuration item into the chain configuration contract of the target chain, the target chain in the second business lock state is unlocked through a non-blocking chain configuration lock, thereby resuming normal business on the target chain.
[0253] It should be understood that the main difference between the cross-chain configuration of the target chain through the blocking chain configuration lock and the non-blocking chain configuration lock is that there are two stages in the cross-chain configuration of the target chain through the blocking chain configuration lock (i.e., the first stage is to initiate a configuration transaction to configure the business state of the target chain to the first business lock state, and the second stage is to initiate a modification configuration transaction when the target chain is in the first business lock state, and configure the first cross-chain configuration item in the modification configuration transaction to the target chain through the cross-chain relay). As mentioned above Figure 6 In the example, the first phase corresponds to steps S601-S602, and the second phase corresponds to steps S603-S604. Using a blocking chain configuration lock to perform cross-chain configuration on the target chain in two phases allows for synchronous cross-chain configuration, providing better consistency, but this can cause the target chain to be temporarily unavailable. However, using a non-blocking chain configuration lock to perform cross-chain configuration on the target chain requires only one phase, initiating a configuration transaction to configure the target chain's business state to the second business lock state. Upon detecting that the target chain is in the second business lock state, the cross-chain relay can directly configure the second cross-chain configuration item in the configuration transaction to the target chain. There is no need to initiate a modification transaction when the target chain is in the second business lock state. This single phase of cross-chain configuration on the target chain through the non-blocking chain configuration lock allows for cross-chain configuration without impacting the target chain's business. This cross-chain configuration is user-impactless, providing a more convenient and user-friendly experience.
[0254] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain, and when it is determined that the transaction type of the configuration transaction is a non-blocking transaction type, execute the above configuration transaction and generate a second configuration transaction identifier corresponding to the configuration transaction; the cross-chain relay can use the second configuration transaction identifier to enable the target consensus node to obtain the non-blocking chain configuration lock corresponding to the non-blocking transaction type, and lock the business state of the target chain through the non-blocking chain configuration lock; then, after locking the business state of the target chain, the second cross-chain configuration item configured for the target chain on the first chain is configured to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application can uniformly manage the configuration information of other chains through the first consensus node on the first chain to ensure the consistency of the configuration information on the chain. In addition, the introduction of a configuration mechanism such as a non-blocking chain configuration lock can achieve seamless configuration modification, provide a better user experience, and also ensure the consistency and reliability of the configuration information on each independent blockchain.
[0255] For further information, see Figure 8 , Figure 8 This is a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application. The multiple blockchains include a first chain and a target chain, such as Figure 8As shown, the method can be jointly performed by a first consensus node in a first chain network corresponding to the first chain, a cross-chain relay, and a target consensus node in a target chain network corresponding to the target chain. The cross-chain relay can be used to isolate the first chain network from the target chain network. The method can specifically include the following steps S801-S813.
[0256] Step S801: The first consensus node receives a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction.
[0257] Step S802: The first consensus node determines the transaction type of the configuration transaction.
[0258] Step S803: When the transaction type of the configuration transaction is a blocking transaction type, the first consensus node calls the chain management configuration contract on the first chain to execute the configuration transaction and generates a first configuration transaction identifier corresponding to the configuration transaction.
[0259] Step S804: The cross-chain relay detects the first configuration transaction identifier corresponding to the configuration transaction on the first chain.
[0260] Step S805: When the first configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, the cross-chain relay sends a first configuration lock acquisition transaction to the target consensus node in the target chain network.
[0261] Step S806: The target consensus node obtains the blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configures the business state of the target chain to the first business lock state through the blocking chain configuration lock.
[0262] It should be understood that the target consensus node receives the first configuration lock acquisition transaction sent by the cross-chain relay, and then obtains the blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain based on the first configuration lock acquisition transaction.
[0263] Step S807: When the cross-chain relay detects that the target chain is in the first business lock state, it sends a first lock declaration transaction to the first consensus node.
[0264] It should be understood that when the cross-chain relay detects that the target chain is in the first business lock state, it can generate a first lock declaration transaction based on the first business lock state. The first lock declaration transaction can be used to declare that the target chain has been successfully locked, or to declare that the first configuration transaction identifier has been successfully locked.
[0265] Step S808: When the first consensus node determines that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction locked state based on the first lock declaration transaction, it generates first transaction locking information corresponding to the first lock declaration transaction and writes the first transaction locking information into the first chain.
[0266] Among them, it should be understood that, after receiving the first lock declaration transaction sent by the cross-chain relay, the first consensus node determines that the status of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state based on the first lock declaration transaction, and when determining that the status of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state, it can generate the first transaction lock information based on the first lock declaration transaction, and then reach a consensus on the first transaction lock information through other consensus nodes in the first chain except the target consensus node, and after the consensus is passed, generate a block according to the first transaction lock information and write it into the first chain.
[0267] Step S809: The first consensus node receives the configuration modification transaction sent by the management object based on the first transaction lock information on the first chain.
[0268] Step S810: When obtaining the configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, the first consensus node obtains the first cross-chain configuration item in the configuration modification transaction.
[0269] Step S811: When the cross-chain relay detects a configuration modification transaction on the first chain, it obtains the first cross-chain configuration item in the configuration modification transaction.
[0270] Step S812: The cross-chain relay configures the first cross-chain configuration item to the target chain.
[0271] Step S813: The target consensus node unlocks the target chain in the first business locking state through a blocking chain configuration lock.
[0272] Optionally, it should be understood that a cumulative lock duration threshold can be set for the blocking chain configuration lock. Such a cumulative lock duration threshold can prevent the blocking chain configuration lock from being occupied by the target chain and being unavailable for other configuration transactions. The target consensus node can accumulate the chain lock duration of the target chain in the first business lock state. When the accumulated chain lock duration reaches the cumulative lock duration threshold of the blocking chain configuration lock, the target consensus node calls the lock release method to release the blocking chain configuration lock and changes the business state of the target chain from the first business lock state to the business unlock state.
[0273] Optionally, the cross-chain relay can accumulate the chain lock duration of the target chain detected to be in the first business lock state, and when the accumulated chain lock duration reaches the accumulated lock duration threshold of the blocking chain configuration lock, send a timeout release lock transaction to the target consensus node. After receiving the timeout release lock transaction, the target consensus node calls the lock release method to release the blocking chain configuration lock and changes the business state of the target chain from the first business lock state to the business unlock state.
[0274] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain. When the transaction type of the configuration transaction is a blocking transaction type, the above configuration transaction is executed to generate a first configuration transaction identifier corresponding to the configuration transaction; then, the target consensus node obtains a blocking chain configuration lock corresponding to the blocking transaction type through the first configuration transaction identifier, and locks the business state of the target chain through the blocking chain configuration lock; after locking the business state of the target chain, the cross-chain configuration items configured for the target chain on the first chain are configured to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application can uniformly manage the configuration information of other chains through the first consensus node on the first chain to ensure the consistency of the configuration information on the chain. At the same time, when the business state of the target chain is locked, the first chain can generate corresponding transaction lock information and write it to the first chain, which can also effectively ensure the auditability and traceability of the configuration of the target chain; in addition, the introduction of a configuration mechanism such as a blocking chain configuration lock can achieve synchronous effectiveness of the configuration, ensure the strict execution of the business logic, and also ensure the consistency and reliability of the configuration information on each independent blockchain.
[0275] For further information, see Figure 9 , Figure 9 This is a cross-chain configuration method based on multiple blockchains provided in an embodiment of the present application. The multiple blockchains include a first chain and a target chain, such as Figure 9 As shown, the method can be jointly performed by a first consensus node in a first chain network corresponding to the first chain, a cross-chain relay, and a target consensus node in a target chain network corresponding to the target chain. The cross-chain relay can be used to isolate the first chain network from the target chain network. The method can specifically include the following steps S901-S910.
[0276] Step S901: The first consensus node receives a configuration transaction for cross-chain configuration of a target chain sent by a management object based on a configuration transaction.
[0277] Step S902: The first consensus node determines the transaction type of the configuration transaction.
[0278] Step S903: When the transaction type of the configuration transaction is a non-blocking transaction type, the first consensus node calls the chain management configuration contract on the first chain to execute the configuration transaction and generates a second configuration transaction identifier corresponding to the configuration transaction.
[0279] Step S904: When a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a second configuration lock acquisition transaction is sent to the target consensus node in the target chain network.
[0280] Step S905: When a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a second configuration lock acquisition transaction is sent to the target consensus node in the target chain network.
[0281] Step S906: The target consensus node obtains the non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configures the business state of the target chain to the second business lock state through the non-blocking chain configuration lock.
[0282] It should be understood that the target consensus node receives the second configuration lock acquisition transaction sent by the cross-chain relay, and then obtains the non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain according to the second configuration lock acquisition transaction.
[0283] Step S907: When the cross-chain relay detects that the target chain is in the second business lock state, it sends a second lock declaration transaction to the first consensus node.
[0284] Step S908: When the first consensus node determines that the status of the configuration transaction corresponding to the configuration transaction identifier is the second transaction locked state based on the second lock declaration transaction, it generates second transaction locking information corresponding to the second lock declaration transaction and writes the second transaction locking information corresponding to the second lock declaration transaction into the first chain.
[0285] Among them, it should be understood that, after receiving the second lock declaration transaction sent by the cross-chain relay, the first consensus node determines that the status of the configuration transaction corresponding to the configuration transaction identifier is the second transaction lock state based on the second lock declaration transaction, and when determining that the status of the configuration transaction corresponding to the configuration transaction identifier is the second transaction lock state, it can generate the second transaction lock information based on the second lock declaration transaction, generate a block for the second transaction lock information, and write the block containing the transaction lock information into the first chain after passing the consensus of other consensus nodes on the first chain.
[0286] Step S909: The cross-chain relay configures the second cross-chain configuration item associated with the configuration transaction to the target chain.
[0287] Step S910: The target consensus node unlocks the target chain in the second business locking state through a non-blocking chain configuration lock.
[0288] In an embodiment of the present application, the first consensus node on the first chain can receive a configuration transaction for cross-chain configuration of the target chain. When the transaction type of the configuration transaction is a non-blocking transaction type, the configuration transaction is executed to generate a second configuration transaction identifier corresponding to the configuration transaction; then the cross-chain relay can use the first configuration transaction identifier to enable the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type, and lock the business state of the target chain through the non-blocking chain configuration lock; after locking the business state of the target chain, the second cross-chain configuration item configured for the target chain on the first chain can be configured to the target chain through the cross-chain relay. It can be seen that the embodiment of the present application can uniformly manage the configuration information of other chains through the first consensus node on the first chain to ensure the consistency of the configuration information on the chain. At the same time, when the business state of the target chain is locked, the first consensus node can generate corresponding transaction lock information and write it to the first chain, which can also effectively ensure the auditability and traceability of the configuration process of the target chain; in addition, the introduction of a configuration mechanism such as a non-blocking chain configuration lock realizes seamless configuration modification, improves user experience, and ensures the consistency and reliability of configuration information on each independent blockchain.
[0289] For further information, see Figure 10 , Figure 10 This is a schematic diagram of the structure of a cross-chain configuration device based on multiple blockchains provided by this application. Figure 10 As shown, the cross-chain configuration device 1 based on multiple blockchains can be run on a first consensus node, and the multiple blockchains include a first chain associated with the first consensus node and a target chain to be cross-chain configured; the first chain network corresponding to the first chain and the target chain network corresponding to the target chain are isolated through a cross-chain relay, and the first consensus node can be any blockchain node in the first chain network (for example, the above-mentioned consensus network 100a), for example, the first consensus node can be the above-mentioned Figure 1 The consensus node 10a in the corresponding embodiment. It should be understood that the cross-chain configuration device 1 based on multiple blockchains can be a computer program (including program code) running in a blockchain node (for example, the aforementioned consensus node 10a). For example, the cross-chain configuration device 1 based on multiple blockchains can be an application software; it can be understood that the cross-chain configuration device 1 based on multiple blockchains can be used to execute the corresponding steps in the method provided in the embodiment of the present application. Figure 10 As shown, the cross-chain configuration device 1 based on multiple blockchains may include: a determination module 11, a calling module 12, a receiving module 13, a generation module 14, a first acquisition module 15 and a first configuration module 16;
[0290] Determination module 11, configured to determine the transaction type of the configuration transaction upon receiving a configuration transaction for cross-chain configuration of a target chain sent by a management object based on the configuration transaction;
[0291] The calling module 12 is used to call the chain management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction is a blocking transaction type, and generate a first configuration transaction identifier corresponding to the configuration transaction; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0292] Receiving module 13 receives a first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the first business lock state;
[0293] A generating module 14 is configured to generate first transaction locking information corresponding to the first lock declaration transaction when determining that the state of the configuration transaction corresponding to the first configuration transaction identifier is the first transaction locked state based on the first lock declaration transaction, and write the first transaction locking information into the first chain;
[0294] A first acquisition module 15 is configured to, upon acquiring a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, acquire the first cross-chain configuration item in the configuration modification transaction;
[0295] The first configuration module 16 is used to cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0296] Among them, when there are multiple target chains and the configuration resources indicated by the configuration transaction belong to global configuration resources, the chain management configuration contract corresponding to the global configuration resources is the platform configuration contract on the first chain;
[0297] The calling module 12 includes:
[0298] The calling subunit 121 is used to write the configuration transaction into the platform configuration contract, call the blocking transaction configuration method in the platform configuration contract, execute the configuration transaction, and obtain the chain identifiers of multiple target chains indicated by the configuration transaction;
[0299] The generating subunit 122 is configured to generate a first configuration transaction identifier corresponding to the configuration transaction based on identifiers of multiple target chains.
[0300] Among them, the multi-blockchain includes a business main chain managed by the first consensus node through the first chain and a business sub-chain independent of the business main chain; the business main chain includes one or more of the second chain and the third chain independent of the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly formed by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through the authorization of the first consensus node; one target business corresponds to one business sub-chain; multiple target chains include business sub-chains and business main chains.
[0301] Among them, the multi-blockchain includes a business sub-chain and a second chain and a third chain managed by the first consensus node through the full-platform configuration contract on the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly established by the consensus node in the second chain network corresponding to the second chain and the consensus node in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through authorization by the first consensus node; one target business corresponds to one business sub-chain; when the target chain is a business sub-chain, a second chain or a third chain, and the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract includes a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a sub-chain management configuration contract for configuring the business sub-chain.
[0302] Wherein, when there are multiple target chains and the configuration resource indicated by the configuration transaction belongs to a global configuration resource, the chain management configuration contract corresponding to the global configuration resource is the platform configuration contract on the first chain; the configuration transaction includes a second cross-chain configuration item associated with the configuration transaction;
[0303] The calling module 12 is further used to call the platform configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction is a non-blocking transaction type, and generate a second configuration transaction identifier corresponding to the configuration transaction; the second configuration transaction identifier is used to instruct the cross-chain relay to send a second configuration lock acquisition transaction to the target consensus node associated with the target chain; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0304] The receiving module 13 is further configured to receive a second lock declaration transaction sent by the cross-chain relay; the second lock declaration transaction is determined by the cross-chain relay when it detects that the target chain is in the second business lock state;
[0305] The generation module 14 is further configured to generate second transaction locking information corresponding to the second lock declaration transaction when determining that the state of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction locked state based on the second lock declaration transaction, and write the second transaction locking information into the first chain.
[0306] The calling module 12 includes:
[0307] The calling submodule 121 is configured to write a configuration transaction with the second cross-chain configuration item into the platform configuration contract, call the non-blocking transaction configuration method in the platform configuration contract on the first chain, execute the configuration transaction, and obtain the chain identifier of the target chain indicated in the configuration transaction and the second cross-chain configuration item;
[0308] The generation submodule 122 is configured to generate a second configuration transaction identifier corresponding to the configuration transaction based on the chain identifier of the target chain and the second cross-chain configuration item.
[0309] The specific implementation of the determination module 11, the calling module 12, the receiving module 13, the generating module 14, the first obtaining module 15 and the first configuring module 16 can be found in the above Figure 4 The description of steps S401 to S405 in the corresponding embodiment and the above Figure 5 The description of steps S501 to S508 in the corresponding embodiment will not be repeated here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be repeated here either.
[0310] For further information, see Figure 11 , Figure 11 This is a schematic diagram of the structure of a cross-chain configuration device based on multiple blockchains provided by this application. Figure 11 As shown, the cross-chain configuration device 2 based on multiple blockchains can run on a cross-chain relay, and the multiple blockchains include a first chain associated with a first consensus node and a target chain to be cross-chain configured; the cross-chain relay is used to isolate the first chain network corresponding to the first chain and the target chain network corresponding to the target chain. It should be understood that the cross-chain configuration device 2 based on multiple blockchains can be a computer program (including program code) running in the cross-chain relay. For example, the cross-chain configuration device 2 based on multiple blockchains can be an application software; it can be understood that the cross-chain configuration device 2 based on multiple blockchains can be used to execute the corresponding steps in the method provided in the embodiment of the present application. Figure 11 As shown, the cross-chain configuration device 2 based on multiple blockchains may include: a sending module 21, a second acquisition module 22 and a second configuration module 23;
[0311] The sending module 21 is configured to send a first configuration lock acquisition transaction to a target consensus node in a target chain network when a first configuration transaction identifier corresponding to a configuration transaction on the first chain is detected; the first configuration transaction identifier is generated when the first consensus node in the first chain network calls the chain management configuration contract on the first chain to execute a configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock;
[0312] The sending module 21 is further configured to send a first lock declaration transaction to the first consensus node when detecting that the target chain is in the first business lock state; the first lock declaration transaction is configured to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain when determining, based on the first lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state;
[0313] A second acquisition module 22 is configured to acquire a first cross-chain configuration item in a configuration modification transaction upon detecting a configuration modification transaction on the first chain; the configuration modification transaction is sent by the management object based on the first transaction lock information on the first chain;
[0314] The second configuration module 23 is used to cross-chain configure the first cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
[0315] The second configuration module 23 includes:
[0316] A construction unit 231 is configured to construct a first lock release transaction based on the first cross-chain configuration item; the first lock release transaction is configured to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock when writing the first cross-chain configuration item to the chain configuration contract, and to change the business state of the target chain from the first business locked state to the business unlocked state.
[0317] The sending subunit 232 is used to send the first lock release transaction to the target consensus node.
[0318] Among them, the sending module 21 is also used to: accumulate the chain lock time of the target chain detected to be in the first business lock state, and when the accumulated chain lock time reaches the accumulated lock time threshold of the blocking chain configuration lock, send a timeout release lock transaction to the target consensus node. The timeout release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock, and change the business state of the target chain from the first business lock state to the business unlock state.
[0319] Among them, the sending module 21 is also used to: when it is detected that the target chain is not in the first business locking state, send a first lock failure transaction to the first consensus node, and send a first lock failure release lock transaction to the target consensus node. The first lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock.
[0320] The configuration transaction includes a second cross-chain configuration item associated with the configuration transaction;
[0321] The sending module 21 is further configured to send a second configuration lock acquisition transaction to the target consensus node in the target chain network when a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected. The second configuration transaction identifier is generated when the first consensus node in the first chain network calls the management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a non-blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock;
[0322] The sending module 21 is further configured to send a second lock declaration transaction to the first consensus node when detecting that the target chain is in the second business lock state; the second lock declaration transaction is configured to instruct the first consensus node to generate second transaction lock information corresponding to the second lock declaration transaction for writing into the first chain when determining, based on the second lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the second transaction lock state;
[0323] The second configuration module 23 is further used to cross-chain configure the second cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the second business lock state through a non-blocking chain configuration lock.
[0324] The second configuration module 23 includes:
[0325] A construction unit 231 is configured to construct a second lock release transaction based on the second cross-chain configuration item;
[0326] The sending subunit 232 is used to send the second lock release transaction to the target consensus node; the second lock release transaction is used to instruct the target consensus node in the target chain to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock when writing the second cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the second business locked state to the business unlocked state.
[0327] Among them, the second configuration lock acquisition transaction is also used to instruct the target consensus node to obtain the block buffer height from the chain configuration contract on the target chain. The block buffer height is used to represent the maximum interval height of the blocks obtained on the target chain before the business state of the target chain is configured to the second business lock state through the non-blocking chain configuration lock.
[0328] The sending module 21 is further configured to:
[0329] When it is detected that the target chain is not in the second business lock state, a second lock failure transaction is sent to the first consensus node, and a second lock failure release lock transaction is sent to the target consensus node. The second lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock.
[0330] The specific implementation of the sending module 21, the second acquisition module 22 and the second configuration module 23 can be found in the above Figure 6 The description of steps S601 to S604 in the corresponding embodiment and the above Figure 7 The description of steps S701 to S703 in the corresponding embodiment will not be repeated here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be repeated here either.
[0331] Further, see Figure 12 , Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 12As shown, the computer device 1000 can be a user terminal or a server, and will not be limited here. For ease of understanding, this application takes the computer device as an example of a server. The computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 12 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.
[0332] The network interface 1004 in the computer device 1000 can also provide network communication functions. Figure 12 In the computer device 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to execute the above Figures 4 to 9 The description of the cross-chain configuration method based on multiple blockchains in the corresponding embodiment can also be performed as described above. Figure 10 or Figure 11 The description of the cross-chain configuration device based on multiple blockchains in the corresponding embodiments (i.e., the cross-chain configuration device based on multiple blockchains 1 and the cross-chain configuration device based on multiple blockchains 2) will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0333] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores the computer program executed by the cross-chain configuration device 1 based on multiple blockchains and the cross-chain configuration device 2 based on multiple blockchains mentioned above, and the computer program includes computer instructions. When the processor executes the computer instructions, it can execute the above-mentioned Figures 4 to 9The description of the cross-chain configuration method based on multiple blockchains in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, computer instructions can be deployed on a computing device for execution, or on multiple computing devices located in one location, or on multiple computing devices distributed in multiple locations and interconnected by a communication network. Multiple computing devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain system.
[0334] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the above Figures 4 to 9 The description of the cross-chain configuration method based on multiple blockchains in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here. For technical details not disclosed in the computer program product or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.
[0335] For further information, see Figure 13 , Figure 13 This is a schematic diagram of a multi-blockchain cross-chain configuration system provided by an embodiment of the present application. The multi-blockchain cross-chain configuration system 3 may include a consensus node 3a, a cross-chain relay 3b, and a consensus node 3c; wherein, the consensus node 3a and the consensus node 3c may interact through the cross-chain relay, and the consensus node 3a may be the above-mentioned Figures 4 to 9 The first consensus node in the first chain network described in the corresponding embodiment can be the above Figure 1 Any blockchain node in the consensus network 100a shown; wherein the consensus node 3c can be the above Figures 4 to 9 The target consensus node in the target chain network described in the corresponding embodiment can be the target consensus node Figure 1 Any blockchain node in the consensus network 200a or consensus network 300 shown will not be further described here; the cross-chain relay 3b can be the above Figures 4 to 9 The cross-chain relay described in the corresponding embodiment. In addition, the description of the beneficial effects of adopting the same method will not be repeated.
[0336] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0337] The above disclosure is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A cross-chain configuration method based on multiple blockchains, characterized in that: The method is performed by a first consensus node, and the multi-blockchain includes a first chain associated with the first consensus node and a target chain to be cross-chain configured; The first chain network corresponding to the first chain and the target chain network corresponding to the target chain are isolated through cross-chain relay, and the method includes: Upon receiving a configuration transaction for cross-chain configuration of the target chain sent by the management object based on the configuration transaction, determining the transaction type of the configuration transaction; When the transaction type of the configuration transaction is a blocking transaction type, the chain management configuration contract on the first chain is called to execute the configuration transaction, and a first configuration transaction identifier corresponding to the configuration transaction is generated; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to a first business lock state through the blocking chain configuration lock; Receiving a first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when detecting that the target chain is in the first business lock state; When it is determined based on the first lock declaration transaction that the state of the configuration transaction corresponding to the first configuration transaction identifier is a first transaction locked state, generating first transaction locking information corresponding to the first lock declaration transaction, and writing the first transaction locking information into the first chain; When obtaining a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, obtaining a first cross-chain configuration item in the configuration modification transaction, and cross-chain configuring the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business lock state through the blocking chain configuration lock.
2. The method according to claim 1, wherein When there are multiple target chains and the configuration resource indicated by the configuration transaction belongs to a global configuration resource, the chain management configuration contract corresponding to the global configuration resource is the platform configuration contract on the first chain; The calling of the chain management configuration contract on the first chain to execute the configuration transaction and generate a first configuration transaction identifier corresponding to the configuration transaction includes: Writing the configuration transaction into the platform configuration contract, calling the blocking transaction configuration method in the platform configuration contract, executing the configuration transaction, and obtaining the chain identifiers of the multiple target chains indicated by the configuration transaction; Based on the identifiers of the multiple target chains, a first configuration transaction identifier corresponding to the configuration transaction is generated.
3. The method according to claim 2, characterized in that The multi-blockchain includes a business main chain managed by the first consensus node through the first chain and a business sub-chain independent of the business main chain; the business main chain includes one or more of a second chain and a third chain independent of the first chain; the sub-chain consensus network corresponding to the business sub-chain is jointly established by the consensus nodes in the second chain network corresponding to the second chain and the consensus nodes in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business sub-chain is created by the business object requesting to execute the target business through the authorization of the first consensus node; one target business corresponds to one business sub-chain; multiple target chains include the business sub-chain and the business main chain.
4. The method according to claim 1, wherein The multi-blockchain includes a business subchain and a second chain and a third chain managed by the first consensus node through the full-platform configuration contract on the first chain; the subchain consensus network corresponding to the business subchain is jointly established by the consensus nodes in the second chain network corresponding to the second chain and the consensus nodes in the third chain network corresponding to the third chain; wherein the second chain network is independent of the third chain network; the business subchain is created by the business object requesting to execute the target business through authorization by the first consensus node; one target business corresponds to one business subchain; when the target chain is the business subchain, the second chain or the third chain, and the configuration resource indicated by the configuration transaction belongs to an independent configuration resource, the chain management configuration contract corresponding to the independent configuration resource is the target chain management configuration contract on the first chain; the target chain management configuration contract includes a chain management configuration contract for configuring the second chain, a chain management configuration contract for configuring the third chain, or a subchain management configuration contract for configuring the business subchain.
5. The method according to claim 1, wherein When there are multiple target chains and the configuration resource indicated by the configuration transaction belongs to a global configuration resource, the chain management configuration contract corresponding to the global configuration resource is the platform configuration contract on the first chain; The configuration transaction includes a second cross-chain configuration item associated with the configuration transaction; and the method further includes: When the transaction type of the configuration transaction is a non-blocking transaction type, the platform configuration contract on the first chain is called to execute the configuration transaction, and a second configuration transaction identifier corresponding to the configuration transaction is generated; the second configuration transaction identifier is used to instruct the cross-chain relay to send a second configuration lock acquisition transaction to the target consensus node associated with the target chain; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain a non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock; Receiving a second lock declaration transaction sent by the cross-chain relay; the second lock declaration transaction is determined by the cross-chain relay when detecting that the target chain is in the second business lock state; When it is determined based on the second lock declaration transaction that the state of the configuration transaction corresponding to the second configuration transaction identifier is the second transaction lock state, second transaction lock information corresponding to the second lock declaration transaction is generated, and the second transaction lock information is written into the first chain.
6. The method according to claim 5, wherein The calling of the platform configuration contract on the first chain to execute the configuration transaction and generating a second configuration transaction identifier corresponding to the configuration transaction includes: Writing the configuration transaction with the second cross-chain configuration item into the platform configuration contract, calling the non-blocking transaction configuration method in the platform configuration contract on the first chain, executing the configuration transaction, and obtaining the chain identifier of the target chain and the second cross-chain configuration item indicated in the configuration transaction; Based on the chain identifier of the target chain and the second cross-chain configuration item, a second configuration transaction identifier corresponding to the configuration transaction is generated.
7. A cross-chain configuration method based on multiple blockchains, characterized in that: The multi-blockchain includes a first chain and a target chain; The method is executed by a cross-chain relay; The cross-chain relay is used to isolate the first chain network corresponding to the first chain and the target chain network corresponding to the target chain; the method includes: When a first configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a first configuration lock acquisition transaction is sent to the target consensus node in the target chain network; the first configuration transaction identifier is generated by the first consensus node in the first chain network calling the chain management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type, and the configuration transaction is sent by the management object requesting the execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the first business lock state through the blocking chain configuration lock; When detecting that the target chain is in the first business lock state, sending a first lock declaration transaction to the first consensus node; the first lock declaration transaction is used to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain when determining, based on the first lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state; Upon detecting a configuration modification transaction on the first chain, obtaining a first cross-chain configuration item in the configuration modification transaction; the configuration modification transaction is sent by the management object based on the first transaction locking information on the first chain; The first cross-chain configuration item is cross-chain configured to the target chain, so that the target consensus node unlocks the target chain in the first business locked state through the blocking chain configuration lock.
8. The method according to claim 7, wherein The cross-chain configuration of the first cross-chain configuration item to the target chain includes: A first lock release transaction is constructed based on the first cross-chain configuration item; the first lock release transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract to release the blocking chain configuration lock when writing the first cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the first business locked state to the business unlocked state; Send the first lock release transaction to the target consensus node.
9. The method according to claim 7, wherein: The method further comprises: The chain lock duration of the target chain detected to be in the first business lock state is accumulated. When the accumulated chain lock duration reaches the accumulated lock duration threshold of the blocking chain configuration lock, a timeout release lock transaction is sent to the target consensus node. The timeout release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock, and change the business state of the target chain from the first business lock state to the business unlock state.
10. The method according to claim 7, wherein: The method further comprises: When it is detected that the target chain is not in the first business locking state, a first lock failure transaction is sent to the first consensus node, and a first lock failure release lock transaction is sent to the target consensus node, where the first lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the blocking chain configuration lock.
11. The method according to claim 7, wherein The configuration transaction includes a second cross-chain configuration item associated with the configuration transaction; and the method further includes: When a second configuration transaction identifier corresponding to the configuration transaction on the first chain is detected, a second configuration lock acquisition transaction is sent to the target consensus node in the target chain network. The second configuration transaction identifier is generated by the first consensus node in the first chain network calling the management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a non-blocking transaction type. The configuration transaction is sent by the management object requesting the execution of the configuration transaction; the second configuration lock acquisition transaction is used to instruct the target consensus node to obtain the non-blocking chain configuration lock corresponding to the non-blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to the second business lock state through the non-blocking chain configuration lock; When detecting that the target chain is in the second business lock state, sending a second lock declaration transaction to the first consensus node; the second lock declaration transaction is used to instruct the first consensus node to generate second transaction lock information corresponding to the second lock declaration transaction for writing into the first chain when determining, based on the second lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the second transaction lock state; The second cross-chain configuration item is cross-chain configured to the target chain, so that the target consensus node unlocks the target chain in the second business lock state through the non-blocking chain configuration lock.
12. The method according to claim 11, wherein The cross-chain configuration of the second cross-chain configuration item to the target chain includes: A second lock-release transaction is constructed based on the second cross-chain configuration item, and the second lock-release transaction is sent to the target consensus node; the second lock-release transaction is used to instruct the target consensus node in the target chain to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock when writing the second cross-chain configuration item to the chain configuration contract, and change the business state of the target chain from the second business locked state to the business unlocked state.
13. The method according to claim 11, wherein The second configuration lock acquisition transaction is further used to instruct the target consensus node to obtain a block buffer height from the chain configuration contract on the target chain. The block buffer height is used to represent the maximum interval height of blocks obtained on the target chain before the business state of the target chain is configured to the second business lock state through the non-blocking chain configuration lock.
14. The method according to claim 11, wherein The method further comprises: When it is detected that the target chain is not in the second business lock state, a second lock failure transaction is sent to the first consensus node, and a second lock failure release lock transaction is sent to the target consensus node, where the second lock failure release lock transaction is used to instruct the target consensus node to call the lock release method in the chain configuration contract on the target chain to release the non-blocking chain configuration lock.
15. A cross-chain configuration device based on multiple blockchains, characterized in that: The device runs on a first consensus node, and the multi-blockchain includes a first chain associated with the first consensus node and a target chain to be cross-chain configured; The first chain network corresponding to the first chain and the target chain network corresponding to the target chain are isolated through a cross-chain relay, and the device includes: A determination module, configured to determine the transaction type of the configuration transaction upon receiving a configuration transaction for cross-chain configuration of the target chain sent by the management object based on the configuration transaction; A calling module is configured to, when the transaction type of the configuration transaction is a blocking transaction type, call the chain management configuration contract on the first chain to execute the configuration transaction and generate a first configuration transaction identifier corresponding to the configuration transaction; the first configuration transaction identifier is used to instruct the cross-chain relay to send a first configuration lock acquisition transaction to the target consensus node associated with the target chain; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to a first business lock state through the blocking chain configuration lock; A receiving module receives a first lock declaration transaction sent by the cross-chain relay; the first lock declaration transaction is determined by the cross-chain relay when detecting that the target chain is in the first business lock state; a generating module configured to, upon determining, based on the first lock declaration transaction, that the state of the configuration transaction corresponding to the first configuration transaction identifier is a first transaction locked state, generate first transaction locking information corresponding to the first lock declaration transaction, and write the first transaction locking information into the first chain; A first acquisition module is configured to, upon acquiring a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, acquire a first cross-chain configuration item in the configuration modification transaction; The first configuration module is configured to cross-chain configure the first cross-chain configuration item to the target chain through the cross-chain relay, so that the target consensus node unlocks the target chain in the first business locked state through the blocking chain configuration lock.
16. A cross-chain configuration device based on multiple blockchains, characterized in that: The multi-blockchain includes a first chain and a target chain. The device runs on a cross-chain relay. The cross-chain relay is used to isolate a first chain network corresponding to the first chain and a target chain network corresponding to the target chain. The device includes: A sending module, configured to send a first configuration lock acquisition transaction to a target consensus node in the target chain network upon detecting a first configuration transaction identifier corresponding to the configuration transaction on the first chain; the first configuration transaction identifier is generated by the first consensus node in the first chain network calling the chain management configuration contract on the first chain to execute the configuration transaction when the transaction type of the configuration transaction in the configuration transaction is a blocking transaction type, and the configuration transaction is sent by the management object requesting execution of the configuration transaction; the first configuration lock acquisition transaction is used to instruct the target consensus node to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to a first business lock state through the blocking chain configuration lock; The sending module is further configured to, upon detecting that the target chain is in the first business lock state, send a first lock declaration transaction to the first consensus node; the first lock declaration transaction is configured to instruct the first consensus node to generate first transaction lock information corresponding to the first lock declaration transaction for writing into the first chain upon determining, based on the first lock declaration transaction, that the state of the configuration transaction corresponding to the configuration transaction identifier is the first transaction lock state; A second acquisition module is configured to, upon detecting a configuration modification transaction on the first chain, acquire a first cross-chain configuration item in the configuration modification transaction; the configuration modification transaction is sent by the management object based on the first transaction locking information on the first chain; The second configuration module is configured to cross-chain configure the first cross-chain configuration item to the target chain, so that the target consensus node unlocks the target chain in the first business locking state through the blocking chain configuration lock.
17. A cross-chain configuration system based on multiple blockchains, characterized in that: The system includes: The first consensus node in the first chain network, the target consensus node in the target chain network, and the cross-chain relay; the first chain network and the target chain network are isolated by the cross-chain relay; The first consensus node is configured to, upon receiving a configuration transaction for cross-chain configuration of the target chain sent by the management object based on the configuration transaction, determine the transaction type of the configuration transaction, and, if the transaction type of the configuration transaction is a blocking transaction type, call the chain management configuration contract on the first chain to execute the configuration transaction and generate a first configuration transaction identifier corresponding to the configuration transaction; The cross-chain relay is used to send a first configuration lock acquisition transaction to the target consensus node in the target chain network when detecting a first configuration transaction identifier corresponding to the configuration transaction on the first chain; The target consensus node is used to obtain a blocking chain configuration lock corresponding to the blocking transaction type from the chain configuration contract on the target chain, and configure the business state of the target chain to a first business lock state through the blocking chain configuration lock; The cross-chain relay is used to send a first lock declaration transaction to the first consensus node when detecting that the target chain is in the first business lock state; The first consensus node is further configured to, when determining based on the first lock declaration transaction that the state of the configuration transaction corresponding to the configuration transaction identifier is a first transaction locked state, generate first transaction locking information corresponding to the first lock declaration transaction of the first chain, and write the first transaction locking information into the first chain; The first consensus node is further configured to, upon obtaining a configuration modification transaction sent by the management object based on the first transaction lock information on the first chain, obtain a first cross-chain configuration item in the configuration modification transaction; The cross-chain relay is further configured to cross-chain configure the first cross-chain configuration item to the target chain when a configuration modification transaction on the first chain is detected.
18. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 14.
20. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the method according to any one of claims 1 to 14 when executed by a processor.
Citation Information
Patent Citations
Cross-chain data processing method and device, electronic equipment and readable storage medium
CN113377875A
Cross-block chain interaction method based on relay chain
CN114493879A