Data processing method and device of block chain system and block chain system
By introducing gateways into the blockchain system, processing blocks and transactions of multiple heterogeneous layer two-layer blockchains, the problems of high development costs and poor compatibility are solved, and a low-cost and high-applicability data processing method is realized .
Patent Information
- Application Number
- CN202510038716.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2045-01-09
AI Technical Summary
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.
By introducing a gateway into the second-layer blockchain system, the second-layer gateway generates a target transaction after receiving the target block and sends it to the first-layer gateway. The first-layer gateway caches blocks and sends transactions to the consensus node of the first-layer blockchain, updates status data through management contracts, and notifies the second-layer blockchain.
It reduces the cost of developing a layer two-layer blockchain program, improves applicability, and can effectively deal with heterogeneous layer two-layer blockchain without modifying the program of the layer two-layer blockchain.
Smart Images

Figure CN119483908A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to blockchain technology, and in particular to a data processing method and device for a blockchain system, and a blockchain system. Background Art
[0002] Rollup technology is a second-layer expansion technology that aims to improve the throughput and transaction efficiency of blockchain systems while reducing transaction costs.
[0003] In the second-layer blockchain network, the second-layer blockchain submits the block and status data to the smart contract through the interface provided by the smart contract on the first-layer blockchain, and the smart contract confirms the blocks and status submitted by the second-layer blockchain. However, when the first-layer blockchain faces multiple heterogeneous second-layer blockchains, it is necessary to configure multiple applications for multiple heterogeneous second-layer blockchains, which has high development costs and poor compatibility. Summary of the invention
[0004] The embodiments of the present disclosure provide a data processing method, device and blockchain system for a blockchain system to solve the above problems.
[0005] A first aspect of the embodiments of the present disclosure provides a data processing method for a blockchain system, including: 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, wherein 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; 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 status data update, the second-layer blockchain is notified through the first-layer gateway and the second-layer gateway.
[0006] In some embodiments of the present disclosure, the target block includes a plurality of blocks, and the target transaction includes at least one transaction; The layer 2 gateway generates a target transaction based on the target block, including: The layer 2 gateway generates the at least one transaction based on the block information of the multiple blocks.
[0007] In some embodiments of the present disclosure, the generating the at least one transaction based on the block information of the plurality of blocks includes: Based on a numerical relationship between an average block generation interval of the first-layer blockchain and an average block generation interval of the second-layer blockchain, block information of the multiple blocks is added to the at least one transaction.
[0008] In some embodiments of the present disclosure, there are multiple second-layer blockchains, among which at least two second-layer blockchains are heterogeneous, and there are multiple second-layer gateways, and there is a one-to-one correspondence between the multiple second-layer blockchains and the multiple second-layer gateways.
[0009] In some embodiments of the present disclosure, it further includes: In response to the verification node of the second-layer blockchain receiving the target state data sent by the management contract, obtaining transaction data corresponding to the target state data 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 verification of the target state data has failed, the verification node sends a verification failure report to the management contract, wherein the verification failure report includes the state verification result.
[0010] A second aspect of the embodiments of the present disclosure provides a data processing device of a blockchain system, including: 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 a layer 1 gateway, wherein the layer 2 gateway is a gateway of the layer 2 blockchain, and the layer 1 gateway is a gateway of the layer 1 blockchain; 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 is used to notify the second-layer blockchain through the first-layer gateway and the second-layer gateway in response to the completion of the status data update.
[0011] In some embodiments of the present disclosure, the target block includes a plurality of blocks, and the target transaction includes at least one transaction; The layer 2 gateway processing module is used for the layer 2 gateway to generate the at least one transaction based on the block information of the multiple blocks.
[0012] In some embodiments of the present disclosure, the layer 2 gateway processing module is used to add the block information of the multiple blocks to the at least one transaction based on the numerical relationship between the average block interval of the layer 1 blockchain and the average block interval of the layer 2 blockchain.
[0013] In some embodiments of the present disclosure, there are multiple second-layer blockchains, among which at least two second-layer blockchains are heterogeneous, and there are multiple second-layer gateways, and there is a one-to-one correspondence between the multiple second-layer blockchains and the multiple second-layer gateways.
[0014] In some embodiments of the present disclosure, the device further includes: 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.
[0015] A third aspect of the embodiments of the present disclosure provides a blockchain system, including: 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 apparatus of the second aspect is used to execute the method of the first aspect.
[0016] The data processing method, device and blockchain system of the blockchain system of the disclosed embodiment use a 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, for heterogeneous second-layer blockchains, only the corresponding gateway program needs to be adapted, which has strong applicability.
[0017] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which: Figure 1 A flowchart of a data processing method of a blockchain system in some embodiments of the present disclosure; Figure 2 A partial flowchart of a data processing method of a blockchain system in some embodiments of the present disclosure; Figure 3 This is a working principle diagram of a data processing method of a blockchain system in an example of the present disclosure; Figure 4 This is a structural block diagram of a data processing device of a blockchain system in one embodiment of the present disclosure; Figure 5 This is a structural block diagram of a data processing device of a blockchain system in another embodiment of the present disclosure; Figure 6 The structure block diagram of an electronic device in one embodiment of the present disclosure is shown in FIG. DETAILED DESCRIPTION
[0020] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0021] Those skilled in the art can understand that the terms "first" and "second" 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 the necessary logical order between them.
[0022] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0023] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0024] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0025] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0026] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0027] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0028] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0029] 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, etc.
[0030] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are performed 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.
[0031] Figure 1 The following is a flow chart of a data processing method of a blockchain system in some embodiments of the present disclosure. Figure 1 As shown, the data processing method of the blockchain system includes the following steps: 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.
[0032] Among them, 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. 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.
[0033] 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 based on 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 to the block before the target block in the second-layer blockchain and verify all transaction data in the target block. In some examples of this disclosure, the main contents of the block header include: Parent block hash value (PreHash): used to connect to the previous block to ensure the continuity of the blockchain; Hash value of this block: used to verify the data integrity of this block; Timestamp: records the time when the block was created; Merkle tree root: used to summarize and quickly verify all transaction data in the block; Version number: used to record the version information of the second-layer blockchain.
[0034] 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 node of the first-layer blockchain.
[0035] After receiving the target block and target transaction sent by the second-layer gateway, the first-layer gateway can cache the target block in the local cache of the first-layer gateway and send the target transaction to the target node of the first-layer blockchain, such as a consensus node in the first-layer blockchain.
[0036] S3: Reach 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 of blockchain.
[0037] The preset consensus method is adopted to reach consensus on the target transaction through all consensus nodes in the first layer of blockchain. The preset consensus method may include: Proof-of-Work (PoW) method and Proof-of-Stock (PoS) method, etc.
[0038] After all consensus nodes in the first-layer blockchain reach consensus on the target transaction, they call the management contract in the first-layer blockchain to update the state data for the target transaction. The collection of accounts, transactions, account balances, and data in the contract in the blockchain is called the state. A Merkle Patricia Trie (MPT) is generated based on the hash of the data in the contract, and the hash of the root of the tree is the state data.
[0039] S4: In response to the completion of the status data update, the second-layer blockchain is notified through the first-layer gateway and the second-layer gateway.
[0040] After the status data is updated, the management contract can notify the second-layer blockchain of the log event through the first-layer gateway and the second-layer gateway.
[0041] In this embodiment, the gateway is used to monitor the transaction data and execution results of the second-layer blockchain, and the transaction data and execution results of the second-layer blockchain are sent 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, for heterogeneous second-layer blockchains, only the corresponding gateway program needs to be adapted, which has strong applicability.
[0042] In some embodiments of the present disclosure, the target block includes multiple blocks, and the target transaction includes at least one transaction. Accordingly, the layer 2 gateway generates the target transaction based on the target block, specifically including: the layer 2 gateway generates at least one transaction based on the block information of the multiple blocks.
[0043] After receiving N blocks submitted by the second-layer blockchain, the second-layer gateway 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 merge 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.
[0044] In this embodiment, by merging the transaction data of multiple blocks to generate at least one transaction, the storage capacity occupied by the layer 2 gateway can be reduced.
[0045] In some embodiments of the present disclosure, the second-layer gateway generates at least one transaction based on the block information of multiple blocks, which may further include: adding the block information of multiple blocks to the at least one transaction based on the numerical relationship between the average block interval of the first-layer blockchain and the average block interval of the second-layer blockchain.
[0046] The average block interval of the first-layer blockchain and the second-layer blockchain is different. Usually, the average block interval of the second-layer blockchain is much smaller than the average block interval of the first-layer blockchain.
[0047] The average block interval of the first-layer blockchain is set to T1, and the average block interval of the second-layer blockchain is set to T2. After the second-layer gateway receives N blocks submitted by the second-layer blockchain, it extracts the block data of multiple blocks, merges the transaction data of N blocks, and generates M transactions. , Indicates rounding up. N is an integer greater than 1, M is an integer greater than or equal to 1, and N≥M.
[0048] In this embodiment, since the average block generation intervals of the first-layer blockchain and the second-layer blockchain are different, the block information of multiple blocks is correspondingly added 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, so that the first-layer blockchain can process a transaction submitted by the second-layer gateway within the corresponding time of processing one block, which helps to improve the processing efficiency of the first-layer blockchain for transactions submitted by the second-layer gateway. In some embodiments of the present disclosure, there are multiple layer-2 blockchains, among which at least two layer-2 blockchains are heterogeneous, and there are multiple layer-2 gateways, and the multiple layer-2 blockchains correspond one to one to the multiple layer-2 gateways.
[0049] A layer 1 blockchain can correspond to multiple heterogeneous layer 2 blockchains. A layer 2 gateway is set up in each layer 2 blockchain. Through the layer 2 gateway of each blockchain communicating with the layer 1 gateway, block monitoring and management of multiple heterogeneous layer 2 blockchains can be achieved.
[0050] In this embodiment, by respectively setting up a second-layer gateway in multiple heterogeneous second-layer blockchains, block monitoring and management of multiple heterogeneous second-layer blockchains can be achieved through the first-layer gateway and the second-layer gateways of multiple heterogeneous second-layer blockchains.
[0051] Figure 2 This is a partial flow chart of the data processing method of the blockchain system in some embodiments of the present disclosure. Figure 2 As shown, the data processing method of the blockchain system may include the following steps: S5: 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.
[0052] During the consensus process of the first-layer blockchain's consensus nodes on the transactions submitted by the second-layer gateway, if a transaction is found to be erroneous, that is, the block data and status corresponding to the transaction do not correspond, the management contract can be used to send the erroneous status data, that is, the target status data, to the verification node in the second-layer blockchain.
[0053] The verification node obtains the transaction data corresponding to the target state data from the cache of the first-layer gateway.
[0054] S6: 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.
[0055] The verification node performs hash calculation based on the transaction data corresponding to the target state data, compares the hash calculated with the hash of the target state data to verify the target state data, and obtains the state verification result. If the hash calculated is consistent with the hash of the target state data, the verification is successful; if the hash calculated is inconsistent with the hash of the target state data, the verification fails.
[0056] S7: In response to the state verification result indicating that the verification of the target state data has failed, the verification node sends a verification failure report to the management contract.
[0057] When the verification of the target state data fails, the verification node returns a verification failure report to the management contract. The verification failure report includes the state verification result, which may include the target state data, the transaction data corresponding to the target state data, and the hash calculated by hashing the transaction data corresponding to the target state data.
[0058] In this embodiment, after receiving the target state hash data sent by the management contract, the verification node of the second-layer blockchain can use the transaction data corresponding to the target state data to verify the target state 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 state data.
[0059] Figure 3 This is a working principle diagram of a data processing method of a blockchain system in an example of the present disclosure. Figure 3 As shown, the data processing method of the blockchain system includes the following steps: 1. The execution node submits the block to the L2 gateway (i.e., the L2 gateway of the L2 blockchain). The execution node is the node responsible for block generation in the L2 blockchain. The subscription client in the L2 gateway is used to monitor the execution node block status and block generation status, and obtain the block data in the block. The K / V DB in the L2 gateway is a non-relational database.
[0060] 2. The L2 gateway signs a new transaction based on the block data. The transaction includes 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). The transactions are numbered sequentially. The subscription client in the L1 gateway is used to monitor the execution of the management contract and obtain the execution results.
[0061] 3. The blocks submitted by the L2 gateway are cached through the block cache in the L1 gateway, and the transactions are sent to the first layer of the blockchain.
[0062] 4. The consensus node of the first-layer blockchain reaches a consensus on the transaction and calls the management contract to trigger the status data update of the L2 instance corresponding to the L2 network. 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 based on the access content. The object records the information of the second-layer blockchain, which is the L2 instance. The operator of the second-layer blockchain can register, update, deactivate and restart the management contract using a super account. The management contract can generate an L2 instance for each second-layer blockchain. Each L2 instance includes gateway data, including: data of the L1 gateway and L1 node, blockchain identifier (chain id), status data, and data of the L2 gateway and proposer (proposer).
[0063] 5. After the L2 instance is updated successfully, the log event is notified to the nodes of the Layer 2 blockchain through the Layer 1 gateway and the Layer 2 gateway.
[0064] In addition, the state and the block are one-to-one corresponding, and the state is the root of the MPT tree. The verification node requests the state data, and then the contract responds and provides the state data. When the verification node raises questions, the transaction execution results are arbitrated through the fraud proof logic.
[0065] Figure 4 1 is a block diagram of a data processing device of a blockchain system in one embodiment of the present disclosure. Figure 4 As shown, the data processing device of the blockchain system includes: The second-layer gateway processing module 100 is used for generating a target transaction based on the target block in response to the second-layer gateway receiving the target block submitted by the second-layer blockchain, and sending the target block and the target transaction to the first-layer gateway, wherein 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; A first-layer gateway processing module 200 is used 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 the consensus node of the first-layer blockchain; The transaction processing module 300 is used 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 of blockchain; The notification module 400 is used to notify the second-layer blockchain through the first-layer gateway and the second-layer gateway in response to the completion of the status data update.
[0066] In some embodiments of the present disclosure, the target block includes a plurality of blocks, and the target transaction includes at least one transaction; The layer 2 gateway processing module 100 is used for the layer 2 gateway to generate at least one transaction based on the block information of multiple blocks.
[0067] In some embodiments of the present disclosure, the layer 2 gateway processing module 100 is used to add block information of multiple blocks to at least one transaction based on the numerical relationship between the average block interval of the layer 1 blockchain and the average block interval of the layer 2 blockchain.
[0068] In some embodiments of the present disclosure, there are multiple layer-2 blockchains, among which at least two layer-2 blockchains are heterogeneous, and there are multiple layer-2 gateways, and the multiple layer-2 blockchains correspond one to one to the multiple layer-2 gateways.
[0069] Figure 5 FIG. 1 is a structural block diagram of a data processing device of a blockchain system in another embodiment of the present disclosure. Figure 5 As shown, the data processing device of the blockchain system also includes: The verification module 500 is used 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; The verification module 500 is also used for verifying the target state data based on the transaction data corresponding to the target state data by the verification node to obtain a state verification result; The verification module 500 is also used to respond to the state verification result indicating that the verification of the target state data fails, and the verification node sends a verification failure report to the management contract, wherein the verification failure report includes the state verification result.
[0070] It should be noted that the specific implementation of the data processing device of the blockchain system of the embodiment of the present disclosure is similar to the specific implementation of the data processing method of the blockchain system of the embodiment of the present disclosure, and the technical effect of the data processing device of the blockchain system of the embodiment of the present disclosure is similar to the technical effect of the data processing method of the blockchain system of the embodiment of the present disclosure. Please refer to the description of the data processing method of the blockchain system for details. In order to reduce redundancy, it is not repeated here.
[0071] A third aspect of the embodiments of the present disclosure provides a blockchain system, including: 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 data processing device of the above-mentioned blockchain system is used to execute the data processing method of the above-mentioned blockchain system.
[0072] In addition, an embodiment of the present disclosure further provides an electronic device, including: Memory for storing computer programs; The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the data processing method of the blockchain system described in any one of the above embodiments of the present disclosure is implemented.
[0073] Below, reference Figure 6 To describe the electronic device according to the embodiment of the present disclosure. Figure 6 As shown, the electronic device includes one or more processors and memory.
[0074] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0075] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the data processing method of the blockchain system of each embodiment of the present disclosure described above and / or other desired functions.
[0076] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0077] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0078] The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0079] Of course, to simplify, Figure 6 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0080] In addition to the above-mentioned method and device, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to perform 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.
[0081] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0082] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the data processing method of the blockchain system according to various embodiments of the present disclosure described in the above part of this specification.
[0083] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media 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 above.
[0084] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0085] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0086] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, 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 therewith.
[0087] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically 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, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0088] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0089] 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 rather to the widest scope consistent with the principles and novel features disclosed herein.
[0090] The above description has been given for the purpose 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, changes, 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 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, wherein 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; 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 status data update, the second-layer blockchain is notified through the first-layer gateway and the second-layer gateway.
2. The method according to claim 1, characterized in that The target block includes a plurality of blocks, and the target transaction includes at least one transaction; The layer 2 gateway generates a target transaction based on the target block, including: The layer 2 gateway generates the at least one transaction based on the block information of the multiple blocks.
3. The method according to claim 2, characterized in that The generating the at least one transaction based on the block information of the plurality of blocks includes: Based on a numerical relationship between an average block generation interval of the first-layer blockchain and an average block generation interval of the second-layer blockchain, block information of the multiple blocks is added to the at least one transaction.
4. 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.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: In response to the verification node of the second-layer blockchain receiving the target state data sent by the management contract, obtaining transaction data corresponding to the target state data 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 verification of the target state data has failed, the verification node sends a verification failure report to the management contract, wherein the verification failure report includes the state verification result.
6. 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, and the layer 1 gateway is a gateway of the layer 1 blockchain; 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 is used to notify the second-layer blockchain through the first-layer gateway and the second-layer gateway in response to the completion of the status data update.
7. The device according to claim 6, characterized in that The target block includes a plurality of blocks, and the target transaction includes at least one transaction; The layer 2 gateway processing module is used for the layer 2 gateway to generate the at least one transaction based on the block information of the multiple blocks.
8. The device according to claim 7, characterized in that The layer 2 gateway processing module is used to add the block information of the multiple blocks to the at least one transaction based on the numerical relationship between the average block interval of the layer 1 blockchain and the average block interval of the layer 2 blockchain.
9. The device according to claim 6, 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.
10. The device according to any one of claims 6 to 9, characterized in that: Also includes: 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.
11. 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 any one of claims 6 to 10 is used to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and system based on block chain
CN116881949A
Block chain network method and system with expandability
CN117014448A
Consensus method and system of block chain system, storage medium and program product
CN118826994A
Delivery care practicum system and method using virtual reality
KR1020240000863A
Methods and Systems for Object Validated Blockchain Accounts
US20190279172A1