Data processing method and device of blockchain system, medium and electronic equipment
By generating blocks containing cross-chain indicator fields in the blockchain system, cross-chain transactions between multiple blockchains are realized, solving the problem of indistinguishable transaction information in the blockchain system and ensuring the validity and atomicity of cross-chain transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2026-03-31
AI Technical Summary
In blockchain systems, cross-chain transactions between multiple blockchains have not yet been effectively implemented, making it impossible to effectively distinguish transaction information from different business operations.
Cross-chain transaction processing is performed by generating blocks containing cross-chain indication fields between the first and second blockchains, and then generating effective status information based on the processing results for on-chain processing, thus ensuring the atomicity and validity of cross-chain transactions.
It enables cross-chain transactions between multiple blockchains, ensuring the exclusivity of transaction information stored on each chain, and ensures accurate adjustment of the global state of the blockchain when cross-chain processing is successful through state settings.
Smart Images

Figure CN116233139B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer and communication technology, and more specifically, to a data processing method, apparatus, medium, and electronic device for a blockchain system. Background Technology
[0002] In related technologies, blockchain systems typically contain a single blockchain on which all transaction information submitted by business nodes within the system needs to be recorded. Because all transaction information must be written to the same blockchain, this blockchain stores transaction information corresponding to different businesses, making it impossible to effectively distinguish between different businesses on that blockchain. Based on this, related technologies have proposed technical solutions involving multiple blockchains. However, in scenarios with multiple blockchains, how to achieve cross-chain transactions between multiple blockchains is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] The embodiments of this application provide a data processing method, apparatus, medium, and electronic device for a blockchain system, which can at least to some extent effectively realize cross-chain transactions between multiple blockchains.
[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0005] According to one aspect of the embodiments of this application, a data processing method for a blockchain system is provided. The blockchain system includes a first blockchain and a second blockchain. The data processing method is executed by a maintenance node of the first blockchain. The data processing method includes: generating a first block based on first business transaction information to be processed across chains, the first block containing pre-effective status information of the first business transaction information, and the block header of the first block containing a cross-chain indication field for indicating a cross-chain transaction with the second blockchain; performing on-chain processing of the first block on the first blockchain to trigger a cross-chain transaction with the second blockchain; obtaining processing result information for the first business transaction information contained in a second block in the second blockchain, wherein the block header of the second block contains a cross-chain indication field for indicating a cross-chain transaction with the first blockchain; generating second business transaction information based on the processing result information; setting the second business transaction information to an effective state; and performing on-chain processing of the second business transaction information on the first blockchain.
[0006] According to one aspect of the embodiments of this application, a data processing method for a blockchain system is provided. The blockchain system includes a first blockchain and a second blockchain. The data processing method is executed by a maintenance node of the second blockchain. The data processing method includes: obtaining first business transaction information contained in a first block in the first blockchain, wherein the first block contains pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain; processing the first business transaction information to generate processing result information for the first business transaction information; generating a second block based on the processing result information, wherein the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain; and performing on-chain processing of the second block in the second blockchain to trigger the maintenance node of the first blockchain to obtain the processing result information.
[0007] According to one aspect of the embodiments of this application, a data processing apparatus for a blockchain system is provided. The blockchain system includes a first blockchain and a second blockchain. The data processing apparatus is disposed within a maintenance node of the first blockchain. The data processing apparatus includes: a first generation unit configured to generate a first block based on first business transaction information to be processed across chains, the first block containing pre-effective status information of the first business transaction information, and the block header of the first block containing a cross-chain indication field for indicating cross-chain transactions with the second blockchain; a first processing unit configured to perform on-chain processing of the first block on the first blockchain to trigger cross-chain transactions with the second blockchain; a first acquisition unit configured to acquire processing result information for the first business transaction information contained in a second block in the second blockchain, wherein the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain; and a second generation unit configured to generate second business transaction information based on the processing result information, set the second business transaction information to an effective state, and perform on-chain processing of the second business transaction information on the first blockchain.
[0008] In some embodiments of this application, based on the aforementioned scheme, a first relay contract is deployed in the first blockchain. The first relay contract is used to store the block header of the second blockchain obtained by the first relay service. The first acquisition unit is configured to: acquire the processing result information from the first relay contract. The processing result information is acquired from the second block and stored in the first relay contract by the first relay service when it determines that the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain.
[0009] In some embodiments of this application, based on the aforementioned scheme, a second relay contract is deployed in the second blockchain. The second relay contract is used to store the block header of the first blockchain obtained by the second relay service. The first processing unit is configured to perform on-chain processing on the first blockchain to trigger the second relay service to obtain the block header of the first block and the first business transaction information, and store them in the second relay contract. The second relay contract is used for the maintenance node of the second blockchain to generate the processing result information based on the first business transaction information obtained therefrom.
[0010] In some embodiments of this application, based on the foregoing scheme, the first processing unit is further configured to: after processing the first block on the first blockchain, if the processing result information is not obtained after a set time, then the first business transaction information is set to an invalid state.
[0011] In some embodiments of this application, based on the foregoing scheme, the first processing unit is further configured to: after processing the first block on the first blockchain, if the processing result information is obtained only after a set time has elapsed, then the processing result information is ignored.
[0012] In some embodiments of this application, based on the foregoing scheme, the processing result information includes the context of the first business transaction information and result information for the first business transaction information; the second generation unit is configured to: verify the processing result information, and after the processing result information passes the verification, generate the second business transaction information according to the context of the first business transaction information included in the processing result information and the result information.
[0013] In some embodiments of this application, based on the foregoing scheme, the first blockchain is derived from a block height in the second blockchain, and at least one first blockchain is derived from the second blockchain; the first business transaction information includes business transaction information to be reviewed, and the processing result information includes review result information for the business transaction information to be reviewed.
[0014] According to one aspect of the embodiments of this application, a data processing apparatus for a blockchain system is provided. The blockchain system includes a first blockchain and a second blockchain. The data processing apparatus is disposed within a maintenance node of the second blockchain. The data processing apparatus includes: a second acquisition unit configured to acquire first business transaction information contained in a first block in the first blockchain, wherein the first block contains pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain; a second processing unit configured to process the first business transaction information to generate processing result information for the first business transaction information; a third generation unit configured to generate a second block based on the processing result information, wherein the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain; and a third processing unit configured to perform on-chain processing of the second block in the second blockchain to trigger the maintenance node of the first blockchain to acquire the processing result information.
[0015] In some embodiments of this application, based on the aforementioned scheme, a second relay contract is deployed in the second blockchain. The second relay contract is used to store the block header of the first blockchain obtained by the second relay service. The second acquisition unit is configured to: acquire the first business transaction information from the second relay contract. The first business transaction information is acquired from the first block and stored in the second relay contract by the second relay service when it determines that the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain.
[0016] In some embodiments of this application, based on the aforementioned scheme, after the second relay service stores the first business transaction information in the second relay contract, it generates a task to be processed in the second relay contract; the second processing unit is configured to process the first business transaction information according to the task to be processed contained in the second relay contract.
[0017] In some embodiments of this application, based on the foregoing scheme, the second processing unit is configured as follows: if the smart contract deployed in the second blockchain can process the first business transaction information, then the smart contract processes the first business transaction information; if the smart contract deployed in the second blockchain cannot process the first business transaction information, then the first business transaction information is pushed to a designated device for processing.
[0018] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the data processing method of the blockchain system as described in the above embodiments.
[0019] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the data processing method of the blockchain system as described in the above embodiments.
[0020] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method of the blockchain system provided in the various alternative embodiments described above.
[0021] In some embodiments of this application, the technical solutions provided include a first blockchain and a second blockchain. Different blockchains can effectively distinguish different businesses, ensuring the exclusivity of transaction information stored on each chain. Simultaneously, the maintenance node of the first blockchain generates a first block based on the first business transaction information to be processed across chains. This first block contains pre-effective state information of the first business transaction information. The first block is then processed on the first blockchain to trigger a cross-chain transaction with the second blockchain. This allows the processing result information for the first business transaction information contained in the second block of the second blockchain to be obtained. Based on this processing result information, second business transaction information is generated and set to an effective state. This second business transaction information is then processed on the first blockchain, enabling cross-chain transactions through data transfer between the first and second blockchains, ensuring the effectiveness of multi-chain interaction. Furthermore, by setting the state of the business transaction information, the global state of the blockchain is only adjusted upon successful cross-chain processing, ensuring the atomicity of cross-chain interaction.
[0022] The first block contains pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain; the first block is processed on the first blockchain to trigger cross-chain transactions with the second blockchain; the processing result information for the first business transaction information contained in the second block in the second blockchain is obtained, wherein the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain; second business transaction information is generated according to the processing result information, the second business transaction information is set to an effective state, and processed on the first blockchain.
[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0025] Figure 1 A schematic diagram of the blockchain network structure is shown.
[0026] Figures 2 to 4 The diagram shows the architecture of the blockchain system used in the embodiments of this application.
[0027] Figure 5 A schematic diagram of an electronic invoice system according to an embodiment of this application is shown.
[0028] Figure 6 A schematic diagram of a multi-chain scenario according to an embodiment of this application is shown.
[0029] Figure 7 A flowchart illustrating a data processing method for a blockchain system according to an embodiment of this application is shown;
[0030] Figure 8 A flowchart illustrating a data processing method for a blockchain system according to an embodiment of this application is shown;
[0031] Figure 9 A schematic diagram illustrating cross-chain auditing between the main chain and sub-chains according to an embodiment of this application is shown;
[0032] Figure 10A block diagram of a data processing apparatus for a blockchain system according to an embodiment of this application is shown;
[0033] Figure 11 A block diagram of a data processing apparatus for a blockchain system according to an embodiment of this application is shown;
[0034] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0035] Exemplary embodiments will now be described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to these examples; rather, these embodiments are provided so that this application will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.
[0036] Furthermore, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to provide a full understanding of the embodiments of this application. However, those skilled in the art will recognize that when implementing the technical solutions of this application, not all detailed features in the embodiments may be used, one or more specific details may be omitted, or other methods, elements, devices, steps, etc., may be employed.
[0037] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0038] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0039] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0040] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks (i.e., blocks) linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and to generate the next block. A blockchain can include an underlying platform, a platform product service layer, and an application service layer.
[0041] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational monitoring. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user real identities and blockchain addresses (access management). Furthermore, under authorization, it monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information using a consensus algorithm (consensus management). After encryption, the data is transmitted completely and consistently to the shared ledger (network communication) and recorded and stored. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). According to the contract terms, the key or other events are invoked to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operation monitoring module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization output during product release, such as alarms, network monitoring, and monitoring of node device health status.
[0042] The platform's product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can leverage these basic capabilities, along with the specific characteristics of their business needs, to implement blockchain-based business logic. The application service layer provides blockchain-based application services to business stakeholders.
[0043] See Figure 1The illustrated blockchain network may include multiple nodes 101, which can be various clients forming the blockchain network. Each node 101, in its normal operation, receives input information and maintains shared data within the blockchain network based on this information. To ensure information exchange within the blockchain network, information connections can exist between each node, allowing for information transmission. For example, when any node in the blockchain network receives input information, other nodes in the network retrieve this input information according to a consensus algorithm and store it as shared data, ensuring data consistency across all nodes in the blockchain network.
[0044] Each node in a blockchain network has a corresponding node identifier, and each node can store the node identifiers of other nodes. This allows for the broadcast of generated blocks to other nodes in the blockchain network based on their node identifiers. Each node can maintain a list of node identifiers, storing the node name and its corresponding node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node.
[0045] Each node in a blockchain network stores the same blockchain. A blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information features, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the current block's input information features, the parent block's block header features, version number, timestamp, and difficulty value, and so on. This ensures that the data stored in each block is related to the data stored in its parent block, guaranteeing the security of the input information within each block.
[0046] When generating blocks in the blockchain, each node receiving input information verifies it. After verification, it stores the input information in a memory pool and updates its hash tree used to record the input. Then, it updates the timestamp to the time the input information was received and attempts to generate different random numbers, performing feature value calculations multiple times. When a random number that meets the conditions is obtained, the corresponding information is stored, generating a block header and block body, thus obtaining the current block. Subsequently, the node sending the newly generated block to other nodes in the data sharing system based on their node identifiers, allows other nodes to verify the new block and add it to their stored blockchain. Nodes can use consensus algorithms to verify the newly generated block, which may include, but are not limited to:
[0047] Pow (Proof) of Proof-of-Work (PoW) refers to a measurement method set up by a system (such as the aforementioned blockchain network system) to achieve a certain goal. Simply put, it's a proof used to confirm the amount of work done. In the PoW algorithm, each node provides computing power (or computing power) to the entire system. Through a competitive mechanism, the node that completes the most computational work receives a reward from the system, that is, the right to record transactions.
[0048] Pos (proof) of Stake (Proof of Stake): Proof of Stake (PoS) is an upgraded consensus mechanism of Proof of Work (PoW). Specifically, the longer someone holds electronic resources (the length of time they hold electronic resources = the number of electronic resources they hold * the time they hold electronic resources), the more likely they are to obtain the right to record blocks. Electronic resources can refer to resources that are stored in electronic accounts in electronic form and can be circulated through the Internet.
[0049] Delegated Proof of Stake (DPoS) is similar to a board of directors vote. Holders of electronic resources vote to elect a certain number of nodes to act as their proxies for verification and record-keeping. To incentivize more nodes to participate, the system generates a small amount of electronic resources as a reward. The elected nodes have equal rights. If elected representatives fail to fulfill their duties (e.g., failing to generate a block when it's their turn), they are removed, and the network elects new nodes to replace them. This allows DPoS to significantly reduce the number of nodes involved in verification and record-keeping, achieving consensus verification in seconds. However, the entire consensus mechanism still relies on electronic resources.
[0050] PBFT (Practical Byzantine Fault Tolerance): PBFT is a message-passing-based consensus algorithm that achieves consensus through three phases, which may be repeated due to failures. Specifically, assuming a total of 3f+1 nodes, where f represents Byzantine faulty nodes, firstly, when a node discovers that the leader (such as a representative node, ledger node, or supernode) is acting maliciously, the algorithm elects another replica (node) as the new leader. Secondly, the leader, through pre... The `prepare` message broadcasts the selected value to other replica nodes. Other replica nodes send a `prepare` message if they accept it, otherwise they don't. Next, once 2f nodes accept the `prepare` message, they send a `commit` message. Finally, when 2f+1 nodes accept the `commit` message, the value is considered finalized. This process allows the PBFT Byzantine Fault Tolerance algorithm to reach consensus when all nodes are composed of business stakeholders or regulators, ensuring security and stability. Furthermore, the consensus latency is approximately 2-5 seconds, essentially meeting the requirements for commercial real-time processing, improving consensus efficiency, and satisfying the demands of high-frequency trading.
[0051] Paxos (a distributed algorithm): The Paxos algorithm is a two-phase algorithm with three main roles: proposer, acceptor, and learner. The proposer proposes a proposal, the acceptor agrees or rejects, and the learner obtains the final value after consensus is reached. The Paxos algorithm consists of two phases: ① Preparation phase: The proposer selects a proposal number n and sends a prepare request to a majority of the acceptors; after receiving the prepare request, if the acceptor's proposal number is greater than all prepare requests it has already responded to, the acceptor replies to the proposer with the proposal it previously accepted and promises not to respond to proposals less than n. ② Approval Phase: Once a proposer receives responses to the prepare request from a majority of acceptors, it enters the approval phase. It sends an accept request, including a number n and a value (if no value has already been accepted, it can freely choose the value). Without violating its commitments to other proposers, an acceptor accepts the request upon receiving it. The Paxos algorithm is suitable for simple fault-tolerant models, where only failed or faulty nodes exist in the system, and malicious nodes are not allowed. If the number of failed nodes is x (where x is a positive integer), then only x+1 non-failed nodes are needed to maintain the normal operation of the system.
[0052] Raft (a distributed consensus algorithm): The Raft algorithm includes three roles: follower, candidate, and leader. A node can only be in one of these three states at any given time, and these roles can transform into each other over time and under changing conditions. All nodes initially start as followers. Followers that do not receive a heartbeat within a timeout period become candidates and broadcast a vote request. The node that receives a majority of votes becomes the leader. In this round of voting, whoever sends the request first has the advantage, and each node only gives one vote. The leader node periodically sends heartbeats to other nodes. Leader node failure triggers a new round of voting.
[0053] Optionally, each node in the blockchain network can be a server or a terminal device. A server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Terminal devices can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart home devices, in-vehicle terminals, etc., but are not limited to these. Nodes can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.
[0054] The aforementioned cloud computing refers to the delivery and usage model of IT infrastructure, specifically the acquisition of required resources through the network in an on-demand and easily scalable manner. In a broader sense, cloud computing refers to the delivery and usage model of services, namely, the acquisition of required services through the network in an on-demand and easily scalable manner. These services can be IT and software-related, internet-related, or other services. Cloud computing is a product of the convergence and development of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Driven by the development of the internet, real-time data streams, the diversification of connected devices, and the demands of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel and distributed computing, the emergence of cloud computing will, conceptually, drive a revolutionary change in the entire internet model and enterprise management model.
[0055] Based on blockchain technology, embodiments of this application propose an architecture for a blockchain system. For example... Figure 2 As shown, the blockchain system includes a ledger node network 2 and a business node network 1. The ledger node network 2 includes ledger nodes 21 that reach consensus on data blocks and record them on the blockchain. The business node network 1 includes business nodes 11, which can verify the data blocks recorded on the blockchain by the ledger nodes or request corresponding transaction data from the ledger nodes.
[0056] Specifically, the verification of data blocks recorded on the blockchain by the accounting nodes by business node 11 may include the following steps: An accounting node 21 in the accounting node network uses a key specific to that accounting node to generate a signature based on the transaction information to be included in a data block to be added to the blockchain; accounting node 21 adds the transaction information and the generated signature to the data block and adds it to the blockchain; accounting node 21 sends the signature to a business node in the business node network, and the business node verifies the signature using its key specific to that accounting node, thereby enabling business node 11 to verify the data blocks recorded on the blockchain by the accounting nodes. The accounting nodes in the accounting node network are responsible for recording data blocks to the blockchain, and the business nodes in the business node network are responsible for witnessing the results of the accounting node recording. Specifically, the accounting node generates a signature based on the transaction information to be included in a data block to be added to the blockchain, then adds the transaction information and the generated signature to the data block and uploads it to the blockchain. The signature is then sent to a business node in the business node network, allowing the business node to verify the signature using its key specific to that accounting node. In the business node network, business nodes can witness the transaction data of the entire network by verifying the signatures of the ledger nodes on the blocks. Although the ledger node network has a monopoly on the right to record transactions, all actions are publicly traceable because the data blocks have digital signatures representing the identities of the ledger recorders. If the ledger nodes collectively commit malicious acts, then all nodes in the business node network will retain evidence of the specific ledger nodes' malicious actions. Compared to traditional centralized systems and private blockchains, the system in this embodiment operates more transparently; and compared to traditional decentralized solutions, this solution is more controllable and easier to supervise.
[0057] In one embodiment of this application, the ledger node network 2 and the business node network 1 can be connected via a proxy node 12. The proxy node 12 can be a business node in the business node network 1, responsible for transmitting information from the ledger node 21 to the business node 11. The business node 11 is the terminal of the transaction party that generates various transaction data that needs to be uploaded to the blockchain, and can also be a terminal that queries transaction data from the ledger node network 2. The transaction data generated by the business node 11 is transmitted to the ledger node 21 through the proxy node 12, and then recorded on the blockchain after consensus. This facilitates the unified processing and supervision of transaction data. The business node 11 can also supervise and witness the on-chain uploading of transaction data through the information sent by the ledger node 21 via the proxy node 12. This is of great significance in scenarios where unified supervision is needed, but there is also a fear of collective cheating by the monitored nodes.
[0058] exist Figure 1In the structure shown, business node network 1 adopts a P2P (Peer-to-Peer) network model. A P2P network is a distributed application architecture that distributes tasks and workloads among peers. It is a network form or topology of the peer-to-peer computing model at the application layer, i.e., a "point-to-point" or "end-to-end" network. It can be defined as follows: network participants share a portion of their hardware resources (processing power, storage capacity, network connectivity, printers, etc.). These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediary entity. Participants in this network are both providers and recipients of resources, services, and content. Therefore, in business node network 1, when agent node 12 receives a message from accounting node 21, it propagates it to surrounding business nodes 11. The surrounding business nodes 11 receive the message and then propagate it to their neighboring business nodes 11, achieving the propagation of the message among all business nodes 11 in business node network 1.
[0059] Figure 3 This illustrates the architecture of another blockchain system used in the embodiments of this application. This architecture is similar to... Figure 2 The difference in the architecture shown is that a P2P network mode is not adopted in business node network 1; instead, a broadcast network mode is used. Specifically, after receiving a message from accounting node 21, agent node 12 broadcasts the message to other business nodes 11 in business node network 1. In this way, the message is also propagated among each business node 11 in business node network 1.
[0060] Figure 4 This illustrates another blockchain system architecture used in embodiments of the present invention. This architecture is similar to... Figure 2The difference in the illustrated architecture lies in that its ledger node network 2 is divided into multiple branch ledger node networks. Each branch ledger node network is responsible for recording a specific type of transaction information. For example, a company may have supply chain finance business and may need to record contract information, outstanding payments, and other information generated during the supply and sales process on the blockchain. Simultaneously, the company also needs to issue invoices and record invoice information and invoice reimbursement information on the blockchain. In this case, to facilitate the supervision of ledger nodes by the same department, the ledger nodes recording supply chain finance transactions and those recording transactions during the invoice circulation process may belong to different departments. For example, the ledger node recording supply chain finance transactions might be a bank-set ledger terminal, while the ledger node recording transactions during the invoice circulation process might be a tax authority-set ledger terminal. Furthermore, supply chain finance transactions and invoice circulation transactions may ultimately be recorded on different branch ledger node networks. In this case, the agent node 12, based on the transaction type carried in the transaction information sent from the business node 11, sends the transaction information to the branch ledger node network corresponding to that transaction type.
[0061] It should be noted that, in Figures 2 to 4 In the architecture of the blockchain system shown, the proxy node 12 is located in the business node network 1. In other embodiments of this application, the proxy node 12 may also be located in the consensus node network 2, or be independent of the business node network 1 and the consensus node network 2.
[0062] Figures 2 to 6 The architecture of the blockchain system shown can be applied to electronic invoice scenarios, which will be elaborated in detail below:
[0063] In one embodiment of this application, the accounting nodes in the accounting node network can be various State Taxation Administration terminals, for example, the accounting node network can be composed of State Taxation Administration terminals deployed in multiple regions, each serving as an accounting node. The business nodes in the business node network can be local tax bureau terminals, invoicing agent service provider terminals, invoicing enterprise terminals, individual user terminals, etc.
[0064] Specifically, in Figure 5 The electronic invoice system shown can include a business layer, a routing proxy layer, and a consensus network (i.e., an accounting node network, hereinafter referred to as the accounting network) layer. The business layer is the business node network, which contains various business nodes, such as local tax bureaus located in a dedicated tax network; invoicing service providers, reimbursement service providers, and enterprises located in a public cloud; and payment service providers, circulation service providers, and enterprises located in a private cloud.
[0065] The routing proxy layer includes proxy nodes that provide routing services, certificate caching and authentication services, P2P services, and other functions. The routing proxy layer isolates the business layer and the consensus network layer, as described in the technical solution of the aforementioned embodiments. Optionally, the proxy nodes in the routing proxy layer can be located within a tax-related private network. The consensus network (ledger network) layer is the ledger node network, which includes multiple blockchains. Of course, in other embodiments of this application, the consensus network (ledger network) layer may also include only one blockchain.
[0066] In one embodiment of this application, the consensus network (ledger network) of the electronic invoice system can include multiple blockchains. These blockchains can be divided into chains according to time sequence, such as chains for the same business transaction based on time, where the business participants are consistent, and both blockchains use the same CA (Certificate Authority) center as the authentication and authorization party for the invoice business system. Of course, in one embodiment of this application, chains can be divided according to different business transactions, such as one blockchain for business A and another for business B, and cross-chain interaction between businesses is also possible.
[0067] Optionally, such as Figure 6 As shown, in one exemplary embodiment, the consensus network (which may be the aforementioned) Figures 2 to 5 The consensus network shown can also be a standalone consensus network (i.e., a consensus network without separating business networks and consensus networks). It can contain multiple blockchains, specifically a main chain 601, and N sub-chains derived from the main chain 601 at a certain block height, where N is a positive integer. Each time a new sub-chain is derived, a new chain identifier needs to be generated for that new sub-chain. For example, in... Figure 6 In this model, main chain 601 can derive sub-chains 602, 603, and 604. Each sub-chain can correspond to a specific business function, such as in the tax business field. This effectively distinguishes different transaction businesses and maintains the exclusivity of the data stored in each business branch chain. Specific businesses could include invoice processing, credit reporting, import and export, enterprise qualification processing, and tax refund processing.
[0068] In one embodiment of this application, the main chain 601 in the consensus network may include registration information for sub-chains corresponding to various services. This registration information may include the sub-chain's chain identifier, service configuration information corresponding to the service, and derivation conditions corresponding to the chain identifier. Optionally, after each sub-chain is generated, it needs to be registered in the main chain. The main chain has a smart contract for managing sub-chain registration. During registration, the main chain can assign a chain identifier to the sub-chain and record its registration information.
[0069] Optionally, the business configuration information corresponding to a business (e.g., a bill transaction) may include basic business information (i.e., a description of the bill transaction) and node configuration information (including business node configuration information and consensus node configuration information). The business node configuration information may include a node identifier configured by a consensus node with regulatory authority (e.g., node 120a with regulatory authority) for the corresponding business branch chain (e.g., the business branch chain corresponding to the bill transaction). The business node corresponding to this node identifier can be used to execute the bill transaction. The consensus node configuration information may include consensus nodes configured by a consensus node with regulatory authority for this sub-chain to participate in the consensus process of that sub-chain.
[0070] Optionally, the genesis block of each subchain can be the block corresponding to the one derived from the main chain, for example... Figure 6 As shown, subchain 602 is derived from block A1 in mainchain 601, and its genesis block is A1; subchain 603 is derived from block A2 in mainchain 601, and its genesis block is A2; subchain 604 is derived from block A3 in mainchain 601, and its genesis block is A3. The mainchain and each subchain can operate independently, and each subchain can process its own transactions. When verifying a subchain block, in addition to verifying the subchain block itself, the genesis block of the subchain can be used to find chain A and then verify the genesis block of chain A (e.g., verifying a Merkle tree) to improve the reliability of the verification. Of course, if the consensus node has already synchronized chain A locally, then the verification of a subchain block can simply be done up to its genesis block on chain A.
[0071] Optionally, if the configuration information of the blockchain node system corresponding to the entire blockchain network (e.g., a tax blockchain system) changes, the consensus nodes in the consensus network need to suspend operation. If the configuration information that has changed is referred to as configuration change information, then this configuration change information can refer to changes in regulatory rules within the tax field, changes in computing regulations, changes in important blockchain nodes, rotation of certificate issuing nodes, etc. Consensus nodes with regulatory authority in the consensus network can generate configuration change blocks based on this configuration change information, and then upload these configuration change blocks to the main chain 601 of the consensus network, synchronizing them to all sub-chains. At this time, other consensus nodes in the consensus network can resume operation. Figure 6 As shown, assuming the configuration information changes, a configuration change block A3 is generated in the main chain 601, and then it will be synchronized in the sub-chains, such as block B5 in sub-chain 602 and block C4 in sub-chain 603.
[0072] Optionally, for Figures 2 to 5In the system architecture shown, any business node in the business network can be configured with M chain identifiers. These M chain identifiers belong to the chain identifiers of the N business branch chains registered in the consensus network. Here, M is a positive integer less than or equal to N. The number of chain identifiers configured for each business node can be the same or different; this is not limited here.
[0073] For example, if the main chain in the consensus network derives from three sub-chains, and the chain identifiers of these three sub-chains are chain identifier 1s for business 1X (e.g., bill payment business), chain identifier 2s for business 2X (e.g., credit reporting business), and chain identifier 3s for business 3X (e.g., import / export business), then two chain identifiers (e.g., chain identifier 1s and chain identifier 3s) can be dynamically configured for one business node in the business network, and three chain identifiers (e.g., chain identifier 1s, chain identifier 2s, and chain identifier 3s) can be dynamically configured for another business node in the business network. It can be understood that if a business node is configured with multiple chain identifiers, then that business node can participate in executing the business of the sub-chains corresponding to these multiple chain identifiers, thereby effectively ensuring control over the business nodes.
[0074] Alternatively, although different subchains are derived from the main chain, these subchains and the main chain can still be processed by the same consensus nodes to complete the consensus on-chain processing. Transaction information can be distinguished according to the chain identifier, and different subchains can conduct consensus in parallel.
[0075] Of course, some subchains can also be configured to have independent consensus nodes, but these independent consensus nodes must synchronize with the main chain's data. Specifically, for example, consensus nodes that independently reach consensus on a subchain can form a subchain independent consensus network, and consensus nodes that independently reach consensus on the main chain can form a main chain independent consensus network.
[0076] Meanwhile, the proxy node needs to record information about the independent consensus network. If it encounters a request to send transaction information or synchronize data to the independent consensus network, it forwards it to the independent consensus network; otherwise, it checks the request according to the basic configuration and forwards it to the consensus node of the core network. The consensus node then processes the request independently based on the subchain ID.
[0077] Optionally, to reduce the waste of storage space for business nodes, the business nodes in this embodiment can take a lightweight node (Simplified Payment Verification, or SPV) as an example. This business node does not need to store complete transaction data, but obtains block header data and partially authorized visible block data (such as business transactions associated with the business node itself) from the consensus network through a proxy node. An SPV node can dynamically configure multiple subchain IDs to participate in the business of multiple subchains. Multiple subchains can participate using the same SPV node identifier and address. At the same time, the SPV node identifier and address must be registered on the main chain in advance. The block data of each subchain is independently synchronized back to the SPV node and stored independently on the SPV node.
[0078] In response to the multi-chain scenarios described in the foregoing embodiments, this application proposes a cross-chain transaction scheme between multiple chains, which is described in detail below:
[0079] Figure 7 A flowchart illustrating a data processing method for a blockchain system according to an embodiment of this application is shown. The blockchain system includes a first blockchain and a second blockchain. Figure 7 The data processing method of the blockchain system shown can be executed by the maintenance node of the first blockchain. Specifically, refer to... Figure 7 As shown, the data processing method of this blockchain system includes at least steps S710 to S740, which are described in detail below:
[0080] In step S710, a first block is generated based on the first business transaction information to be processed across the chain as needed. The first block contains the pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain.
[0081] Optionally, Figure 7 The first blockchain in the illustrated embodiment may be derived from a block height in the second blockchain, for example, in Figure 6 In this context, the second blockchain can be the main chain 601, and the first blockchain can be any one of the sub-chains 602, 603, and 604.
[0082] or, Figure 7 In the illustrated embodiment, the first and second blockchains can be two independent blockchains, meaning they have no derivative relationship with each other. Or Figure 7 The first and second blockchains in the illustrated embodiment can also be two sub-chains derived from the same main chain. For example, the first and second blockchains can be... Figure 6 Subchains 602 and 603 are shown in the diagram.
[0083] In one embodiment of this application, the first business transaction information may be business transaction information to be reviewed, data query business information, or other business-related transaction information. This embodiment of the application does not impose specific limitations.
[0084] It should be noted that the pre-effective status information of the first business transaction information is used to indicate that the first business transaction information has not yet taken effect, and its ineffectiveness will not affect the global state of the blockchain system. Optionally, the cross-chain indicator field can be, for example, "corss:x", indicating that a cross-chain transaction with blockchain x is required.
[0085] In step S720, the first block is uploaded to the first blockchain to trigger a cross-chain transaction with the second blockchain.
[0086] In one embodiment of this application, after the maintenance node of the first blockchain processes the first block on the first blockchain, the maintenance node of the second blockchain can obtain the block header of the first block and the first business transaction information contained therein, and then process the first business transaction information.
[0087] Optionally, a second relay contract can be deployed in the second blockchain. This second relay contract stores the block headers of the first blockchain obtained by the second relay service. The second relay service monitors the first blockchain, and after a new block is generated in the first blockchain, it obtains the block header of the new block and puts it into the second relay contract. If, after obtaining the block header of a new block, the second relay service finds a cross-chain indication field in the block header, indicating that a cross-chain transaction with the second blockchain is required, it obtains the business transaction information (in this embodiment, the first business transaction information). In this case, after the maintenance node of the first blockchain processes the first block on the first blockchain, the second relay service can obtain the block header and the first business transaction information of the first block and store them in the second relay contract, so that the maintenance node of the second blockchain can generate processing result information based on the first business transaction information obtained therefrom.
[0088] In step S730, the processing result information for the first business transaction information contained in the second block of the second blockchain is obtained, wherein the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain.
[0089] In one embodiment of this application, the maintenance node of the first blockchain can obtain the processing result information of the first business transaction information from the second block in the second blockchain.
[0090] Optionally, a first relay contract can be deployed in the first blockchain. This first relay contract stores the block headers of the second blockchain obtained by the first relay service. The first relay service monitors the second blockchain, and after a new block is generated in the second blockchain, it obtains the block header of the new block and puts it into the first relay contract. If, after obtaining the block header of a new block, the first relay service finds a cross-chain indication field in the block header, indicating that a cross-chain transaction with the first blockchain is required, it obtains the transaction information (in this embodiment, the processing result information for the first business transaction information). In this case, the maintenance node of the first blockchain can obtain the processing result information from the first relay contract.
[0091] Optionally, if the first business transaction information is business transaction information to be reviewed, then the processing result information can be the review result information for the business transaction information to be reviewed.
[0092] Continue to refer to Figure 7 As shown, in step S740, second business transaction information is generated based on the processing result information, the second business transaction information is set to an effective state, and on-chain processing is performed on the first blockchain.
[0093] In one embodiment of this application, the processing result information may include the context of the first business transaction information and the result information for the first business transaction information. For example, if the first business transaction information is business transaction information to be reviewed, then the result information for the first business transaction information may be information on whether the review is passed or not.
[0094] Optionally, when generating the second business transaction information based on the processing result information, the processing result information can be verified, such as verifying the signature information of the processing result information. After the processing result information passes the verification, the second business transaction information is generated based on the context and result information of the first business transaction information included in the processing result information.
[0095] In one embodiment of this application, after the first block is processed on the first blockchain, if no processing result information is obtained after a set time, the first business transaction information is set to an invalid state. This embodiment's technical solution can limit the processing time of the first business transaction information.
[0096] In one embodiment of this application, after the first block is processed on the first blockchain, if the processing result information is obtained after a set time limit, the processing result information is ignored. This embodiment's technical solution can also limit the processing time of the first business transaction information, so that the business transaction information is ignored after the timeout.
[0097] The implementation details of the technical solution of this application embodiment have been described above from the perspective of the maintenance node of the first blockchain. The technical solution of this application embodiment will be further described below from the perspective of the maintenance node of the second blockchain:
[0098] Figure 8 A flowchart illustrating a data processing method for a blockchain system according to an embodiment of this application is shown. The blockchain system includes a first blockchain and a second blockchain. Figure 8 The data processing method of the blockchain system shown can be executed by the maintenance node of the second blockchain. Specifically, refer to... Figure 8 As shown, the data processing method of this blockchain system includes at least steps S810 to S840, which are described in detail below:
[0099] In step S810, the first business transaction information contained in the first block of the first blockchain is obtained. The first block contains the pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain.
[0100] Optionally, Figure 7 The first blockchain in the illustrated embodiment may be derived from a block height in the second blockchain, for example, in Figure 6 In this context, the second blockchain can be the main chain 601, and the first blockchain can be any one of the sub-chains 602, 603, and 604.
[0101] or, Figure 7 In the illustrated embodiment, the first and second blockchains can be two independent blockchains, meaning they have no derivative relationship with each other. Or Figure 7 The first and second blockchains in the illustrated embodiment can also be two sub-chains derived from the same main chain. For example, the first and second blockchains can be... Figure 6 Subchains 602 and 603 are shown in the diagram.
[0102] In one embodiment of this application, the first business transaction information may be business transaction information to be reviewed, data query business information, or other business-related transaction information. This embodiment of the application does not impose specific limitations.
[0103] It should be noted that the pre-effective status information of the first business transaction information is used to indicate that the first business transaction information has not yet taken effect, and its ineffectiveness will not affect the global state of the blockchain system. Optionally, the cross-chain indicator field can be, for example, "corss:x", indicating that a cross-chain transaction with blockchain x is required.
[0104] In one embodiment of this application, a second relay contract can be deployed in the second blockchain. This second relay contract stores the block headers of the first blockchain obtained by the second relay service. The second relay service monitors the first blockchain, and after a new block is generated in the first blockchain, it obtains the block header of the new block and puts it into the second relay contract. If, after obtaining the block header of a new block, the second relay service finds a cross-chain indication field in the block header, indicating that a cross-chain transaction with the second blockchain is required, it obtains the business transaction information therein (in this embodiment, the first business transaction information). In this case, the maintenance node of the second blockchain can obtain the first business transaction information from the second relay contract.
[0105] In step S820, the first business transaction information is processed to generate processing result information for the first business transaction information.
[0106] In one embodiment of this application, if the smart contract deployed in the second blockchain can process the first business transaction information, then the smart contract can directly process the first business transaction information; if the smart contract deployed in the second blockchain cannot process the first business transaction information, then the first business transaction information can be pushed to a designated device (such as the device used by the user) for processing.
[0107] In one embodiment of this application, if the aforementioned second relay service is deployed, after storing the first business transaction information in the second relay contract, the second relay service can generate pending tasks in the second relay contract. Then, the maintenance node of the second blockchain can process the first business transaction information according to the pending tasks contained in the second relay contract.
[0108] In step S830, a second block is generated based on the processing result information. The block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain.
[0109] Optionally, the processing result information may include the context of the first business transaction information and the result information for the first business transaction information. For example, if the first business transaction information is a business transaction information to be reviewed, then the result information for the first business transaction information may be whether the review is passed or not. Then, the maintenance node of the second blockchain can package this information to generate the second block.
[0110] In step S840, the second block is processed on the second blockchain to trigger the maintenance node of the first blockchain to obtain the processing result information.
[0111] Optionally, a first relay contract can be deployed in the first blockchain. This first relay contract stores the block headers of the second blockchain obtained by the first relay service. The first relay service monitors the second blockchain, and after a new block is generated in the second blockchain, it obtains the block header of the new block and puts it into the first relay contract. If, after obtaining the block header of a new block, the first relay service finds a cross-chain indication field in the block header, indicating that a cross-chain transaction with the first blockchain is required, it obtains the transaction information (in this embodiment, the processing result information for the first business transaction information). In this case, the maintenance node of the first blockchain can obtain the processing result information from the first relay contract.
[0112] The following combination Figure 9 The second blockchain is the main chain (denoted as Chain A), and the first blockchain is a block height derived from the main chain. Figure 9 Taking the sub-chain (denoted as chain B) derived from block A1 as an example, the technical solution of this application embodiment will be described:
[0113] exist Figure 9 The system shown includes a subchain relay service, a subchain relay contract, a mainchain relay service, and a mainchain relay contract. Specifically, each subchain has a mainchain relay service for the main chain. This mainchain relay service monitors changes in the block header height of the main chain and periodically submits the block header of a new block to the mainchain relay contract on the subchain after obtaining it. The subchain can then detect block changes in the main chain.
[0114] The main chain has a subchain relay service for each subchain. The subchain relay service is responsible for monitoring the block header information and state changes of the subchain, and then submitting the block header of the new block to the subchain relay contract for each subchain in the main chain.
[0115] In one example, taking the cross-chain audit business scenario as an example, the first business transaction information in the aforementioned embodiment is the business transaction that needs to be audited, and the specific process is as follows:
[0116] (1) Subchain B packages a business transaction X1 that needs cross-chain review. After consensus, a new block B4 is added to subchain B (for example only). The business transaction X1 that needs to be reviewed is packaged in B4 and its state is pre-effective. The pre-effective state will not have a real impact on the global state of the blockchain.
[0117] (2) When the new block B4 is uploaded to the chain, a flag "cross" will be added to the block header to indicate which chain to cross-chain audit with. Since the main chain A is specified for audit in this embodiment, the flag is cross:A.
[0118] (3) The relay service of sub-chain B in main chain A synchronizes to the block header of block B4 and finds that there is business transaction information in block B4 that needs to be reviewed by the main chain. Therefore, it synchronizes the block header of block B4 and the content of business transaction X1, and submits it to the relay contract of sub-chain B in main chain A, and generates a task to be reviewed in the relay contract of sub-chain B.
[0119] (4) The maintenance nodes (such as consensus nodes) of the main chain A will periodically check whether there are any pending business transactions in the relay contracts of each sub-chain. If the pending business transactions can be automatically reviewed by the smart contract, the smart contract will automatically perform the review. Otherwise, it can prompt the outside world that manual review is required, and wait for the manual review to be completed before submitting the relevant successfully reviewed transactions.
[0120] (5) The approved transaction, along with the context and review result information of X1, is packaged into a block (here assumed to be block A2) by the maintenance node of the main chain A as a transaction X2. Similarly, a flag "cross" needs to be added to the block header of block A2 to indicate which chain to conduct the cross-chain transaction with. Since the cross-chain transaction in this embodiment is conducted with the sub-chain B, the flag is cross:B.
[0121] (6) The main chain relay service of subchain B synchronizes with the block header of block A2 and finds that there is information in block A2 that requires cross-chain transactions. Therefore, it synchronizes the block header of block A2 and the content of transaction X2, and submits it to the main chain relay contract of subchain B. At this time, subchain B obtains X2. Based on the verification result of X2, it generates X3. X3 has more information than X1 than the result of the main chain A's review, and becomes officially effective, which will affect the global state of the blockchain. Then, the maintenance node of subchain B reaches consensus on X3 and puts it on the B chain.
[0122] Optionally, a timeout mechanism can be set. If subchain B does not receive the review result information X2 from mainchain A within a certain period of time, the review is deemed a failure, and the pre-activated X1 is automatically invalidated. Even if X2 is received again subsequently, no further processing will be performed.
[0123] It should be noted that: except Figure 9 In other embodiments of this application, the cross-chain transaction scheme of this application embodiment can also be executed on two independent blockchains, or on two sub-chains derived from the same main chain. Furthermore, in addition to cross-chain verification, other types of business, such as data query services, can also be processed.
[0124] The technical solution of this application provides an effective process for cross-chain transactions, ensuring the effectiveness and correctness of interactions and verifications between multiple chains. At the same time, since the transaction information processed by cross-chain has a pre-effective state, if the cross-chain review fails, it will not cause any changes to the original state of the business, thus proving the atomicity of cross-chain interaction.
[0125] The following describes an apparatus embodiment of this application, which can be used to execute the data processing method of the blockchain system in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the data processing method of the blockchain system described above.
[0126] Figure 10 A block diagram of a data processing apparatus for a blockchain system according to an embodiment of this application is shown. The blockchain system includes a first blockchain and a second blockchain. Figure 10 The data processing device shown can be set up within the maintenance node of the first blockchain.
[0127] Reference Figure 10 As shown, a data processing apparatus 1000 for a blockchain system according to an embodiment of this application includes: a first generation unit 1002, a first processing unit 1004, a first acquisition unit 1006, and a second generation unit 1008.
[0128] The first generation unit 1002 is configured to generate a first block based on the first business transaction information to be processed across the blockchain. The first block contains pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain. The first processing unit 1004 is configured to process the first block on the first blockchain to trigger cross-chain transactions with the second blockchain. The first acquisition unit 1006 is configured to acquire the processing result information for the first business transaction information contained in the second block of the second blockchain. The block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain. The second generation unit 1008 is configured to generate second business transaction information based on the processing result information, set the second business transaction information to an effective state, and process it on the first blockchain.
[0129] In some embodiments of this application, based on the aforementioned scheme, a first relay contract is deployed in the first blockchain. The first relay contract is used to store the block header of the second blockchain obtained by the first relay service. The first acquisition unit 1006 is configured to: acquire the processing result information from the first relay contract. The processing result information is acquired from the second block and stored in the first relay contract by the first relay service when it determines that the block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain.
[0130] In some embodiments of this application, based on the aforementioned scheme, a second relay contract is deployed in the second blockchain. The second relay contract is used to store the block header of the first blockchain obtained by the second relay service. The first processing unit 1004 is configured to perform on-chain processing on the first blockchain to trigger the second relay service to obtain the block header of the first block and the first business transaction information, and store them in the second relay contract. The second relay contract is used for the maintenance node of the second blockchain to generate the processing result information based on the first business transaction information obtained therefrom.
[0131] In some embodiments of this application, based on the foregoing scheme, the first processing unit 1004 is further configured to: after processing the first block on the first blockchain, if the processing result information is not obtained after a set time, then the first business transaction information is set to an invalid state.
[0132] In some embodiments of this application, based on the foregoing scheme, the first processing unit 1004 is further configured to: after the first block is processed on the first blockchain, if the processing result information is obtained only after a set time has elapsed, then the processing result information is ignored.
[0133] In some embodiments of this application, based on the foregoing scheme, the processing result information includes the context of the first business transaction information and result information for the first business transaction information; the second generation unit 1008 is configured to: verify the processing result information, and after the processing result information passes the verification, generate the second business transaction information according to the context of the first business transaction information included in the processing result information and the result information.
[0134] In some embodiments of this application, based on the foregoing scheme, the first blockchain is derived from a block height in the second blockchain, and at least one first blockchain is derived from the second blockchain; the first business transaction information includes business transaction information to be reviewed, and the processing result information includes review result information for the business transaction information to be reviewed.
[0135] Figure 11 A block diagram of a data processing apparatus for a blockchain system according to an embodiment of this application is shown. The blockchain system includes a first blockchain and a second blockchain. Figure 11 The data processing device shown can be set up within the maintenance node of the second blockchain.
[0136] Reference Figure 11 As shown, a data processing apparatus 1100 for a blockchain system according to an embodiment of this application includes: a second acquisition unit 1102, a second processing unit 1104, a third generation unit 1106, and a third processing unit 1108.
[0137] The second acquisition unit 1102 is configured to acquire the first business transaction information contained in the first block of the first blockchain. The first block contains pre-effective status information of the first business transaction information, and the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain. The second processing unit 1104 is configured to process the first business transaction information and generate processing result information for the first business transaction information. The third generation unit 1106 is configured to generate a second block based on the processing result information. The block header of the second block contains a cross-chain indication field for indicating cross-chain transactions with the first blockchain. The third processing unit 1108 is configured to perform on-chain processing of the second block in the second blockchain to trigger the maintenance node of the first blockchain to acquire the processing result information.
[0138] In some embodiments of this application, based on the aforementioned scheme, a second relay contract is deployed in the second blockchain. The second relay contract is used to store the block header of the first blockchain obtained by the second relay service. The second acquisition unit 1102 is configured to: acquire the first business transaction information from the second relay contract. The first business transaction information is acquired from the first block and stored in the second relay contract by the second relay service when it determines that the block header of the first block contains a cross-chain indication field for indicating cross-chain transactions with the second blockchain.
[0139] In some embodiments of this application, based on the aforementioned scheme, after the second relay service stores the first business transaction information in the second relay contract, it generates a task to be processed in the second relay contract; the second processing unit 1104 is configured to process the first business transaction information according to the task to be processed contained in the second relay contract.
[0140] In some embodiments of this application, based on the foregoing scheme, the second processing unit 1104 is configured as follows: if the smart contract deployed in the second blockchain can process the first business transaction information, then the smart contract processes the first business transaction information; if the smart contract deployed in the second blockchain cannot process the first business transaction information, then the first business transaction information is pushed to a designated device for processing.
[0141] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0142] It should be noted that, Figure 12 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0143] like Figure 12 As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1208 into Random Access Memory (RAM) 1203, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1203. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. An input / output (I / O) interface 1205 is also connected to bus 1204.
[0144] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.
[0145] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.
[0146] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0148] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0149] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0150] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0151] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0152] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0153] The data collection and processing plan outlined in this application must be implemented in strict accordance with the requirements of relevant national laws and regulations, obtaining the informed consent or separate consent of the data subject (or having a legal basis as stipulated by the relevant national laws and regulations), and conducting subsequent data use and processing within the scope authorized by laws and regulations and the data subject.
[0154] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data processing method of a blockchain system, characterized by, The blockchain system comprises a first blockchain and a second blockchain, and a second relay contract is deployed in the second blockchain, the second relay contract is configured to store a block header of the first blockchain obtained by a second relay service, and a data processing method is executed by a maintenance node of the first blockchain, the data processing method comprises: generating a first block according to a first business transaction information which needs to be processed cross-chain, the first block comprising pre-effective state information of the first business transaction information, and a cross-chain indication field indicating cross-chain transaction with the second blockchain being included in a block header of the first block; performing on-chain processing of the first block on the first blockchain to trigger the second relay service to obtain the block header of the first block, and when it is determined that the cross-chain indication field indicating cross-chain transaction with the second blockchain is included in the block header of the first block, obtaining the first business transaction information from the first block and storing the first business transaction information in the second relay contract, so as to generate processing result information according to the first business transaction information obtained from the second relay contract; obtaining processing result information for the first business transaction information included in a second block in the second blockchain, wherein the cross-chain indication field indicating cross-chain transaction with the first blockchain is included in a block header of the second block; generating second business transaction information according to the processing result information, setting the second business transaction information to an effective state, and performing on-chain processing on the first blockchain. 2.The data processing method of the blockchain system according to claim 1, characterized in that, A first relay contract is deployed in the first blockchain, and the first relay contract is configured to store a block header of the second blockchain obtained by a first relay service; obtaining processing result information for the first business transaction information included in a second block in the second blockchain, wherein the cross-chain indication field indicating cross-chain transaction with the first blockchain is included in a block header of the second block; The data processing method further comprises: 3.The data processing method of the blockchain system according to claim 1, characterized in that, after performing on-chain processing of the first block on the first blockchain, if the processing result information is not obtained within a set time period, setting the first business transaction information to an invalid state. The data processing method further comprises: 4.The data processing method of the blockchain system according to claim 1, characterized in that, after performing on-chain processing of the first block on the first blockchain, if the processing result information is obtained after a set time period, ignoring the processing result information. The processing result information comprises context of the first business transaction information and result information for the first business transaction information; 5.The data processing method of the blockchain system according to claim 1, characterized in that, generating second business transaction information according to the processing result information, comprises: The processing result information is verified, and after the processing result information is verified, the second business transaction information is generated according to the context of the first business transaction information and the result information included in the processing result information. 6.The data processing method of the blockchain system according to any one of claims 1 to 5, characterized in that, The first blockchain is derived from a block height in the second blockchain, and the second blockchain derives at least one first blockchain; The first business transaction information includes to-be-audited business transaction information, and the processing result information includes audit result information for the to-be-audited business transaction information. 7.A data processing method of a blockchain system, characterized by, The blockchain system includes a first blockchain and a second blockchain, and a second relay contract is deployed in the second blockchain. The second relay contract is used to store a block header of the first blockchain obtained by a second relay service. The data processing method is executed by a maintenance node of the second blockchain, and the data processing method includes: The first business transaction information is obtained from the second relay contract. The first business transaction information is obtained from the first block and stored in the second relay contract by the second relay service when it is determined that the block header of the first block in the first blockchain includes a cross-chain indication field indicating cross-chain transaction with the second blockchain. The first block includes pre-effective state information of the first business transaction information, and the block header of the first block includes a cross-chain indication field indicating cross-chain transaction with the second blockchain. The second relay service obtains the block header of the first block and the first business transaction information, which is triggered by on-chain processing of the first block in the first blockchain; The first business transaction information is processed to generate processing result information for the first business transaction information; The second block is generated according to the processing result information. The block header of the second block includes a cross-chain indication field indicating cross-chain transaction with the first blockchain. The second block is processed in the second blockchain to trigger the maintenance node of the first blockchain to obtain processing result information. 8.The data processing method of the blockchain system according to claim 7, characterized in that, The second relay service generates a to-be-processed task in the second relay contract after storing the first business transaction information in the second relay contract. The first business transaction information is processed, including: The first business transaction information is processed according to the to-be-processed task included in the second relay contract. 9.The data processing method of the blockchain system according to any one of claims 7 to 8, characterized in that, The first business transaction information is processed, including: If the smart contract deployed in the second blockchain can process the first business transaction information, the smart contract processes the first business transaction information; If the smart contract deployed in the second blockchain cannot process the first business transaction information, the first business transaction information is pushed to a designated device for processing. 10.A data processing apparatus of a blockchain system, characterized by, The blockchain system comprises a first blockchain and a second blockchain, the second blockchain is deployed with a second relay contract, the second relay contract is used to store a block header of the first blockchain obtained by a second relay service, the data processing device is arranged in a maintenance node of the first blockchain, and the data processing device comprises: A first generation unit configured to generate a first block according to first business transaction information requiring cross-chain processing, the first block comprising pre-effective state information of the first business transaction information, and the block header of the first block comprising a cross-chain indication field indicating cross-chain transaction with the second blockchain; A first processing unit configured to perform on-chain processing of the first block on the first blockchain to trigger cross-chain transaction with the second blockchain; The first processing unit is configured to perform on-chain processing of the first block on the first blockchain to trigger the second relay service to obtain the block header of the first block, and when it is determined that the block header of the first block comprises the cross-chain indication field indicating cross-chain transaction with the second blockchain, obtain the first business transaction information from the first block and store the first business transaction information in the second relay contract, so as to generate processing result information according to the first business transaction information obtained from the second relay contract; A first acquisition unit configured to acquire processing result information for the first business transaction information contained in a second block in the second blockchain, wherein the block header of the second block comprises a cross-chain indication field indicating cross-chain transaction with the first blockchain; A second generation unit configured to generate second business transaction information according to the processing result information, set the second business transaction information to an effective state, and perform on-chain processing on the first blockchain. 11.A data processing apparatus of a blockchain system, characterized by, The blockchain system comprises a first blockchain and a second blockchain, the second blockchain is deployed with a second relay contract, the second relay contract is used to store a block header of the first blockchain obtained by a second relay service, the data processing device is arranged in a maintenance node of the second blockchain, and the data processing device comprises: A second acquisition unit configured to acquire first business transaction information contained in a first block in the first blockchain, the first block comprising pre-effective state information of the first business transaction information, and the block header of the first block comprising a cross-chain indication field indicating cross-chain transaction with the second blockchain; The second obtaining unit is configured to obtain the first service transaction information from the second relay contract, the first service transaction information being obtained from the first block and stored in the second relay contract by the second relay service when it is determined that the cross-chain indication field indicating cross-chain transaction with the second blockchain is contained in the block header of the first block in the first blockchain; the second relay service obtaining the block header of the first block and the first service transaction information is triggered by on-chain processing of the first block on the first blockchain; The second processing unit is configured to process the first service transaction information to generate processing result information for the first service transaction information; The third generating unit is configured to generate a second block according to the processing result information, the block header of the second block containing a cross-chain indication field indicating cross-chain transaction with the first blockchain; The third processing unit is configured to perform on-chain processing of the second block in the second blockchain to trigger the maintenance node of the first blockchain to obtain the processing result information.
12. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the data processing method of the blockchain system in any one of claims 1 to 9.
13. An electronic device, comprising: Comprise: One or more processors; Storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the electronic device implements the data processing method of the blockchain system in any one of claims 1 to 9.
14. A computer program product, characterised in that, The computer program product comprises computer instructions stored in a computer readable storage medium, and the processor of the computer device reads and executes the computer instructions from the computer readable storage medium, so that the computer device executes the data processing method of the blockchain system in any one of claims 1 to 9.
Citation Information
Patent Citations
Cross-chain implementation method, device and equipment for associated transaction requests, and medium
CN111399993A
Block chain transmission method and system for real estate transaction data, and storage medium
CN113570479A