Data processing method and device based on block chain, equipment and storage medium
By introducing cross-chain transaction protocols and contracts into the blockchain network, the legitimacy and data validity of cross-chain services are verified, and the problems of low processing efficiency and poor security of cross-blockchain services are solved, achieving efficient and secure cross-blockchain services. Chain data transmission and processing.
Patent Information
- Application Number
- CN202310626339.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-12-03
AI Technical Summary
The cross-chain business processing efficiency of cross-blockchain in existing blockchain technology is low, and there is a risk of data leakage and loss, making it difficult to ensure the security of cross-chain business processing.
By introducing cross-chain transaction protocols into the blockchain network, the on-chain service verification contract is used to verify the legitimacy of cross-chain services, and the validity of cross-chain transaction data is checked in the off-chain data verification contract to ensure the data secure transmission and processing.
It improves the efficiency and security of cross-chain business processing, avoids the risk of centralized evil, reduces the cost of cross-chain business processing, and enhances the decentralized management of data.
Smart Images

Figure CN119067657A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, device, equipment and storage medium. Background Art
[0002] Blockchain technology is a new distributed infrastructure and computing method that uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses smart contracts composed of automated script codes to program and operate data. Simply put, blockchain is a decentralized distributed ledger.
[0003] As blockchain technology is widely recognized and accepted, many different types of blockchains have emerged. However, in the existing technology, blockchains are independent of each other, and it is difficult to implement cross-chain business processing between blockchains. Human participation is also required, resulting in low efficiency in cross-chain business processing between blockchains, and data leakage and data loss are prone to occur, making it difficult to ensure the security of cross-chain business processing. Summary of the invention
[0004] The embodiments of the present application provide a blockchain-based data processing method, apparatus, device, and storage medium, which can improve the efficiency and security of cross-chain business processing.
[0005] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, including:
[0006] The first node device associated with the first blockchain receives a cross-chain transaction request sent by the business terminal; the cross-chain transaction request includes business description information of the target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device maintaining the second blockchain both meet the cross-chain transaction protocol;
[0007] Call the on-chain business verification contract in the cross-chain transaction protocol, verify the legitimacy of the target cross-chain business according to the business description information, and obtain the business verification result;
[0008] If the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business and obtain the cross-chain transaction data;
[0009] The cross-chain transaction data is sent to N cross-chain relay devices associated with the cross-chain transaction protocol; the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid, N is a positive integer greater than 1, and i is a positive integer less than or equal to N.
[0010] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, including:
[0011] The second node device associated with the second blockchain receives the cross-chain transaction data sent by the cross-chain relay device i among the N cross-chain relay devices; the cross-chain transaction data is generated by the first node device when it determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the cross-chain relay device i is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol, the target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N;
[0012] Based on the on-chain business execution contract in the cross-chain transaction protocol, the validity of the received cross-chain transaction data is verified to obtain the data verification result;
[0013] When the data verification result indicates that the cross-chain transaction data is valid, the cross-chain transaction data is processed.
[0014] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, including:
[0015] A cross-chain relay device i among the N cross-chain relay devices receives the cross-chain transaction data sent by the first node device; the cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device, and both the first node device and the second node device satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N
[0016] Verify the validity of cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol;
[0017] If the cross-chain transaction data is valid, the cross-chain transaction data is sent to the second node device; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
[0018] On the one hand, an embodiment of the present application provides a data processing device based on blockchain, including:
[0019] A first receiving module is used for a first node device associated with a first blockchain to receive a cross-chain transaction request sent by a business terminal; the cross-chain transaction request includes business description information of a target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device maintaining the second blockchain both meet the cross-chain transaction protocol;
[0020] The first verification module is used to call the on-chain business verification contract in the cross-chain transaction protocol, verify the legitimacy of the target cross-chain business according to the business description information, and obtain the business verification result;
[0021] The execution module is used to call the on-chain business execution contract in the cross-chain transaction protocol to execute the target cross-chain business and obtain the cross-chain transaction data if the business verification result indicates that the target cross-chain business is legal;
[0022] The first sending module is used to send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol; the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid, N is a positive integer greater than 1, and i is a positive integer less than or equal to N.
[0023] On the one hand, an embodiment of the present application provides a data processing device based on blockchain, including:
[0024] The second receiving module is used for the second node device associated with the second blockchain to receive the cross-chain transaction data sent by the cross-chain relay device i among the N cross-chain relay devices; the cross-chain transaction data is generated by the first node device when the target cross-chain business is determined to be legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and the target cross-chain business is executed, and is forwarded by the first node device to the N cross-chain relay devices; the cross-chain relay device i is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol, the target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N;
[0025] The verification module is used to verify the validity of the received cross-chain transaction data based on the on-chain business execution contract in the cross-chain transaction protocol and obtain the data verification result;
[0026] The data processing module is used to process the cross-chain transaction data when the data verification result indicates that the cross-chain transaction data is valid.
[0027] On the one hand, an embodiment of the present application provides a data processing device based on blockchain, including:
[0028] The third receiving module is used for the cross-chain relay device i among the N cross-chain relay devices to receive the cross-chain transaction data sent by the first node device; the cross-chain transaction data is generated by the first node device when it determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device, and the first node device and the second node device both meet the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N.
[0029] The second verification module is used to verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol;
[0030] The second sending module is used to send the cross-chain transaction data to the second node device if the cross-chain transaction data is valid; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
[0031] An embodiment of the present application provides a computer device, including: a processor and a memory;
[0032] The processor is connected to the memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.
[0033] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.
[0034] In one aspect, the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the present application.
[0035] In an embodiment of the present application, a cross-chain transaction protocol is provided, which includes an on-chain part and an off-chain part. The on-chain part includes an on-chain business verification contract (used to verify the legitimacy of the cross-chain business), an on-chain business execution contract (used to execute the cross-chain business), and the access conditions (i.e., risk control rules) for the node devices corresponding to the blockchain to join the cross-chain transaction; the off-chain part includes an off-chain data verification contract used by the cross-chain relay device to verify the validity of the cross-chain transaction data to be forwarded. Through these contracts in the cross-chain transaction protocol, cross-chain business processing can be automatically realized, improving the efficiency and security of cross-chain business processing. In actual applications, when the first node device receives a cross-chain transaction request sent by the business terminal, it calls the on-chain business verification contract in the cross-chain transaction protocol to verify the legitimacy of the target cross-chain business in the cross-chain transaction request. If the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business to obtain cross-chain transaction data. It can be seen that the legitimacy of the target cross-chain business is verified through the on-chain business verification contract. The target cross-chain business will only be executed when it is legitimate, which can effectively improve the security of cross-chain business processing.
[0036] Further, the first node device can send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol, and the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices and forwarding the valid cross-chain transaction data, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as a third-party cross-chain relay device forwarding and submitting the cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, by verifying the validity of the cross-chain transaction data by the cross-chain relay device, a large amount of book structure data on the first blockchain can be avoided from being sent to the second blockchain (for the second blockchain to verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain business processing costs and low efficiency, which can reduce the cross-chain business processing costs and improve the cross-chain business processing efficiency. The second node device processes the cross-chain transaction data only when it determines that the received cross-chain transaction data is valid, which can improve the security of the cross-chain transaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1a It is a schematic diagram of a blockchain structure provided by an embodiment of the present application;
[0039] Figure 1b This is a schematic diagram of block generation provided by an embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of a blockchain network hierarchical structure provided by an embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of the structure of a blockchain network applied to electronic bills provided in an embodiment of the present application;
[0042] Figure 4 This is a schematic diagram of an invoice application scenario of a blockchain-based data processing method provided in an embodiment of the present application;
[0043] Figure 5 This is a scenario diagram of a data processing method based on blockchain provided in an embodiment of the present application;
[0044] Figure 6 It is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application;
[0045] Figure 7 It is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application;
[0046] Figure 8 It is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application;
[0047] Fig. 9 It is a schematic diagram of a cross-chain transaction provided in an embodiment of the present application;
[0048] Fig.10 It is a structural schematic diagram of a blockchain-based data processing device provided in an embodiment of the present application;
[0049] Fig.11 It is a structural schematic diagram of a blockchain-based data processing device provided in an embodiment of the present application;
[0050] Fig.12 It is a structural schematic diagram of a blockchain-based data processing device provided in an embodiment of the present application;
[0051] Fig.13 It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer. Blockchain consists of multiple blocks, see Figure 1a , Figure 1a is a schematic diagram of a blockchain structure provided in an embodiment of the present application, such as Figure 1aAs shown, the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version numbers, timestamps, and difficulty values, and the block body stores input information. The next block of 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 input information feature values of the current block, feature values of the block header of the parent block, version numbers, timestamps, and difficulty values, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block.
[0054] When generating each block in the blockchain, see Figure 1b , Figure 1b It is a schematic diagram of a block generation provided by an embodiment of the present application. When the node receives the input information, it verifies the input information. After completing the verification, it stores the input information in the memory pool and updates the hash tree used to record the input information; afterwards, the update timestamp is updated to the time when the input information is received, and different random numbers are tried, and the characteristic value calculation is performed multiple times. Among them, when the calculation obtains a random number that meets the target, the information can be stored accordingly, the block header and the block body are generated, and the current block is obtained. Subsequently, the blockchain can broadcast the newly generated current block to the outside, that is, send the current block to other nodes in the data sharing system where it is located. Each node in the data sharing system stores the same blockchain, and other nodes verify the current block, and add the current block to the blockchain stored therein after completing the verification.
[0055] The underlying blockchain platform can include processing modules such as user management, basic services, and smart contracts. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the corresponding relationship between the user's real identity and the blockchain address (authority management), etc., and under authorization, it detects and audits the transaction of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests and record the valid requests to the storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management), and transmits it to the shared ledger in a complete and consistent manner after encryption (network communication), and records and stores it. The smart contract module is responsible for the registration and issuance of contracts, contract triggering, and contract execution. Developers can define the contract logic in a certain programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other event triggers the execution to complete the contract logic, and also provides the function of contract upgrade and cancellation. Among them, smart contracts can refer to computerized protocols that can execute the terms of a contract and are deployed on a shared ledger. Smart contracts are used to implement codes that are executed when certain conditions are met. According to actual business needs, the codes are used to complete automated transactions.
[0056] See also Figure 2 , Figure 2 This is a schematic diagram of a blockchain network hierarchical structure provided in an embodiment of the present application. The blockchain network hierarchical structure in the embodiment of the present application can be Figure 2 The blockchain network 1W shown in the figure can be represented by the complete blockchain business system corresponding to the blockchain network 1W. Figure 2 The business network shown, the core consensus network and the routing proxy network where the proxy node 10D is located are composed.
[0057] It should be understood that the number of nodes of the proxy node in the routing proxy network can be one or more, which is not limited here. The embodiment of the present application takes the proxy node 10D as an example, and the proxy node 10D can be used to isolate the business network from the core consensus network. The proxy node 10D can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, which are not limited here. The proxy node 10D can perform network stratification on the peer-to-peer (Peer To Peer, referred to as P2P) network to form a hierarchical structure such as "business network-core consensus network", which can improve the confidentiality and security of data on the blockchain.
[0058] in, Figure 2 The blockchain node system corresponding to the business network (i.e., witness network) shown may include one or more blockchain nodes, and the number of nodes in the blockchain node system corresponding to the business network will not be limited here. For example, the blockchain node system corresponding to the business network may specifically include node 110a, node 110b, node 110c, ..., node 110n. It should be understood that the blockchain node in the business network may be referred to as a business node in the embodiment of the present application. The business node does not need to participate in the bookkeeping consensus and is mainly used to execute transaction services to obtain transaction data associated with the transaction service. Among them, the business node here can be a full node containing a complete blockchain database, or it can be a lightweight node that stores part of the data in the blockchain database, which will not be limited here. In order to reduce the waste of storage space of the business node, the business node in the embodiment of the present application can take a lightweight node (Simplified Payment Verification, referred to as SPV) as an example. The business node does not need to store complete transaction data, but through the proxy node 10D, from Figure 2 In the core consensus network shown, block header data and partially authorized visible block data (e.g., transactions associated with the business node itself) are obtained.
[0059] in, Figure 2The blockchain node system corresponding to the core consensus network shown may also include one or more blockchain nodes, and the number of nodes in the blockchain node system corresponding to the core consensus network will not be limited here. For example, the blockchain node system corresponding to the core consensus network may specifically include node 120a, node 120b, node 120c, ..., node 120m. It should be understood that the embodiment of the present application may refer to the nodes in the core consensus network as consensus nodes (i.e., accounting nodes), and the consensus nodes may run a blockchain consensus protocol.
[0060] It should be understood that in the embodiment of the present application, the proxy node, the service node and the consensus node can be collectively referred to as the blockchain node in the blockchain network 1W. The blockchain node can be a server connected to the blockchain network 1W, or a user terminal connected to the blockchain network 1W. The specific form of the blockchain node is not limited here. It is understandable that Figure 2 The business network and core consensus network shown can be in different network environments. For example, generally speaking, business nodes are deployed in the business network on the public network, while consensus nodes running the blockchain consensus protocol are deployed in the private core consensus network. The two can interact through the routing boundary. Business nodes can be connected to the consensus network after meeting certain requirements, but because the consensus network is in a relatively secure private cloud, its mutual access is guaranteed by the consensus mechanism and has high security. Business nodes are in the public network and may be accessed by other uncertain network terminals. Therefore, the behavior of business nodes and other possible nodes accessing the consensus network needs to be strictly controlled.
[0061] like Figure 3 As shown, Figure 3 is a schematic diagram of a structure of a blockchain network applied to electronic bills provided in an embodiment of the present application, such as Figure 3 As shown, when Figure 2 When the blockchain network in the paper is applied to the scenario of electronic bills, the blockchain network can record the transaction data generated during the entire circulation process of the electronic bills, such as Figure 3As shown, the blockchain network includes a business network 31a, a core consensus network 32b and a routing proxy network 33c. Among them, the circulation process of electronic bills includes the application of electronic bills, the issuance of electronic bills, the reimbursement of electronic bills, and the tax declaration of electronic bills. Among them, the issuance of electronic bills is also called the generation of electronic bills. Since the roles involved in the circulation process of the entire electronic bill include management agencies, bill issuers, reimbursement parties, and tax return parties, the business network 31a includes a management agency private network 311a that provides relevant services for management agencies, and also includes a public cloud 312a that provides relevant services for bill issuers, reimbursement parties, and tax return parties. It also includes a private cloud 313a that provides electronic bill storage services for consumers. Among them, the management agency private network 311a includes computer equipment used by the management agency involved in the electronic bill, including a management agency terminal 3111a, and the management terminal can access the management agency private network 311a. The public cloud 312a includes computer equipment used by the invoice issuer, expense reimbursement and tax payer involved in the electronic invoice, including the invoice issuer terminal 3121a, the reimbursement party terminal 3122a and the tax payer terminal 3123a, wherein the invoice issuer may be an invoice service provider, the reimbursement party may be a reimbursement service provider, and the enterprise terminal may access the public cloud 312a. The private cloud 313a includes computer equipment used by users involved in the electronic invoice, including a payment terminal 3131a for payment, an electronic invoice circulation terminal 3132a for temporarily storing electronic invoices for users, and some enterprise-specific terminals 3133a, and the consumer terminal may access the private cloud 313a. The computer equipment in the management agency private network 311a, the public cloud 312a and the private cloud 313a can all be used as business nodes to send data uplink requests or data query requests for electronic invoices to the consensus network 33c through the routing layer 32b.
[0062] It is understandable that any routing node in the routing layer 32b includes functional modules that provide authentication services 321b, certificate cache 322b, routing services 323b, and P2P services 324b. The authentication service 321b is used to authenticate the business nodes in the business network 31a, the certificate cache 322b is used to cache the identity certificates of each node, the routing service 323b is used to achieve network isolation between the business network 31a and the consensus network 33c, and the P2P service 324b is used to allocate tasks between routing nodes, and the routing nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol that runs on the Transmission Control Protocol (TCP) protocol.
[0063] Among them, the consensus network 33c includes multiple consensus branch networks, such as blockchain network 1 331c, blockchain network 2 332c and blockchain network 3 333c, etc. Each consensus branch network includes multiple consensus nodes (i.e., consensus node devices), and multiple consensus nodes in each consensus branch network maintain the blockchain corresponding to the consensus branch network, such as the multiple formula nodes included in blockchain network 1 331c are used to maintain the blockchain 1 corresponding to blockchain network 1 331c. Among them, the functions of different blockchains in the consensus network 33c are different. For example, some blockchains are used to record transaction information related to electronic bills belonging to a certain bill number segment interval, and some blockchains are used to record transaction information related to red electronic bills. When it is necessary to record data related to electronic bills, the blockchain to be recorded can be determined according to the authority of the business node, and then recorded by the consensus branch network that maintains the blockchain. Consensus nodes can usually be computer devices used by management agencies in various regions.
[0064] The consensus node in each consensus branch network includes a permission contract, which stores the circulation logic of the entire life cycle of the electronic bill, such as the bill status, circulation process, data access rights, electronic bill application conditions, electronic bill issuance conditions, etc. The consensus node also includes cache and data blocks, which can provide support for the chaining and query of transaction information. It can be understood that this solution can realize cross-chain data transactions between different blockchains, such as Figure 3 The cross-chain data transactions between different blockchains in the business network shown, or the cross-chain data transactions between the blockchain in the business network and the blockchain in the official network, or the cross-chain data transactions between different blockchains in the official network.
[0065] Among them, the first blockchain network to which the first blockchain in the embodiment of the present application belongs can be the same as the second blockchain network to which the second blockchain belongs, that is, the present application can realize cross-chain communication between different blockchains in the same blockchain network. For example, the first blockchain and the second blockchain are both blockchains in the above-mentioned consensus network 33c, such as the first blockchain can be blockchain one, and the second blockchain is blockchain two. Of course, the blockchain network to which the first blockchain in the implementation of the present application belongs can be different from the blockchain network to which the second blockchain belongs, that is, the present application can realize cross-chain communication between different blockchains in different blockchain networks. For example, the first blockchain network to which the first blockchain belongs is the business network 31a, and the second blockchain network to which the second blockchain belongs is the consensus network 33c.
[0066] It should be noted that all node devices in the blockchain network involved in the embodiments of the present application can be mobile phones, tablet computers, laptops, PDAs, mobile Internet devices (MID, mobile internet device), vehicles, roadside equipment, aircraft, wearable devices, such as smart watches, smart bracelets, pedometers and other smart devices with data processing functions, and the device type corresponding to each node device can be the same or different.
[0067] It is understandable that the first blockchain in the embodiment of the present application may refer to Figure 3 Any blockchain in the consensus network 33c shown, such as the first blockchain, can be blockchain one 331c in the consensus network 33c, or it can refer to blockchain two 332c in the consensus network 33c, or it can refer to other blockchains in the consensus network 33c. Of course, the first blockchain in the embodiment of the present application can also refer to any blockchain in the business network. The second blockchain in the embodiment of the present application is different from the first blockchain. The blockchain network to which the first blockchain belongs can be different from or the same as the second blockchain network. For example, the first blockchain belongs to a blockchain in the consensus network, and the second blockchain belongs to a blockchain in the business network. Of course, the first blockchain and the second blockchain both belong to different blockchains in the consensus network. The second blockchain can also refer to Figure 3 Any blockchain in the consensus network 33c shown may also refer to any blockchain in the business network.
[0068] Specifically, the data processing method based on blockchain provided in the embodiment of the present application can be applied to various scenarios in the field of blockchain to realize cross-chain transactions between different blockchains in the field of blockchain. For example, the data processing method based on blockchain provided in the embodiment of the present application can be applied to on-chain asset transactions between different blockchains (such as asset transfer, asset locking or asset freezing, etc.), such as transferring assets on the first blockchain to the second blockchain. The data processing method based on blockchain provided in the embodiment of the present application can be applied to on-chain information sharing between different blockchains, such as sharing information on the first blockchain to the second blockchain. Of course, the data processing method based on blockchain provided in the embodiment of the present application can be applied to on-chain transaction transfer between different blockchains, such as transferring pending transactions on the first blockchain to the second blockchain to achieve performance expansion and reduce the burden on the first blockchain. Of course, it can also be applied to other application scenarios of cross-chain transactions, and the embodiment of the present application will not be repeated here.
[0069] See also Figure 4 , Figure 4 Schematic diagram of an invoice application scenario of a blockchain-based data processing method provided in an embodiment of the present application. Figure 4As shown, a blockchain-based data processing method in this application can be applied to invoice application scenarios. The invoice application scenario is a multi-chain architecture, such as management chain, invoice chain, application contract chain and sub-chain z1, etc. Each blockchain has a corresponding core chain (i.e., the blockchain in the consensus network) and a corresponding business node network (i.e., the knowledge network). Different chains can conduct cross-chain communication transactions through cross-chain transaction protocols. Figure 4 As shown, individuals and business organizations can submit their business transaction requests to the management chain through the business management department entrance. The management chain is deployed with a global management information contract for managing the relevant information of individual objects or business organizations (such as invoice information for individual objects or business organizations applying for opening). At the same time, the management chain includes business metadata management, which is used to manage the business description information of related businesses submitted to the management chain (such as business identification, business initiation object information, business initiation time, etc.). The full node of the management chain can store all the information of the business submitted on the management chain (such as block information about business submission), and the business management department can obtain the information recorded in the full node of the management chain.
[0070] like Figure 4 As shown, local invoice nodes d1, local invoice nodes d2, application invoice nodes, and subchain invoice nodes can submit business transaction requests to the invoice chain through the invoice business entrance. The invoice chain is deployed with global information cross-chain contracts, invoice authority clearing contracts, invoice node authority contracts, and invoice business contracts, all of which are used to process submitted business transaction requests. The full node of the invoice chain can store all information of the business submitted on the invoice chain, and the invoice data center can obtain the information recorded in the full node of the invoice chain. The application invoice node can submit business transaction requests to the application contract chain through the derivative business entrance. The application contract chain is deployed with global information cross-chain contracts, application node authority contracts, various business application contracts (including data clearing interfaces), and general data clearing contracts, all of which are used to process submitted business transaction requests. The full node of the application contract chain can store all information of the business submitted on the application contract chain, and the business collaboration department and business-related departments can obtain the information recorded in the full node of the application contract chain. The subchain invoice node can submit business transaction requests to the subchain z1 (or other subchains) through the derivative business entrance. The subchain z1 is deployed with a global information cross-chain contract, a subchain node permission contract, a dedicated business application contract (including a data clearing interface) and a general data clearing contract, all of which are used to process the submitted business transaction requests.
[0071] like Figure 4As shown, the management chain, invoice chain, application contract chain and subchain z1 can all conduct cross-chain transactions based on the cross-chain relay device through the cross-chain technology in this application. Specifically, taking the cross-chain transaction between the management chain and the invoice chain as an example, after the management chain executes the cross-chain transaction request submitted by the individual object, it can verify the legality of the target cross-chain business in the cross-chain transaction request, and execute the target cross-chain transaction business when the target cross-chain business is legal, and obtain the cross-chain transaction data. Furthermore, the cross-chain transaction data can be forwarded to the invoice chain through the cross-chain relay device. When the invoice chain determines that the cross-chain transaction data is valid, it processes the cross-chain transaction data to realize cross-chain transactions between different blockchains.
[0072] For further understanding, please refer to Figure 5 , Figure 5 Schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application. Figure 5 As shown, the first blockchain 512 belongs to the first blockchain network 510, the first blockchain 512 is composed of multiple blocks, the first blockchain network 510 to which the first blockchain 512 belongs can be the above-mentioned core consensus network, and the first blockchain 512 can be the blockchain 331c in the above-mentioned core consensus network. Figure 5 As shown, the second blockchain 532 belongs to the second blockchain network 530, and the second blockchain is also composed of multiple blocks. The second blockchain network 530 to which the second blockchain 532 belongs can also be the above-mentioned core consensus network, and the second blockchain 532 can be the blockchain 332c in the above-mentioned core consensus network. The first node device 511 can be any one of the one or more node devices in the first blockchain 512, and the second node device 531 can be any one of the one or more node devices in the second blockchain 532. The business terminal 500 can refer to a business node that maintains the first blockchain 512, or it can refer to a terminal device that has data communication with the first node device 511 (such as Figure 3 consumer terminals, enterprise terminals, etc.).
[0073] Among them, when the node devices in different blockchains need to conduct cross-chain transactions, they all need to meet the cross-chain transaction protocol. Meeting the cross-chain transaction protocol can mean jointly formulating a cross-chain transaction protocol or joining a cross-chain transaction protocol, and conducting cross-chain transactions based on the cross-chain transaction protocol. Among them, the cross-chain transaction protocol is a protocol for interaction and communication between different blockchains, which solves the problems of isolation and interoperability between blockchains and allows cross-chain transfer and exchange of data and assets between different blockchains. The cross-chain transaction protocol includes a series of technical and protocol specifications, including consensus algorithms, encryption technologies, smart contracts, and inter-chain communication protocols. When the node devices on different blockchains conduct cross-chain transactions, they need to comply with the rules of a series of technical and protocol specifications included in the cross-chain transaction protocol. Among them, the first node device 511 and the second node device 531 both meet the cross-chain transaction protocol, so that the first node device 511 maintaining the first blockchain 512 and the second node device 531 maintaining the second blockchain 532 can achieve cross-chain transactions.
[0074] like Figure 5 As shown, the business object 501 may refer to the object held or operated by the business terminal 500. The business object 501 may generate a cross-chain transaction request through the business terminal 500. The cross-chain transaction request includes the business description information of the target cross-chain business associated with the first blockchain and the second blockchain. The target cross-chain business may refer to a cross-chain asset transfer business (such as transferring digital assets on the first blockchain to the second blockchain), or a cross-chain information sharing business (such as sharing information on the first blockchain with the second blockchain), or a cross-chain transaction transfer business (such as transferring transactions on the first blockchain to the second blockchain to reduce the operating burden of the first blockchain). Among them, the business description information is the description information of the target cross-chain business. When the target cross-chain business is to transfer digital assets on the first blockchain to the second blockchain, the business description information of the target cross-chain business may include the asset transfer-out account, transfer-out asset amount, transfer-out asset type, second blockchain identifier, asset transfer-in account on the second blockchain, and the business identifier of the target cross-chain business. Further, the business terminal 500 may send the cross-chain transaction request initiated by the business object 501 to the first node device 511.
[0075] Specifically, the first node device 511 can call the on-chain business verification contract in the cross-chain transaction protocol. The on-chain business verification contract called by the first node device 511 can refer to a smart contract deployed on the first blockchain, which can be called by the node devices maintaining the first blockchain when conducting cross-chain transactions. The on-chain business verification contract is used to verify the legality of the target cross-chain business in the cross-chain transaction request to verify whether the target cross-chain business is a risky transaction (such as illegal asset transactions, leakage of important information (such as privacy), etc.). Further, the first node device 511 can verify the legality of the target cross-chain business based on the on-chain business verification contract and business description information, such as verifying whether the target cross-chain business is a risky transaction, and obtain a business verification result.
[0076] It is understandable that if the business verification result indicates that the target cross-chain business is not legitimate (i.e., the target cross-chain business is a risky transaction), the first node device 511 does not execute the target cross-chain business. If the business verification result indicates that the target cross-chain business is legitimate (i.e., the target cross-chain business is not a risky transaction), the first node device 511 can call the on-chain business execution contract in the cross-chain transaction protocol. The on-chain business execution contract called by the first node device 511 can be deployed as a smart contract on the first blockchain. The on-chain business execution contract can refer to a cross-chain bridge contract, which processes the received target cross-chain business based on the business processing rules agreed in the cross-chain bridge contract and the cross-chain communication protocol. It can be seen that the legitimacy of the target cross-chain business is verified through the on-chain business verification contract, and the target cross-chain business will only be executed when the target cross-chain business is legitimate, which can effectively improve the security of cross-chain transactions.
[0077] The first node device 511 can call the on-chain business execution contract, execute the target cross-chain business, and obtain cross-chain transaction data. For example, if the target cross-chain business is to transfer the digital assets on the first blockchain to the second blockchain, the first node device 511 can call the on-chain business execution contract, lock the assets specified by the target cross-chain business on the first blockchain, obtain the asset lock event that has locked the assets specified by the target cross-chain business on the first blockchain, and generate an asset release request for instructing the second blockchain to release the assets specified by the target cross-chain business to the asset transfer account on the second blockchain, and determine the asset lock event and the asset release request as the cross-chain transaction data of the target cross-chain business.
[0078] Furthermore, the first node device 511 may send the cross-chain transaction data to N cross-chain relay devices 520 associated with the cross-chain transaction protocol. Figure 5As shown, N cross-chain relay devices 520 include cross-chain relay device 521, cross-chain relay device 522, cross-chain relay device 523, ..., etc., and N is a positive integer greater than 1. It can be understood that the first node device 511 can send cross-chain transaction data to each cross-chain relay device in the N cross-chain relay devices 520, that is, the first node device 511 can send cross-chain transaction data to cross-chain relay device 521, send cross-chain transaction data to cross-chain relay device 522, send cross-chain transaction data to cross-chain relay device 523, etc. Of course, the first node device 511 can also lock the assets specified by the target cross-chain business through the on-chain business execution contract, and issue a business success submission event about the target cross-chain business. The N cross-chain relay devices can detect the cross-chain business execution contracts on each blockchain. When the N cross-chain relay devices detect the business success submission event issued by the first blockchain, the cross-chain transaction data of the target cross-chain business can be obtained from the first blockchain.
[0079] The cross-chain relay device i among the N cross-chain relay devices 520 obtains the off-chain data verification contract (such as the off-chain data verification rule) based on the cross-chain transaction protocol. The off-chain data verification contract is used to verify the validity of the cross-chain transaction data, that is, to verify the authenticity of the cross-chain transaction data. If the cross-chain transaction data includes an asset locking event, the cross-chain relay device i can verify whether the asset locking event is executed on the first blockchain. When it is determined that the cross-chain transaction data is valid, the cross-chain relay device i can forward and submit the cross-chain transaction data to the second blockchain (such as sending it to the second node device that maintains the second blockchain). Among them, the cross-chain relay device i belongs to any one of the N cross-chain relay devices 520, and i is a positive integer less than or equal to N. It can be understood that each cross-chain relay device among the N cross-chain relay devices 520 can verify the validity of the cross-chain transaction data sent by the first node device 511, and when it is determined that the cross-chain transaction data is valid, the cross-chain transaction data is forwarded and submitted to the second blockchain.
[0080] like Figure 5As shown, the cross-chain relay device 521 determines that the cross-chain transaction data is valid, and forwards the cross-chain transaction data to the second node device 531. The cross-chain relay device 522 determines that the cross-chain transaction data is not valid, and does not forward the cross-chain transaction data. The cross-chain relay device 523 determines that the cross-chain transaction data is valid, and forwards the cross-chain transaction data to the second node device 531, etc. In this way, other cross-chain relay devices in the N cross-chain relay devices 520 can also verify the validity of the cross-chain transaction data, and forward the cross-chain transaction data to the second node device 531 after determining that the cross-chain transaction data is valid. Among them, when the cross-chain relay device i forwards and submits the cross-chain transaction data to the second blockchain, it will sign the cross-chain transaction data and forward the signed cross-chain transaction data to the second blockchain. It can be understood that the behavior of the cross-chain relay device i forwarding and submitting the signed cross-chain transaction data to the second blockchain can be understood as a voting behavior for the cross-chain transaction data (i.e., determining that the cross-chain transaction data is valid). When the cross-chain relay device i determines that the cross-chain transaction data is not valid (such as the cross-chain transaction data is not authentic), the cross-chain transaction data will not be forwarded and submitted to the second blockchain. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward the cross-chain transaction data (such as the third-party cross-chain relay device forwarding the cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, the verification of the validity of the cross-chain transaction data by the cross-chain relay device can avoid sending a large amount of ledger structure data on the first blockchain to the second blockchain (so that the second blockchain can verify the validity of the cross-chain transaction data based on a large amount of ledger structure data), resulting in high cross-chain transaction costs and low efficiency.
[0081] like Figure 5As shown, the second node device 531 can receive the cross-chain transaction data forwarded by the cross-chain relay device i, and the cross-chain relay device i can refer to the cross-chain relay device 521, the cross-chain relay device 523, etc. The second node device 531 counts the number of devices of the cross-chain devices that send the cross-chain transaction data, and obtains the relay number threshold configured in the cross-chain business execution contract in the cross-chain transaction protocol. Further, the second node device 531 can verify the validity of the cross-chain transaction data based on the number of devices of the cross-chain devices that send the cross-chain transaction data and the relay number threshold. Specifically, the second node device 531 can compare the number of devices of the cross-chain devices that send the cross-chain transaction data and the relay number threshold. If the number of devices is greater than or equal to the relay number threshold, it means that most of the cross-chain relay devices determine that the cross-chain transaction data is valid, then the cross-chain transaction data is determined to be valid, and the cross-chain transaction data is executed. If the number of devices is less than the relay number threshold, it means that most of the cross-chain relay devices determine that the cross-chain transaction data is not valid, then the cross-chain transaction data is determined to be not valid, and the cross-chain transaction data is not executed.
[0082] For example, the number of N cross-chain relay devices is 5, and the relay number threshold is 5. If the second node device 531 receives cross-chain transaction data sent by 5 or more cross-chain relay devices, it can be determined that the cross-chain transaction is valid. If the second node device 531 receives cross-chain transaction data sent by 3 or less cross-chain relay devices, it can be determined that the cross-chain transaction is not valid. In this way, by determining the validity of cross-chain transaction data based on the number of cross-chain relay devices that send cross-chain transaction data, decentralization can be achieved to avoid the risk of centralized malicious behavior by third-party cross-chain relay devices (such as third-party cross-chain relay devices forwarding and submitting cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid).
[0083] It can be seen that the embodiment of the present application can effectively improve the security of cross-chain transactions by verifying the legality of the target cross-chain business through the on-chain business verification contract, and only when the target cross-chain business is legal will the target cross-chain business be executed. At the same time, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices, decentralization can be achieved to avoid the risk of centralized evil by third-party cross-chain relay devices (such as third-party cross-chain relay devices forwarding cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, the efficiency of cross-chain transactions can also be improved to avoid sending a large amount of ledger structure data on the first blockchain to the second blockchain (so that the second blockchain verifies the validity of the cross-chain transaction data based on a large amount of ledger structure data), resulting in high cross-chain transaction costs and low efficiency.
[0084] For further information, see Figure 6 , Figure 6 Schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application. Figure 6 As shown, the method can be executed by the first node device maintaining the first blockchain in the blockchain network. The blockchain network can refer to the core consensus network mentioned above, or the business network mentioned above, or other blockchain networks. The embodiment of the present application is not limited here. The first node device can be a server connected to the blockchain network, or a terminal device connected to the blockchain network. The first node device can refer to any node device in the node device maintaining the first blockchain. The specific form of the first node device is not limited here. The method can at least include but is not limited to the following steps:
[0085] S101, a first node device associated with a first blockchain receives a cross-chain transaction request sent by a business terminal.
[0086] Specifically, the first node device associated with the first blockchain may refer to a node device that maintains the first blockchain. It can be understood that the first blockchain is composed of one or more blocks, and the first node device may refer to a device that generates blocks and links the generated blocks to the first blockchain. Among them, the first blockchain may belong to the first blockchain network, and the first blockchain network may refer to the above Figure 3 The core consensus network in Figure 3 The business network in the above may also refer to other blockchain networks. The business terminal may refer to a business node device that maintains the first blockchain, or may refer to a terminal device that has data communication with the node device that maintains the first blockchain. The cross-chain transaction request includes business description information of the target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device that maintains the second blockchain both meet the cross-chain transaction protocol.
[0087] Among them, when node devices in different blockchains need to conduct cross-chain transactions, they all need to meet the cross-chain transaction protocol. Meeting the cross-chain transaction protocol can mean jointly formulating the cross-chain transaction protocol, those who agree to the cross-chain transaction protocol join the cross-chain transaction protocol, and conduct cross-chain transactions based on the cross-chain transaction protocol. Among them, the cross-chain transaction protocol is a protocol for interaction and communication between different blockchains, which solves the problems of isolation and interoperability between blockchains and allows cross-chain transfer and exchange of data and assets between different blockchains. The cross-chain transaction protocol includes a series of technical and protocol specifications, including consensus algorithms, encryption technologies, smart contracts, and inter-chain communication protocols. When node devices on different blockchains conduct cross-chain transactions, they need to comply with the rules of a series of technical and protocol specifications included in the cross-chain transaction protocol.
[0088] It is understandable that the target cross-chain business is a cross-chain business between the first blockchain and the second blockchain. For example, when the target cross-chain business is to transfer digital assets on the first blockchain to the second blockchain, the business description information of the target cross-chain business may include the asset transfer-out account (first account) on the first blockchain, the amount of transferred assets, the type of transferred assets, the second blockchain identifier, the asset transfer-in account (second account) on the second blockchain, the business identifier of the target cross-chain business, etc. For example, when the target cross-chain business is to share the status information on the first blockchain with the second blockchain, the business description information of the target cross-chain business may include the information attributes of the status information (such as whose status information, such as the asset status information of a digital asset on the first blockchain, such as unlocked status or locked status), the second blockchain identifier, and the business identifier of the target cross-chain business, etc.
[0089] Specifically, the business object associated with the business terminal can initiate a cross-chain transaction request for the association between the first blockchain and the second blockchain through the cross-chain service front end provided in the business terminal. Among them, the business object associated with the business terminal can refer to the holding object or operation object of the business terminal device, and the cross-chain service front end provided in the business terminal can be an application client, which is responsible for interacting with the cross-chain object (such as the business object), such as the cross-chain service front end can be a web page, an application (i.e., APP, Application), a small program, etc. The business object can initiate a cross-chain transaction request for the association between the first blockchain and the second blockchain in the cross-chain transaction page provided by the cross-chain service front end. The cross-chain service front end can send the cross-chain transaction request initiated by the business object to the cross-chain service back end, and the cross-chain service back end can assemble the cross-chain transaction request for the transaction and send it to the first blockchain, and the first node device maintaining the first blockchain can obtain the cross-chain transaction request. At the same time, the cross-chain service back end can obtain the execution status or other information of the target cross-chain transaction, return the execution status or other information about the target cross-chain transaction to the cross-chain service front end, and the cross-chain service front end can display the execution status or other information of the target cross-chain transaction. Among them, the cross-chain service backend is a background server, which is mainly used to provide data and blockchain transaction function support for the cross-chain service frontend.
[0090] S102, calling the on-chain business verification contract in the cross-chain transaction protocol, verifying the legitimacy of the target cross-chain business according to the business description information, and obtaining the business verification result.
[0091] The first node device can call the on-chain business verification contract in the cross-chain transaction protocol. The on-chain verification contract can refer to a smart contract deployed on the first blockchain. The on-chain business verification contract is used to verify the legitimacy of the cross-chain business to verify whether the cross-chain business is a risky transaction (such as illegal asset transactions, transactions that leak important information (such as privacy), etc.). Specifically, the first node device can call the on-chain business verification contract to verify the legitimacy of the target cross-chain business according to the business description information to obtain the business verification result. Among them, the business verification result includes that the target cross-chain business is legal, or that the target cross-chain business is not legal. It can be understood that the cross-chain business verification contract can verify the legitimacy of the cross-chain business submitted by the node device that maintains the blockchain, and is deployed and managed by the verification agency in the cross-chain transaction protocol, such as the verification agency setting the content of the on-chain business verification contract and managing the on-chain business verification contract. In this way, by verifying the legitimacy of the target cross-chain business through the on-chain business verification contract, the target cross-chain business that is not legal can be identified, which can effectively improve the security of cross-chain transaction execution.
[0092] Specifically, the first node device calls the on-chain business verification contract in the cross-chain transaction protocol, and verifies the legitimacy of the target cross-chain business according to the business description information. The specific method of obtaining the business verification result may include: calling the on-chain business verification contract in the cross-chain transaction protocol, and obtaining the first business attribute information used to reflect the business type of the target cross-chain business from the business description information, and the second business attribute information used to reflect the business risk of the target cross-chain business. According to the first business attribute information, determine the business verification type of the target cross-chain business, and verify the legitimacy of the target cross-chain business according to the business verification type and the second business attribute information to obtain the business verification result.
[0093] Specifically, the first node device can call the on-chain business verification contract in the cross-chain transaction protocol, and obtain the first business attribute information used to reflect the business type of the target cross-chain business from the business description information of the target cross-chain business. It can be understood that the on-chain business verification contract that the first node device can call can be a smart contract deployed on the first blockchain. It can be understood that the first business attribute information can be used to reflect the business type of the target cross-chain business. For example, when the target cross-chain business is to transfer digital assets on the first blockchain to the second blockchain, the business description information of the target cross-chain business can include the asset transfer account (first account) on the first blockchain, the amount of transferred assets, the type of transferred assets, the second blockchain identifier, the asset transfer account (second account) on the second blockchain, the business identifier of the target cross-chain business, etc. The first business attribute information may include information such as the asset transfer account, the amount of transferred assets, and the type of transferred assets. Specifically, the first node device can determine the business verification type of the target cross-chain business based on the first business attribute information. Specifically, the first node device can determine the business verification type of the target cross-chain business based on the asset transfer account, and the business verification type may include the on-chain business verification type and the off-chain business verification type.
[0094] Among them, the on-chain business verification type refers to the verification of the legitimacy of the target cross-chain business on the first blockchain, and the off-chain business verification type may refer to the verification of the legitimacy of the target cross-chain business through an off-chain business verification service (such as an off-chain business verification device). It can be understood that the on-chain business verification type refers to the first node device verifying the legitimacy of the target cross-chain business by calling the on-chain business verification contract. The off-chain business verification type may refer to the first node device sending the target cross-chain business to the off-chain business verification device through the on-chain business verification contract, and the off-chain business verification device instructs the business verification object to verify the legitimacy of the target cross-chain business. In other words, the off-chain business verification type may be a manual verification type. Since it is difficult to determine the legitimacy of the target cross-chain business by using the on-chain business verification type when the target cross-chain business is a specific cross-chain business, the accuracy of the legitimacy verification of the target cross-chain business can be improved by using the off-chain business verification type.
[0095] Optionally, when the target cross-chain business is a cross-chain asset transfer business, the first business attribute information may include the amount of transferred assets specified by the target cross-chain business (i.e., the amount of digital assets to be transferred), and the specific method for the first node device to determine the business verification type of the target cross-chain business based on the first business attribute information may include: the first node device may obtain the first asset amount threshold configured in the on-chain business verification contract, compare the amount of transferred assets with the first asset amount threshold, and if the amount of transferred assets is greater than or equal to the first asset amount threshold, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type. Since there is a risk of illegal transfer of assets when the amount of transferred assets is greater than or equal to the first asset amount threshold, the legitimacy of the target cross-chain business is verified by the off-chain business verification type, which can improve the security of cross-chain asset transfer. Of course, if the amount of transferred assets is less than the first asset amount threshold, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type, which can improve the efficiency of the legitimacy verification of the target cross-chain business.
[0096] Optionally, when the target cross-chain business is a cross-chain asset transfer business, the first business attribute information may include an asset transfer-out account, and the specific method for the first node device to determine the business verification type of the target cross-chain business based on the first business attribute information may include: the first node device may obtain the total asset amount corresponding to the asset transfer-out account, and obtain the second asset amount threshold configured in the on-chain business verification contract, compare the total asset amount of the asset transfer-out account with the second asset amount threshold, and if the total asset amount of the asset transfer-out account is greater than or equal to the asset amount threshold, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type. Since there is a risk of illegal transfer of assets when the total asset amount of the asset transfer-out account is greater than or equal to the asset amount threshold, the legitimacy of the target cross-chain business is verified by the off-chain business verification type, which can improve the security of cross-chain asset transfer. Of course, if the total asset amount of the asset transfer-out account is less than the asset amount threshold, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type, which can improve the efficiency of the legitimacy verification of the target cross-chain business.
[0097] Optionally, when the target cross-chain business is a cross-chain asset transfer business, the first business attribute information may include an asset transfer-out account, and the specific method for the first node device to determine the business verification type of the target cross-chain business based on the first business attribute information may include: the first node device may obtain the number of asset transfers corresponding to the asset transfer-out account, and obtain the transfer number threshold configured in the on-chain business verification contract, compare the number of asset transfers corresponding to the asset transfer-out account with the transfer number threshold, and if the number of asset transfers corresponding to the asset transfer-out account is greater than or equal to the transfer number threshold asset, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type. Since when the number of asset transfers corresponding to the asset transfer-out account is greater than or equal to the transfer number threshold asset, it means that the business object corresponding to the asset transfer account frequently transfers assets, and there is a risk of illegal transfer of assets, so the legitimacy of the target cross-chain business is verified by the off-chain business verification type, which can improve the security of cross-chain asset transfer. Of course, if the number of asset transfers corresponding to the asset transfer-out account is less than the transfer number threshold asset, then the business verification type of the target cross-chain business may be determined to be an off-chain business verification type, which can improve the efficiency of the legitimacy verification of the target cross-chain business.
[0098] Of course, the first node device can comprehensively determine the business verification type of the target cross-chain business based on the first business attribute information. For example, when the target cross-chain business is a cross-chain asset transfer business, the first node device can comprehensively determine the business verification type of the target cross-chain business based on information such as the asset transfer-out account, the amount of the transferred assets, and the type of the transferred assets. Further, the first node device can obtain the second business attribute information used to reflect the business risk of the target cross-chain business from the business description information. For example, when the business description information of the target cross-chain business includes information such as the asset transfer-out account (first account) on the first blockchain, the amount of the transferred assets, the type of the transferred assets, the second blockchain identifier, the asset transfer-in account (second account) on the second blockchain, and the business identifier of the target cross-chain business, the second business attribute information may include information such as the asset transfer-out account, the amount of the transferred assets, the type of the transferred assets, and the asset transfer-in account. The first node device can verify the legality of the target cross-chain business based on the business verification type and the second business attribute information to obtain a business verification result.
[0099] Optionally, the first node device verifies the legitimacy of the target cross-chain business according to the business verification type and the second business attribute information, and the specific method of obtaining the business verification result may include: if the business verification type is the on-chain business verification type, then calling the on-chain business verification contract, obtaining the terminal risk level of the business terminal according to the second business attribute information, and obtaining the data risk level of the business data specified by the target cross-chain business. If the terminal risk level is less than the first level threshold, and the data risk level is less than the second level threshold, then a business verification result indicating that the target cross-chain business is legitimate is generated.
[0100] Specifically, if the business verification type is an on-chain business verification type, the first node device can call the on-chain business verification contract to obtain the terminal risk level of the business terminal according to the second business attribute information. Specifically, the first node device can call the terminal identification list configured in the on-chain business verification contract, which includes one or more terminal identifications with higher risk levels (such as risk levels greater than or equal to the first level threshold), and detect whether the terminal identification of the business terminal belongs to the terminal identification list. If the terminal identification of the business terminal belongs to the terminal identification list, it is determined that the terminal risk level is higher (such as determining that the terminal risk level of the business terminal is greater than or equal to the first level threshold). If the terminal identification of the business terminal belongs to the terminal identification list, the historical transaction request submission record of the business terminal is obtained, and the terminal risk level of the business terminal is determined based on the historical transaction request record (such as whether there are multiple submissions of risky transaction requests (i.e., transaction requests that are not legitimate)). Of course, the first node device can obtain the processing authority of the business terminal for the target cross-chain business. For example, when the target cross-chain business is a cross-chain asset transfer business, it is detected whether the business object corresponding to the business terminal has the asset processing authority for the asset transfer account. If the business terminal does not have processing authority for the target cross-chain business, it is determined that the terminal risk level of the business terminal device is greater than or equal to the first level threshold.
[0101] At the same time, the first node device can obtain the data risk level of the business data specified by the target cross-chain business. The business data specified by the target cross-chain business can refer to the business subject. For example, when the target cross-chain business is a cross-chain asset transfer business, the business data specified by the target cross-chain business can be the digital assets that need to be transferred out; when the target cross-chain business is a cross-chain information sharing business, the business data specified by the target cross-chain business can be the information that needs to be transferred out, etc. The first node device obtains the data source of the business data specified by the target cross-chain business, and determines the data risk level of the business data specified by the target cross-chain business based on the data source. If the business data specified by the target cross-chain business is important information and cannot be transferred, it can be determined that the data risk level of the business data specified by the target cross-chain business is greater than or equal to the second level threshold. If the source of the business data specified by the target cross-chain business is abnormal (such as illegal assets, that is, assets that are not generated according to the normal asset production process), it can be determined that the data risk level of the business data specified by the target cross-chain business is greater than or equal to the second level threshold.
[0102] Furthermore, if the first node device determines that the terminal risk level is less than the first level threshold, and the data risk level is less than the second level threshold, a business verification result is generated to indicate that the target cross-chain business is legitimate. Of course, if the first node device determines that the terminal risk level is greater than or equal to the first level threshold, and the data risk level is greater than or equal to the second level threshold, a business verification result is generated to indicate that the target cross-chain business is not legitimate.
[0103] Optionally, the first node device verifies the legality of the target cross-chain business according to the business verification type and the second business attribute information, and the specific method of obtaining the business verification result may include: if the business verification type is the off-chain business verification type, then call the on-chain business verification contract and send the second business attribute information to the off-chain business verification device; the off-chain business verification device is used to instruct the business verification object to perform a verification operation on the target cross-chain business based on the second business attribute information. Receive the operation result of the verification operation returned by the off-chain business verification device, and generate the business verification result of the target cross-chain business according to the operation result.
[0104] Specifically, if the business verification type is an off-chain business verification type, the first node device can call the on-chain business verification contract and send the second business attribute information to the off-chain business verification device, which can be a server or a terminal device. The off-chain business verification device can instruct the business verification object to perform a verification operation on the target cross-chain business based on the second business attribute information, such as the off-chain business verification device can output the second business attribute information to instruct the business verification object to verify the legitimacy of the target cross-chain business. The off-chain business verification device can obtain the operation result of the business verification object performing the verification operation on the target cross-chain business, and the operation result can refer to the business object determining that the target cross-chain business is not legal, or that the target cross-chain business is legal. The off-chain business verification device can return the operation result to the on-chain business verification contract, and the on-chain business verification contract can generate a business verification result of the target cross-chain business based on the operation result. In this way, the business verification object verifies the legitimacy of the target cross-chain business, which can solve the situation where the on-chain business verification contract cannot verify the legitimacy of the target cross-chain business, and can also improve the accuracy of the verification.
[0105] S103: If the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business and obtain the cross-chain transaction data.
[0106] Specifically, if the business verification result indicates that the target cross-chain business is legal, the first node device calls the on-chain business execution contract in the cross-chain transaction protocol, executes the target cross-chain business, and obtains cross-chain transaction data. Among them, the on-chain business execution contract called by the first node device may refer to a smart contract deployed on the first blockchain, and the on-chain business execution contract may refer to a cross-chain bridge contract, which processes the received target cross-chain business based on the business processing rules agreed in the cross-chain bridge contract and the cross-chain communication protocol. It can be seen that the embodiment of the present application will only execute the target cross-chain business when the target cross-chain business is valid, which can improve the security of the execution of the cross-chain business and avoid the execution of illegal cross-chain business.
[0107] Optionally, taking the target cross-chain business as a cross-chain asset transfer business as an example, the target cross-chain business is used to indicate the transfer of digital assets of the target asset type, and the first node device calls the on-chain business execution contract in the cross-chain transaction protocol to execute the target cross-chain business. The specific method of obtaining cross-chain transaction data may include: if the business verification result indicates that the target cross-chain business is legal, then call the on-chain business execution contract in the cross-chain transaction protocol, and determine the asset custody contract that matches the target asset type from the asset custody contract set on the first blockchain as the first asset custody contract. From the asset processor set on the first blockchain, determine the asset processor that matches the target asset type as the first asset processor. According to the first asset custody contract and the first asset processor, execute the target cross-chain business to obtain cross-chain transaction data.
[0108] Specifically, if the first node device determines that the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol can be called to determine the asset custody contract that matches the target asset type from the asset custody contract set on the first blockchain as the first asset custody contract. It can be understood that the asset custody contract on the first blockchain can refer to a smart contract deployed on the first blockchain, which can automatically lock the specified digital asset or release the specified digital asset. Among them, the asset custody contract set on the first blockchain includes one or more asset custody contracts, such as the asset custody contract set on the first blockchain can include asset custody contract A1 and asset custody contract A2. Among them, an asset custody contract in the asset custody contract set on the first blockchain is used to lock a digital asset of one asset type, so that it is convenient to manage digital assets of different asset types.
[0109] Furthermore, the first node device can determine an asset processor that matches the target asset type from the asset processor set on the first blockchain as the first asset processor. The asset processor set on the first blockchain includes one or more asset processors, such as the asset processor set on the first blockchain may include asset processor B1 and asset processor B2. Each asset processor in the asset processor set is deployed with a cross-chain asset contract, and the asset processor can perform asset processing based on the cross-chain asset contract. An asset processor in the asset processor set on the first blockchain is used to process digital assets of one asset type, so that it is convenient to manage digital assets of different asset types. The first node device can execute the target cross-chain business according to the first asset custody contract and the first asset processor to obtain cross-chain transaction data.
[0110] Optionally, the digital asset of the target asset type belongs to the first account in the first blockchain, and the amount of the digital asset is the target asset amount, that is, the target cross-chain service is used to indicate that the digital asset with the target asset type and the target asset amount in the first account of the first blockchain is transferred to the second blockchain. The first node device executes the target cross-chain service according to the first asset custody contract and the first asset processor, and the specific method of obtaining the cross-chain transaction data may include: calling the first asset processor to lock the digital asset with the target asset type and the target asset amount in the first account to the first asset custody contract. Generate an asset lock event indicating that the digital asset with the target asset type and the target asset amount has been locked to the first asset custody contract. Generate an on-chain request for the asset lock event, and send the on-chain request to the consensus node of the first blockchain; the consensus node of the first blockchain is used to reach a consensus on the asset lock event and obtain a consensus result. Receive the consensus result returned by the consensus node of the first blockchain, and generate cross-chain transaction data about the target cross-chain service according to the consensus result.
[0111] Specifically, the first node device can call the first asset processor through the on-chain business execution contract to lock the digital assets with the target asset type and target asset amount in the first account into the first asset custody contract. It can be understood that the first asset custody contract includes a public account about the target asset type, and the first node device can transfer the digital assets with the target asset type and target asset amount in the first account to the public account about the target asset type in the first asset custody contract to lock the digital assets with the target asset type and target asset amount in the first account. It can be seen that when the target cross-chain business is a cross-chain asset transfer business, the digital assets to be transferred (such as the digital assets with the target asset type and target asset amount in the first account) can be locked into the asset custody contract on the first blockchain through the asset processor on the first blockchain. In this way, the cross-chain service provided by the on-chain business execution contract and the asset custody service provided by the asset custody contract can be realized to be independent of each other, and the on-chain business execution contract shall not arbitrarily operate the pledged assets of the target cross-chain business in the cross-chain process, further improving asset security. It is understandable that the existence of the asset custody contract makes the cross-chain service provider and the asset custodian independent. The cross-chain service shall not arbitrarily operate the pledged assets of the target cross-chain business during the cross-chain process, further improving asset security.
[0112] Further, the first node device may generate an asset lock event indicating that the digital asset with the target asset type and the target asset amount in the first account has been locked to the first asset custody contract. The first node device may generate an on-chain request for the asset lock event, and send the on-chain request to the consensus node of the first blockchain. The consensus node of the first blockchain may reach a consensus on the asset lock event to detect whether the asset lock event is valid (i.e., whether the first node device has locked the digital asset with the target asset type and the target asset amount in the first account to the first asset custody contract) to obtain a consensus result, and return the consensus result to the first node device. Specifically, the first node device may receive the consensus result returned by the consensus node of the first blockchain, and generate cross-chain transaction data about the target cross-chain business according to the consensus result.
[0113] Optionally, the target cross-chain business is also used to indicate that a digital asset having a target asset type and a target asset amount is transferred to a second account in the second blockchain. The specific manner in which the computer device generates cross-chain transaction data about the target cross-chain business based on the consensus result may include: if the consensus result indicates that the consensus of the asset locking event is successful, the asset locking event is chained to the first blockchain. Generate an asset release request, the asset release request is used to instruct the second node device to release the digital asset having the target asset type and the target asset amount from the second asset custody contract to the second account; the second asset custody contract is an asset custody contract associated with the target asset type on the second blockchain. The asset locking event and the asset release request are determined as cross-chain transaction data about the target cross-chain business.
[0114] Specifically, if the consensus result indicates that the consensus of the asset locking event is successful, the first node device can chain the asset locking event to the first blockchain. Specifically, the first node device can generate a target block for the asset locking event and add the target block to the first blockchain. At the same time, the first node device can generate an asset release request, which is used to instruct the second node device to release the digital asset with the target asset type and the target asset amount from the second asset custody contract to the second account. Among them, the second asset custody contract is an asset custody contract associated with the target asset type on the second blockchain. The asset locking event and the asset release request are determined as cross-chain transaction data about the target cross-chain business.
[0115] Among them, when the third node device maintaining the third blockchain receives an asset transfer service for transferring a digital asset with a target asset type on the third blockchain to the first blockchain, the third node device can verify the legitimacy of the asset transfer service. When the asset transfer service is legitimate, the third node device can lock the digital asset with the target asset type on the third blockchain through the asset depository contract associated with the target asset type and the asset processor on the third blockchain. At the same time, the third node device can generate a release request for instructing the first node device to release the digital asset with the target asset type to the first account. After the first node device receives the release request to release the digital asset with the target asset type to the first account, it can determine the asset depository contract that matches the target asset type from the asset depository contract set on the first blockchain, that is, the first asset depository contract, and determine the asset processor that matches the target asset type from the asset processor set on the first blockchain, that is, the first asset processor. Further, the digital asset with the target asset type is released from the first asset depository contract to the first account, that is, the digital asset with the target asset type is transferred from the public account in the first asset depository contract to the first account.
[0116] Optionally, the target cross-chain business may be a cross-chain information sharing business, a cross-chain transaction transfer business, etc. The first node device calls the on-chain cross-chain contract in the cross-chain transaction protocol to execute the target cross-chain business. The specific method of obtaining cross-chain transaction data about the target cross-chain business may include: if the business verification result indicates that the target cross-chain business is legal, and the target cross-chain business is a non-asset transaction type, then the on-chain business execution contract in the cross-chain transaction protocol is used to call the general message processor on the first blockchain. The business data specified by the target cross-chain business is obtained from the first blockchain through the general message processor, and the business data specified by the target cross-chain business is determined as the cross-chain transaction data about the target cross-chain business.
[0117] Specifically, if the business verification result indicates that the target cross-chain business is legitimate, and the target cross-chain business is a non-asset transaction type (such as the target cross-chain business is a cross-chain information sharing business, a cross-chain transaction transfer business, etc.), the first node device can call the general message processor on the first blockchain through the on-chain business execution contract in the cross-chain transaction protocol. The general message processor is deployed with a cross-chain application contract for processing cross-chain businesses of non-asset transaction types. The first node device can obtain the business data specified by the target cross-chain business from the first blockchain through the message processor. If the target cross-chain business is a cross-chain information sharing business, the business data specified by the target cross-chain business is the information to be shared, such as the status information of a certain asset (such as a locked state or an unlocked state), or the execution status information of a certain business (such as completed execution, being executed, or not executed, etc.). If the target cross-chain business is a cross-chain transaction transfer business, the business data specified by the target cross-chain business is the transaction to be transferred, that is, the transaction to be executed on the first blockchain can be transferred to other blockchains (such as the second blockchain). In this way, performance can be expanded and the burden of the first blockchain can be reduced. The first node device may determine the business data executed by the target cross-chain business as the cross-chain transaction data of the target cross-chain business.
[0118] S104, sending the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol.
[0119] Specifically, the first node device can send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol, where N is a positive integer greater than 1, and i is a positive integer less than or equal to N. It is understandable that the first node device can send the cross-chain transaction data to each cross-chain relay device in the N cross-chain relay devices. After receiving the cross-chain transaction data sent by the first node device, the cross-chain relay device i in the N cross-chain relay devices can obtain the off-chain data verification contract in the cross-chain transaction protocol (such as the off-chain data verification rules agreed in the cross-chain transaction protocol for the cross-chain relay device to perform cross-chain transaction data validity verification). Further, the cross-chain relay device i can verify the validity of the cross-chain transaction data based on the off-chain data verification contract to verify whether the first node device has locked the digital assets with the target asset type and the target asset amount in the first account on the first blockchain. If the cross-chain relay device i determines that the cross-chain transaction data is valid (that is, the first node device has locked the digital assets with the target asset type and the target asset amount in the first account on the first blockchain), the cross-chain transaction data is sent to the second node device.
[0120] Among them, the cross-chain relay device i belongs to any one of the N cross-chain relay devices. It can be understood that each of the N cross-chain relay devices verifies the validity of the cross-chain transaction data, and forwards the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid. Of course, when the cross-chain relay device determines that the cross-chain transaction data is not legitimate, it will not forward the cross-chain transaction data to the second node device. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as forwarding and submitting the cross-chain transaction data to the second node device when the third-party cross-chain transaction data is not valid, causing the second node device to execute risky cross-chain transaction data). At the same time, the efficiency of cross-chain transactions can also be improved, avoiding sending a large amount of book structure data on the first blockchain to the second blockchain (so that the second blockchain verifies the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain transaction costs and low efficiency.
[0121] Among them, the on-chain business execution contract in the cross-chain transaction protocol can add, delete, modify and check the identities of N cross-chain relay devices. Specifically, the on-chain business execution contract can manage the qualifications for joining N cross-chain relay devices. For example, device Q1 requests to join N cross-chain relay devices, and the on-chain business execution contract can review the qualifications of device Q1. When the device Q1 is reviewed and passed, device Q1 joins N cross-chain relay devices to verify the validity of cross-chain transaction data. Specifically, the on-chain business execution contract can delete unqualified cross-chain relay devices from N cross-chain relay devices (i.e., remove unqualified cross-chain relay devices from N cross-chain relay devices). For example, when cross-chain relay device j among N cross-chain relay devices repeatedly forwards cross-chain transaction data that does not have legality, it can be determined that cross-chain relay device j is unqualified, and the on-chain business execution contract can remove cross-chain relay device j from N cross-chain relay devices. Specifically, the on-chain business execution contract can modify the off-chain data verification contract used by the cross-chain relay device to verify the validity of the cross-chain transaction data, and can also query the historical cross-chain transaction data verification records in N cross-chain relay devices, the device status of the cross-chain relay device, and other information. At the same time, the on-chain business execution contract can manage the relay quantity threshold M for the cross-chain relay device. If M of the N cross-chain relay devices complete the voting on the cross-chain transaction data (i.e. forwarding the cross-chain transaction data), the cross-chain transaction data can be determined to be valid in the on-chain business execution contract of the second node device, and the cross-chain transaction data can be executed (i.e. the cross-chain transaction data is considered to have passed and continues to be executed).
[0122] Among them, the on-chain business execution contract on the first blockchain can record the business description information of the target cross-chain business. For example, when the target cross-chain business is a cross-chain asset transfer business, the on-chain business execution contract on the first blockchain can record the submitted business terminal (or the business object that initiates the cross-chain transaction request), the asset amount (that is, the asset amount of the digital asset to be transferred), the asset type (that is, the asset type of the digital asset to be transferred), the target chain identifier (the blockchain identifier of the digital asset to be transferred, such as the chain identifier of the second blockchain), the target user address (the account of the digital asset to be transferred), the transaction sequence number (that is, the business identifier of the target cross-chain business), etc.
[0123] Among them, the on-chain business execution contract on the second blockchain can record the voting situation of the target cross-chain business (i.e., the situation of the cross-chain relay device forwarding the cross-chain transaction data), and the status information of the target cross-chain business, and the status information of the target cross-chain business can include one or more of the inactive state, the active state, the passed state, the executing state, the completed execution state, the cancelled state, etc. Among them, the inactive state may mean that there is currently no cross-chain relay device voting on the cross-chain transaction data (i.e., forwarding the cross-chain transaction data to the second node device); the active state may mean that there is currently a cross-chain relay device voting on the cross-chain transaction data, the passed state means that there are currently cross-chain relay devices greater than or equal to the relay quantity threshold M voting on the cross-chain transaction data, the executing state may mean that the second node device is processing the cross-chain transaction data, the completed execution state may mean that the second node device has completed the execution of the cross-chain transaction data, and the cancelled state may mean that the second node device cancels the execution of the cross-chain transaction data.
[0124] The second node device can receive the cross-chain transaction data forwarded by the cross-chain relay device i, perform validity verification on the received cross-chain transaction data, and process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
[0125] In an embodiment of the present application, a cross-chain transaction protocol is provided, which includes an on-chain part and an off-chain part. The on-chain part includes an on-chain business verification contract (used to verify the legitimacy of the cross-chain business), an on-chain business execution contract (used to execute the cross-chain business), and the access conditions (i.e., risk control rules) for the node devices corresponding to the blockchain to join the cross-chain transaction; the off-chain part includes an off-chain data verification contract used by the cross-chain relay device to verify the validity of the cross-chain transaction data to be forwarded. Through these contracts in the cross-chain transaction protocol, cross-chain business processing can be automatically realized, improving the efficiency and security of cross-chain business processing. In actual applications, when the first node device receives a cross-chain transaction request sent by the business terminal, it calls the on-chain business verification contract in the cross-chain transaction protocol to verify the legitimacy of the target cross-chain business in the cross-chain transaction request. If the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business to obtain cross-chain transaction data. It can be seen that the legitimacy of the target cross-chain business is verified through the on-chain business verification contract. The target cross-chain business will only be executed when it is legitimate, which can effectively improve the security of cross-chain business processing.
[0126] Further, the first node device can send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol, and the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices and forwarding the valid cross-chain transaction data, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as a third-party cross-chain relay device forwarding and submitting the cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, by verifying the validity of the cross-chain transaction data by the cross-chain relay device, a large amount of book structure data on the first blockchain can be avoided from being sent to the second blockchain (for the second blockchain to verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain business processing costs and low efficiency, which can reduce the cross-chain business processing costs and improve the cross-chain business processing efficiency. The second node device processes the cross-chain transaction data only when it determines that the received cross-chain transaction data is valid, which can improve the security of the cross-chain transaction.
[0127] For further information, see Figure 7 , Figure 7 Schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application. Figure 7As shown, the method can be executed by a second node device maintaining a second blockchain in a blockchain network. The blockchain network can refer to the core consensus network mentioned above, or the business network mentioned above, or other blockchain networks. The embodiment of the present application is not limited here. The second node device can be a server connected to the blockchain network, or a terminal device connected to the blockchain network. The second point device can refer to any node device in the node device maintaining the second blockchain. The specific form of the second node device is not limited here. The method can at least include but is not limited to the following steps:
[0128] S201, the second node device associated with the second blockchain receives cross-chain transaction data sent by the cross-chain relay device i among N cross-chain relay devices.
[0129] Specifically, the second node device associated with the second blockchain can maintain the node device of the second blockchain, and the second node device can be any node device among the node devices maintaining the second blockchain. It can be understood that the second blockchain is composed of one or more blocks, and the second node device can refer to a device that generates a block and links the generated block to the second blockchain. Among them, the second blockchain can belong to the second blockchain network, and the second blockchain network can refer to the above Figure 3 The core consensus network in Figure 3 The business network in the above-mentioned first blockchain network may also refer to other blockchain networks. The first blockchain network may be the same as or different from the first blockchain network to which the first blockchain belongs. The second node devices all meet the cross-chain transaction protocol, that is, the cross-chain transaction protocol is deployed on the second blockchain, and the node devices maintaining the second blockchain can perform cross-chain transactions based on the cross-chain transaction protocol.
[0130] Among them, the cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to N cross-chain relay devices. The cross-chain relay device i is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as forwarding and submitting the cross-chain transaction data to the second node device when the third-party cross-chain transaction data is not valid, causing the second node device to execute risky cross-chain transaction data). At the same time, the efficiency of cross-chain transactions can also be improved, avoiding sending a large amount of book structure data on the first blockchain to the second blockchain (so that the second blockchain can verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain transaction costs and low efficiency. The target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device. Both the first node device and the second node device satisfy the cross-chain transaction protocol. N is an integer greater than 1, and i is an integer less than or equal to N. The specific content of the cross-chain transaction data in step S201 in the embodiment of the present application can be found in the above Figure 6 The contents of step S101 to step S104 in the present embodiment of the application will not be repeated here.
[0131] S202, based on the on-chain business execution contract in the cross-chain transaction protocol, verify the validity of the received cross-chain transaction data to obtain a data verification result.
[0132] Specifically, the second node device can verify the validity of the received cross-chain transaction data based on the on-chain business execution contract in the cross-chain transaction protocol to obtain a data verification result. The on-chain business execution contract called by the second node device may refer to a smart contract deployed on the second blockchain, and the node device maintaining the second blockchain calls the on-chain business execution contract deployed on the second blockchain to perform cross-chain transactions. The data verification result can be used to indicate that the received cross-chain transaction data is valid, or to indicate that the received cross-chain transaction data is not valid.
[0133] Optionally, the cross-chain transaction data includes an asset locking event reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked. The second node device verifies the cross-chain transaction data sent by M cross-chain relay devices based on the on-chain data verification contract in the cross-chain transaction protocol. The specific method may include: obtaining the relay quantity threshold configured by the on-chain business execution contract in the cross-chain transaction protocol, and counting the number of devices corresponding to the cross-chain relay device that sends the cross-chain transaction data. Compare the relay quantity threshold with the device quantity. If the device quantity is greater than or equal to the relay quantity threshold, it is determined that the asset locking event is valid, and a data verification result indicating that the cross-chain transaction data is valid is generated.
[0134] Specifically, the second node device obtains the relay quantity threshold configured by the on-chain business execution contract in the cross-chain transaction protocol. The relay quantity threshold can be determined based on N of the N cross-chain relay devices, such as the relay quantity threshold can be a threshold greater than N / 2 and less than or equal to N. For example, when the number of N cross-chain relay devices is 5, the relay quantity threshold can be 3, 4 or 5. The relay quantity threshold can be configured by the on-chain business execution contract in the cross-chain transaction protocol, and the on-chain business execution contract can manage the N cross-chain relay devices. The second node device can count the number of cross-chain relay devices that send cross-chain transaction data, and compare the relay quantity threshold with the number of devices. If the number of devices is greater than or equal to the relay quantity threshold, it means that the vast majority of cross-chain relay devices determine that the cross-chain transaction data is valid, then the asset locking event is determined to be valid, and a data verification result indicating that the cross-chain transaction data has been verified is generated. In this way, the second node device determines that the cross-chain transaction data is valid only when it determines that the number of devices is greater than or equal to the relay number threshold, which can achieve decentralization and avoid the risk of centralized malicious behavior when relying on third-party cross-chain relay devices to forward cross-chain transaction data (such as forwarding cross-chain transaction data to the second node device when the third-party cross-chain transaction data is not valid, causing the second node device to execute risky cross-chain transaction data).
[0135] Of course, if the number of devices is less than the relay number threshold, it means that most of the cross-chain relay devices have determined that the cross-chain transaction data is not valid, then the asset lock event is determined to be invalid, and a data verification result indicating that the cross-chain transaction data is not valid is generated. At this time, the second node device will not execute the cross-chain transaction data. In this way, the security of cross-chain transactions can be improved.
[0136] S203: When the data verification result indicates that the cross-chain transaction data is valid, the cross-chain transaction data is processed.
[0137] Specifically, when the data verification result indicates that the cross-chain transaction data is valid, the second node device can execute the cross-chain transaction data to realize the cross-chain transaction between the first blockchain and the second blockchain. At the same time, the cross-chain transaction data is only executed when it is determined that the cross-chain transaction data is valid, which can improve the security of the cross-chain transaction.
[0138] Optionally, when the data verification result indicates that the cross-chain transaction data has passed the verification, the specific manner in which the second node device processes the cross-chain transaction data may include: when the data verification result indicates that the cross-chain transaction data is valid, calling the on-chain business verification contract in the cross-chain transaction protocol to determine the data verification type of the cross-chain transaction data. Verifying the data processing risk of the cross-chain transaction data according to the data verification type to obtain a risk verification result. When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, processing the cross-chain transaction data.
[0139] Specifically, when the data verification result indicates that the cross-chain transaction data is valid, the second node device can call the on-chain business verification contract in the cross-chain transaction protocol. The on-chain business verification contract called by the second node device can refer to the smart contract deployed on the second blockchain. The node devices that maintain the second blockchain can all call the on-chain business verification contract to verify whether the business or data is risky (i.e., whether it is legal). Among them, the on-chain business verification contract can be deployed in different blockchains that need to conduct cross-chain transactions to verify whether the business or data is risky (i.e., whether it is legal). The second node device can call the on-chain business verification contract in the cross-chain transaction protocol to determine the data verification type of the cross-chain transaction data.
[0140] Among them, the data verification type can be an on-chain data verification type and an off-chain data verification type. The on-chain data verification type refers to verifying the data risk of cross-chain transaction data through an on-chain business verification contract, and the off-chain data verification type may refer to sending the cross-chain transaction data to an off-chain business verification device through an on-chain business verification contract, and the off-chain business verification device instructs the business verification object to verify the data risk of the cross-chain transaction data (such as manual verification). The second node device can verify the data risk of the cross-chain transaction data based on the data verification type, obtain the risk verification result, and process the cross-chain transaction data when the risk verification result indicates that the cross-chain transaction data does not belong to risk data. In this way, the security of cross-chain transaction data processing can be improved.
[0141] For example, the cross-chain transaction data includes an asset release request, which is used to instruct the second node device to release the digital asset with the target asset type and the target asset amount to the second account in the second blockchain. The second node device can detect whether the second account belongs to the illegal account set. If the second account belongs to the illegal account set, it can be determined that the cross-chain transaction data belongs to risk data and the cross-chain transaction data is not processed. Alternatively, the second node device can obtain the owner of the second account, detect the object risk level of the owner based on the transaction record of the owner, and if the object risk level of the owner is greater than or equal to the third risk level, it can be determined that the cross-chain transaction data belongs to risk data and the cross-chain transaction data is not processed.
[0142] Optionally, the cross-chain transaction data includes an asset release request, and the asset release request is used to instruct the second node device to release the digital asset with the target asset type and the target asset amount to the second account in the second blockchain. When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, the specific method for the second node device to process the cross-chain transaction data may include: when the risk verification result indicates that the cross-chain transaction data does not belong to risk data, determine the asset custody contract that matches the target asset type from the asset custody contract set on the second blockchain as the second asset custody contract. Determine the asset processor that matches the target asset type from the asset processor set on the second blockchain as the second asset processor. Call the second asset processor to release the digital asset with the target asset type and the target asset amount from the second asset custody contract to the second account.
[0143] Specifically, when the risk verification result indicates that the cross-chain transaction data does not belong to risk data, the second node device can determine the asset custody contract that matches the target asset type from the asset custody contract set on the second blockchain as the second asset custody contract. Similarly, the asset custody contract on the second blockchain can refer to a smart contract deployed on the second blockchain, which can automatically lock the specified digital asset or release the specified digital asset. Among them, the asset custody contract set on the second blockchain includes one or more asset custody contracts, such as the asset custody contract set on the second blockchain can include asset custody contract A3 and asset custody contract A4. Among them, one asset custody contract in the asset custody contract set on the second blockchain is used to lock a digital asset of an asset type, so that it is convenient to manage digital assets of different asset types. Among them, the asset custody contract set on the first blockchain and the asset custody contract set on the second blockchain both belong to the cross-chain transaction protocol (such as configured in the cross-chain transaction protocol), and the asset custody contract set on the first blockchain and the asset custody contract set on the second blockchain can be the same or different (such as different compilation formats).
[0144] Further, the second node device can determine an asset processor that matches the target asset type from the asset processor set on the second blockchain as the second asset processor. Similarly, the asset processor set on the second blockchain includes one or more asset processors, such as the asset processor set on the second blockchain may include asset processor B3 and asset processor B4. Among them, each asset processor in the asset processor set is deployed with a cross-chain asset contract, and the asset processor can perform asset processing based on the cross-chain asset contract. Among them, an asset processor in the asset processor set on the second blockchain is used to process a digital asset of an asset type, so that it is convenient to manage digital assets of different asset types. Similarly, the asset processor set on the first blockchain and the asset processor set on the second blockchain both belong to the cross-chain transaction protocol (such as configured in the cross-chain transaction protocol), and the asset processor set on the first blockchain and the asset processor set on the second blockchain can be the same or different (such as different compilation formats).
[0145] Specifically, the second node device can call the second asset processor to release the digital asset with the target asset type and the target asset amount from the second asset custody contract to the second account. It can be understood that there is a public account in the second asset custody contract, and the second node device can call the second asset processor to transfer the digital asset with the target asset type and the target asset amount in the public account in the second asset custody contract to the second account. It can be seen that the digital asset is locked in the asset custody contract on the second blockchain. In this way, the cross-chain service provided by the on-chain business execution contract and the asset custody service provided by the asset custody contract can be made independent. The on-chain business execution contract shall not arbitrarily operate the pledged assets of the target cross-chain business in the cross-chain process, further improving asset security. It can be understood that the existence of the asset custody contract makes the cross-chain service provider and the asset custodian independent, and the cross-chain service shall not arbitrarily operate the pledged assets of the target cross-chain business in the cross-chain process, further improving asset security.
[0146] Specifically, when the cross-chain transaction data is the business data specified by the target cross-chain business, the second node device can process the business data. If the business data is a pending transaction, the second node device can process the pending transaction; if the business data is the status information of an asset, the second node device can process the business based on the status information of the asset.
[0147] In an embodiment of the present application, a cross-chain transaction protocol is provided, which includes an on-chain part and an off-chain part. The on-chain part includes an on-chain business verification contract (used to verify the legitimacy of the cross-chain business), an on-chain business execution contract (used to execute the cross-chain business), and the access conditions (i.e., risk control rules) for the node devices corresponding to the blockchain to join the cross-chain transaction; the off-chain part includes an off-chain data verification contract used by the cross-chain relay device to verify the validity of the cross-chain transaction data to be forwarded. Through these contracts in the cross-chain transaction protocol, cross-chain business processing can be automatically realized, improving the efficiency and security of cross-chain business processing. In actual applications, when the first node device receives a cross-chain transaction request sent by the business terminal, it calls the on-chain business verification contract in the cross-chain transaction protocol to verify the legitimacy of the target cross-chain business in the cross-chain transaction request. If the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business to obtain cross-chain transaction data. It can be seen that the legitimacy of the target cross-chain business is verified through the on-chain business verification contract. The target cross-chain business will only be executed when it is legitimate, which can effectively improve the security of cross-chain business processing.
[0148] Further, the first node device can send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol, and the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices and forwarding the valid cross-chain transaction data, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as a third-party cross-chain relay device forwarding and submitting the cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, by verifying the validity of the cross-chain transaction data by the cross-chain relay device, a large amount of book structure data on the first blockchain can be avoided from being sent to the second blockchain (for the second blockchain to verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain business processing costs and low efficiency, which can reduce the cross-chain business processing costs and improve the cross-chain business processing efficiency. The second node device processes the cross-chain transaction data only when it determines that the received cross-chain transaction data is valid, which can improve the security of cross-chain transactions. At the same time, the cross-chain service provided by the on-chain business execution contract and the asset custody service provided by the asset custody contract can be made independent. The on-chain business execution contract shall not arbitrarily operate the pledged assets of the target cross-chain business during the cross-chain process, further improving asset security. It can be understood that the existence of the asset custody contract makes the cross-chain service provider and the asset custodian independent, and the cross-chain service shall not arbitrarily operate the pledged assets of the target cross-chain business during the cross-chain process, further improving asset security.
[0149] For further information, see Figure 8 , Figure 8 Schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application. Figure 8 As shown, the method can be executed by a cross-chain relay device i, which can be any one of N cross-chain relay devices, and can be a server or a terminal device. The specific form of the cross-chain relay device i is not limited here. The method can at least include but is not limited to the following steps:
[0150] S301, a cross-chain relay device i among N cross-chain relay devices receives cross-chain transaction data sent by the first node device.
[0151] Specifically, the cross-chain relay device i among the N cross-chain relay devices can receive the cross-chain transaction data sent by the first node device. The cross-chain transaction data is generated by the first node device when it determines that the target cross-chain business is legal based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices. The target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device. Both the first node device and the second node device satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N. Among them, each cross-chain relay device has its own independent relayer identity (that is, its own address and private key), and independently votes for the detected cross-chain transaction data (that is, forwarding the cross-chain transaction data after determining that the cross-chain transaction data is valid). The specific process of obtaining cross-chain transaction data can refer to the above Figure 6 The contents of step S101 to step S104 are not repeated here in the embodiment of the present application.
[0152] S302, verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol.
[0153] Specifically, the cross-chain relay device i can verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol, that is, verify the authenticity of the cross-chain transaction data. Among them, the off-chain data verification contract can refer to the off-chain data verification rules agreed in the cross-chain transaction protocol for the cross-chain relay device to verify the validity of the cross-chain transaction data, which is used to verify the validity of the cross-chain transaction data, that is, to verify the authenticity of the cross-chain transaction data. For example, if the cross-chain transaction data includes an asset locking event, the cross-chain relay device i can verify whether the asset locking event has been executed on the first blockchain. It can be understood that the cross-chain relay device i can independently verify the validity of the cross-chain transaction data. In this way, by N cross-chain relay devices independently verifying the validity of the cross-chain transaction data, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as forwarding and submitting the cross-chain transaction data to the second node device when the third-party cross-chain transaction data is not valid, causing the second node device to execute risky cross-chain transaction data). At the same time, by verifying the validity of cross-chain transaction data through the cross-chain relay device i, the efficiency of cross-chain transactions can also be improved, avoiding sending a large amount of ledger structure data on the first blockchain to the second blockchain (so that the second blockchain can verify the validity of the cross-chain transaction data based on a large amount of ledger structure data), resulting in higher cross-chain transaction costs and lower efficiency.
[0154] Optionally, the cross-chain transaction data includes an asset locking event reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked. The cross-chain relay device i verifies the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol in a specific manner including: obtaining an event identifier of the asset locking event, and detecting a target block containing the event identifier from the first blockchain. If a target block containing the event identifier is detected on the first blockchain, it is determined that the cross-chain transaction data is valid.
[0155] The cross-chain relay device i can obtain the event identifier of the asset locking event, and detect the target block containing the event identifier from the first blockchain. If the target block containing the event identifier is detected on the first blockchain, it means that the first node device maintaining the first blockchain has locked the digital asset with the target asset type and the target asset amount in the first account of the first blockchain, and then it is determined that the cross-chain transaction data is valid. If the target block containing the event identifier is not detected on the first blockchain, it means that the first node device maintaining the first blockchain has not locked the digital asset with the target asset type and the target asset amount in the first account of the first blockchain, and then it is determined that the cross-chain transaction data is not valid. It can be seen that by verifying the validity of the cross-chain transaction data through the cross-chain relay device i, the efficiency of the cross-chain transaction can also be improved, and a large amount of book structure data on the first blockchain can be avoided from being sent to the second blockchain (so that the second blockchain can verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain transaction costs and low efficiency.
[0156] S303: If the cross-chain transaction data is valid, the cross-chain transaction data is sent to the second node device.
[0157] Specifically, when the second node device determines that the received cross-chain transaction data is valid, it processes the cross-chain transaction data. The specific content of the second node device processing the cross-chain transaction data can be found in the above Figure 7 The contents of step S201 to step S203 in the present embodiment of the application will not be repeated here.
[0158] like Fig. 9 As shown, Fig. 9 is a schematic diagram of a cross-chain transaction provided by an embodiment of the present application, such as Fig. 9As shown, the business object can send a cross-chain transaction request for the first blockchain and the second blockchain through the cross-chain service front end in the business terminal. The cross-chain transaction request includes the target cross-chain business, including asset locking authorization and cross-chain asset transfer request (i.e., asset release request) on the first blockchain. The business object can initiate a cross-chain asset transfer request in the object account of the cross-chain service front end, and the cross-chain asset transfer request can be used to indicate that the digital assets on the first blockchain where the object account is located are transferred to the second blockchain. Among them, the cross-chain service front end can be an application client, responsible for interacting with the cross-chain object (such as a business object), such as the cross-chain service front end can be in the form of a web page, an application (i.e., APP, Application), a mini program, etc. The cross-chain service back end can assemble the cross-chain transaction request and send it to the first blockchain, and the first node device maintaining the first blockchain can obtain the cross-chain transaction request. At the same time, the cross-chain service back end can obtain the execution status or other information of the target cross-chain transaction, return the execution status or other information about the target cross-chain transaction to the cross-chain service front end, and the cross-chain service front end can display the execution status or other information of the target cross-chain transaction. Among them, the cross-chain service backend can be a background server, which is mainly used to provide data and blockchain transaction function support for the cross-chain service frontend.
[0159] Among them, the first blockchain is deployed with a cross-chain bridge contract, an on-chain business verification contract, an asset custody contract, a cross-chain asset contract, and a cross-chain application contract. Among them, the cross-chain bridge contract is an on-chain business execution contract on the first blockchain, and the cross-chain bridge contract includes a business verification management function, a relay multi-signature management function, and a cross-chain business management function. Among them, the business verification management function can be connected with the on-chain business verification contract on the first blockchain to manage the call to the on-chain business verification contract during the submission and execution of the cross-chain business to ensure the controllability of the target cross-chain business, that is, when the target cross-chain business is not legitimate, the target cross-chain business may not be executed, and when the target cross-chain business is an asset transfer business, the assets specified by the target cross-chain business may be frozen. Only when the target cross-chain business is legitimate, the target cross-chain business is executed to ensure the security of cross-chain transactions. Among them, the relay multi-signature management function refers to the addition, deletion, modification and query of the identities of N cross-chain relay devices in the cross-chain relay service of the cross-chain bridge contract, as well as the setting of the relay quantity threshold. If M of the N cross-chain relay devices complete the voting on the cross-chain transaction data (i.e. forwarding the cross-chain transaction data), then the cross-chain transaction data can be determined to be valid in the on-chain business execution contract of the second node device, and the cross-chain transaction data can be executed (i.e. the cross-chain transaction data is considered to have passed and continues to be executed). The cross-chain business management function can refer to the relevant process of executing the target cross-chain business. Among them, the on-chain business verification contract can manage the asset custody contract, such as the deployment of the asset custody contract, the binding with the asset type or cross-chain transaction type, and the authority allocation of the operator of the asset custody contract.
[0160] Specifically, the first node device maintaining the first blockchain can receive the target cross-chain business in the cross-chain transaction request through the cross-chain bridge contract, and can call the on-chain business verification contract through the cross-chain bridge contract to verify the legitimacy of the target cross-chain business. Taking the target cross-chain business as transferring the digital assets with the target asset type and the target asset amount in the first account on the first blockchain to the second account on the second blockchain as an example, when the cross-chain bridge contract determines that the target cross-chain business is legitimate, it can obtain the asset custody contract that matches the target asset type from the asset custody contract set on the first blockchain as the first asset custody contract. The first node device can obtain the asset processor that matches the target asset type from the asset processor set on the first blockchain through the cross-chain bridge contract as the first asset processor. Among them, the asset processor can lock the digital assets of the corresponding asset type into the corresponding asset custody contract through the cross-chain asset contract, or release the digital assets in the corresponding asset custody contract. The first asset custody contract address is used as a parameter to call the first asset processor. The digital assets with the target asset type and the target asset amount in the first account are locked into the first asset custody contract through the first asset processor. In this way, the cross-chain service provided by the on-chain business execution contract and the asset custody service provided by the asset custody contract can be made independent. The on-chain business execution contract shall not arbitrarily operate the pledged assets of the target cross-chain business during the cross-chain process, further improving asset security. It can be understood that the existence of the asset custody contract makes the cross-chain service provider and the asset custodian independent, and the cross-chain service shall not arbitrarily operate the pledged assets of the target cross-chain business during the cross-chain process, further improving asset security.
[0161] Among them, the on-chain business verification contract can determine the business verification type of the target cross-chain business. If the business verification type is the on-chain business verification type, the on-chain business verification contract verifies the legality of the target cross-chain business. If the business verification type is the off-chain business verification type, the on-chain business verification contract sends the target cross-chain business to the off-chain verification service, and the off-chain business verification device in the off-chain verification service instructs the business verification object to verify the legality of the target cross-chain business. Among them, the off-chain verification service can include multi-chain detection function, cross-chain verification function and cross-chain risk management function. The multi-chain detection function refers to detecting the on-chain business verification contracts on each blockchain and obtaining the verification tasks that need to be verified for legality. Cross-chain verification refers to the verification of the obtained verification business. The cross-chain risk management function refers to the management of cross-chain risk business. The off-chain verification service has the authority to freeze and transfer digital assets in all asset custody contracts on the chain. When a risky transaction is found, the corresponding risk management operation (such as locking or transferring) can be performed on the locked assets in the on-chain asset custody contract.
[0162] Among them, the first node device can generate an asset lock event indicating that the digital asset with the target asset type and the target asset amount in the first account has been locked to the first asset custody contract, and the asset lock event is chained to the first blockchain. At the same time, the first node device can generate an asset release request, which is used to instruct the second node device to release the digital asset with the target asset type and the target asset amount to the second account. The asset lock event and the asset release request are determined as cross-chain transaction data about the target cross-chain business, and the cross-chain transaction data is sent to N cross-chain relay devices in the cross-chain relay service. Fig. 9 As shown, the cross-chain relay service includes multi-chain detection function, cross-chain transaction forwarding function, and cross-chain historical business and status management function. Among them, the multi-chain detection function means that N cross-chain relay devices can detect cross-chain transactions that occur in node devices that join the cross-chain transaction protocol, and the cross-chain transaction forwarding function means that the cross-chain relay device can verify the validity of the cross-chain transaction data. When the cross-chain transaction data is determined to be valid, the cross-chain transaction data is forwarded to the second node device that maintains the second blockchain. The cross-chain historical business and status management function refers to the management of relevant information and status information of cross-chain historical business. Of course, when the target cross-chain business is a non-asset transaction business, a universal information processor can be used to obtain the business data specified by the target cross-chain business based on the cross-chain application contract as cross-chain transaction data, and the cross-chain transaction data is sent to N cross-chain relay devices.
[0163] like Fig. 9 As shown, the second blockchain is also deployed with a cross-chain bridge contract, an on-chain business verification contract, an asset custody contract, a cross-chain asset contract, and a cross-chain application contract, etc., which have the same functions as the contracts on the first blockchain. The second node device can obtain the relay quantity threshold configured by the on-chain business execution contract on the second blockchain, and count the number of cross-chain relay devices that send cross-chain transaction data, and compare the relay quantity threshold with the number of devices. If the number of devices is greater than or equal to the relay quantity threshold, it means that most of the cross-chain relay devices have determined that the cross-chain transaction data is valid, then the asset locking event is determined to be valid, and a data verification result is generated to indicate that the cross-chain transaction data has been verified. In this way, the second node device can only determine that the cross-chain transaction data is valid when it determines that the number of devices is greater than or equal to the relay quantity threshold, which can achieve decentralization and avoid the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as forwarding and submitting cross-chain transaction data to the second node device when the third-party cross-chain transaction data is not valid, causing the second node device to execute risky cross-chain transaction data).
[0164] In an embodiment of the present application, a cross-chain transaction protocol is provided, which includes an on-chain part and an off-chain part. The on-chain part includes an on-chain business verification contract (used to verify the legitimacy of the cross-chain business), an on-chain business execution contract (used to execute the cross-chain business), and the access conditions (i.e., risk control rules) for the node devices corresponding to the blockchain to join the cross-chain transaction; the off-chain part includes an off-chain data verification contract used by the cross-chain relay device to verify the validity of the cross-chain transaction data to be forwarded. Through these contracts in the cross-chain transaction protocol, cross-chain business processing can be automatically realized, improving the efficiency and security of cross-chain business processing. In actual applications, when the first node device receives a cross-chain transaction request sent by the business terminal, it calls the on-chain business verification contract in the cross-chain transaction protocol to verify the legitimacy of the target cross-chain business in the cross-chain transaction request. If the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business to obtain cross-chain transaction data. It can be seen that the legitimacy of the target cross-chain business is verified through the on-chain business verification contract. The target cross-chain business will only be executed when it is legitimate, which can effectively improve the security of cross-chain business processing.
[0165] Further, the first node device can send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol, and the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol. In this way, by verifying the validity of the cross-chain transaction data through N cross-chain relay devices and forwarding the valid cross-chain transaction data, decentralization can be achieved, avoiding the risk of centralized malicious behavior when relying on a third-party cross-chain relay device to forward cross-chain transaction data (such as a third-party cross-chain relay device forwarding and submitting the cross-chain transaction data to the second blockchain when the cross-chain transaction data is not valid). At the same time, by verifying the validity of the cross-chain transaction data by the cross-chain relay device, a large amount of book structure data on the first blockchain can be avoided from being sent to the second blockchain (for the second blockchain to verify the validity of the cross-chain transaction data based on a large amount of book structure data), resulting in high cross-chain business processing costs and low efficiency, which can reduce the cross-chain business processing costs and improve the cross-chain business processing efficiency. The second node device processes the cross-chain transaction data only when it determines that the received cross-chain transaction data is valid, which can improve the security of the cross-chain transaction.
[0166] For further information, see Fig.10 , Fig.101 is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. The blockchain-based data processing device 1 may be a computer program (including program code) running in a computer device. For example, the blockchain-based data processing device 1 is an application software. The blockchain-based data processing device 1 may be used to execute the corresponding steps of the method provided in an embodiment of the present application. Fig.10 As shown, the blockchain-based data processing device 1 can be a first node device for maintaining a first blockchain. The blockchain-based data processing device 1 can include: a first receiving module 11, a first verification module 12, an execution module 13 and a first sending module 14.
[0167] A first receiving module 11 is used for a first node device associated with a first blockchain to receive a cross-chain transaction request sent by a business terminal; the cross-chain transaction request includes business description information of a target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device maintaining the second blockchain both meet the cross-chain transaction protocol;
[0168] The first verification module 12 is used to call the on-chain business verification contract in the cross-chain transaction protocol, verify the legitimacy of the target cross-chain business according to the business description information, and obtain the business verification result;
[0169] The execution module 13 is used to call the on-chain business execution contract in the cross-chain transaction protocol, execute the target cross-chain business, and obtain cross-chain transaction data if the business verification result indicates that the target cross-chain business is legal;
[0170] The first sending module 14 is used to send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol; the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid, N is a positive integer greater than 1, and i is a positive integer less than or equal to N.
[0171] Wherein, the first verification module 12 includes:
[0172] The first acquisition unit 1201 is used to call the on-chain business verification contract in the cross-chain transaction protocol, and acquire first business attribute information used to reflect the business type of the target cross-chain business and second business attribute information used to reflect the business risk of the target cross-chain business from the business description information;
[0173] A first determining unit 1202 is used to determine a service verification type of a target cross-chain service according to the first service attribute information;
[0174] The first verification unit 1203 is used to verify the legitimacy of the target cross-chain business according to the business verification type and the second business attribute information to obtain a business verification result.
[0175] The first verification unit 1203 is specifically used for:
[0176] If the business verification type is an on-chain business verification type, the on-chain business verification contract is called to obtain the terminal risk level of the business terminal according to the second business attribute information, and obtain the data risk level of the business data specified by the target cross-chain business;
[0177] If the terminal risk level is less than the first level threshold and the data risk level is less than the second level threshold, a business verification result is generated to indicate that the target cross-chain business is legitimate.
[0178] The first verification unit 1203 is further specifically used for:
[0179] If the business verification type is an off-chain business verification type, the on-chain business verification contract is called to send the second business attribute information to the off-chain business verification device; the off-chain business verification device is used to instruct the business verification object to perform a verification operation on the target cross-chain business based on the second business attribute information;
[0180] Receive the verification operation results returned by the off-chain business verification device;
[0181] Based on the operation results, generate the business verification results of the target cross-chain business.
[0182] Among them, the target cross-chain business is used to indicate the transfer of digital assets of the target asset type;
[0183] The execution module 13 includes:
[0184] The second determining unit 1301 is configured to, if the business verification result indicates that the target cross-chain business is legitimate, call the on-chain business execution contract in the cross-chain transaction protocol, and determine an asset custody contract that matches the target asset type from the asset custody contract set on the first blockchain as the first asset custody contract;
[0185] The third determining unit 1302 is used to determine an asset processor matching the target asset type from the asset processor set on the first blockchain as the first asset processor;
[0186] The execution unit 1303 is used to execute the target cross-chain business according to the first asset custody contract and the first asset processor to obtain cross-chain transaction data.
[0187] The digital asset of the target asset type belongs to the first account in the first blockchain, and the amount of the digital asset is the target asset amount;
[0188] The execution unit 1303 is specifically used for:
[0189] Calling the first asset processor to lock the digital asset of the target asset type and target asset amount in the first account into the first asset custody contract;
[0190] Generate an asset lock event indicating that a digital asset having a target asset type and a target asset amount in the first account has been locked to the first asset depository contract;
[0191] Generate a request for the asset locking event to be uploaded to the blockchain, and send the request to the consensus node of the first blockchain; the consensus node of the first blockchain is used to reach a consensus on the asset locking event and obtain a consensus result;
[0192] Receive the consensus result returned by the consensus node of the first blockchain, and generate cross-chain transaction data about the target cross-chain business according to the consensus result.
[0193] The target cross-chain service is further used to instruct to transfer a digital asset having a target asset type and a target asset amount to a second account in a second blockchain;
[0194] Generate cross-chain transaction data about the target cross-chain business based on the consensus results, including:
[0195] If the consensus result indicates that the asset locking event consensus is successful, the asset locking event is uploaded to the first blockchain;
[0196] Generate an asset release request, the asset release request is used to instruct the second node device to release the digital asset having the target asset type and the target asset amount from the second asset custody contract to the second account; the second asset custody contract is an asset custody contract associated with the target asset type on the second blockchain;
[0197] The asset locking event and the asset release request are determined as cross-chain transaction data about the target cross-chain business.
[0198] The execution module 13 includes:
[0199] The calling unit 1304 is configured to call the general message processor on the first blockchain through the on-chain business execution contract in the cross-chain transaction protocol if the business verification result indicates that the target cross-chain business is legal and the target cross-chain business is a non-asset transaction type;
[0200] The second acquisition unit 1305 is used to acquire the business data specified by the target cross-chain business from the first blockchain through the general message processor;
[0201] The fourth determining unit 1306 is used to determine the business data specified by the target cross-chain business as cross-chain transaction data about the target cross-chain business.
[0202] According to one embodiment of the present application, Fig.10 The various modules in the blockchain-based data processing device 1 shown can be separately or completely combined into one or several units to constitute, or one (some) of the units can be further divided into at least two functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the functions of one module can also be implemented by at least two units, or the functions of at least two modules can be implemented by one unit. In other embodiments of the present application, the blockchain-based data processing device 1 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by at least two units in collaboration.
[0203] According to one embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 6 A computer program (including program code) for each step involved in the corresponding method shown in Fig.10 The data processing device 1 based on blockchain shown in the embodiment of the present application is used to implement the data processing method based on blockchain. The above computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above computer device through the computer-readable recording medium, and run therein. Fig.10 The beneficial effects of the blockchain-based data processing device 1 shown in Figure 6 The description of the beneficial effects of the corresponding method will not be repeated in the embodiments of the present application.
[0204] For further information, see Fig.11 , Fig.11 : is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. The blockchain-based data processing device 2 can be a computer program (including program code) running in a computer device. For example, the blockchain-based data processing device 2 is an application software; the blockchain-based data processing device 2 can be used to execute the corresponding steps of the method provided in an embodiment of the present application. Fig.11 As shown, the blockchain-based data processing device 2 can be a second node device for maintaining a second blockchain. The blockchain-based data processing device 2 can include: a second receiving module 21, a verification module 22 and a data processing module 23.
[0205] The second receiving module 21 is used for the second node device associated with the second blockchain to receive the cross-chain transaction data sent by the cross-chain relay device i among the N cross-chain relay devices; the cross-chain transaction data is generated by the first node device when the target cross-chain business is determined to be legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and the target cross-chain business is executed, and is forwarded by the first node device to the N cross-chain relay devices; the cross-chain relay device i is used to send the cross-chain transaction data to the second node device when the cross-chain transaction data is determined to be valid based on the off-chain data verification contract in the cross-chain transaction protocol, the target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N;
[0206] The verification module 22 is used to verify the validity of the received cross-chain transaction data based on the on-chain business execution contract in the cross-chain transaction protocol to obtain a data verification result;
[0207] The data processing module 23 is used to process the cross-chain transaction data when the data verification result indicates that the cross-chain transaction data is valid.
[0208] The cross-chain transaction data includes an asset locking event for reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked;
[0209] The verification module 22 includes:
[0210] A statistical unit 2201 is used to obtain a relay quantity threshold configured in an on-chain business execution contract in a cross-chain transaction protocol, and to count the number of cross-chain relay devices that send cross-chain transaction data;
[0211] A comparison unit 2202, configured to compare the relay quantity threshold with the device quantity;
[0212] The generating unit 2203 is used to determine that the asset locking event is valid if the number of devices is greater than or equal to the relay number threshold, and to generate a data verification result indicating that the cross-chain transaction data is valid.
[0213] The data processing module 23 includes:
[0214] The fifth confirmation unit 2301 is used to call the on-chain business verification contract in the cross-chain transaction protocol to determine the data verification type of the cross-chain transaction data when the data verification result indicates that the cross-chain transaction data is valid;
[0215] The second verification unit 2302 is used to verify the data risk of the cross-chain transaction data according to the data verification type to obtain a risk verification result;
[0216] The data processing unit 2303 is used to process the cross-chain transaction data when the risk verification result indicates that the cross-chain transaction data does not belong to risk data.
[0217] The cross-chain transaction data includes an asset release request, and the asset release request is used to instruct the second node device to release the digital asset having the target asset type and the target asset amount to the second account in the second blockchain;
[0218] The data processing unit 2303 is specifically used for:
[0219] When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, an asset custody contract matching the target asset type is determined from the asset custody contract set on the second blockchain as the second asset custody contract;
[0220] Determine, from the set of asset processors on the second blockchain, an asset processor that matches the target asset type as the second asset processor;
[0221] The second asset processor is called to release the digital asset having the target asset type and the target asset amount from the second asset depository contract to the second account.
[0222] According to one embodiment of the present application, Fig.11 The various modules in the blockchain-based data processing device 2 shown can be combined into one or several units separately or in whole, or one (some) of the units can be further divided into at least two functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the functions of one module can also be implemented by at least two units, or the functions of at least two modules can be implemented by one unit. In other embodiments of the present application, the blockchain-based data processing device 2 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of at least two units.
[0223] According to one embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 7 A computer program (including program code) for each step involved in the corresponding method shown in Fig.11The data processing device 2 based on blockchain shown in the embodiment of the present application is used to implement the data processing method based on blockchain. The above computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above computer device through the computer-readable recording medium, and run therein. Fig.11 The beneficial effects of the blockchain-based data processing device 2 shown in can be found in Figure 7 The description of the beneficial effects of the corresponding method will not be repeated in the embodiments of the present application.
[0224] For further information, see Fig.12 , Fig.12 : is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. The blockchain-based data processing device 3 may be a computer program (including program code) running in a computer device. For example, the blockchain-based data processing device 3 is an application software; the blockchain-based data processing device 3 may be used to execute the corresponding steps in the method provided in an embodiment of the present application. Fig.12 As shown, the blockchain-based data processing device 3 can be a second node device for maintaining a second blockchain. The blockchain-based data processing device 3 can include: a third receiving module 31, a second verification module 32 and a second sending module 33.
[0225] The third receiving module 31 is used for the cross-chain relay device i among the N cross-chain relay devices to receive the cross-chain transaction data sent by the first node device; the cross-chain transaction data is generated by the first node device when it determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device, and the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N.
[0226] The second verification module 32 is used to verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol;
[0227] The second sending module 33 is used to send the cross-chain transaction data to the second node device if the cross-chain transaction data is valid; the second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
[0228] The cross-chain transaction data includes an asset locking event for reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked;
[0229] The second verification module 32 includes:
[0230] The detection unit 3201 is used to obtain an event identifier of the asset locking event and detect a target block containing the event identifier from the first blockchain;
[0231] The sixth determination unit 3202 is configured to determine whether the cross-chain transaction data is valid if a target block containing an event identifier is detected on the first blockchain.
[0232] According to one embodiment of the present application, Fig.12 The various modules in the blockchain-based data processing device 3 shown can be combined into one or several units separately or in whole, or one (some) of the units can be further divided into at least two functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the functions of one module can also be implemented by at least two units, or the functions of at least two modules can be implemented by one unit. In other embodiments of the present application, the blockchain-based data processing device 3 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by at least two units in collaboration.
[0233] According to one embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 8 A computer program (including program code) for each step involved in the corresponding method shown in Fig.12 The data processing device based on blockchain shown in the embodiment of the present application is implemented to realize the data processing method based on blockchain. The above computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above computer device through the computer-readable recording medium, and run therein. Fig.12 The beneficial effects of the blockchain-based data processing device 3 shown in Figure 8 The description of the beneficial effects of the corresponding method will not be repeated in the embodiments of the present application.
[0234] For further information, see Fig.13 , Fig.13 Schematic diagram of a computer device provided in an embodiment of the present application. Fig.13As shown, the computer device 3000 may include: at least one processor 3001, such as a CPU, at least one network interface 3004, a user interface 3003, a memory 3005, and at least one communication bus 3002. The communication bus 3002 is used to realize the connection and communication between these components. The user interface 3003 may include a display screen (Display) and a keyboard (Keyboard), and the network interface 3004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 3005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The storage 3005 may optionally also be at least one storage device located away from the aforementioned processor 3001. As shown in FIG. Fig.13 As shown, the memory 3005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application.
[0235] exist Fig.13 In the computer device 3000 shown, the network interface 3004 is mainly used for the second node device to communicate with the target relay server and the target oracle server over the network; the user interface 3003 is mainly used to provide an input interface for the user; and the processor 3001 can be used to call the device control application stored in the memory 3005.
[0236] It should be understood that the computer device 3000 described in the embodiment of the present application can execute the above Figure 6 , Figure 7 or Figure 8 The description of the data processing method based on blockchain in the corresponding embodiment can also be performed as described above. Fig.10 In the corresponding embodiment, the data processing device based on blockchain 1, the above Fig.11 In the corresponding embodiment, the data processing device 2 based on blockchain or Fig.12 The description of the blockchain-based data processing device 3 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here.
[0237] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the blockchain-based data processing device 1, the blockchain-based data processing device 2, or the blockchain-based data processing device 3 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above Figure 6 , Figure 7 or Figure 8The description of the data processing method based on blockchain in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, program instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network. Multiple computing devices distributed at multiple locations and interconnected by a communication network can constitute a blockchain system.
[0238] On one hand, the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can execute the above Figure 6 , Figure 7 or Figure 8 The description of the data processing method based on blockchain in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here.
[0239] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0240] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method based on blockchain, characterized in that: include: The first node device associated with the first blockchain receives a cross-chain transaction request sent by the business terminal; the cross-chain transaction request includes business description information of the target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device maintaining the second blockchain both meet the cross-chain transaction protocol; Calling the on-chain business verification contract in the cross-chain transaction protocol, verifying the legitimacy of the target cross-chain business according to the business description information, and obtaining a business verification result; If the business verification result indicates that the target cross-chain business is legitimate, then the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business and obtain cross-chain transaction data; The cross-chain transaction data is sent to N cross-chain relay devices associated with the cross-chain transaction protocol; the cross-chain relay device i among the N cross-chain relay devices is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol; The second node device is used to process the cross-chain transaction data when determining that the received cross-chain transaction data is valid, where N is a positive integer greater than 1, and i is a positive integer less than or equal to N.
2. The method according to claim 1, characterized in that The calling of the on-chain business verification contract in the cross-chain transaction protocol verifies the legitimacy of the target cross-chain business according to the business description information, and obtains a business verification result, including: Calling the on-chain business verification contract in the cross-chain transaction protocol, and obtaining first business attribute information reflecting the business type of the target cross-chain business and second business attribute information reflecting the business risk of the target cross-chain business from the business description information; Determine the service verification type of the target cross-chain service according to the first service attribute information; According to the business verification type and the second business attribute information, the legitimacy of the target cross-chain business is verified to obtain a business verification result.
3. The method according to claim 2, characterized in that The verifying the legitimacy of the target cross-chain business according to the business verification type and the second business attribute information to obtain a business verification result includes: If the business verification type is an on-chain business verification type, the on-chain business verification contract is called to obtain the terminal risk level of the business terminal according to the second business attribute information, and obtain the data risk level of the business data specified by the target cross-chain business; If the terminal risk level is less than the first level threshold, and the data risk level is less than the second level threshold, a business verification result is generated to indicate that the target cross-chain business is legitimate.
4. The method according to claim 2, characterized in that: The verifying the legitimacy of the target cross-chain business according to the business verification type and the second business attribute information to obtain a business verification result includes: If the business verification type is an off-chain business verification type, the on-chain business verification contract is called to send the second business attribute information to the off-chain business verification device; the off-chain business verification device is used to instruct the business verification object to perform a verification operation on the target cross-chain business based on the second business attribute information; Receiving the operation result of the verification operation returned by the off-chain service verification device; According to the operation result, a business verification result of the target cross-chain business is generated.
5. The method according to claim 1, characterized in that The target cross-chain business is used to instruct the transfer of digital assets of the target asset type; If the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business and obtain cross-chain transaction data, including: If the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called, and an asset custody contract matching the target asset type is determined from the asset custody contract set on the first blockchain as the first asset custody contract; Determine, from the set of asset processors on the first blockchain, an asset processor that matches the target asset type as the first asset processor; According to the first asset custody contract and the first asset processor, the target cross-chain business is executed to obtain cross-chain transaction data.
6. The method according to claim 5, characterized in that The digital asset of the target asset type belongs to the first account in the first blockchain, and the amount of the digital asset is the target asset amount; The step of executing the target cross-chain business according to the first asset custody contract and the first asset processor to obtain cross-chain transaction data includes: Calling the first asset processor to lock the digital asset of the target asset type and the target asset amount in the first account into the first asset custody contract; generating an asset lock event indicating that the digital asset having the target asset type and the target asset amount in the first account has been locked to the first asset depository contract; Generate a request for uploading the asset lock event, and send the request to the consensus node of the first blockchain; the consensus node of the first blockchain is used to reach a consensus on the asset lock event and obtain a consensus result; Receive the consensus result returned by the consensus node of the first blockchain, and generate cross-chain transaction data about the target cross-chain business according to the consensus result.
7. The method according to claim 6, characterized in that The target cross-chain service is further used to instruct to transfer the digital asset having the target asset type and the target asset amount to a second account in the second blockchain; The generating cross-chain transaction data about the target cross-chain business according to the consensus result includes: If the consensus result indicates that the consensus of the asset locking event is successful, the asset locking event is uploaded to the first blockchain; Generate an asset release request, the asset release request is used to instruct the second node device to release the digital asset having the target asset type and the target asset amount from the second asset custody contract to the second account; the second asset custody contract is an asset custody contract associated with the target asset type on the second blockchain; The asset locking event and the asset release request are determined as cross-chain transaction data regarding the target cross-chain business.
8. The method according to claim 1, characterized in that If the business verification result indicates that the target cross-chain business is legitimate, the on-chain business execution contract in the cross-chain transaction protocol is called to execute the target cross-chain business and obtain cross-chain transaction data, including: If the business verification result indicates that the target cross-chain business is legitimate, and the target cross-chain business is a non-asset transaction type, the general message processor on the first blockchain is called through the on-chain business execution contract in the cross-chain transaction protocol; Obtaining the business data specified by the target cross-chain business from the first blockchain through the general message processor; The business data specified by the target cross-chain business is determined as cross-chain transaction data regarding the target cross-chain business.
9. A data processing method based on blockchain, characterized in that: include: The second node device associated with the second blockchain receives the cross-chain transaction data sent by the cross-chain relay device i among the N cross-chain relay devices; The cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the cross-chain relay device i is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol, the target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N; Based on the on-chain business execution contract in the cross-chain transaction protocol, verify the validity of the received cross-chain transaction data to obtain a data verification result; When the data verification result indicates that the cross-chain transaction data is valid, the cross-chain transaction data is processed.
10. The method according to claim 9, characterized in that The cross-chain transaction data includes an asset locking event for reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked; The on-chain data verification contract in the cross-chain transaction protocol is used to verify the cross-chain transaction data sent by the M cross-chain relay devices to obtain a data verification result, including: Obtain the relay quantity threshold configured in the on-chain business execution contract in the cross-chain transaction protocol, and count the number of cross-chain relay devices that send the cross-chain transaction data; comparing the relay quantity threshold with the device quantity; If the number of devices is greater than or equal to the relay number threshold, the asset locking event is determined to be valid, and a data verification result is generated to indicate that the cross-chain transaction data is valid.
11. The method according to claim 9, characterized in that When the data verification result indicates that the cross-chain transaction data is valid, processing the cross-chain transaction data includes: When the data verification result indicates that the cross-chain transaction data is valid, calling the on-chain business verification contract in the cross-chain transaction protocol to determine the data verification type of the cross-chain transaction data; Verify the data risk of the cross-chain transaction data according to the data verification type to obtain a risk verification result; When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, the cross-chain transaction data is processed.
12. The method according to claim 11, characterized in that The cross-chain transaction data includes an asset release request, where the asset release request is used to instruct the second node device to release a digital asset having a target asset type and a target asset amount to a second account in the second blockchain; When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, processing the cross-chain transaction data includes: When the risk verification result indicates that the cross-chain transaction data does not belong to risk data, determining an asset custody contract matching the target asset type from the asset custody contract set on the second blockchain as the second asset custody contract; Determine, from the set of asset processors on the second blockchain, an asset processor that matches the target asset type as the second asset processor; The second asset processor is called to release the digital asset having the target asset type and the target asset amount from the second asset depository contract to the second account.
13. A data processing method based on blockchain, characterized in that: include: The cross-chain relay device i among the N cross-chain relay devices receives the cross-chain transaction data sent by the first node device; The cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N; Verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol; If the cross-chain transaction data is valid, sending the cross-chain transaction data to the second node device; The second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
14. The method according to claim 13, characterized in that The cross-chain transaction data includes an asset locking event for reflecting that a digital asset having a target asset type and a target asset amount in a first account of the first blockchain has been locked; Verifying the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol includes: Obtaining an event identifier of the asset locking event, and detecting a target block containing the event identifier from the first blockchain; If a target block containing the event identifier is detected on the first blockchain, it is determined that the cross-chain transaction data is valid.
15. A data processing device based on blockchain, characterized in that: include A first receiving module, configured for a first node device associated with a first blockchain to receive a cross-chain transaction request sent by a business terminal; the cross-chain transaction request includes business description information of a target cross-chain business associated with the first blockchain and the second blockchain, and the first node device and the second node device maintaining the second blockchain both meet the cross-chain transaction protocol; The first verification module is used to call the on-chain business verification contract in the cross-chain transaction protocol, verify the legitimacy of the target cross-chain business according to the business description information, and obtain a business verification result; An execution module, configured to call the on-chain business execution contract in the cross-chain transaction protocol, execute the target cross-chain business, and obtain cross-chain transaction data if the business verification result indicates that the target cross-chain business is legal; A first sending module, configured to send the cross-chain transaction data to N cross-chain relay devices associated with the cross-chain transaction protocol; a cross-chain relay device i among the N cross-chain relay devices is configured to send the cross-chain transaction data to the second node device when determining that the cross-chain transaction data is valid based on an off-chain data verification contract in the cross-chain transaction protocol; The second node device is used to process the cross-chain transaction data when determining that the received cross-chain transaction data is valid, where N is a positive integer greater than 1, and i is a positive integer less than or equal to N.
16. A data processing device based on blockchain, characterized in that: include: A second receiving module is used for a second node device associated with a second blockchain to receive cross-chain transaction data sent by a cross-chain relay device i among N cross-chain relay devices; the cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the cross-chain relay device i is used to send the cross-chain transaction data to the second node device when it is determined that the cross-chain transaction data is valid based on the off-chain data verification contract in the cross-chain transaction protocol, the target cross-chain business is associated with the first blockchain and the second blockchain maintained by the first node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N; A verification module, used to verify the validity of the received cross-chain transaction data based on the on-chain business execution contract in the cross-chain transaction protocol, and obtain a data verification result; A data processing module is used to process the cross-chain transaction data when the data verification result indicates that the cross-chain transaction data is valid.
17. A data processing device based on blockchain, characterized in that: include: A third receiving module, used for the cross-chain relay device i among the N cross-chain relay devices to receive the cross-chain transaction data sent by the first node device; The cross-chain transaction data is generated by executing the target cross-chain business when the first node device determines that the target cross-chain business is legitimate based on the on-chain business verification contract in the cross-chain transaction protocol, and is forwarded by the first node device to the N cross-chain relay devices; the target cross-chain business is associated with the first blockchain maintained by the first node device and the second blockchain maintained by the second node device, the first node device and the second node device both satisfy the cross-chain transaction protocol, N is an integer greater than 1, and i is an integer less than or equal to N A second verification module, used to verify the validity of the cross-chain transaction data according to the off-chain data verification contract in the cross-chain transaction protocol; A second sending module, configured to send the cross-chain transaction data to the second node device if the cross-chain transaction data is valid; The second node device is used to process the cross-chain transaction data when it is determined that the received cross-chain transaction data is valid.
18. A computer device, characterized in that: include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 14.
20. A computer program product or a computer program, characterized in that The computer program product or computer program comprises computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 14.
