Data Processing Method, Device and Blockchain System of Blockchain System

By introducing data processing methods of layer two gateways and layer one gateways in the blockchain system, the problems of high development costs and poor compatibility when configuring applications of multiple heterogeneous layer two blockchains are solved, and low-cost and high-applicability data processing is achieved.

CN119483908BActive Publication Date: 2025-06-27CHINA ACADEMY OF INFORMATION & COMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510038716.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-06-27
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

In a layer two blockchain network, when facing multiple heterogeneous layer two blockchains, multiple applications need to be configured, resulting in high development costs and poor compatibility.

Method used

By introducing a Layer 2 gateway and a Layer 1 gateway, the target transaction is generated and sent to the Layer 1 gateway in response to the target block submitted by the Layer 2 blockchain. Then, the target block is cached, the target transaction is sent to the consensus node of the first layer blockchain, and the consensus is carried out and the status data is updated, and the layer two blockchain is finally notified through the gateway.

Benefits of technology

The cost of layer two-layer blockchain program development is reduced, the applicability is improved, and the compatibility problems caused by heterogeneous layer two-layer blockchain are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483908B_ABST
    Figure CN119483908B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a data processing method, apparatus, and blockchain system for a blockchain system. Among them, the method includes: in response to the second-layer gateway receiving a target block submitted by the second-layer blockchain, the second-layer gateway generates a target transaction based on the target block and sends the target block and the target transaction to the first-layer gateway; in response to the first-layer gateway receiving the target block and the target transaction, caching the target block and sending the target transaction to the consensus nodes of the first-layer blockchain; performing consensus on the target transaction based on the consensus nodes and updating the status data based on the target transaction through the management contract of the first-layer blockchain; in response to the completion of the status data update, notifying the second-layer blockchain through the first-layer gateway and the second-layer gateway. Embodiments of the present disclosure do not require modification of the program of the second-layer blockchain, and the program development cost is low. In addition, for heterogeneous second-layer blockchains, only the corresponding gateway program needs to be adapted, and the applicability is strong.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to blockchain technology, and in particular to a data processing method, apparatus, and blockchain system for a blockchain system. Background Art

[0002] The rollup technology is a layer-2 expansion technology aimed at improving the throughput and transaction efficiency of the blockchain system while reducing transaction costs.

[0003] In a layer-2 blockchain network, the layer-2 blockchain submits blocks and state data to a smart contract through an interface provided by the smart contract located in the layer-1 blockchain, and the smart contract confirms the blocks and states submitted by the layer-2 blockchain. However, when the layer-1 blockchain faces multiple heterogeneous layer-2 blockchains, multiple application programs need to be configured for the multiple heterogeneous layer-2 blockchains, resulting in high development costs and poor compatibility of the application programs. Summary of the Invention

[0004] Embodiments of the present disclosure provide a data processing method, apparatus, and blockchain system for a blockchain system to solve the above problems.

[0005] In a first aspect of embodiments of the present disclosure, a data processing method for a blockchain system is provided, including:

[0006] In response to the layer-2 gateway receiving a target block submitted by the layer-2 blockchain, the layer-2 gateway generates a target transaction based on the target block and sends the target block and the target transaction to the layer-1 gateway, where the layer-2 gateway is the gateway of the layer-2 blockchain and the layer-1 gateway is the gateway of the layer-1 blockchain;

[0007] In response to the layer-1 gateway receiving the target block and the target transaction, caching the target block and sending the target transaction to the consensus nodes of the layer-1 blockchain;

[0008] Performing consensus on the target transaction based on the consensus nodes and updating state data based on the target transaction through the management contract of the layer-1 blockchain;

[0009] In response to the completion of the state data update, notifying the layer-2 blockchain through the layer-1 gateway and the layer-2 gateway.

[0010] In some embodiments of the present disclosure, the target block includes multiple blocks, and the target transaction includes at least one transaction;

[0011] The layer-2 gateway generating a target transaction based on the target block includes:

[0012] The layer-2 gateway generates the at least one transaction based on the block information of the multiple blocks.

[0013] In some embodiments of the present disclosure, generating the at least one transaction based on the block information of the plurality of blocks includes:

[0014] Adding the block information of the plurality of blocks to the at least one transaction based on the numerical relationship between the average block generation interval of the first-layer blockchain and the average block generation interval of the second-layer blockchain.

[0015] In some embodiments of the present disclosure, there are a plurality of second-layer blockchains, and at least two of the plurality of second-layer blockchains are heterogeneous. There are a plurality of second-layer gateways, and the plurality of second-layer blockchains and the plurality of second-layer gateways correspond one-to-one.

[0016] In some embodiments of the present disclosure, it further includes:

[0017] In response to the verification node of the second-layer blockchain receiving the target status data sent by the management contract, obtaining the transaction data corresponding to the target status data from the first-layer gateway;

[0018] The verification node verifies the target status data based on the transaction data corresponding to the target status data to obtain a status verification result;

[0019] In response to the status verification result indicating that the verification of the target status data fails, the verification node sends a verification failure report to the management contract, where the verification failure report includes the status verification result.

[0020] In a second aspect of the embodiments of the present disclosure, there is provided a data processing device for a blockchain system, including:

[0021] A second-layer gateway processing module, configured to, in response to the second-layer gateway receiving a target block submitted by the second-layer blockchain, generate a target transaction based on the target block and send the target block and the target transaction to the first-layer gateway, where the second-layer gateway is the gateway of the second-layer blockchain, and the first-layer gateway is the gateway of the first-layer blockchain;

[0022] A first-layer gateway processing module, configured to, in response to the first-layer gateway receiving the target block and the target transaction, cache the target block and send the target transaction to the consensus node of the first-layer blockchain;

[0023] A transaction processing module, configured to perform consensus on the target transaction based on the consensus node and update status data based on the target transaction through the management contract of the first-layer blockchain;

[0024] A notification module, configured to, in response to the completion of the update of the status data, notify the second-layer blockchain through the first-layer gateway and the second-layer gateway.

[0025] In some embodiments of the present disclosure, the target block includes a plurality of blocks, and the target transaction includes at least one transaction;

[0026] A second-layer gateway processing module, configured to generate the at least one transaction by the second-layer gateway based on the block information of the plurality of blocks.

[0027] In some embodiments of the present disclosure, the second-layer gateway processing module is configured to add the block information of the plurality of blocks to the at least one transaction based on the numerical relationship between the average block generation interval of the first-layer blockchain and the average block generation interval of the second-layer blockchain.

[0028] In some embodiments of the present disclosure, there are a plurality of second-layer blockchains, and at least two of the plurality of second-layer blockchains are heterogeneous. There are a plurality of second-layer gateways, and the plurality of second-layer blockchains and the plurality of second-layer gateways are in one-to-one correspondence.

[0029] In some embodiments of the present disclosure, the apparatus further includes:

[0030] A verification module, configured to, in response to the verification node of the second-layer blockchain receiving the target status data sent by the management contract, obtain the transaction data corresponding to the target status data from the first-layer gateway;

[0031] Wherein, the verification module is further configured to verify the target status data by the verification node based on the transaction data corresponding to the target status data to obtain a status verification result;

[0032] The verification module is further configured to, in response to the status verification result indicating that the verification of the target status data fails, the verification node sends a verification failure report to the management contract, where the verification failure report includes the status verification result.

[0033] A third aspect of the embodiments of the present disclosure provides a blockchain system, including:

[0034] A second-layer blockchain, configured to execute blockchain transactions and generate corresponding block data;

[0035] A first-layer blockchain, wherein the first-layer blockchain is connected to the second-layer blockchain through a cross-chain bridge;

[0036] The apparatus in the second aspect above is configured to execute the method in the first aspect above.

[0037] The data processing method, apparatus, and blockchain system according to the embodiments of the present disclosure use a gateway to monitor the transaction data and execution results of a layer-2 blockchain, and send the transaction data and execution results of the layer-2 blockchain to a layer-1 blockchain through the gateway. Since there is no need to modify the program of the layer-2 blockchain, the program development cost is low. In addition, for heterogeneous layer-2 blockchains, only the corresponding gateway program needs to be adapted, so the applicability is strong.

[0038] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings forming a part of the specification depict the embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure.

[0040] Referring to the accompanying drawings, the present disclosure can be more clearly understood according to the following detailed description, where:

[0041] Figure 1 is a schematic flowchart of the data processing method of the blockchain system in some embodiments of the present disclosure;

[0042] Figure 2 is a partial schematic flowchart of the data processing method of the blockchain system in some embodiments of the present disclosure;

[0043] Figure 3 is a working principle diagram of the data processing method of the blockchain system in an example of the present disclosure;

[0044] Figure 4 is a structural block diagram of the data processing apparatus of the blockchain system in an embodiment of the present disclosure;

[0045] Figure 5 is a structural block diagram of the data processing apparatus of the blockchain system in another embodiment of the present disclosure;

[0046] Figure 6 is a structural block diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0047] Now, various exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. It should be noted that: Unless otherwise specifically stated, the relative arrangements, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0048] Those skilled in the art can understand that the terms "first", "second", etc. in the embodiments of the present disclosure are only used to distinguish different steps, devices, or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.

[0049] It should also be understood that in the embodiments of the present disclosure, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.

[0050] It should also be understood that for any component, data or structure mentioned in the embodiments of the present disclosure, in the absence of a clear definition or contrary disclosure in the context, it is generally understood to be one or more.

[0051] In addition, the term "and / or" in the present disclosure is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the associated objects before and after.

[0052] It should also be understood that the description of each embodiment in the present disclosure emphasizes the differences between the embodiments, and the same or similar parts can be referred to each other. For the sake of brevity, they will not be elaborated one by one.

[0053] The following description of at least one exemplary embodiment is merely illustrative and in no way restrictive of the present disclosure and its application or use.

[0054] Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and devices should be regarded as part of the specification.

[0055] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0056] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0057] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logics, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0058] Figure 1 It is a schematic flowchart of the data processing method of the blockchain system in some embodiments of the present disclosure. As Figure 1 shown, the data processing method of the blockchain system includes the following steps:

[0059] S1: In response to the second-layer gateway receiving the target block submitted by the second-layer blockchain, the second-layer gateway generates a target transaction based on the target block and sends the target block and the target transaction to the first-layer gateway.

[0060] Among them, the second-layer gateway is the gateway of the second-layer blockchain, the first-layer gateway is the gateway of the first-layer blockchain, and the blocks in the second-layer blockchain can be submitted to the first-layer blockchain through the second-layer gateway and the first-layer gateway.

[0061] After the second-layer blockchain generates a target block (such as a new block), it submits the target block to the second-layer gateway. After receiving the target block, the second-layer gateway generates a target transaction corresponding to the target block according to the block data of the target block. Among them, the target transaction includes the block header of the target block. The block header contains the header information of the block, which is mainly used to connect the blocks before the target block in the second-layer blockchain and verify all the transaction data in the target block.

[0062] In some examples of the present disclosure, the main contents of the block header include:

[0063] Parent block hash value (PreHash): Used to connect the previous blocks to ensure the continuity of the blockchain;

[0064] Hash value of the current block body (Hash): Used to verify the data integrity of the current block;

[0065] Time stamp (TimeStamp): Records the time when the block is created;

[0066] Merkle root: Used to summarize and quickly verify all the transaction data in the block;

[0067] Version number: Used to record the version information of the second-layer blockchain.

[0068] S2: In response to the first-layer gateway receiving the target block and the target transaction, cache the target block and send the target transaction to the consensus nodes of the first-layer blockchain.

[0069] After the first-layer gateway receives the target block and the target transaction sent by the second-layer gateway, it can cache the target block in the local cache of the first-layer gateway and send the target transaction to the target nodes of the first-layer blockchain, such as a certain consensus node in the first-layer blockchain.

[0070] S3: Based on the consensus nodes to conduct consensus on the target transaction, and update the status data based on the target transaction through the management contract of the first-layer blockchain.

[0071] Adopt a preset consensus method to conduct consensus on the target transaction through all the consensus nodes in the first-layer blockchain. Among them, the preset consensus method can include: Proof-of-Work (PoW) method and Proof-of-Stake (PoS) method, etc.

[0072] After all the consensus nodes in the first-layer blockchain conduct consensus on the target transaction, call the management contract in the first-layer blockchain to update the status data for the target transaction. Among them, the set of accounts, transactions, account balances, and data in the contract in the blockchain is called the state. Generate a Merkle Patricia Trie (MPT) based on the data hash in the contract, and the hash of the root of the tree is the status data.

[0073] S4: In response to the completion of the status data update, notify the second-layer blockchain through the first-layer gateway and the second-layer gateway.

[0074] After the status data update is completed, the management contract can use the log event to notify the second-layer blockchain through the first-layer gateway and the second-layer gateway.

[0075] In this embodiment, use the gateway to monitor the transaction data and execution results of the second-layer blockchain, and send the transaction data and execution results of the second-layer blockchain to the first-layer blockchain through the gateway. Since there is no need to modify the program of the second-layer blockchain, the program development cost is low. In addition, only the corresponding gateway program needs to be adapted for heterogeneous second-layer blockchains, and the applicability is strong.

[0076] In some embodiments of the present disclosure, the target block includes multiple blocks, and the target transaction includes at least one transaction. Correspondingly, the second-layer gateway generates the target transaction based on the target block, specifically including: the second-layer gateway generates at least one transaction based on the block information of multiple blocks.

[0077] After the second-layer gateway receives N blocks submitted by the second-layer blockchain, it can extract the block data of multiple blocks and generate M transactions based on the block data of multiple blocks. That is, the second-layer gateway can perform a merging process on the transaction data of N blocks to generate M transactions. Among them, N is an integer greater than 1, M is an integer greater than or equal to 1, and N≥M.

[0078] In this embodiment, by performing a merging process on the transaction data of multiple blocks to generate at least one transaction, the occupancy of the storage capacity of the second-layer gateway can be reduced.

[0079] In some embodiments of the present disclosure, the second-layer gateway generates at least one transaction based on the block information of multiple blocks. Further, it may include: adding the block information of multiple blocks to at least one transaction based on the numerical relationship between the average block generation interval of the first-layer blockchain and the average block generation interval of the second-layer blockchain.

[0080] The average block generation intervals of the first-layer blockchain and the second-layer blockchain are different. Generally, the average block generation interval of the second-layer blockchain is much smaller than that of the first-layer blockchain.

[0081] Set the average block generation interval of the first-layer blockchain as T1 and the average block generation interval of the second-layer blockchain as T2. After the second-layer gateway receives N blocks submitted by the second-layer blockchain, it extracts the block data of multiple blocks, performs a merging process on the transaction data of N blocks, and generates M transactions. Among them, , represents rounding up. N is an integer greater than 1, M is an integer greater than or equal to 1, and N≥M.

[0082] In this embodiment, since the average block generation intervals of the first-layer blockchain and the second-layer blockchain are different, adding the block information of multiple blocks to at least one transaction according to the numerical relationship between the average block generation interval of the first-layer blockchain and the average block generation interval of the second-layer blockchain can enable the first-layer blockchain to process one transaction submitted by the second-layer gateway within the corresponding time for processing one block, which helps to improve the processing efficiency of the first-layer blockchain for the transactions submitted by the second-layer gateway.

[0083] In some embodiments of the present disclosure, there are multiple second-layer blockchains, and at least two of the multiple second-layer blockchains are heterogeneous. There are multiple second-layer gateways, and the multiple second-layer blockchains and the multiple second-layer gateways correspond one by one.

[0084] The first-layer blockchain can correspond to multiple heterogeneous second-layer blockchains. A second-layer gateway is set in each second-layer blockchain, and by communicating with the first-layer gateway through the second-layer gateway of each blockchain, block monitoring and management of multiple heterogeneous second-layer blockchains can be achieved.

[0085] In this embodiment, by respectively setting up second-layer gateways in multiple heterogeneous second-layer blockchains, the block listening and management of multiple heterogeneous second-layer blockchains can be realized through the first-layer gateway and the second-layer gateways of multiple heterogeneous second-layer blockchains.

[0086] Figure 2 It is a partial flowchart of the data processing method of the blockchain system in some embodiments of the present disclosure. As Figure 2 shown, the data processing method of the blockchain system may include the following steps:

[0087] S5: In response to the verification node of the second-layer blockchain receiving the target status data sent by the management contract, obtain the transaction data corresponding to the target status data from the first-layer gateway.

[0088] During the process of the consensus node of the first-layer blockchain conducting consensus on the transactions submitted by the second-layer gateway, if it is found that a certain transaction has an error, that is, the block data corresponding to the transaction does not match the status, the status data with an error, that is, the target status data, can be sent to the verification node in the second-layer blockchain through the management contract.

[0089] The verification node obtains the transaction data corresponding to the target status data from the cache of the first-layer gateway.

[0090] S6: The verification node verifies the target status data based on the transaction data corresponding to the target status data to obtain a status verification result.

[0091] The verification node performs a hash calculation according to the transaction data corresponding to the target status data, and compares the hash obtained from the hash calculation with the hash of the target status data to implement the verification of the target status data, and obtains a status verification result. If the hash obtained from the hash calculation is consistent with the hash of the target status data, the verification is successful; if the hash obtained from the hash calculation is inconsistent with the hash of the target status data, the verification fails.

[0092] S7: In response to the status verification result indicating that the verification of the target status data fails, the verification node sends a verification failure report to the management contract.

[0093] When the verification of the target status data fails, the verification node sends a verification failure report to the management contract. Among them, the verification failure report includes the status verification result, and may include the target status data, the transaction data corresponding to the target status data, and the hash calculated by performing a hash calculation on the transaction data corresponding to the target status data.

[0094] In this embodiment, after the verification node of the second-layer blockchain receives the target status hash data sent by the management contract, it can verify the target status data by using the transaction data corresponding to the target status data, and feedback a verification failure report when the verification fails, so that the management contract can know whether there is an error in the target status data.

[0095] Figure 3 This is the working schematic diagram of the data processing method of the blockchain system in an example of the present disclosure. As Figure 3 shown, the data processing method of the blockchain system includes the following steps:

[0096] 1. The execution node submits a block to the L2 gateway (i.e., the second-layer gateway of the second-layer blockchain). Among them, the execution node is the node responsible for generating blocks in the second-layer blockchain. The subscription client in the L2 gateway is used to monitor the block situation and block generation situation of the execution node, and obtain the block data in the block. The K / V DB in the L2 gateway is a non-relational database.

[0097] 2. The L2 gateway signs a new transaction according to the block data. Among them, the transaction contains the block header, and submits the transaction and the block to the L1 gateway (i.e., the first-layer gateway of the first-layer blockchain), and the transaction uses a sequential number. The subscription client in the L1 gateway is used to monitor the execution situation of the management contract and obtain the execution result.

[0098] 3. Cache the block submitted by the L2 gateway through the block cache in the L1 gateway, and send the transaction to the first-layer blockchain.

[0099] 4. The consensus nodes of the first-layer blockchain perform consensus on the transaction, and call the management contract to trigger the update of the state data of the corresponding L2 instance in the L2 network. Among them, the management contract is used to assign a unique identifier and address to each second-layer blockchain, and maintain the information of each second-layer blockchain. When the second-layer blockchain is connected to the first-layer blockchain, the management contract will generate an object according to the access content, and the object records the information of the second-layer blockchain, which is the L2 instance. The operation personnel of the second-layer blockchain can register, update, deactivate and restart the management contract using the super account. The management contract can generate an L2 instance for each corresponding second-layer blockchain. Among them, each L2 instance includes gateway data, specifically including: data of the L1 gateway and L1 nodes, blockchain identifier (chain id), state data, and data of the L2 gateway and proposer.

[0100] 5. After the L2 instance is updated successfully, notify the nodes of the second-layer blockchain of the log event through the first-layer gateway and the second-layer gateway.

[0101] In addition, the state and the block are in one-to-one correspondence, and the state is the root of the MPT tree. The verification node requests the state data, and then the contract responds to provide the state data. When the verification node raises a question, the arbitration of the transaction execution result is carried out through the fraud proof logic.

[0102] Figure 4 This is the structural block diagram of the data processing device of the blockchain system in an embodiment of the present disclosure. AsFigure 4 As shown, the data processing device of the blockchain system includes:

[0103] The two-layer gateway processing module 100 is configured to, in response to the two-layer gateway receiving a target block submitted by the two-layer blockchain, generate a target transaction based on the target block by the two-layer gateway, and send the target block and the target transaction to the one-layer gateway, where the two-layer gateway is the gateway of the two-layer blockchain, and the one-layer gateway is the gateway of the one-layer blockchain;

[0104] The one-layer gateway processing module 200 is configured to, in response to the one-layer gateway receiving the target block and the target transaction, cache the target block, and send the target transaction to the consensus nodes of the one-layer blockchain;

[0105] The transaction processing module 300 is configured to perform consensus on the target transaction based on the consensus nodes, and update the status data based on the target transaction through the management contract of the one-layer blockchain;

[0106] The notification module 400 is configured to, in response to the completion of the status data update, notify the two-layer blockchain through the one-layer gateway and the two-layer gateway.

[0107] In some embodiments of the present disclosure, the target block includes multiple blocks, and the target transaction includes at least one transaction;

[0108] The two-layer gateway processing module 100 is configured to generate at least one transaction based on the block information of the multiple blocks by the two-layer gateway.

[0109] In some embodiments of the present disclosure, the two-layer gateway processing module 100 is configured to add the block information of the multiple blocks to at least one transaction based on the numerical relationship between the average block generation interval of the one-layer blockchain and the average block generation interval of the two-layer blockchain.

[0110] In some embodiments of the present disclosure, there are multiple two-layer blockchains, and at least two of the multiple two-layer blockchains are heterogeneous. There are multiple two-layer gateways, and the multiple two-layer blockchains and the multiple two-layer gateways are in one-to-one correspondence.

[0111] Figure 5 This is the structural block diagram of the data processing device of the blockchain system in another embodiment of the present disclosure. As Figure 5 shown, the data processing device of the blockchain system further includes:

[0112] The verification module 500 is configured to, in response to the verification node of the two-layer blockchain receiving the target status data sent by the management contract, obtain the transaction data corresponding to the target status data from the one-layer gateway;

[0113] Among them, the verification module 500 is further configured to verify the target status data based on the transaction data corresponding to the target status data by the verification node to obtain a status verification result;

[0114] The verification module 500 is further configured to, in response to the status verification result indicating that the verification of the target status data fails, the verification node sends a verification failure report to the management contract, where the verification failure report includes the status verification result.

[0115] It should be noted that the specific implementation manner of the data processing device of the blockchain system in the embodiments of the present disclosure is similar to the specific implementation manner of the data processing method of the blockchain system in the embodiments of the present disclosure, and the technical effects of the data processing device of the blockchain system in the embodiments of the present disclosure are similar to the technical effects of the data processing method of the blockchain system in the embodiments of the present disclosure. For details, please refer to the description in the part of the data processing method of the blockchain system. To reduce redundancy, it will not be elaborated here.

[0116] In a third aspect of the embodiments of the present disclosure, a blockchain system is provided, including:

[0117] A two-layer blockchain for executing blockchain transactions and generating corresponding block data;

[0118] A one-layer blockchain, where the one-layer blockchain is connected to the two-layer blockchain through a cross-chain bridge;

[0119] The data processing device of the above blockchain system is used to execute the data processing method of the above blockchain system.

[0120] In addition, the embodiments of the present disclosure further provide an electronic device, including:

[0121] A memory for storing a computer program;

[0122] A processor for executing the computer program stored in the memory, and when the computer program is executed, it implements the data processing method of the blockchain system described in any one of the above embodiments of the present disclosure.

[0123] Next, refer to Figure 6 to describe the electronic device according to the embodiments of the present disclosure. As Figure 6 shown, the electronic device includes one or more processors and a memory.

[0124] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to execute the desired functions.

[0125] The memory can store one or more computer program products. The memory can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory can include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory can include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products can be stored on the computer-readable storage media, and the processor can run the computer program products to implement the data processing methods of the blockchain system in various embodiments of the present disclosure described above and / or other desired functions.

[0126] In one example, the electronic device can further include: an input device and an output device, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0127] In addition, the input device can further include, for example, a keyboard, a mouse, and so on.

[0128] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0129] Of course, for simplicity, Figure 6 only some of the components related to the present disclosure in the electronic device are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device can further include any other appropriate components.

[0130] In addition to the above methods and devices, an embodiment of the present disclosure can also be a computer program product, which includes computer program instructions. When the computer program instructions are run by a processor, the processor is caused to execute the steps in the data processing method of the blockchain system according to various embodiments of the present disclosure described in the above part of this specification.

[0131] The computer program product can be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as the "C" language or similar programming languages. The program code can be executed completely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or executed completely on a remote computing device or server.

[0132] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the steps in the data processing method of the blockchain system according to various embodiments of the present disclosure described in the foregoing part of this specification.

[0133] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0134] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-described specific details are only for illustrative and easy-to-understand purposes and are not limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0135] Each embodiment in this specification is described in a progressive manner, and the key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other. For system embodiments, since they basically correspond to method embodiments, they are described relatively simply, and reference may be made to the corresponding part of the method embodiments for relevant content.

[0136] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended words, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used herein refer to the word "and / or" and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to" and can be used interchangeably with each other.

[0137] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of the steps for the methods is for illustration only. The steps of the methods of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.

[0138] It should also be noted that in the apparatuses, devices, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.

[0139] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0140] The above description has been given for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A data processing method for a blockchain system, characterized in that: include: In response to the second-layer gateway receiving a target block submitted by the second-layer blockchain, the second-layer gateway generates a target transaction based on the target block, and sends the target block and the target transaction to the first-layer gateway, wherein the second-layer gateway is a gateway of the second-layer blockchain, the first-layer gateway is a gateway of the first-layer blockchain, the target block includes multiple blocks, and the target transaction includes at least one transaction; In response to the first-layer gateway receiving the target block and the target transaction, cache the target block, and send the target transaction to the consensus node of the first-layer blockchain; A consensus is reached on the target transaction based on the consensus node, and status data is updated based on the target transaction through the management contract of the first-layer blockchain; In response to completion of the state data update, notifying the second-layer blockchain through the first-layer gateway and the second-layer gateway; The layer 2 gateway generates a target transaction based on the target block, including: adding block information of the plurality of blocks to the at least one transaction based on a numerical relationship between an average block generation interval of the layer 1 blockchain and an average block generation interval of the layer 2 blockchain; In response to the verification node of the second-layer blockchain receiving the target state data sent by the management contract, the transaction data corresponding to the target state data is obtained from the first-layer gateway; the verification node verifies the target state data based on the transaction data corresponding to the target state data to obtain a state verification result; in response to the state verification result indicating that the verification of the target state data fails, the verification node sends a verification failure report to the management contract, wherein the verification failure report includes the state verification result.

2. The method according to claim 1, characterized in that There are multiple second-layer blockchains, and at least two of the multiple second-layer blockchains are heterogeneous. There are multiple second-layer gateways, and the multiple second-layer blockchains and the multiple second-layer gateways correspond one to one.

3. A data processing device for a blockchain system, characterized in that: include: A layer 2 gateway processing module, configured to, in response to the layer 2 gateway receiving a target block submitted by the layer 2 blockchain, generate a target transaction based on the target block, and send the target block and the target transaction to the layer 1 gateway, wherein the layer 2 gateway is a gateway of the layer 2 blockchain, the layer 1 gateway is a gateway of the layer 1 blockchain, the target block includes multiple blocks, and the target transaction includes at least one transaction; a first-layer gateway processing module, configured to cache the target block in response to the first-layer gateway receiving the target block and the target transaction, and send the target transaction to a consensus node of the first-layer blockchain; A transaction processing module, configured to reach a consensus on the target transaction based on the consensus node, and update the status data based on the target transaction through the management contract of the first-layer blockchain; A notification module, configured to notify the second-layer blockchain through the first-layer gateway and the second-layer gateway in response to completion of the status data update; The layer 2 gateway processing module is specifically configured to add the block information of the plurality of blocks to the at least one transaction based on a numerical relationship between an average block generation interval of the layer 1 blockchain and an average block generation interval of the layer 2 blockchain; A verification module, configured to obtain transaction data corresponding to the target state data from the first-layer gateway in response to the verification node of the second-layer blockchain receiving the target state data sent by the management contract; Wherein, the verification module is also used for the verification node to verify the target state data based on the transaction data corresponding to the target state data to obtain a state verification result; The verification module is further configured to, in response to the status verification result indicating that the verification of the target status data has failed, the verification node sends a verification failure report to the management contract, wherein the verification failure report includes the status verification result.

4. The device according to claim 3, characterized in that There are multiple second-layer blockchains, and at least two of the multiple second-layer blockchains are heterogeneous. There are multiple second-layer gateways, and the multiple second-layer blockchains and the multiple second-layer gateways correspond one to one.

5. A blockchain system, characterized in that: include: The second-layer blockchain is used to execute blockchain transactions and generate corresponding block data; A layer 1 blockchain, wherein the layer 1 blockchain is connected to the layer 2 blockchain via a cross-chain bridge; The device according to claim 3 or 4 is used to perform the method according to claim 1 or 2.