Data processing method and device based on block chain network, and related equipment

By deploying cross-chain relay contracts and executor contracts in the blockchain network and defining a unified cross-chain calling interface, the problem of complexity and high cost of cross-chain business is solved, and the simplification and cost reduction of cross-chain business are achieved. .

CN118590505APending Publication Date: 2024-09-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310238100.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The current implementation of cross-chain business is complex, costly and difficult to simplify.

Method used

By deploying cross-chain relay contracts and executor contracts in the blockchain network, a unified cross-chain calling interface is defined to simplify the implementation of cross-chain business and reduce cross-chain costs.

Benefits of technology

It achieves unified adaptation of cross-chain calling interfaces between different blockchains, simplifies the implementation process of cross-chain business, reduces cross-chain costs, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590505A
    Figure CN118590505A
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device based on a block chain network and related equipment, and the method comprises the steps: calling a cross-chain repeater contract to generate a cross-chain transaction event after a first node of a first block chain executes a target transaction, the cross-chain transaction event comprises a cross-chain call parameter, and the cross-chain call parameter is a cross-chain call parameter; and when the relay server receives the cross-chain transaction event, the relay server sends a cross-chain transaction request to a second node of a second block chain based on the cross-chain transaction event, so that the second node determines a cross-chain transaction result based on the actuator contract and the cross-chain calling parameter, and sends the cross-chain transaction result to the relay server, after the first node receives the cross-chain transaction result sent by the relay server, the target transaction result is determined based on the cross-chain transaction result, and a unified cross-chain calling interface can be defined by deploying a cross-chain relay contract and an actuator contract in different block chains, so that the implementation mode of a cross-chain service can be simplified, and the cross-chain cost can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device and related equipment based on a blockchain network. Background Art

[0002] With the rapid development and promotion of blockchain technology, various decentralized applications (also known as distributed applications) are widely deployed on blockchain to provide diversified business services. Currently, due to the existence of many different blockchains, the demand for connecting different blockchain networks to realize the flow of business and value chains is growing, and the demand for cross-chain technology is becoming increasingly prominent. The current cross-chain technology mainly uses cross-chain relay services to communicate between different blockchains (such as source chains and target chains). However, for each new cross-chain service of a decentralized application, the cross-chain relay service needs to do targeted adaptation work separately, which makes the current implementation of cross-chain services more complicated and costly.

[0003] It can be seen that how to simplify the implementation of cross-chain business and effectively reduce cross-chain costs has become an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus, and related equipment based on a blockchain network, which can unify the cross-chain calling interfaces of different decentralized applications, thereby simplifying the implementation of cross-chain services and effectively reducing cross-chain costs.

[0005] In a first aspect, an embodiment of the present application provides a data processing method based on a blockchain network, the method comprising:

[0006] The first node obtains a target transaction of the business server, and the first node is any node in the blockchain network corresponding to the first blockchain.

[0007] After executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, and the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, and the cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters. The cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The second node is any node in the blockchain network corresponding to the second blockchain.

[0008] The first node receives the cross-chain transaction result sent by the relay server, and the cross-chain transaction result is sent to the relay server by the second node.

[0009] The first node determines a target transaction result based on the cross-chain transaction result, and sends the target transaction result to the business server.

[0010] In a second aspect, an embodiment of the present application provides a data processing method based on a blockchain network, the method comprising:

[0011] The second node receives a cross-chain transaction request sent by the relay server, where the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, where the cross-chain transaction event includes cross-chain call parameters, and where the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, where the cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain, and the second node is any node in the blockchain network corresponding to the second blockchain.

[0012] The second node responds to the cross-chain transaction request, executes the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtains a cross-chain transaction result.

[0013] The second node sends the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

[0014] In a third aspect, an embodiment of the present application provides a data processing method based on a blockchain network, the method comprising:

[0015] When the relay server listens to the cross-chain transaction event generated by the first node, it generates a cross-chain transaction request based on the cross-chain transaction event, and the cross-chain transaction event includes cross-chain call parameters. The cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction. The cross-chain call parameters include one or more of contract call parameters, target random value, data consumption limit and cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain.

[0016] The relay server sends the cross-chain transaction request to the second node, where the cross-chain transaction request is used to instruct the second node to execute the cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result. The second node is any node in the blockchain network corresponding to the second blockchain.

[0017] The relay server obtains the cross-chain transaction result of the second node, and sends the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

[0018] In a fourth aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0019] The acquisition module is used to acquire the target transaction of the business server.

[0020] A processing module is used to call a cross-chain repeater contract to generate a cross-chain transaction event after executing the target transaction, and the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, and the cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameter, and the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The second node is any node in the blockchain network corresponding to the second blockchain.

[0021] A receiving module is used to receive the cross-chain transaction result sent by the relay server, where the cross-chain transaction result is sent by the second node to the relay server.

[0022] The processing module is further used to determine the target transaction result based on the cross-chain transaction result.

[0023] A sending module is used to send the target transaction result to the business server.

[0024] In a fifth aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0025] A receiving module is used to receive a cross-chain transaction request sent by a relay server, wherein the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, and the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, wherein the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the first node is any node in the blockchain network corresponding to the first blockchain.

[0026] The processing module is used to respond to the cross-chain transaction request, execute the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtain the cross-chain transaction result.

[0027] A sending module is used to send the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

[0028] In a sixth aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0029] A generation module is used to generate a cross-chain transaction request based on the cross-chain transaction event generated by the first node when listening to the cross-chain transaction event, the cross-chain transaction event includes a cross-chain call parameter, the cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction, the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the first node is any node in the blockchain network corresponding to the first blockchain.

[0030] A sending module is used to send the cross-chain transaction request to the second node, where the cross-chain transaction request is used to instruct the second node to perform a cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result. The second node is any node in the blockchain network corresponding to the second blockchain.

[0031] An acquisition module is used to obtain the cross-chain transaction result of the second node.

[0032] The sending module is further used to send the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

[0033] In the seventh aspect, an embodiment of the present application provides a computer device, comprising a processor, a network interface and a storage device, wherein the processor, the network interface and the storage device are interconnected, wherein the network interface is controlled by the processor for sending and receiving data, and the storage device is used to store a computer program, wherein the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the data processing method based on the blockchain network as described in the first aspect, the second aspect or the third aspect.

[0034] In the eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to execute the data processing method based on the blockchain network as described in the first aspect, the second aspect, or the third aspect.

[0035] In the ninth aspect, an embodiment of the present application provides a computer program product, including a computer program, characterized in that when the computer program is executed by a computer processor, it implements the data processing method based on the blockchain network as described in the first aspect, the second aspect, or the third aspect.

[0036] In an embodiment of the present application, after a node (such as a first node) in the blockchain network corresponding to the first blockchain obtains the target transaction of the business server, it can execute the target transaction, and then call the cross-chain repeater contract to generate a cross-chain transaction event. The cross-chain transaction event includes cross-chain call parameters, and the cross-chain call parameters may include one or more of contract call parameters, target random values, data consumption limit amounts, and cross-chain initiator identifiers. When the relay server hears the cross-chain transaction event, it can send a cross-chain transaction request to a node (such as a second node) in the blockchain network corresponding to the second blockchain based on the cross-chain transaction event, so that the second node can determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters, and send the cross-chain transaction result to the relay server. After receiving the cross-chain transaction result sent by the relay server, the first node can determine the target transaction result based on the cross-chain transaction result, and return the target transaction result to the business server. In the above cross-chain business, the first blockchain can be regarded as the source chain, and the second blockchain can be regarded as the target chain. It can be seen that by deploying cross-chain repeater contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined to effectively adapt to the cross-chain requirements of different decentralized applications, thereby simplifying the implementation of cross-chain business and effectively reducing cross-chain costs. 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, and other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1a It is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;

[0039] Figure 1b This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;

[0040] Figure 1c It is a schematic diagram of a process of generating a new block provided by an embodiment of the present application;

[0041] Figure 2 It is a flowchart of a data processing method based on a blockchain network provided in an embodiment of the present application;

[0042] Figure 3 It is a flowchart of another data processing method based on a blockchain network provided in an embodiment of the present application;

[0043] Figure 4 This is a flowchart of another data processing method based on a blockchain network provided in an embodiment of the present application;

[0044] Figure 5 This is a flowchart of another data processing method based on a blockchain network provided in an embodiment of the present application;

[0045] Figure 6 This is a schematic diagram of the overall implementation process of a cross-chain service provided by an embodiment of the present application;

[0046] Figure 7 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0047] Figure 8 is a structural schematic diagram of another data processing device provided in an embodiment of the present application;

[0048] Fig. 9 is a structural diagram of another data processing device provided in an embodiment of the present application;

[0049] Fig.10 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] 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. All other embodiments obtained based on the embodiments in the present application without creative work are within the scope of protection of the present application.

[0051] See also Figure 1a , is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application, the data processing system includes a terminal device 13, a business server 15, a relay server 11, and a blockchain network 12 and a blockchain network 14, wherein:

[0052] Blockchain network 12 and blockchain network 14 refer to networks for data sharing between node devices. A blockchain network may include multiple node devices, such as node device 102 in blockchain network 12 and node device 104 in blockchain network 14. Each node device can receive input information when performing normal work, and maintain the shared data (i.e., blockchain) in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there can be an information connection between each node device, and peer-to-peer (PeerTo Peer, P2P) communication can be achieved between any two node devices, and P2P communication can be performed specifically through a wired communication link or a wireless communication link. For example, when any node device in the blockchain network receives input information, other node devices obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all node devices in the blockchain network are consistent.

[0053] Among them, different blockchain networks can maintain different blockchains, for example, blockchain network 12 is used to maintain blockchain A, and blockchain network 14 is used to maintain blockchain B. Smart contracts of various applications can be run on the node devices of the blockchain network. Smart contracts are code implementations that are executed when certain conditions are met. The contract logic can be defined in a programming language and published on the blockchain (smart contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. At the same time, the functions of updating and canceling the smart contract are also provided.

[0054] The smart contract can be, for example, a smart contract of a decentralized application. Different blockchains can deploy different smart contracts of decentralized applications to provide users with corresponding services, such as data management services such as on-chain data transfer. When providing services to the outside world, a blockchain can call the smart contracts of decentralized applications on other blockchains in a cross-chain manner to achieve corresponding functions.

[0055] Optionally, the blockchain maintained by blockchain network 12 and blockchain network 14 may be a consortium chain or other forms of blockchain, such as a public chain or a private chain, etc.

[0056] Among them, the business server 15 is used as a background service to provide specific business functions to the terminal device 13. For example, a data management interface can be displayed on the terminal device 13 through an application (such as a mini program). The business user or transaction initiator can submit the transaction to be chained to the business server 15 through the data management interface, such as a data transfer transaction. After receiving the transaction to be chained, the business server 15 can forward it to the corresponding blockchain network. For example, the business server 15 forwards the transaction to be chained to a node device 102 in the blockchain network 12 corresponding to blockchain A, so that the node device 102 in the blockchain network 12 can call the smart contract of the decentralized application deployed on blockchain A to execute the transaction to be chained; or, the business server 15 can also forward the transaction to be chained to a node device 104 in the blockchain network 14 corresponding to blockchain B, so that the node device 104 in the blockchain network 14 can call the smart contract of the decentralized application deployed on blockchain B to execute the transaction to be chained. The business server 15 can also receive the transaction execution results of the blockchain network sent by the relay server 11, and forward the transaction execution results to the terminal device 13, so that the business user can view the transaction execution results through the application interface of the terminal device 13.

[0057] Among them, the relay server 11 is used to provide cross-chain relay services between different blockchain networks to achieve intercommunication between different blockchains. Specifically, it can forward contract call information between different blockchains, so that one blockchain can call the smart contract of decentralized applications on other blockchains through the cross-chain relay service provided by the relay server 11 to achieve corresponding functions. The relay server 11 can also obtain the transaction execution result of the blockchain network and send the transaction execution result to the business server 15.

[0058] The terminal device 13 can communicate with the business server 15, and can also display the data management interface to the business user. The business user can input the management operation of the data through the data management interface, for example, submit the transaction to be put on the chain to the business server 15, and the transaction to be put on the chain can be, for example, a data transfer transaction, a data exchange transaction, etc.; the terminal device 13 can also receive the transaction execution result sent by the business server 15, and display the transaction execution result to the business user through the application interface. Among them, the terminal device 13 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart terminal mounted on a mobile platform, etc., which is not limited in the embodiment of the present application.

[0059] It should be noted that Figure 1aThe number of node devices 102, node devices 104, business servers 15, relay servers 11, terminal devices 13, and the number of blockchain networks 12 and blockchain networks 14 shown in the figure are only schematic. Any number of nodes, business servers, relay servers, blockchain networks, and terminal devices can be deployed according to actual needs. Node devices 102, node devices 104, business servers 15, and relay servers 11 can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide 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, content delivery networks (CDNs), and big data.

[0060] Among them, for each node device in the blockchain network, there is a node identifier corresponding to it, and each node device in the blockchain network can store the node identifiers of other node devices in the blockchain network, so that the generated blocks can be broadcast to other node devices in the blockchain network according to the node identifiers of other node devices. A node identifier list as shown in the following table can be maintained in each node device, and the node name and node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an Internet Protocol (IP) address and any other information that can be used to identify the node. The table only uses the IP address as an example for illustration.

[0061] Node Name Node ID Node 1 000.000.000.000 Node 2 111.111.111.111 … … Node N 999.999.999.999

[0062] Each node device in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 1b The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp and difficulty value, and the block body stores the input information. The next block of the genesis block takes the genesis block as the parent block. The next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp and difficulty value of the parent block, and so on. The block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0063] Among them, when generating each block in the blockchain, see Figure 1cWhen the node device where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, the input information is stored in the memory pool and the hash tree used to record the input information is updated; then, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:

[0064] SHA256(SHA256(version+prev_hash+merkle_root+nt+nbits+x)) <TARGET

[0065] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; nt is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0066] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node device where the blockchain is located sends the newly generated block to other node devices in the blockchain network according to the node identification of other node devices in the blockchain network. Other node devices verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.

[0067] In some feasible implementations, assuming that the blockchain network corresponding to the first blockchain is blockchain network 12, and the blockchain network corresponding to the second blockchain is blockchain network 14, after the node 102 (such as the first node) in the blockchain network 12 obtains the target transaction of the business server 15, the target transaction can be executed. The target transaction can be submitted to the business server 15 by the business user through the terminal device 13; then, the first node calls the deployed cross-chain repeater contract to generate a cross-chain transaction event, and the cross-chain transaction event includes cross-chain call parameters, and the cross-chain call parameters can include contract call parameters, target random When the relay server 11 receives the cross-chain transaction event, it can send a cross-chain transaction request to the node 104 (such as the second node) in the blockchain network 14 based on the cross-chain transaction event, so that the second node can determine the cross-chain transaction result based on the deployed executor contract and the cross-chain call parameters, and send the cross-chain transaction result to the relay server 11. After receiving the cross-chain transaction result sent by the relay server 11, the first node can determine the target transaction result based on the cross-chain transaction result, and return the target transaction result to the business server 15. In the above cross-chain business, the first blockchain can be regarded as the source chain, and the second blockchain can be regarded as the target chain. It can be seen that by deploying cross-chain relay contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined. The relay server does not need to do corresponding adaptation work for different decentralized applications, and can effectively adapt to the cross-chain requirements of different decentralized applications, thereby simplifying the implementation of cross-chain business and effectively reducing cross-chain costs.

[0068] It is understandable that in the specific implementation of this application, data such as the blockchain account address of the object (such as business users, transaction initiators), the smart contract identifier of the decentralized application, etc., when the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of relevant data need to comply with the relevant laws and regulations and standards of relevant countries and regions.

[0069] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0070] See also Figure 2 , is the embodiment of this application based on Figure 1a The data processing system shown in the figure provides a flowchart of a data processing method based on a blockchain network, which can be applied to Figure 1a The node 102 in the blockchain network 12, such as the first node, may specifically include the following steps:

[0071] 201. A first node obtains a target transaction of a business server, wherein the first node is any node in a blockchain network corresponding to a first blockchain.

[0072] Specifically, the target transaction can be submitted by the target object (such as a business user, a transaction initiator, etc.) through a terminal device. After the terminal device obtains the target transaction of the target object, it sends the target transaction to the business server, and then the business server applies to the first blockchain for on-chain. The business server can specifically send the target transaction to a node (such as the first node) in the blockchain network corresponding to the first blockchain. The target transaction can specifically be a data management operation transaction, such as a transfer transaction of on-chain data. The target transaction can be submitted by any decentralized application.

[0073] In some feasible implementations, in order to ensure the security of the transaction, the target transaction may carry the signature information of the target object, for example, a digital signature obtained by signing with the secret key of the target object. Before executing the target transaction, the first node obtains the digital signature of the target object carried by the target transaction, and may obtain the public key information of the target object from the first blockchain or other blockchains based on the blockchain account address of the target object, and verify the digital signature based on the public key information. If the verification passes, the target transaction is executed.

[0074] In some feasible implementations, the target object's secret key can be kept by itself or in backend custody. The business server can obtain the target object's secret key custody type; if the secret key custody type is secret key custody, the business server uses the secret key of the managed target object to digitally sign the target transaction and obtain a target transaction with a digital signature; if the secret key custody type is secret key non-custody (that is, self-custody), the terminal device can use the secret key of the target object to digitally sign the target transaction, obtain a target transaction with a digital signature, and send the target transaction with a digital signature to the business server. In addition, the business server can also write the signed target transaction into the blockchain, thereby recording the target object's data management activities, which is helpful for subsequent tracing.

[0075] 202. After executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, and the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, and the cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters. The cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The second node is any node in the blockchain network corresponding to the second blockchain.

[0076] Among them, the cross-chain repeater contract can be deployed in the source chain (i.e., the source blockchain, such as the first blockchain mentioned above), and specifically can be deployed on each node in the blockchain network corresponding to the source chain. The cross-chain repeater contract is used to provide a unified cross-chain call interface for the source chain to process the cross-chain call information of the business contract on the source chain to the business contract on the target chain (i.e., the target blockchain, such as the second blockchain or other blockchains), and generate cross-chain transaction events. The cross-chain transaction events can be used to trigger and transmit cross-chain transactions between the source chain and the target chain.

[0077] In some feasible implementations, the cross-chain transaction event includes cross-chain call parameters, which may at least include contract call parameters, and the contract call parameters are used to indicate the called contract on the target chain and the corresponding incoming parameters.

[0078] In some feasible implementations, in addition to the above-mentioned contract call parameters, the cross-chain call parameters may also include one or more of a target random value, a data consumption limit, and a cross-chain initiator identifier. Among them, the target random value is used to prevent off-chain events (such as cross-chain transaction events) from being repeated on the chain, that is, to ensure that cross-chain transaction events will only be executed once. The "data" in the data consumption limit refers to the cost of consuming blockchain computing data paid by the initiator of the transaction to the node that executes the transaction. The data consumption limit is used to indicate the maximum amount of expenditure allowed for a cross-chain transaction. The cross-chain initiator identifier is used to indicate the initiator of the cross-chain transaction, for example, it can be the blockchain address of the target object or the identifier of a business contract.

[0079] In some feasible implementations, the cross-chain call parameters may include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier.

[0080] Specifically, after executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, so that when the relay server hears the cross-chain transaction event of the first node of the source chain, it sends a cross-chain transaction request to any node (such as the second node) in the blockchain network of the target chain based on the cross-chain transaction event. The cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters. For example, the second node can use the executor contract to process the cross-chain call parameters, execute the cross-chain transaction corresponding to the cross-chain call parameters, and obtain the cross-chain transaction result.

[0081] In some feasible implementations, after executing the target transaction, the first node may call the cross-chain repeater contract to generate a cross-chain transaction event. The specific implementation method may include:

[0082] After executing the target transaction, the first node determines the contract call parameters and the data consumption limit. The contract call parameters include at least one calling contract identifier and input parameters corresponding to each calling contract identifier. The calling contract identifier refers to the identifier of the contract called on the target chain; the first node calls the cross-chain repeater contract to process the contract call parameters and the data consumption limit to obtain the target random value; the first node determines the cross-chain initiator identifier, which is the initiator of the cross-chain transaction, which can be a business contract, and calls the cross-chain repeater contract to process the contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier to generate a cross-chain transaction event, thereby calling the cross-chain repeater contract, a unified cross-chain call interface, to generate a cross-chain transaction event in a standard format.

[0083] In some feasible implementations, the cross-chain repeater contract may include a relay processing method. The first node may obtain the relay processing method included in the cross-chain repeater contract, input the contract call parameters and the data consumption limit as parameters into the relay processing method for processing, and generate a target random value.

[0084] In some feasible implementations, the cross-chain repeater contract may also include an event generation method. The first node may obtain the event generation method included in the cross-chain repeater contract, input the contract call parameters, target random value, data consumption limit and cross-chain initiator identifier as cross-chain call parameters into the event generation method, and generate a cross-chain transaction event.

[0085] In some feasible implementations, the sample code of the Relayer contract (i.e., the cross-chain relayer contract) deployed on the source chain can be as follows:

[0086] / *Structure data type of contract call parameters* /

[0087] struct Call{

[0088] address target;

[0089] bytes data;

[0090] }

[0091] / *Cross-chain relay contract* /

[0092] interface Relayer{

[0093] function relaycalls(Call[]calldata calls,uint256 max)external payablereturns(uint256 nonce);

[0094] event relaycalls(uint256 indexed nonce,address indexed sender,Call[]calls,uint256 max);

[0095] }

[0096] Among them, the function relaycalls function corresponds to the above-mentioned relay processing method, and its function is to trigger the following cross-chain event event relaycalls (corresponding to the above-mentioned event generation method) after execution. The function relaycalls function is called by the external object of the contract. The external object can be, for example, a business contract on the source chain. By calling the function relaycalls function of the Relayer contract and passing in unified parameters, the Relayer contract can issue a cross-chain transaction event through the event relaycalls function.

[0097] Among them, Call[] refers to the defined structure data type, calldata refers to the data storage type on the chain, calls are specific parameters (corresponding to the above-mentioned contract call parameters); max is the maximum cost allowed for this cross-chain transaction (corresponding to the above-mentioned data consumption limit); nonce is a random value (such as the above-mentioned target random value), which is used by the source chain and the target chain to prevent an off-chain event from being repeatedly executed on the chain. For example, if the target chain executes a cross-chain event with a nonce of 10, the next time it is called, it will be executed only if the nonce is 11. If the nonce is less than or equal to 10, it will be refused to execute, thereby ensuring that the cross-chain transaction event will only be executed once; Sender is used to indicate which business contract on the source chain calls the Relayer contract. When the business contract calls the Relayer contract, the Relayer contract will obtain which business contract is calling it through the system function;

[0098] Among them, indexeds is a type of data storage. Since there are a large number of blocks on the chain, each block includes multiple transactions, and there will be multiple events in a transaction. In order to better retrieve these events, some indexes are added to these fields. The index can indicate that an index is established for the field of the event. The purpose is to allow external applications to better query this data from the blockchain.

[0099] In some feasible implementations, the contract call parameter calls can be in array form, thereby realizing the execution of batch cross-chain transactions and improving the overall efficiency of the cross-chain system.

[0100] Among them, the executor contract can be deployed in the target chain (i.e., the target blockchain, such as the second blockchain mentioned above), and can be specifically deployed on each node in the blockchain network corresponding to the target chain. The executor contract is used to provide a unified cross-chain call interface for the target chain to process the cross-chain call transaction of the source chain to the business contract on the target chain, and return the cross-chain transaction result to the cross-chain relay service (such as the relay server mentioned above).

[0101] In some feasible implementations, the sample code of the Executor contract (i.e., executor contract) deployed on the target chain can be as follows:

[0102] / *Executor contract* /

[0103] interface Executor{

[0104] function executorCalls(uint256 indexed nonce,address indexed sender,Call[]calldata calls,uint256 max)external payable returns(bool success);

[0105] event executorCalls(uint256 indexed nonce,address indexed sender,Call[]calls,uint256 max);

[0106] }

[0107] Among them, the function executorCalls is called by the relay server under the chain. After calling this function, the target chain will also send a specified event (i.e. event executorCalls) to indicate that the cross-chain call has indeed been executed on the target chain, that is, the cross-chain transaction has been executed, which is equivalent to the notification event generated after the target chain completes the cross-chain transaction. After the relay server hears the notification event, it confirms that the cross-chain transaction has been executed.

[0108] In some feasible implementations, the function executorCalls of the executor contract will parse and call the data in the calls structure in sequence when executed, and call the contracts in sequence according to the contract address to execute cross-chain transactions. After all cross-chain transactions are executed, the event executorCalls function will generate a cross-chain transaction completion event.

[0109] It can be understood that from the relay and executor function interfaces deployed on the source chain and the target chain above, the calling interfaces for different decentralized applications are the same. Through the above unified cross-chain transaction calling interface, cross-chain calling smart contract transactions can be executed on the source chain and the target chain respectively, thereby realizing a unified cross-chain calling interface and effectively adapting to the cross-chain requirements of different decentralized applications.

[0110] 203. The first node receives the cross-chain transaction result sent by the relay server, and the cross-chain transaction result is sent to the relay server by the second node.

[0111] 204. The first node determines a target transaction result based on the cross-chain transaction result, and sends the target transaction result to the business server.

[0112] In the specific implementation, the first node receives the cross-chain transaction result sent by the relay server. The cross-chain transaction result can be a cross-chain transaction corresponding to the cross-chain call parameter executed by the second node, and after obtaining the cross-chain transaction result, it is sent to the relay server. The second node can specifically send the cross-chain transaction result to the relay server through the cross-chain transaction completion event. Specifically, the relay server can obtain the cross-chain transaction result of the second node by listening to the cross-chain transaction completion event of the second node. The first node determines the final execution result of the target transaction (which can be recorded as the target transaction result) based on the cross-chain transaction result, and sends the target transaction result to the business server. The business server can display the target transaction result to the target object through the front-end terminal device.

[0113] In some feasible implementations, if the second node does not need the first node to further execute related transactions after executing the cross-chain transaction, the first node can directly use the cross-chain transaction result of the second node as the target transaction result.

[0114] In some feasible implementations, if the second node needs the first node to further execute related transactions after executing the cross-chain transaction, the roles of the first blockchain where the first node is located and the second blockchain where the second node is located are swapped, that is, the second blockchain is used as the source chain and the first blockchain is used as the target chain. After the second node completes the cross-chain transaction, it can add a cross-chain result parameter to the cross-chain transaction result. The cross-chain result parameter includes at least one call contract identifier and cross-chain result data corresponding to each call contract identifier, which is used to indicate which business contracts of the first blockchain the second blockchain needs to call and the corresponding parameters (such as cross-chain result data) passed in. After receiving the cross-chain transaction result, the first node can obtain at least one call contract identifier included in the cross-chain transaction result and the cross-chain result data corresponding to each call contract identifier, determine the first smart contract based on each call contract identifier included in the cross-chain result parameter, and call the first smart contract to process the corresponding cross-chain result data in the cross-chain result parameter to obtain the target transaction result.

[0115] It should be noted that the concepts of source chain and target chain are distinguished from the perspective of business needs or business functions. Which chain is used as the source chain and which chain is used as the target chain to execute the cross-chain call of the smart contract can be flexibly specified according to the business flow, and the embodiments of this application do not limit this.

[0116] In an embodiment of the present application, after the first node of the first blockchain obtains the target transaction of the business server, it can execute the target transaction, and then call the cross-chain repeater contract to generate a cross-chain transaction event. The cross-chain transaction event includes cross-chain call parameters, and the cross-chain call parameters may include one or more of contract call parameters, target random values, data consumption limit amounts, and cross-chain initiator identifiers. When the relay server hears the cross-chain transaction event, it can send a cross-chain transaction request to the second node of the second blockchain based on the cross-chain transaction event, so that the second node can determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters, and send the cross-chain transaction result to the relay server. After receiving the cross-chain transaction result sent by the relay server, the first node can determine the target transaction result based on the cross-chain transaction result, and return the target transaction result to the business server. In the above cross-chain business, the first blockchain can be regarded as the source chain, and the second blockchain can be regarded as the target chain. It can be seen that by deploying cross-chain repeater contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined to effectively adapt to the cross-chain requirements of different decentralized applications. The source chain interacts with the relay server through a unified cross-chain call interface and sends cross-chain business to the target chain, thereby simplifying the implementation of cross-chain business and effectively reducing cross-chain costs.

[0117] See also Figure 3 , is the embodiment of this application based on Figure 1aThe data processing system shown in FIG. 1 is a flowchart of another data processing method based on a blockchain network, which can be applied to Figure 1a The node 104 in the blockchain network 14, such as the second node, may specifically include the following steps:

[0118] 301. The second node receives a cross-chain transaction request sent by the relay server, where the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, where the cross-chain transaction event includes cross-chain call parameters, where the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, where the cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, where the first node is any node in the blockchain network corresponding to the first blockchain, and where the second node is any node in the blockchain network corresponding to the second blockchain.

[0119] Among them, the contract call parameters are used to indicate the contract being called on the target chain and the corresponding parameters passed in. The target random value is used to prevent off-chain events (such as cross-chain transaction events) from being repeated on the chain, that is, to ensure that cross-chain transaction events will only be executed once. The data consumption limit is used to indicate the maximum amount of spending allowed for a cross-chain transaction. The cross-chain initiator identifier is used to indicate the initiator of the cross-chain transaction, for example, it can be the blockchain address of the target object or the identifier of a business contract.

[0120] 302. The second node responds to the cross-chain transaction request, executes the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtains a cross-chain transaction result.

[0121] In the specific implementation, after the second node receives the cross-chain transaction request from the relay server, it obtains the cross-chain call parameters from the cross-chain transaction request, and then executes the cross-chain transaction based on the deployed executor contract and the cross-chain call parameters to obtain the cross-chain transaction result. The cross-chain transaction request can be understood as a call request from the relay server to the executor contract of the second node. After receiving the call request, the second node uses the executor contract to process the passed parameters (i.e., cross-chain call parameters), that is, to execute the cross-chain transaction.

[0122] In some feasible implementations, the cross-chain call parameters include contract call parameters, the executor contract may include a contract execution method, such as the function executorCalls function described above, and the second node executes a cross-chain transaction based on the executor contract and the cross-chain call parameters. The specific implementation method for obtaining the cross-chain transaction result may include: the second node responds to the cross-chain transaction request, obtains the contract execution method of the executor contract, calls the contract execution method to parse and process the contract call parameters included in the cross-chain call parameters in sequence, obtains at least one calling contract identifier included in the contract call parameters and the input parameters corresponding to each calling contract identifier, and then determines the second smart contract based on each calling contract identifier included in the contract call parameters, and sequentially calls the determined second smart contracts to process the corresponding input parameters in the contract call parameters to obtain the cross-chain transaction result.

[0123] In some feasible implementations, the cross-chain call parameters in the cross-chain transaction event may also include a target random value and a data consumption limit. The second node may also call the contract execution method to determine whether the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction based on the target random value, and determine whether the cross-chain transaction corresponding to the cross-chain transaction request is an executable transaction based on the data consumption limit; if the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction and an executable transaction, the second node will execute the step of calling the contract execution method to parse and process the cross-chain call parameters in sequence, thereby effectively preventing repeated execution of cross-chain transactions and controlling the execution cost of cross-chain transactions.

[0124] In some feasible implementations, the executor contract may also include an event generation method, such as the event executorCalls function described above. The second node calls the second smart contract to process the corresponding input parameters in the contract call parameters to obtain the cross-chain transaction result. The specific implementation method may include: the second node calls the second smart contract to process the corresponding input parameters in the contract call parameters to obtain the execution result of the cross-chain call, and then calls the event generation method of the executor contract to generate a cross-chain result event, and then adds the execution result of the cross-chain call as a cross-chain result parameter to the cross-chain result event, and determines the cross-chain transaction result based on the cross-chain result event. For example, the cross-chain transaction result can be transmitted to the relay server through the cross-chain result event, so as to execute the cross-chain call smart contract transaction on the target chain through a unified cross-chain transaction call interface.

[0125] In some feasible implementations, if the second node needs the first node to execute related cross-chain transactions after executing the cross-chain transaction, the roles of the first blockchain where the first node is located and the second blockchain where the second node is located are swapped, that is, the second blockchain serves as the source chain and the first blockchain serves as the target chain. After the second node completes the cross-chain transaction, it can determine the cross-chain result parameters according to the execution result of the cross-chain call, and add the cross-chain result parameters to the cross-chain transaction result. The cross-chain result parameters include at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier, which are used to indicate which business contracts of the first blockchain the second blockchain needs to call and the corresponding incoming parameters (such as cross-chain result data). Then, the cross-chain result parameters are added to the cross-chain result event, and the cross-chain result event is used as the cross-chain transaction result, thereby realizing the free and flexible calling of smart contracts between different blockchains, which is conducive to the data processing efficiency of the blockchain.

[0126] 303. The second node sends the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

[0127] In the specific implementation, after the second node calls the smart contract running on itself to execute the cross-chain transaction, it can send the cross-chain transaction result to the relay server in the form of a cross-chain result event. After the relay server sends the cross-chain transaction result to the first node, the first node can determine the final target transaction result based on the cross-chain transaction result.

[0128] In the embodiment of the present application, the second node of the second blockchain receives the cross-chain transaction request sent by the relay server. The cross-chain transaction request is generated by the relay server based on the cross-chain transaction event of the first node. The cross-chain transaction event includes a cross-chain call parameter. The cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction; the second node executes the cross-chain transaction based on the executor contract and the cross-chain call parameter, obtains the cross-chain transaction result, and sends the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node. The first node can determine the target transaction result according to the cross-chain transaction result. Among them, the first blockchain can be regarded as the source chain, and the second blockchain can be regarded as the target chain. It can be seen that by deploying cross-chain repeater contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined to effectively adapt to the cross-chain requirements of different decentralized applications. The target chain interacts with the relay server through a unified cross-chain call interface and returns the cross-chain transaction result to the source chain, thereby simplifying the implementation of cross-chain business and effectively reducing cross-chain costs.

[0129] See also Figure 4 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flowchart of another data processing method based on a blockchain network, which can be applied to Figure 1a The relay server 11 in the embodiment may specifically include the following steps:

[0130] 401. When the relay server listens to a cross-chain transaction event generated by the first node, the relay server generates a cross-chain transaction request based on the cross-chain transaction event. The cross-chain transaction event includes cross-chain call parameters. The cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction. The cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain.

[0131] In the specific implementation, the relay server can obtain the event subscription information of the cross-chain relay contract registered in the first blockchain, and based on the event subscription information of the cross-chain relay contract, listen to the cross-chain transaction event generated by the first node of the source chain (first blockchain) through the cross-chain relay contract. When listening to the cross-chain transaction event generated by the first node, the cross-chain call parameters carried by the cross-chain transaction event can be parsed, and a cross-chain transaction for the target chain (second blockchain) can be generated. The cross-chain transaction can be sent to the second node of the target chain in the form of a request. Among them, the target transaction can be submitted through the business function of any decentralized application.

[0132] In some feasible implementations, the relay server may simply assemble the parameters in the calls structure, for example, by adding the parameters to the parameter list of the cross-chain transaction to form a cross-chain transaction, and then generate a cross-chain transaction request based on the cross-chain transaction.

[0133] 402. The relay server sends the cross-chain transaction request to the second node, where the cross-chain transaction request is used to instruct the second node to execute the cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result. The second node is any node in the blockchain network corresponding to the second blockchain.

[0134] 403. The relay server obtains the cross-chain transaction result of the second node, and sends the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

[0135] In the specific implementation, after the relay server constructs a cross-chain transaction for the target chain based on the cross-chain transaction event of the first node, it can send a cross-chain transaction request to the second node, that is, call the executor contract deployed by the second node to execute the cross-chain transaction. The second node executes the cross-chain transaction based on the executor contract and the cross-chain call parameters included in the cross-chain transaction request to obtain the cross-chain transaction result. After receiving the cross-chain transaction result from the second node, the relay server sends the cross-chain transaction result to the first node, so that the source chain obtains the cross-chain execution result of the target chain, and determines the final target transaction result based on the cross-chain transaction result.

[0136] In an embodiment of the present application, when the relay server hears a cross-chain transaction event generated by the first node, it generates a cross-chain transaction request based on the cross-chain transaction event and sends the cross-chain transaction request to the second node. The cross-chain transaction request is used to instruct the second node to perform a cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result; after the relay server obtains the cross-chain transaction result of the second node, it can send the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result. It can be seen that when the cross-chain relay service (such as the relay server mentioned above) interacts with the source chain and the target chain, no matter which decentralized application it is, what the business logic is, and what the specific parameters are, the cross-chain relay service does not care. The actions of the cross-chain relay service are the same, and the process is unified. The cross-chain relay service only needs to do simple parsing and assemble it into a cross-chain transaction of the target chain. There is no need to adapt the interface separately for different decentralized applications, which greatly reduces the adaptation cost of the cross-chain relay service. By deploying cross-chain repeater contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined, thereby simplifying the implementation of cross-chain business and effectively reducing cross-chain costs.

[0137] See also Figure 5 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flowchart of another data processing method based on a blockchain network, which can be applied to Figure 1a The business server 15, the node 102 (such as the first node) in the blockchain network 12, the node 104 (such as the second node) in the blockchain network 14, and the relay server 11 may specifically include the following steps:

[0138] 501. A first node obtains a target transaction of a business server, wherein the first node is any node in a blockchain network corresponding to a first blockchain.

[0139] 502. After executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, where the cross-chain transaction event includes cross-chain call parameters, where the cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier.

[0140] 503. When the relay server hears the cross-chain transaction event generated by the first node, it generates a cross-chain transaction request based on the cross-chain transaction event.

[0141] 504. The relay server sends the cross-chain transaction request to a second node, where the second node is any node in the blockchain network corresponding to the second blockchain.

[0142] 505. The second node responds to the cross-chain transaction request, executes the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtains a cross-chain transaction result.

[0143] 506. The second node sends the cross-chain transaction result to the relay server.

[0144] 507. After receiving the cross-chain transaction result, the relay server sends the cross-chain transaction result to the first node.

[0145] 508. The first node determines a target transaction result based on the cross-chain transaction result.

[0146] 509. The first node sends the target transaction result to the business server.

[0147] The specific implementation of steps 501 to 509 can refer to the relevant description of the corresponding steps in the above embodiments, which will not be repeated here.

[0148] See also Figure 6 , is a schematic diagram of the overall implementation process of a cross-chain service provided in an embodiment of the present application, which may specifically include the following steps:

[0149] 601. The target object initiates a transaction request of blockchain A through the blockchain applet on the terminal device.

[0150] Among them, the target object can specifically be a business user or a transaction initiator, and the blockchain applet can run on a terminal device.

[0151] 602. The mini program backend service signs the transaction according to the key escrow type of the target object.

[0152] Among them, the mini program background service obtains the key hosting type of the target object. If the target object is key managed, the transaction request of the target object is signed; if it is not managed, the target object is digitally signed.

[0153] 603. The mini program backend service puts the target object’s transaction on the chain.

[0154] in, Figure 6 The example in which the mini program backend service sends the target object's transaction to blockchain A is taken as an example.

[0155] 604. Blockchain A executes the transaction of the target object.

[0156] 605. Blockchain A issues a cross-chain event.

[0157] 606. The cross-chain relay service listens to cross-chain events on the chain.

[0158] 607. The cross-chain relay service parses the cross-chain event and forms a call transaction of blockchain B.

[0159] 608. The cross-chain relay service calls blockchain B.

[0160] 609. Blockchain B executes cross-chain transactions.

[0161] 610. Blockchain B returns the cross-chain transaction execution result to the cross-chain relay service.

[0162] 611. The cross-chain relay service calls blockchain A and passes in the cross-chain transaction execution result of blockchain B.

[0163] 612. Blockchain A executes cross-chain transactions.

[0164] 613. Blockchain A returns the transaction execution result to the mini program backend service.

[0165] 614. The mini program backend service displays the transaction execution results through the blockchain mini program front end on the terminal device.

[0166] Among them, blockchain A can correspond to the above-mentioned first blockchain, blockchain B can correspond to the above-mentioned second blockchain, the mini program background service can correspond to the above-mentioned business server, and the cross-chain relay service can correspond to the above-mentioned relay server.

[0167] In some feasible implementations, if blockchain B executes a cross-chain transaction, blockchain A does not need to execute a cross-chain transaction as well. For example, blockchain A only needs to ensure that blockchain B executes a cross-chain transaction, but blockchain A does not need to know or care about the cross-chain execution result of blockchain B. Then, after executing step 610, steps 611 to 614 may not be executed. Instead, the cross-chain relay service returns the transaction execution result (i.e., the cross-chain transaction execution result) to the mini program background service, and then the mini program background service displays the transaction execution result through the blockchain mini program front end on the terminal device.

[0168] In some feasible implementations, if blockchain B executes a cross-chain transaction, blockchain A also needs to execute a cross-chain transaction. For example, blockchain A needs to know the cross-chain result of blockchain B. If the execution is successful, one logic needs to be executed, and if the execution fails, another logic needs to be executed. Then, after executing step 610, continue to execute steps 611 to 614. For example, for the business scenario of asset transfer, when blockchain B fails to execute, blockchain A needs to execute a transaction to return the assets. When blockchain B executes successfully, blockchain A does not need to execute a transaction to return the assets. For example, the target object transfers an asset to the smart contract of blockchain A, and correspondingly needs to evaporate an asset to blockchain B (i.e., a cross-chain transaction); if blockchain B fails to execute asset evaporation, blockchain A needs to return the assets transferred by the target object. For example, blockchain B notifies the cross-chain relay service of the failed cross-chain transaction result, and the cross-chain relay service sends it to blockchain A, so that blockchain A executes the cross-chain transaction to return the assets and returns the execution result of the failed transaction to the mini program background service.

[0169] It can be seen that when the cross-chain relay service interacts with the source chain and the target chain, no matter which decentralized application it is, what the business logic is, or what the specific parameters are, the cross-chain relay service does not care. The actions of the cross-chain relay service are the same, and the process is unified. The cross-chain relay service does not need to adapt the interface separately for different decentralized applications, which greatly reduces the adaptation cost of the cross-chain relay service. By deploying cross-chain relay contracts and executor contracts on different blockchains, a unified cross-chain call interface can be defined, thereby simplifying the implementation of cross-chain business, effectively reducing cross-chain costs, and improving the processing efficiency of cross-chain business, which helps to improve the user experience of cross-chain business.

[0170] See also Figure 7 , is a schematic diagram of the structure of a data processing device according to an embodiment of the present application, the device comprising:

[0171] The acquisition module 701 is used to acquire the target transaction of the business server.

[0172] The processing module 702 is used to call the cross-chain repeater contract to generate a cross-chain transaction event after executing the target transaction. The cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event. The cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters. The cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The second node is any node in the blockchain network corresponding to the second blockchain.

[0173] The receiving module 703 is used to receive the cross-chain transaction result sent by the relay server, and the cross-chain transaction result is sent by the second node to the relay server.

[0174] The processing module 702 is further configured to determine a target transaction result based on the cross-chain transaction result.

[0175] The sending module 704 is used to send the target transaction result to the business server.

[0176] Optionally, the processing module 702 is specifically configured to:

[0177] After executing the target transaction, determining contract call parameters and data consumption limit, wherein the contract call parameters include at least one calling contract identifier and input parameters corresponding to each calling contract identifier;

[0178] Calling the cross-chain repeater contract to process the contract call parameters and the data consumption limit to obtain a target random value;

[0179] Determine the cross-chain initiator identifier, and call the cross-chain repeater contract to process the contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier to generate a cross-chain transaction event.

[0180] Optionally, the processing module 702 is specifically configured to:

[0181] Get the relay processing method included in the cross-chain repeater contract;

[0182] The contract call parameters and the data consumption limit are input as parameters into the relay processing method for processing to generate a target random value.

[0183] Optionally, the processing module 702 is specifically configured to:

[0184] Obtain the event generation method included in the cross-chain repeater contract;

[0185] The contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier are input into the event generation method as cross-chain call parameters to generate a cross-chain transaction event.

[0186] Optionally, the processing module 702 is specifically configured to:

[0187] Obtaining cross-chain result parameters included in the cross-chain transaction result, wherein the cross-chain result parameters include at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier;

[0188] Determine a first smart contract based on each calling contract identifier included in the cross-chain result parameter;

[0189] The first smart contract is called to process the corresponding cross-chain result data in the cross-chain result parameter to obtain the target transaction result.

[0190] Optionally, the acquisition module 701 is further used to obtain a digital signature of a target object carried by the target transaction; and obtain public key information of the target object from the first blockchain based on the blockchain account address of the target object;

[0191] The processing module 702 is further configured to verify the digital signature based on the public key information, and if the verification is successful, execute the target transaction.

[0192] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0193] See also Figure 8 , is a schematic diagram of the structure of another data processing device according to an embodiment of the present application, the device comprising:

[0194] The receiving module 801 is used to receive a cross-chain transaction request sent by a relay server, where the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, where the cross-chain transaction event includes a cross-chain call parameter, and where the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, where the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and where the first node is any node in the blockchain network corresponding to the first blockchain.

[0195] The processing module 802 is used to respond to the cross-chain transaction request, execute the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtain the cross-chain transaction result.

[0196] The sending module 803 is used to send the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

[0197] Optionally, the cross-chain call parameter includes the contract call parameter, and the processing module 802 is specifically used to:

[0198] Respond to the cross-chain transaction request and obtain the contract execution method of the executor contract;

[0199] Call the contract execution method to parse the contract call parameters included in the cross-chain call parameters in order to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier;

[0200] Determine a second smart contract based on each calling contract identifier included in the contract calling parameters;

[0201] The second smart contract is called to process the corresponding input parameters in the contract call parameters to obtain a cross-chain transaction result.

[0202] Optionally, the processing module 802 is specifically configured to:

[0203] Calling the second smart contract to process the corresponding input parameters in the contract call parameters to obtain the execution result of the cross-chain call;

[0204] Call the event generation method of the executor contract to generate a cross-chain result event;

[0205] The execution result of the cross-chain call is added as a cross-chain result parameter to the cross-chain result event, and the cross-chain transaction result is determined based on the cross-chain result event.

[0206] Optionally, the processing module 802 is specifically configured to:

[0207] Determine a cross-chain result parameter according to the execution result of the cross-chain call, wherein the cross-chain result parameter includes at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier;

[0208] The cross-chain result parameter is added to the cross-chain result event, and the cross-chain result event is used as the cross-chain transaction result.

[0209] Optionally, the cross-chain call parameter also includes the target random value and the data consumption limit, and the processing module 802 is further used to:

[0210] Calling the contract execution method to determine whether the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction based on the target random value, and determining whether the cross-chain transaction corresponding to the cross-chain transaction request is an executable transaction based on the data consumption limit;

[0211] If the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction and an executable transaction, the step of calling the contract execution method to parse and process the contract call parameters included in the cross-chain call parameters in sequence to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier.

[0212] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0213] See also Fig. 9 , is a structural diagram of another data processing device according to an embodiment of the present application, the device comprising:

[0214] The generation module 901 is used to generate a cross-chain transaction request based on the cross-chain transaction event generated by the first node when the cross-chain transaction event is heard. The cross-chain transaction event includes cross-chain call parameters. The cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction. The cross-chain call parameters include one or more of contract call parameters, target random value, data consumption limit and cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain.

[0215] The sending module 902 is used to send the cross-chain transaction request to the second node, where the cross-chain transaction request is used to instruct the second node to execute the cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result. The second node is any node in the blockchain network corresponding to the second blockchain.

[0216] The acquisition module 903 is used to obtain the cross-chain transaction result of the second node.

[0217] The sending module 902 is further used to send the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

[0218] Optionally, the device further includes a receiving module 904, wherein:

[0219] The acquisition module 903 is further used to obtain event subscription information of the cross-chain repeater contract registered in the first blockchain;

[0220] The receiving module 904 is used to listen to the cross-chain transaction events generated by the cross-chain repeater contract based on the event subscription information of the cross-chain repeater contract.

[0221] Optionally, the generating module 901 is specifically used for:

[0222] When a cross-chain transaction event generated by the first node is listened to, the cross-chain call parameters included in the cross-chain transaction event are parsed to generate a cross-chain transaction for the second blockchain;

[0223] A cross-chain transaction request is generated based on the cross-chain transaction.

[0224] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0225] See also Fig.10 , is a schematic diagram of the structure of a computer device in an embodiment of the present application, wherein the computer device in an embodiment of the present application includes a power supply module and other structures, and includes a processor 1001, a storage device 1002, and a network interface 1003. The processor 1001, the storage device 1002, and the network interface 1003 can exchange data.

[0226] The storage device 1002 may include a volatile memory, such as a random-access memory (RAM); the storage device 1002 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the storage device 1002 may also include a combination of the above-mentioned types of memory.

[0227] The processor 1001 may be a central processing unit (CPU). In one embodiment, the processor 1001 may also be a graphics processing unit (GPU). The processor 1001 may also be a combination of a CPU and a GPU.

[0228] In one embodiment, the storage device 1002 is used to store program instructions. When the processor 1001 is a processor of the first node, the program instructions can be called to perform the following operations:

[0229] Get the target transaction of the business server.

[0230] After executing the target transaction, the cross-chain repeater contract is called to generate a cross-chain transaction event, and the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, and the cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameters. The cross-chain call parameters include one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The second node is any node in the blockchain network corresponding to the second blockchain.

[0231] The cross-chain transaction result sent by the relay server is received through the network interface 1003, and the cross-chain transaction result is sent by the second node to the relay server.

[0232] A target transaction result is determined based on the cross-chain transaction result.

[0233] The target transaction result is sent to the business server through the network interface 1003.

[0234] Optionally, the processor 1001 is specifically configured to:

[0235] After executing the target transaction, determining contract call parameters and data consumption limit, wherein the contract call parameters include at least one calling contract identifier and input parameters corresponding to each calling contract identifier;

[0236] Calling the cross-chain repeater contract to process the contract call parameters and the data consumption limit to obtain a target random value;

[0237] Determine the cross-chain initiator identifier, and call the cross-chain repeater contract to process the contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier to generate a cross-chain transaction event.

[0238] Optionally, the processor 1001 is specifically configured to:

[0239] Get the relay processing method included in the cross-chain repeater contract;

[0240] The contract call parameters and the data consumption limit are input as parameters into the relay processing method for processing to generate a target random value.

[0241] Optionally, the processor 1001 is specifically configured to:

[0242] Obtain the event generation method included in the cross-chain repeater contract;

[0243] The contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier are input into the event generation method as cross-chain call parameters to generate a cross-chain transaction event.

[0244] Optionally, the processor 1001 is specifically configured to:

[0245] Obtaining cross-chain result parameters included in the cross-chain transaction result, wherein the cross-chain result parameters include at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier;

[0246] Determine a first smart contract based on each calling contract identifier included in the cross-chain result parameter;

[0247] The first smart contract is called to process the corresponding cross-chain result data in the cross-chain result parameter to obtain the target transaction result.

[0248] Optionally, the processor 1001 is further used to obtain the digital signature of the target object carried by the target transaction; obtain the public key information of the target object from the first blockchain based on the blockchain account address of the target object; verify the digital signature based on the public key information, and if the verification passes, execute the target transaction.

[0249] In a specific implementation, the processor 1001, the storage device 1002, and the network interface 1003 described in the embodiments of the present application can execute the embodiments of the present application. Figure 2 The implementation described in the related embodiments of the provided method can also be implemented in the embodiments of the present application Figure 7 The implementation methods described in the relevant embodiments of the provided device will not be repeated here.

[0250] In one embodiment, the storage device 1002 is used to store program instructions. When the processor 1001 is a processor of the second node, the program instructions can be called to perform the following operations:

[0251] A cross-chain transaction request sent by a relay server is received through the network interface 1003, wherein the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, and the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, wherein the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the first node is any node in the blockchain network corresponding to the first blockchain.

[0252] In response to the cross-chain transaction request, the cross-chain transaction is executed based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result.

[0253] The cross-chain transaction result is sent to the relay server through the network interface 1003, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

[0254] Optionally, the cross-chain call parameter includes the contract call parameter, and the processor 1001 is specifically used to:

[0255] Respond to the cross-chain transaction request and obtain the contract execution method of the executor contract;

[0256] Call the contract execution method to parse the contract call parameters included in the cross-chain call parameters in order to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier;

[0257] Determine a second smart contract based on each calling contract identifier included in the contract calling parameters;

[0258] The second smart contract is called to process the corresponding input parameters in the contract call parameters to obtain a cross-chain transaction result.

[0259] Optionally, the processor 1001 is specifically configured to:

[0260] Calling the second smart contract to process the corresponding input parameters in the contract call parameters to obtain the execution result of the cross-chain call;

[0261] Call the event generation method of the executor contract to generate a cross-chain result event;

[0262] The execution result of the cross-chain call is added as a cross-chain result parameter to the cross-chain result event, and the cross-chain transaction result is determined based on the cross-chain result event.

[0263] Optionally, the processor 1001 is specifically configured to:

[0264] Determine a cross-chain result parameter according to the execution result of the cross-chain call, wherein the cross-chain result parameter includes at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier;

[0265] The cross-chain result parameter is added to the cross-chain result event, and the cross-chain result event is used as the cross-chain transaction result.

[0266] Optionally, the cross-chain call parameter also includes the target random value and the data consumption limit, and the processor 1001 is further configured to:

[0267] Calling the contract execution method to determine whether the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction based on the target random value, and determining whether the cross-chain transaction corresponding to the cross-chain transaction request is an executable transaction based on the data consumption limit;

[0268] If the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction and an executable transaction, the step of calling the contract execution method to parse and process the contract call parameters included in the cross-chain call parameters in sequence to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier.

[0269] In a specific implementation, the processor 1001, the storage device 1002, and the network interface 1003 described in the embodiments of the present application can execute the embodiments of the present application. Figure 3 The implementation described in the related embodiments of the provided method can also be implemented in the embodiments of the present application Figure 8 The implementation methods described in the relevant embodiments of the provided device will not be repeated here.

[0270] In one embodiment, the storage device 1002 is used to store program instructions. When the processor 1001 is a processor of a relay server, the program instructions can be called to perform the following operations:

[0271] When a cross-chain transaction event generated by the first node is listened to through the network interface 1003, a cross-chain transaction request is generated based on the cross-chain transaction event, and the cross-chain transaction event includes cross-chain call parameters. The cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction. The cross-chain call parameters include one or more of contract call parameters, target random value, data consumption limit and cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain.

[0272] The cross-chain transaction request is sent to the second node through the network interface 1003, and the cross-chain transaction request is used to instruct the second node to perform a cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result. The second node is any node in the blockchain network corresponding to the second blockchain.

[0273] Obtain the cross-chain transaction result of the second node.

[0274] The cross-chain transaction result is sent to the first node through the network interface 1003, so that the first node determines the target transaction result based on the cross-chain transaction result.

[0275] Optionally, the processor 1001 is further used to obtain event subscription information of the cross-chain repeater contract registered in the first blockchain; and based on the event subscription information of the cross-chain repeater contract, listen to the cross-chain transaction events generated by the cross-chain repeater contract.

[0276] Optionally, the processor 1001 is specifically configured to:

[0277] When a cross-chain transaction event generated by the first node is listened to, the cross-chain call parameters included in the cross-chain transaction event are parsed to generate a cross-chain transaction for the second blockchain;

[0278] A cross-chain transaction request is generated based on the cross-chain transaction.

[0279] In a specific implementation, the processor 1001, the storage device 1002, and the network interface 1003 described in the embodiments of the present application can execute the embodiments of the present application. Figure 4 The implementation described in the related embodiments of the provided method can also be implemented in the embodiments of the present application Fig. 9 The implementation methods described in the relevant embodiments of the provided device will not be repeated here.

[0280] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a computer, a server or a network device, etc., specifically a processor in a computer device) to perform all or part of the steps of the above methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (English: Read-Only Memory, abbreviated: ROM) or random access memory (English: Random Access Memory, abbreviated: RAM) and other media that can store program codes.

[0281] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, it should be understood that the technical solutions recorded in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method based on a blockchain network, characterized in that: The method comprises: The first node obtains a target transaction of the business server, where the first node is any node in the blockchain network corresponding to the first blockchain; After executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, and the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, and the cross-chain transaction request is used to instruct the second node to determine the cross-chain transaction result based on the executor contract and the cross-chain call parameter, and the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the second node is any node in the blockchain network corresponding to the second blockchain; The first node receives the cross-chain transaction result sent by the relay server, where the cross-chain transaction result is sent by the second node to the relay server; The first node determines a target transaction result based on the cross-chain transaction result, and sends the target transaction result to the business server.

2. The method according to claim 1, characterized in that After executing the target transaction, the first node calls the cross-chain repeater contract to generate a cross-chain transaction event, including: After executing the target transaction, the first node determines a contract call parameter and a data consumption limit, wherein the contract call parameter includes at least one calling contract identifier and input parameters corresponding to each calling contract identifier; The first node calls the cross-chain repeater contract to process the contract call parameters and the data consumption limit to obtain a target random value; The first node determines the cross-chain initiator identifier, and calls the cross-chain repeater contract to process the contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier to generate a cross-chain transaction event.

3. The method according to claim 2, characterized in that The first node calls the cross-chain repeater contract to process the contract call parameters and the data consumption limit to obtain a target random value, including: The first node obtains the relay processing method included in the cross-chain repeater contract; The first node inputs the contract call parameters and the data consumption limit as parameters into the relay processing method for processing to generate a target random value.

4. The method according to claim 2 or 3, characterized in that: The first node calls the cross-chain repeater contract to process the contract call parameters, the target random value, the data consumption limit, and the cross-chain initiator identifier to generate a cross-chain transaction event, including: The first node obtains an event generation method included in the cross-chain repeater contract; The first node inputs the contract call parameters, the target random value, the data consumption limit and the cross-chain initiator identifier as cross-chain call parameters into the event generation method to generate a cross-chain transaction event.

5. The method according to claim 1 or 2, characterized in that: The first node determines a target transaction result based on the cross-chain transaction result, including: The first node obtains a cross-chain result parameter included in the cross-chain transaction result, where the cross-chain result parameter includes at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier; The first node determines the first smart contract based on each calling contract identifier included in the cross-chain result parameter; The first node calls the first smart contract to process the corresponding cross-chain result data in the cross-chain result parameter to obtain a target transaction result.

6. The method according to claim 1, characterized in that The method further comprises: The first node obtains a digital signature of a target object carried by the target transaction; The first node obtains the public key information of the target object from the first blockchain based on the blockchain account address of the target object; The first node verifies the digital signature based on the public key information, and executes the target transaction if the verification passes.

7. A data processing method based on a blockchain network, characterized in that: The method comprises: The second node receives a cross-chain transaction request sent by the relay server, wherein the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, and the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, wherein the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, wherein the first node is any node in the blockchain network corresponding to the first blockchain, and the second node is any node in the blockchain network corresponding to the second blockchain; The second node responds to the cross-chain transaction request, executes the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtains a cross-chain transaction result; The second node sends the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

8. The method according to claim 7, characterized in that The cross-chain call parameters include the contract call parameters. The second node responds to the cross-chain transaction request, executes the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtains a cross-chain transaction result, including: The second node responds to the cross-chain transaction request and obtains the contract execution method of the executor contract; The second node calls the contract execution method to parse the contract call parameters included in the cross-chain call parameters in order to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier; The second node determines a second smart contract based on each calling contract identifier included in the contract calling parameters; The second node calls the second smart contract to process the corresponding input parameters in the contract call parameters to obtain a cross-chain transaction result.

9. The method according to claim 8, characterized in that The second node calls the second smart contract to process the corresponding input parameters in the contract call parameters to obtain a cross-chain transaction result, including: The second node calls the second smart contract to process the corresponding input parameters in the contract call parameters to obtain the execution result of the cross-chain call; The second node calls the event generation method of the executor contract to generate a cross-chain result event; The second node adds the execution result of the cross-chain call as a cross-chain result parameter to the cross-chain result event, and determines the cross-chain transaction result based on the cross-chain result event.

10. The method according to claim 9, characterized in that The second node adds the execution result of the cross-chain call as a cross-chain result parameter to the cross-chain result event, and determines the cross-chain transaction result based on the cross-chain result event, including: The second node determines a cross-chain result parameter according to the execution result of the cross-chain call, where the cross-chain result parameter includes at least one calling contract identifier and cross-chain result data corresponding to each calling contract identifier; The second node adds the cross-chain result parameter to the cross-chain result event, and uses the cross-chain result event as the cross-chain transaction result.

11. The method according to any one of claims 8 to 10, characterized in that: The cross-chain call parameters also include the target random value and the data consumption limit. The second node calls the contract execution method to parse the contract call parameters included in the cross-chain call parameters in order, and before obtaining at least one call contract identifier included in the contract call parameters and input parameters corresponding to each call contract identifier, the method also includes: The second node calls the contract execution method to determine whether the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction based on the target random value, and determines whether the cross-chain transaction corresponding to the cross-chain transaction request is an executable transaction based on the data consumption limit; If the cross-chain transaction corresponding to the cross-chain transaction request is an unexecuted transaction and an executable transaction, the second node executes the step of calling the contract execution method to parse and process the contract call parameters included in the cross-chain call parameters in sequence to obtain at least one calling contract identifier included in the contract call parameters and input parameters corresponding to each calling contract identifier.

12. A data processing method based on a blockchain network, characterized in that: The method comprises: When the relay server listens to the cross-chain transaction event generated by the first node, the relay server generates a cross-chain transaction request based on the cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, and the cross-chain transaction event is generated by the first node calling the cross-chain repeater contract after executing the target transaction. The cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier. The first node is any node in the blockchain network corresponding to the first blockchain; The relay server sends the cross-chain transaction request to the second node, where the cross-chain transaction request is used to instruct the second node to execute the cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result, and the second node is any node in the blockchain network corresponding to the second blockchain; The relay server obtains the cross-chain transaction result of the second node, and sends the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

13. The method according to claim 12, characterized in that The method further comprises: The relay server obtains event subscription information of the cross-chain relayer contract registered in the first blockchain; The relay server listens to the cross-chain transaction events generated by the cross-chain repeater contract based on the event subscription information of the cross-chain repeater contract.

14. The method according to claim 12 or 13, characterized in that When the relay server hears the cross-chain transaction event generated by the first node, the relay server generates a cross-chain transaction request based on the cross-chain transaction event, including: When the relay server hears the cross-chain transaction event generated by the first node, it parses the cross-chain call parameters included in the cross-chain transaction event to generate a cross-chain transaction for the second blockchain; The relay server generates a cross-chain transaction request based on the cross-chain transaction.

15. A data processing device, characterized in that: The device comprises: An acquisition module, used to acquire a target transaction of a business server; A processing module, configured to, after executing the target transaction, call a cross-chain repeater contract to generate a cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, so that when the relay server hears the cross-chain transaction event, it sends a cross-chain transaction request to the second node based on the cross-chain transaction event, wherein the cross-chain transaction request is used to instruct the second node to determine a cross-chain transaction result based on the executor contract and the cross-chain call parameter, wherein the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the second node is any node in the blockchain network corresponding to the second blockchain; A receiving module, configured to receive the cross-chain transaction result sent by the relay server, where the cross-chain transaction result is sent by the second node to the relay server; The processing module is further used to determine the target transaction result based on the cross-chain transaction result; A sending module is used to send the target transaction result to the business server.

16. A data processing device, characterized in that: The device comprises: A receiving module, configured to receive a cross-chain transaction request sent by a relay server, wherein the cross-chain transaction request is generated by the relay server based on a cross-chain transaction event, wherein the cross-chain transaction event includes a cross-chain call parameter, and wherein the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, wherein the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and wherein the first node is any node in the blockchain network corresponding to the first blockchain; A processing module, used to respond to the cross-chain transaction request, execute the cross-chain transaction based on the executor contract and the cross-chain call parameters, and obtain a cross-chain transaction result; A sending module is used to send the cross-chain transaction result to the relay server, so that the relay server sends the cross-chain transaction result to the first node, and the cross-chain transaction result is used by the first node to determine the target transaction result.

17. A data processing device, characterized in that: The device comprises: A generation module, configured to generate a cross-chain transaction request based on a cross-chain transaction event generated by a first node when the cross-chain transaction event is heard, wherein the cross-chain transaction event includes a cross-chain call parameter, and the cross-chain transaction event is generated by the first node calling a cross-chain repeater contract after executing a target transaction, and the cross-chain call parameter includes one or more of a contract call parameter, a target random value, a data consumption limit, and a cross-chain initiator identifier, and the first node is any node in the blockchain network corresponding to the first blockchain; A sending module, used to send the cross-chain transaction request to the second node, wherein the cross-chain transaction request is used to instruct the second node to execute the cross-chain transaction based on the executor contract and the cross-chain call parameters to obtain a cross-chain transaction result, and the second node is any node in the blockchain network corresponding to the second blockchain; An acquisition module, used to acquire the cross-chain transaction result of the second node; The sending module is further used to send the cross-chain transaction result to the first node, so that the first node determines the target transaction result based on the cross-chain transaction result.

18. A computer device, characterized in that: The computer device includes a processor, a network interface and a storage device, wherein the processor, the network interface and the storage device are interconnected, wherein the network interface is controlled by the processor for sending and receiving data, and the storage device is used to store a computer program, and the computer program includes program instructions. The processor is configured to call the program instructions to execute the data processing method based on the blockchain network according to any one of claims 1 to 6, or the data processing method based on the blockchain network according to any one of claims 7 to 11, or the data processing method based on the blockchain network according to any one of claims 12 to 14.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions, and the program instructions are executed by a processor to execute the data processing method based on a blockchain network as described in any one of claims 1 to 6, or the data processing method based on a blockchain network as described in any one of claims 7 to 11, or the data processing method based on a blockchain network as described in any one of claims 12 to 14.

20. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a computer processor, the data processing method based on the blockchain network described in any one of claims 1 to 6 is implemented, or the data processing method based on the blockchain network described in any one of claims 7 to 11, or the data processing method based on the blockchain network described in any one of claims 12 to 14.

Citation Information

Cited By

  • Accounting method, platform, product and equipment for profit sharing, and storage medium

    CN119151666A

  • Data management and cross-platform scheduling method and system based on alliance chain

    CN119544364A