WO2024103856A1 - 一种基于区块链的数据处理方法、设备以及可读存储介质 - Google Patents

一种基于区块链的数据处理方法、设备以及可读存储介质 Download PDF

Info

Publication number
WO2024103856A1
WO2024103856A1 PCT/CN2023/111728 CN2023111728W WO2024103856A1 WO 2024103856 A1 WO2024103856 A1 WO 2024103856A1 CN 2023111728 W CN2023111728 W CN 2023111728W WO 2024103856 A1 WO2024103856 A1 WO 2024103856A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
blockchain
transfer
address
virtual resource
Prior art date
Application number
PCT/CN2023/111728
Other languages
English (en)
French (fr)
Inventor
时一防
王宗友
刘区城
朱耿良
刘汉卿
廖志勇
黄杨峻
聂凯轩
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to US18/527,493 priority Critical patent/US20240160755A1/en
Publication of WO2024103856A1 publication Critical patent/WO2024103856A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present application relates to the field of Internet technology, and in particular to a data processing method, device, and readable storage medium based on blockchain.
  • a third-party intermediary recognized by both parties is required to transfer resources between the two blockchains. For example, when a virtual resource is transferred from a first address in a first blockchain to a second address in a second blockchain, the first address needs to first send the virtual resource to a third-party intermediary recognized by both the first blockchain and the second blockchain, and then forward the virtual resource to the second address through the third-party intermediary.
  • the above cross-chain resource transfer relies on the resource transfer of a third-party intermediary, so the efficiency of resource transfer is low.
  • the third-party intermediary since the third-party intermediary will directly access the virtual resources, there may be a risk of virtual resources being stolen outside the first blockchain and the second blockchain, thereby reducing the security of resource transfer.
  • the embodiments of the present application provide a blockchain-based data processing method, device, and readable storage medium, which can safely and efficiently transfer resources across chains.
  • an embodiment of the present application provides a data processing method based on blockchain, which is executed by a first service node and includes:
  • a resource cross-chain transfer request initiated by a first account is obtained;
  • the resource cross-chain transfer request includes a virtual resource value, a first resource transfer-out address deployed by the first account on the first blockchain, and a first resource transfer-in address deployed by the first account on the second blockchain;
  • the second blockchain is different from the first blockchain;
  • the resource cross-chain transfer request is used to instruct the second business node to lock a first virtual resource to be obtained by the first account for the first resource transfer-in address in the second blockchain, and the first virtual resource corresponds to the virtual resource value;
  • the first business node is a business node corresponding to the first blockchain;
  • the second business node is a business node corresponding to the second blockchain;
  • a second virtual resource associated with the virtual resource value in the first resource transfer-out address is processed for resource transfer; wherein, if the second virtual resource is successfully transferred out, the first virtual resource is transferred to the first resource transfer-in address in the second blockchain.
  • an embodiment of the present application provides a data processing device based on blockchain, which runs on a first service node, and includes:
  • a first acquisition module is used to acquire a resource cross-chain transfer request initiated by a first account;
  • the resource cross-chain transfer request includes a virtual resource value, a first resource transfer-out address deployed by the first account on the first blockchain, and a first resource transfer-in address deployed by the first account on the second blockchain;
  • the second blockchain is different from the first blockchain;
  • the resource cross-chain transfer request is used to instruct the second business node to lock the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second blockchain, and the first virtual resource corresponds to the virtual resource value;
  • the first business node is the business node corresponding to the first blockchain;
  • the second business node is the business node corresponding to the second blockchain;
  • the second acquisition module is used to perform resource transfer processing on the second virtual resource associated with the virtual resource value in the first resource transfer-out address if the second business node successfully locks the first virtual resource; wherein, if the second virtual resource is successfully transferred out, the first virtual resource is transferred to the first resource transfer-in address in the second blockchain.
  • the present application provides a computer device, including: a processor, a memory, and a network interface;
  • the processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication
  • the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method in the embodiment of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored.
  • the computer program is suitable for being loaded by a processor and executing the method in the embodiment of the present application.
  • an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method in the embodiment of the present application.
  • the first business node corresponding to the first blockchain instructs the second business node corresponding to the second blockchain to lock the first virtual resource to be obtained by the first account at the first resource transfer-in address of the second blockchain deployed for the first account in the second blockchain through the resource cross-chain transfer request; wherein the second blockchain is different from the first blockchain; through this process, the problem of transferring the first virtual resource to the first resource transfer-in address when the first resource transfer-out address has not transferred out the second virtual resource can be avoided, so the computing consumption caused by invalid resource transfer can be avoided;
  • the second service node successfully locks the first virtual resource
  • the second virtual resource associated with the virtual resource value in the first resource transfer address is processed for resource transfer; this process converts the cross-chain resource transfer into the intra-chain resource transfer through the first virtual resource locked by the second blockchain, thereby improving the resource transfer efficiency;
  • the first virtual resource is transferred to the first resource transfer address in the second blockchain; by performing resource transfer in the first blockchain and the second blockchain respectively, the first virtual resource and the second virtual resource are prevented from being transferred through a third party. Since the second virtual resource will not be transferred out of the first blockchain, and the first virtual resource will not be transferred out of the second blockchain, the security of the first virtual resource and the second virtual resource can be improved. That is, through the first virtual resource, the second virtual resource and the resource transfer certificate, cross-chain resource transfer can be performed safely and efficiently within the first blockchain and the second blockchain.
  • FIG1 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG2 is a schematic diagram of a scenario of data processing based on blockchain provided in an embodiment of the present application.
  • FIG3 is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application.
  • FIG4 is a second schematic diagram of a scenario of data processing based on blockchain provided in an embodiment of the present application.
  • FIG5 is a third schematic diagram of a scenario of data processing based on blockchain provided in an embodiment of the present application.
  • FIG6 is a fourth schematic diagram of a scenario of data processing based on blockchain provided in an embodiment of the present application.
  • FIG. 7 is a second flow chart of a data processing method based on blockchain provided in an embodiment of the present application.
  • FIG8 is an interactive schematic diagram of a blockchain-based resource cross-chain transfer contract synchronization method provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of an association relationship between a first blockchain and a second blockchain provided in an embodiment of the present application.
  • FIG10 is an interactive flow chart 1 of a data processing method based on blockchain provided in an embodiment of the present application.
  • FIG11 is a second interactive flow chart of a blockchain-based data processing method provided in an embodiment of the present application.
  • FIG12 is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application.
  • FIG. 13 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application.
  • Blockchain In a narrow sense, blockchain is a chain data structure with blocks as the basic unit. Digital summaries are used in blocks to verify previously acquired transaction histories, which is suitable for the needs of tamper-proof and scalability in distributed accounting scenarios. In a broad sense, blockchain also refers to the distributed accounting technology implemented by the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocols, smart contracts, etc. The goal of the blockchain is to implement a distributed data record book, which only allows additions but not deletions.
  • the basic structure of the underlying ledger is a linear linked list. The linked list is composed of a series of "blocks", and the subsequent block records the hash value of the previous block. Each block (and the transactions in the block) Whether it is legal or not can be quickly verified by calculating the hash value. If a node in the network proposes to add a new block, the consensus mechanism must be used to reach a consensus on the block.
  • Block It is a data packet that carries transaction data on the blockchain network. It is a data structure marked with a timestamp and the hash value corresponding to the previous block. The block is verified and confirmed by the consensus mechanism of the network.
  • the block includes a block header (Block Header) and a block body (Block Body).
  • the block header can record the meta information of the current block, including the current version number, the hash value corresponding to the previous block, the timestamp, the random number, the hash value of the Merkle Root, and other data.
  • the block body can record the detailed data generated within a period of time, including all transaction records or other information generated during the block creation process that have been verified by the current block, which can be understood as a form of account book.
  • the detailed data of the block body can include the unique Merkle Root generated through the hash process of the Merkle Tree and recorded in the block header.
  • Hash value Also known as information characteristic value or characteristic value, the hash value is generated by converting input data of any length into a password and performing a fixed output through a hash algorithm. The original input data cannot be retrieved by decrypting the hash value. It is a one-way encryption function. In the blockchain, each block (except the initial block) contains the hash value of the previous block. The hash value is the potential core foundation and the most important aspect of blockchain technology. It retains the authenticity of the recorded and viewed data, as well as the integrity of the blockchain as a whole.
  • the blockchain network divides blockchain nodes into consensus nodes (also called core nodes and full nodes) and business nodes (also called lightweight nodes, Simplified Payment Verification, SPV for short).
  • the consensus node is responsible for the consensus business of the entire blockchain network;
  • the business node is responsible for synchronizing the ledger information of the consensus node, that is, synchronizing the latest block data.
  • its internal structure includes network communication components, because the blockchain network is essentially a peer-to-peer (P2P) network, which needs to communicate with other nodes in the blockchain network through P2P components.
  • P2P peer-to-peer
  • the resources and services in the blockchain network are scattered on each node, and the transmission of information and the implementation of services are carried out directly between nodes without the intervention of intermediate links or centralized servers (third parties).
  • Merkle tree Merkle root
  • Merkle root is a typical binary tree structure, consisting of a root node (Merkle root), a set of intermediate nodes and a set of leaf nodes.
  • the bottom leaf node stores data or its hash value, and other nodes store the hash values of the contents of their two child nodes.
  • Asymmetric signature This algorithm includes two keys, a public key (public key for short) and a private key (private key for short). The public key and the private key are a pair. If the private key is used to sign data, the signature can only be verified with the corresponding public key. Because the signing process and the verification process use two different keys, this algorithm is called an asymmetric signature.
  • the basic process of asymmetric signature to achieve confidential information exchange can be: Party A generates a pair of keys and makes the public key public. When Party A needs to send information to other roles (Party B), it uses its own private key to sign the confidential information and then sends it to Party B; Party B then uses Party A's public key to verify the signed information.
  • Smart Contract A computer protocol designed to disseminate, verify or execute contracts in an information-based manner.
  • a smart contract (contract for short) is a code that can be understood and executed by each node of the blockchain, which can execute any logic and obtain results.
  • smart contracts are managed and tried out through transactions on the blockchain.
  • Each transaction is equivalent to a remote procedure call (RPC) request to the blockchain system.
  • RPC remote procedure call
  • the blockchain is equivalent to an operating system that provides an operating environment.
  • a blockchain can contain multiple contracts (such as the local resource cross-chain transfer contract in this application, etc.), which are distinguished by contract accounts (Identity, ID), identification numbers or names.
  • Figure 1 is a schematic diagram of a system architecture provided in an embodiment of the present application.
  • the system architecture may include a blockchain network cluster.
  • the embodiment of the present application does not limit the number of blockchain networks in the blockchain network cluster, which may be two or more.
  • the blockchain network cluster may include blockchain network 101 and blockchain network 102.
  • the consensus network 101e may be referred to as the first consensus network, and the blockchain nodes included therein may be referred to as the first consensus nodes.
  • the embodiment of the present application does not limit the number of first consensus nodes in the consensus network 101e, and may include one or more first consensus nodes.
  • the consensus network 101e may include the first consensus node 101a and the first consensus node 101b.
  • the first consensus nodes in the consensus network 101e e.g., the first consensus node 101a and the first consensus node 101b in FIG1
  • jointly maintain the blockchain 101c and the blockchain 101c may also be referred to as the first blockchain.
  • the blockchain network 102 may include the consensus network 102e and the second business network.
  • the blockchain nodes in the second business network may be referred to as the second business nodes.
  • the embodiment of the present application does not limit the number of second business nodes in the second business network, and may include two or more second business nodes.
  • the second business network may include the second business node 102d.
  • the consensus network 102e may be referred to as a second consensus network, and the blockchain nodes included therein may be referred to as second consensus nodes.
  • the embodiment of the present application does not limit the number of second consensus nodes in the consensus network 102e, and may include two or more second consensus nodes.
  • the consensus network 102e may include a second consensus node 102a and a second consensus node 102b.
  • the second consensus nodes in the consensus network 102e (e.g., the second consensus node 102a and the second consensus node 102b in FIG1 ) jointly maintain the blockchain 102c, and the blockchain 102c may also be referred to as a second blockchain.
  • the consensus network 102e and the second business network may be in different network environments. Generally speaking, the consensus network 102e is in a private network, and the second business network is in a shared network.
  • there may be a communication connection between the blockchain nodes in the blockchain network 101 for example, there is a communication connection between the first consensus node 101a and the first consensus node 101b, and there is a communication connection between the first business node 101d and the first consensus node 101a.
  • there may be a communication connection between the blockchain nodes in the blockchain network 102 for example, there is a communication connection between the second consensus node 102a and the second consensus node 102b, and there is a communication connection between the second business node 102d and the second consensus node 102a.
  • the embodiment of the present application does not limit the connection method of the above-mentioned communication connection, and can be directly or indirectly connected by wired communication, directly or indirectly connected by wireless communication, or by other methods, and the present application does not limit it here.
  • blockchain network 101 includes a consensus network 101e, and a business network used for communicating and interacting with blockchain network 101 is outside blockchain network 101, and the business network interacts with blockchain network 101 through business nodes deployed therein, such as: the first business node in the business network is deployed outside blockchain network 101; similarly, blockchain network 102 includes a consensus network 102e, and a business network used for communicating and interacting with blockchain network 102 is outside blockchain network 102, and the business network interacts with blockchain network 102 through business nodes deployed therein, such as: the first business node in the business network is deployed outside blockchain network 102, etc.
  • the communication connection between the above blockchain nodes can be based on node identification.
  • each blockchain node in the blockchain network 101 and each blockchain node in the blockchain network 102 there is a node identification corresponding to it, and each of the above blockchain nodes can store the node identification of other blockchain nodes that are connected to itself, so that the acquired data or generated blocks can be broadcast to other blockchain nodes according to the node identification of other blockchain nodes.
  • the first consensus node 101a can maintain a node identification list, which stores the node names and node identifications of other blockchain nodes, as shown in Table 1.
  • the node identifier can be the Internet Protocol (IP) address for interconnecting networks or any other information that can be used to identify a blockchain node in a blockchain network.
  • IP Internet Protocol
  • the first consensus node 101a can send the resource transfer certificate described below to the first consensus node 101b through the node identifier AAAAAA, and the first consensus node 101b can determine that the resource transfer certificate is sent by the first consensus node 101a through the node identifier FFFFFF.
  • the same is true for data transmission between other blockchain nodes, so they will not be elaborated one by one.
  • each blockchain node (including the blockchain node in the blockchain network 101 and the blockchain node in the blockchain network 102) can receive the business transaction sent by the client when performing normal work, and generate blocks based on the received business transactions, and then perform block chain processing, that is, perform chain processing in the blockchain maintained by itself. It is understandable that in the specific implementation of the present application, it involves user information (such as the first resource transfer-in address and the first resource transfer-out address) and other related data.
  • user information such as the first resource transfer-in address and the first resource transfer-out address
  • the blockchain nodes in FIG. 1 include but are not limited to mobile terminals or servers.
  • the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, referred to as CDN), and big data and artificial intelligence platforms.
  • the above-mentioned mobile terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Among them, the mobile terminal and the server can be directly or indirectly connected by wire or wireless means, and the embodiments of the present application do not limit this.
  • Figure 2 is a schematic diagram of a scenario of blockchain-based data processing provided by an embodiment of the present application.
  • the implementation process of the data processing scenario can be performed by the first business node, or by the second business node, or by the first business node and the second business node interactively, without limitation here.
  • the embodiment of the present application is described by taking the first business node as an example, wherein the first business node can be any first business node in the first business network of the embodiment corresponding to Figure 1 above.
  • the first business node 201b obtains a resource cross-chain transfer request 20a initiated by the first account, wherein the login device of the first account can be the first business node 201b, or a terminal device having a communication connection relationship with the first business node 201b, and the embodiment of the present application does not limit this.
  • the embodiment of the present application illustrates the resource cross-chain transfer request 20a as "address 201a of chain 1 transfers 50 resources to address 202a of chain 2" in Figure 2.
  • Figure 2 uses “chain 1" to illustrate the first blockchain 20c, "address 201a” to illustrate the first resource transfer-out address 20f configured by the first account on the first blockchain, “chain 2" to illustrate the second blockchain 20e, "address 202a” to illustrate the first account configured on the second blockchain
  • the first resource transfer-in address 20g, and "50 resources” are used as examples of virtual resource values.
  • address 201a belongs to the first blockchain 20c, and the total value of virtual resources currently held by address 201a is 200 resources.
  • address 201a holding 200 resources is stored in block 201c of the first blockchain 20c; address 202a belongs to the second blockchain 20e, for example, address 202a currently does not hold virtual resources.
  • the address 202a of the virtual resource is stored in the block 201e of the second blockchain 20e. Because the second blockchain 202a and the first blockchain 201a are two independent chains, the transfer of 50 resources from address 201a to address 202a is a cross-chain resource transfer.
  • the first business node 201b belongs to the business node corresponding to the first blockchain 20c, such as the business node in the first business network mentioned in Figure 1 above
  • the second business node 202b belongs to the business node corresponding to the second blockchain 20e, such as the business node in the second business network mentioned in Figure 1 above.
  • the first business node 201b and the second business node 202b can be the same business node or different business nodes.
  • the embodiment of the present application does not describe the process of determining the node relationship between the first business node 201b and the second business node 202b. Please refer to the description of step S101 in the embodiment corresponding to Figure 3 below.
  • the first business node 201b and the second business node 202b are the same business node, the first business node 201b deploys two different blockchains, namely the first blockchain 20c and the second blockchain 20e, so the first business node 201b can directly access the second blockchain 20e according to the resource cross-chain transfer request 20a, and perform the subsequent process. If the first business node 201b and the second business node 202b are different business nodes, the first business node 201b does not deploy the second blockchain 20e, and the second business node 202b does not deploy the first blockchain 20c, so as shown in Figure 2, the first business node 201b forwards the resource cross-chain transfer request 20a to the second business node 202b.
  • first business node 201b and the second business node 202b are the same business node, the subsequent process of the first business node 201b is the same as the process described below, the only difference is that the first business node 201b and the second business node 202b do not need data interaction, that is, the first business node 201b can be executed independently.
  • the second business node 202b locks the first virtual resource 20d to be acquired by the first account, i.e., the 50 resource in Figure 2, for the first resource transfer-in address 20g (i.e., address 202a) in the second blockchain 20e according to the resource cross-chain transfer request 20a.
  • the second business node 202b only locks the first virtual resource 20d (i.e., the 50 resource) for address 202a to prevent the first virtual resource 20d from being involved in other resource transfer processes; the process does not transfer the first virtual resource 20d to address 202a, so it can avoid the need to transfer the first virtual resource 20d that has been transferred to address 202a to address 202a when the first resource transfer-out address 20f (such as address 201a in Figure 2) fails to successfully transfer the second virtual resource, thereby avoiding the computational consumption caused by invalid resource transfer.
  • the virtual resource value corresponding to the first virtual resource 20d can be equivalent to the virtual resource value corresponding to the second virtual resource, but the first virtual resource 20d is not the second virtual resource.
  • the first virtual resource 20d originates from the second blockchain 20e, and the second virtual resource originates from the first blockchain 20c.
  • the first business node 201b performs resource transfer processing on the second virtual resource associated with the virtual resource value in the first resource transfer address 20f in the first blockchain 20c, that is, transfers the second virtual resource from the first resource transfer address 20f.
  • the current virtual resource of the first resource transfer address 20f is updated, that is, from 200 resources to 150 resources.
  • the first virtual resource 20d is transferred to the first resource transfer-in address 20g, that is, address 202a, in the second blockchain.
  • the current virtual resource of address 202a is updated, that is, from 0 resources to 50 resources.
  • the embodiment of the present application does not need to transfer the virtual resources to be transferred through a third-party intermediary outside the first blockchain and the second blockchain, so it can not only improve the efficiency of resource transfer, but also improve the security of resource transfer.
  • the resource transfer certificate it can be ensured that the second virtual resource is transferred from the first resource transfer address, so the security of resource transfer can be further improved.
  • Figure 3 is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application.
  • the data processing method of blockchain can be executed by a first business node, or by a second business node, or by the first business node and the second business node interactively, without limitation here.
  • the embodiment of the present application is described by taking the first business node as an example, wherein the first business node can be any first business node in the first business network of the embodiment corresponding to Figure 1 above.
  • the data processing method based on blockchain can at least include the following steps S101-S102.
  • Step S101 obtaining a resource cross-chain transfer request initiated by a first account;
  • the resource cross-chain transfer request includes a virtual resource value, a first resource transfer-out address of the first account deployed on the first blockchain, and a first resource transfer-in address of the first account deployed on the second blockchain;
  • the second blockchain is different from the first blockchain;
  • the resource cross-chain transfer request is used to instruct the second business node to lock the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second blockchain;
  • the first virtual resource corresponds to the virtual resource value,
  • the first business node belongs to the business node corresponding to the first blockchain;
  • the second business node belongs to the business node corresponding to the second blockchain.
  • the first account is implemented as a personal account or an exchange account.
  • the personal account is used to represent an account opened by an individual user;
  • the exchange account is used to represent an account opened by a company, enterprise or other merchant participating in a transaction.
  • the first account is registered on the first blockchain, and the registration process enables the first account to perform a resource transaction process on the first blockchain; in addition, the first account is also registered on the second blockchain, and the registration process also enables the first account to perform a resource transaction process on the second blockchain.
  • other accounts can also perform a registration process on at least one of the multiple blockchains including the first blockchain and the second blockchain to implement a resource transaction process on the blockchain.
  • the first business node receives a cross-chain resource transfer request initiated by the first account, where the cross-chain resource transfer request is used to transfer assets of the first account on the first blockchain to the second blockchain.
  • the virtual resource value included in the resource cross-chain transfer request is used to characterize the unit for measuring virtual resources, so that the resource transfer process complies with the principle of equivalent exchange.
  • the resource cross-chain transfer request also includes a first resource transfer-out address and a first resource transfer-in address, the first resource transfer-out address is the address of the first account registered on the first blockchain, and the first resource transfer-in address is the address of the first account registered on the second blockchain.
  • the first resource transfer-out address can be regarded as an account registered by the first account on the first blockchain, which is used for the resource transaction process.
  • the first resource transfer-out address is used to transfer the second virtual resource.
  • the first resource transfer-in address can be regarded as an account registered by the first account on the second blockchain, which is used for the resource transaction process.
  • the first resource transfer-in address is used as the address of the first virtual resource that needs to be transferred by the first account.
  • the first business node after receiving the resource cross-chain transfer request, instructs the second business node to lock the first virtual resource to be acquired by the first account for the first resource transfer address in the second blockchain based on the resource cross-chain transfer request.
  • the first business node locks the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second blockchain; when the first business node and the second business node are different nodes, there is a communication relationship between the first business node and the second business node, and the first business node sends a resource cross-chain transfer request to the second business node, so that the second business node locks the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second blockchain based on the resource cross-chain transfer request.
  • the first virtual resource is the virtual resource corresponding to the second blockchain, and the virtual resource value is the unit used to measure the virtual resource. Therefore, the first virtual resource to be acquired by the first account is determined in the second blockchain based on the virtual resource value.
  • the first virtual resource corresponds to the virtual resource value, which is used to characterize that the first virtual resource is a certain amount of virtual resources determined according to the measurement standard of the virtual resource value. For example: if the virtual resource value is 50, then the first virtual resource is a virtual resource equivalent to 50 (50 can be regarded as a certain amount).
  • the first business node is a business node corresponding to the first blockchain
  • the second business node is a business node corresponding to the second blockchain.
  • the first business node can call data in the first blockchain
  • the second business node can call data in the second blockchain.
  • the first business node and the second business node are the same node, taking the first business node as an example, the first business node can not only call data in the first blockchain, but also call data in the second blockchain; in addition, when the first business node and the second business node are different nodes, the first business node can call data in the first blockchain; the second business node can call data in the second blockchain, and the first business node and the second business node achieve the effect of indirect calling with the help of the communication relationship.
  • a resource cross-chain transfer contract is called according to a resource cross-chain transfer request; the resource cross-chain transfer contract is a smart contract synchronized from the first blockchain; based on the resource cross-chain transfer contract, the first blockchain and the second blockchain are determined.
  • the association relationship between blockchains; the association relationship is used to determine the second business node.
  • determining the association relationship between the first blockchain and the second blockchain may include: based on the resource cross-chain transfer contract, respectively obtaining the first chain structure of the first blockchain and the second chain structure of the second blockchain; comparing the first chain structure and the second chain structure, if the first chain structure is the same as the second chain structure, determining that the association relationship between the first blockchain and the second blockchain is an isomorphic association relationship; if the first chain structure is different from the second chain structure, determining that the association relationship between the first blockchain and the second blockchain is a heterogeneous association relationship.
  • the chain structure includes the chain data structure and organization mode of the blockchain.
  • the first chain structure is the same as the second chain structure, which means that the chain data structure and organization mode corresponding to the first blockchain and the second blockchain are the same; the first chain structure is different from the second chain structure, which means that at least one of the chain data structure and organization mode corresponding to the first blockchain and the second blockchain is different.
  • the relationship between the chain data structure and organization method corresponding to the first blockchain and the chain data structure and organization method corresponding to the second blockchain can be clarified, and a more targeted analysis of the first business node and the second business node can be performed. This is conducive to determining the form of the second business node based on the association relationship, minimizing the tediousness of directly using the first business node and the second business to manage the two blockchains separately, and is conducive to achieving coordinated management of the first blockchain and the second blockchain.
  • the association relationship includes an isomorphic association relationship in which the first chain structure and the second chain structure of the first blockchain have the same structure, and also includes a heterogeneous association relationship in which the first chain structure and the second chain structure are different. Therefore, through the difference between the isomorphic association relationship and the heterogeneous association relationship, the first blockchain and the second blockchain can be managed more specifically, avoiding the inefficient problem of ignoring the impact of the chain structure and directly analyzing the first blockchain and the second blockchain, and improving the efficiency of comprehensive application analysis of the first blockchain and the second blockchain.
  • the resource cross-chain transfer request is sent to the second blockchain.
  • the homogeneous association relationship is used to indicate that the first service node and the second service node are the same service node.
  • the first virtual resource to be acquired by the first account is locked in the second resource transfer-out address for the first resource transfer-in address.
  • the second resource transfer-out address is the address of the second account deployed in the second blockchain, and the second account is the account holding the first virtual resource.
  • the second account is a different account from the first account, and the second account is registered on the first blockchain and the second blockchain respectively, so that the second account corresponds to the second resource transfer-out address on the second blockchain.
  • the second account corresponds to the second resource transfer-in address on the first blockchain, thereby realizing the process of the first account transferring assets on the first blockchain to the second blockchain by means of the resource exchange process between the first account and the second account on the blockchain.
  • the second account is an account that conducts resource transactions with the first account.
  • the second blockchain receives a resource cross-chain transfer request
  • multiple accounts registered on the second blockchain analyze the resource cross-chain transfer request and use the account that wishes to conduct resource transactions with the first account among the multiple accounts as the second account, that is, the second account returns a resource lock permission response through the second resource transfer-out address registered on the second blockchain to indicate that the second account wishes to conduct resource transactions with the first account and can implement the resource transaction process on the second blockchain by transferring resources to the first resource transfer-in address registered on the second blockchain by the first account.
  • the second account returns a resource lock permission response through the second resource transfer-out address to indicate that the first virtual resource in the resources held by the second resource transfer-out address can be locked.
  • the second account is a personal account, or the second account is an exchange account.
  • the second resource transfer-out address registered by the second account on the second blockchain is determined, and the second resource transfer-out address is implemented as an address form for storing resources; or, when the second account is an exchange account, the second resource transfer-out address registered by the second account on the second blockchain is implemented as an exchange resource pool, and the exchange resource pool is used to represent a resource collection registered by the exchange account on the blockchain for realizing resource transactions.
  • a resource lock permission response returned by the second resource transfer address is obtained in the second blockchain, that is, a process of determining that the second resource transfer address is allowed to transfer out resources based on the resource lock permission response; based on this, according to the resource lock permission response, the first virtual resource to be obtained by the first account is locked in the second resource transfer address, and the first virtual resource is The resources locked by the first resource transfer address registered by the first account on the second blockchain.
  • the first virtual resource is obtained for the first resource transfer address from the virtual resource pool corresponding to the second blockchain.
  • the virtual resource pool is a resource pool corresponding to the second blockchain, which is used to represent a resource set in the second blockchain that is not registered with an account and has a certain amount of resources.
  • the virtual resource pool is a resource pool automatically formed by the second blockchain based on the blockchain computing process; or, the virtual resource pool is a resource pool pre-agreed by multiple accounts and registered on the second blockchain in a contractual state, etc.
  • the resource lock permission response it is determined whether there is a second resource transfer address on the second blockchain that is willing to be locked. Since the second resource transfer address is the address registered by the second account on the second blockchain, the process can more intuitively and clearly know whether there is a second account on the second blockchain that is willing to trade resources with the first account. If the resource lock permission response is received, the first virtual resource to be obtained by the first account can be locked from the second resource transfer address that sends the resource lock permission response; if the resource lock permission response is not received, the first virtual resource to be obtained by the first account is locked from the virtual resource pool corresponding to the second blockchain.
  • This process can better know whether there is a second account to trade resources with the first account to realize the process of the first account transferring resources on the first blockchain to the second blockchain, and can also avoid the first account being unable to independently realize the process of transferring resources on the first blockchain to the second blockchain when there is no second account to trade resources with the first account through the setting of the virtual resource pool corresponding to the second blockchain, so that the process of resource cross-chain transfer can be realized more efficiently and with a better success rate, and the success rate of resource cross-chain transfer can be improved.
  • the process of locking the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second resource transfer-out address may include: according to the resource locking permission response, querying the third virtual resource held by the second resource transfer-out address; if the third virtual resource is not less than the first virtual resource corresponding to the virtual resource value, locking the first virtual resource for the first resource transfer-in address from the third virtual resource; if the third virtual resource is less than the first virtual resource, locking the first virtual resource for the first resource transfer-in address from the virtual resource pool corresponding to the second blockchain.
  • the resource quantity relationship between the third virtual resource held by the second resource transfer address and the first virtual resource is considered to avoid the problem of being unable to achieve sufficient resource transactions.
  • the purpose of obtaining a sufficient amount of the first virtual resource is achieved by comprehensively locking the first virtual resource from the third virtual resource or from the virtual resource pool corresponding to the second blockchain, thereby improving the success rate of obtaining the first virtual resource.
  • the third virtual resource held by the second resource transfer address is used to characterize the amount of resources registered and stored by the second account on the second blockchain.
  • the resource within the second resource transfer address is allowed to be locked, so the third virtual resource held by the second resource transfer address is queried, and the third virtual resource is compared with the first virtual resource to be obtained by the first account, that is, the size between the amount of resources corresponding to the third virtual resource and the amount of resources of the first virtual resource is compared.
  • the third virtual resource is not less than the first virtual resource, it means that the first virtual resource can be obtained from the third virtual resource, and then the first virtual resource is locked from the third virtual resource held by the second resource transfer-out address.
  • the first virtual resource is the resource locked by the first resource transfer-in address registered by the first account on the second blockchain.
  • the third virtual resource is smaller than the first virtual resource, it means that a sufficient amount of the first virtual resource cannot be obtained from the second resource transfer-out address, and then the first virtual resource is locked from the virtual resource pool corresponding to the second blockchain.
  • the first virtual resource is the resource locked by the first resource transfer-in address registered by the first account on the second blockchain.
  • the process of locking the first virtual resource for the first resource transfer-in address in the virtual resource pool corresponding to the second blockchain may include: if the third virtual resource is smaller than the first virtual resource, obtaining the third virtual resource for the first resource transfer-in address; determining the first virtual resource difference between the first virtual resource and the third virtual resource, and obtaining the first virtual resource difference for the first resource transfer-in address in the virtual resource pool corresponding to the second blockchain.
  • the third virtual resource held by it can be obtained from the second resource transfer address first. Since the third virtual resource is smaller than the first virtual resource, the difference between the first virtual resource and the third virtual resource can be determined, and To the first virtual resource difference, and then lock the first virtual resource difference from the virtual resource pool corresponding to the second blockchain. That is, the first virtual resource includes the third virtual resource obtained from the second resource transfer address and the first virtual resource difference locked from the virtual resource pool corresponding to the second blockchain.
  • the third virtual resource that is smaller than the first virtual resource is still locked from the second resource transfer address registered by the second account in the second blockchain, and then the first virtual resource difference representing the difference between the first virtual resource and the third virtual resource is locked from the virtual resource pool corresponding to the second blockchain, which not only realizes the sufficient locking process of the first virtual resource, but also facilitates the resource transaction process between accounts.
  • the insufficient virtual resource can be locked from the transfer address registered by other accounts on the second blockchain, so that the first account can complete the cross-chain transfer process of transferring virtual resources from the first blockchain to the second blockchain by means of resource transactions with multiple accounts.
  • the embodiment of the present application proposes a smart contract deployed and running on a business node, namely a cross-chain resource transfer contract, which is verified on the blockchain and then synchronized to the business node.
  • This step does not describe the process of on-chain authentication and off-chain synchronization of the cross-chain resource transfer contract.
  • step S202 in the embodiment corresponding to Figure 7 below.
  • the embodiment of the present application proposes a solution to realize cross-chain resource transfer through a cross-chain resource transfer contract. Since the cross-chain resource transfer contract is a code content that has been authenticated on the chain, it can effectively solve the trust problem caused by running third-party code.
  • the first business node obtains a resource cross-chain transfer request initiated by the first account.
  • the first business node calls the resource cross-chain transfer contract.
  • Figure 4 is a scenario diagram 2 of a data processing based on blockchain provided in an embodiment of the present application
  • Figure 5 is a scenario diagram 3 of a data processing based on blockchain provided in an embodiment of the present application.
  • the resource cross-chain transfer contract 40a is a smart contract synchronized from the first blockchain 20c and deployed on the first business node 201b.
  • the first business node 201b can determine the association relationship between the first blockchain 20c and the second blockchain 20e, and the determination process of the association relationship can be described as follows.
  • the first business node 201b can obtain the first chain structure of the first blockchain 20c and the second chain structure of the second blockchain 20e respectively.
  • the first chain structure can include the chain data structure and organization method of the first blockchain 20c
  • the second chain structure can include the chain data structure and organization method of the second blockchain 20e.
  • the first business node 201b compares the first chain structure and the second chain structure to obtain a first comparison result 40b. If the first comparison result 40b shows that the first chain structure is the same as the second chain structure, it can be determined that the association relationship between the first blockchain 20c and the second blockchain 20e is an isomorphic association relationship, and the first blockchain 20c and the second blockchain 20e can also be called isomorphic chains. Further, since the first chain structure is the same as the second chain structure, the first business node 201b can serve the first blockchain 20c and the second blockchain 20e at the same time, that is, the first business node 201b can maintain the first blockchain 20c and the second blockchain 20e at the same time. At this time, the first business node 201b and the second business node 202b can be the same business node.
  • the association relationship between the first blockchain 20c and the second blockchain 20e is a heterogeneous association relationship, and the first blockchain 20c and the second blockchain 20e can also be called heterogeneous chains.
  • the first business node 201b serving the first blockchain 20c cannot simultaneously serve the second blockchain 20e, because the chain data structure and organization method set by the first business node 201b do not match the chain data structure and organization method corresponding to the second blockchain 20e; similarly, the second business node 202b serving the second blockchain 20e cannot simultaneously serve the first blockchain 20c, and at this time, the first business node 201b and the second business node 202b are not the same business node.
  • the second business node 202b can lock the first virtual resource 20d (such as the 50 resource in FIG. 5 ) for the first resource transfer address 20g (such as the address 202a in FIG. 5 ) in the second blockchain 20e.
  • the locking process is as follows.
  • the service node 201b and the second service node 202b can be the same service node, that is, the first service node 201b can maintain not only the first blockchain 20c, but also the second blockchain 20e which is different from the first blockchain 20c. Therefore, the first service node 201b can send a resource cross-chain transfer request to the second blockchain 20e.
  • the resource lock permission response is not obtained in the second blockchain 20e, that is, the second resource transfer-out address registered by the second account in the second blockchain 20e does not respond to the resource cross-chain transfer request, then in the virtual resource pool 40e corresponding to the second blockchain 20e, the first virtual resource 20d is locked for the first resource transfer-in address 20g (i.e., address 202a).
  • the virtual resource pool 40e can be a virtual resource set set by the second blockchain 20e for the on-chain address (including address 202a and address 203a mentioned below), and the virtual resource pool 40e can also be an address logged in by the cross-chain service device and belonging to the second blockchain 20e.
  • FIG5 illustrates the resource lock permission response 40d as “address 203a transfers 50 resources to address 202a, address 201a transfers 50 resources to address 204a of chain 1”, wherein FIG5 illustrates the second resource transfer-out address 40c as address 203a, which currently holds W resources, and illustrates the second resource transfer-in address belonging to the first blockchain 20c as address 204a, and the response virtual resource (i.e., the virtual resource transferred to the second resource transfer-in address) is also 50 resources.
  • the response virtual resource i.e., the virtual resource transferred to the second resource transfer-in address
  • the first service node 201b before acquiring (locking) the first virtual resource 20d for the first resource transfer-in address 20g, the first service node 201b needs to check the virtual resource currently held by the second resource transfer-out address 40c, and the above process can be described as follows.
  • the first service node 201b queries the third virtual resource held by the second resource transfer-out address 40c (such as the address 203a shown in Figure 5), and Figure 5 shows the W resource.
  • the first service node 201b compares the third virtual resource and the first virtual resource 20d to obtain a second comparison result 40f.
  • the first service node 201b can obtain the first virtual resource 20d for the first resource transfer-in address 20g in the third virtual resource, that is, the address 202a is locked in the address 203a as shown in Figure 5. If the second comparison result 40f is that the third virtual resource is smaller than the first virtual resource 20d, the first service node 201b obtains the first virtual resource 20d for the first resource transfer-in address 20g in the virtual resource pool 40e, and locks 50 resources for the address 202a in the virtual resource pool 40e as shown in FIG5.
  • the first service node 201b obtains the third virtual resource for the first resource transfer-in address, further determines the first virtual resource difference between the first virtual resource 20d and the third virtual resource, and obtains the first virtual resource difference for the first resource transfer-in address 20g in the virtual resource pool 40e.
  • This step does not describe the scenario where the association relationship is a heterogeneous association relationship. Please refer to the description in the embodiment corresponding to Figure 7 below.
  • Step S102 If the second service node successfully locks the first virtual resource, a resource transfer-out process is performed on the second virtual resource associated with the virtual resource value in the first resource transfer-out address.
  • a second resource transfer-in address corresponding to the second resource transfer-out address is determined from the first blockchain.
  • the second resource transfer-out address is the address of the second account registered on the second blockchain
  • the second resource transfer-in address is the address of the second account registered on the first blockchain
  • the second resource transfer-in address is used to represent the transfer-in address after the second virtual resource is transferred out in the first blockchain.
  • the second resource transfer-out address is the address of the second account deployed in the second blockchain, and the second account is the account holding the first virtual resource.
  • the second account is an account different from the first account, and the second account is registered on the first blockchain and the second blockchain respectively, so that the second account corresponds to the second resource transfer-out address on the second blockchain.
  • the second account corresponds to the second resource transfer-in address on the first blockchain, thereby realizing the process of the first account transferring assets on the first blockchain to the second blockchain by means of the resource exchange process between the first account and the second account on the blockchain.
  • the second account is a personal account, or the second account is an exchange account.
  • the second resource transfer-out address registered by the second account on the second blockchain is determined, and the second resource transfer-out address is implemented as an address for storing resources; or, when the second account is an exchange account, the second resource transfer-out address registered by the second account on the second blockchain is implemented as an exchange resource pool, and the exchange resource pool is used to represent the resource set registered by the exchange account on the blockchain for resource transactions.
  • the second resource transfer-in address is used to represent the transfer-in address after the second virtual resource is transferred out in the first blockchain. That is: the second resource transfer-in address in the first blockchain is used to receive the second virtual resource transferred from the first resource transfer-out address.
  • the second virtual resource transferred out from the first resource transfer-out address is transferred into the second resource transfer-in address.
  • the above content determines the location for transferring the second virtual resource based on the location of the locked first virtual resource. If the location for locking the first virtual resource is the second resource transfer address registered by the second account on the first blockchain, the second account can assist the first account in the cross-chain resource transfer process, fully activating the activity of the account in trading on the blockchain.
  • the second account can assist the first account in the cross-chain resource transfer process.
  • the virtual resource pool corresponding to the first blockchain is determined; and the second virtual resource transferred from the first resource transfer address is transferred to the virtual resource pool corresponding to the first blockchain.
  • the virtual resource pool corresponding to the second blockchain is used to represent a resource set in the second blockchain that is not registered with an account and has a certain amount of resources.
  • the virtual resource pool is a resource pool automatically formed by the second blockchain based on the blockchain computing process; or, the virtual resource pool is a resource pool pre-agreed by multiple accounts and registered in the second blockchain in a contractual state, etc.
  • the virtual resource pool corresponding to the first blockchain is determined from the first blockchain, so that the virtual resource pool corresponding to the first blockchain is used as the second resource transfer-in address for transferring the second virtual resource into the first blockchain.
  • the virtual resource pool can be used to assist the first account in the cross-chain resource transfer process, thereby fully avoiding the inability to achieve the purpose of cross-chain resource transfer when there is no account interacting with the first account, thereby increasing the probability of successful resource transfer.
  • the first virtual resource is transferred to the first resource transfer-in address in the second blockchain.
  • the first business node controls the successful transfer of the second virtual resource from the first resource transfer-out address in the first blockchain, it instructs the second business node to transfer the first virtual resource to the first resource transfer-in address in the second blockchain. That is, the second business node transfers the first virtual resource to be acquired by the locked first account to the first resource transfer-in address.
  • the first virtual resource is transferred from the second resource transfer address registered by the second account on the second blockchain.
  • the second business node transfers the first virtual resource transferred from the second resource transfer-out address to the first resource transfer-in address registered by the first account on the second blockchain.
  • a resource transfer certificate is generated; based on the resource transfer certificate, the first virtual resource is transferred to the first resource transfer address in the second blockchain.
  • the resource transfer certificate is used to indicate that the second virtual resource has been successfully transferred out in the first blockchain.
  • a resource transfer certificate is generated.
  • a resource transfer certificate is generated; or, if the second virtual resource is successfully transferred to the virtual resource pool corresponding to the first blockchain in the first blockchain, a resource transfer certificate is generated.
  • a resource transfer certificate is generated; the resource transfer certificate is sent to the second blockchain, and the resource transfer certificate is used to instruct the second blockchain to transfer the first virtual resource to the first resource transfer address.
  • the second blockchain can obtain the resource transfer certificate after consensus on the first blockchain, which is conducive to enabling the second blockchain to perform a more accurate resource transfer process based on the resource transfer certificate, so as to perform subsequent operations on the locked first virtual resource, and more specifically realize the resource transfer process of the locked first virtual resource.
  • a resource transfer certificate is generated if the second virtual resource is successfully transferred to the second resource transfer address in the first blockchain. If the second virtual resource is successfully transferred to the virtual resource pool corresponding to the first blockchain in the first blockchain, a resource transfer certificate is generated.
  • the two situations of the location to which the second virtual resource is successfully transferred are fully considered. Based on the two situations, a resource transfer certificate for indicating that the first virtual resource is transferred to the first resource transfer address in the second blockchain can be generated, thereby increasing the probability of transferring the first virtual resource to the first resource transfer address, which is conducive to enabling the first account to realize cross-chain transfer needs more quickly and securely.
  • a resource transfer transaction including the virtual resource value and the first resource transfer address is generated; and a resource transfer voucher generated for the resource transfer transaction is obtained.
  • the resource transfer transaction is used to verify whether the second virtual resource has been successfully transferred to the second resource transfer-in address or the virtual resource pool corresponding to the first blockchain.
  • the first blockchain it is beneficial for the first blockchain to confirm the transfer of the second virtual resource in a more targeted manner.
  • the quantity and transfer-out address of the second virtual resource can be compared and judged more intuitively, which is beneficial for the first blockchain to conduct a consensus analysis process based on the resource transfer transaction.
  • a resource transfer transaction is sent to a first consensus node corresponding to a first blockchain, wherein the first consensus node processes the resource transfer transaction on-chain to obtain an on-chain result; the on-chain result includes an on-chain success result; the on-chain success result is used to instruct a consensus node to generate a resource transfer certificate for the resource transfer transaction; and obtain the resource transfer certificate returned by the first consensus node.
  • the first consensus node can process the resource transfer transaction on the chain, so as to determine whether each node on the first blockchain has effectively confirmed the successful transfer of the second virtual resource indicated by the resource transfer transaction according to the meaning of the on-chain result. If the on-chain result is a successful on-chain result, that is, the first blockchain has effectively confirmed the resource transfer transaction, which means that the first blockchain has reached a consensus on the process. Then, the first consensus node can generate a resource transfer certificate based on the resource transfer transaction to characterize the consensus situation and achieve a safer and more effective consensus process analysis and description purpose.
  • Figure 6 is a schematic diagram of a scenario of data processing based on blockchain provided by an embodiment of the present application.
  • the first business node 201b generates a resource transfer transaction 60b, wherein the resource transfer transaction 60b may include an address 201a holding 200 resources (i.e., the first resource transfer address 20f) and a virtual resource value.
  • resource transfer transaction 60b is a transaction generated after the first resource transfer-out address 20f transfers out 50 resources to address 60a, wherein address 60a is implemented as the second resource transfer-in address registered by the second account on the first blockchain; or Address 60a is implemented as a virtual resource pool corresponding to the first blockchain.
  • the first business node 201b transmits the resource transfer transaction 60b to the first consensus network corresponding to the first blockchain, so that the first consensus node in the first consensus network performs consensus processing on the resource transfer transaction 60b. If the first consensus node passes the consensus of the resource transfer transaction 60b, the resource transfer transaction 60b is written into the first blockchain. If the resource transfer transaction 60b is successfully written into the first blockchain, the on-chain result of the resource transfer transaction 60b is a successful on-chain result. At this time, the first consensus node generates a resource transfer certificate 60c for the resource transfer transaction 60b, and the resource transfer certificate 60c is used to indicate that the locked first virtual resource is transferred to the first resource transfer address in the second blockchain.
  • the first consensus node returns the resource transfer certificate 60c to the first business node 201b.
  • This application example does not limit the content of the resource transfer certificate 60c, including but not limited to the Merkel proof and read-write set for the resource transfer transaction 60b.
  • the resource transfer certificate is sent to a second blockchain, wherein the second blockchain verifies the resource transfer certificate to obtain a first verification result.
  • the second virtual resource is transferred to the second resource transfer-in address associated with the second resource transfer-out address.
  • the second resource transfer-out address is the address of the second account deployed in the second blockchain, and the second account is the account holding the first virtual resource; the second resource transfer-in address is the address of the second account deployed on the first blockchain.
  • the first virtual resource is a resource locked in the second resource transfer-out address
  • the first virtual resource transferred out from the second resource transfer-out address is transferred to the first resource transfer-in address
  • the second resource transfer-out address is the address of the second account deployed in the second blockchain, and the second account is the account holding the first virtual resource
  • the second resource transfer-in address is the address of the second account deployed on the first blockchain; wherein, if the first virtual resource is a resource locked in the virtual resource pool corresponding to the second blockchain, the first virtual resource locked in the virtual resource pool corresponding to the second blockchain is transferred to the first resource transfer-in address.
  • the location of the first virtual resource is comprehensively locked to determine the location of the first virtual resource to be transferred out, and the first virtual resource transferred out from the location is transferred out to the first resource transfer-in address, so as to more intuitively know the transfer-out and transfer-in of the first virtual resource, and facilitate more targeted control of the first virtual resource.
  • the fourth virtual resource in the first virtual resource is a resource locked in the second resource transfer-out address
  • the second virtual resource difference in the first virtual resource is a resource locked in the virtual resource pool corresponding to the second blockchain
  • the fourth virtual resource is transferred to the second resource transfer-in address
  • the second virtual resource difference is used to characterize the difference between the first virtual resource and the fourth virtual resource
  • the second virtual resource difference is transferred to the virtual resource pool corresponding to the first blockchain.
  • the association relationship is a homogeneous association relationship
  • the resource transfer certificate is transmitted to the second blockchain, wherein the second consensus node corresponding to the second blockchain verifies the resource transfer certificate through the verification contract to obtain a second verification result.
  • the homogeneous association relationship is used to indicate that the first business node and the second business node are the same business node; wherein, if the second verification result returned by the second consensus node is a second verification pass result, the first virtual resource is transferred to the first resource transfer address.
  • the resource transfer certificate is transferred to the second blockchain, and the resource transfer certificate is verified by the second consensus node in the second blockchain.
  • the second verification result is a second verification pass result
  • the first virtual resource can be transferred to the first resource transfer address, thereby realizing a process of securely transferring the first virtual resource and improving the transfer reliability of the first virtual resource.
  • the first business node transfers the second virtual resource to the second resource transfer-in address. If the first virtual resource belongs to the virtual resource pool corresponding to the second blockchain (for the sake of distinction, referred to as the second virtual resource pool), such as the virtual resource pool 40e shown in Figure 5, then by running the resource cross-chain transfer contract, the first business node transfers the second virtual resource to the virtual resource pool corresponding to the first blockchain (for the sake of distinction, referred to as the first virtual resource pool).
  • the first virtual resource pool can also be a set of virtual resources set by the first blockchain for the on-chain address. If the second virtual resource pool is the address logged in by the cross-chain service device and belongs to the second blockchain, The first virtual resource pool may also be the address logged in by the cross-chain service device and belonging to the first blockchain.
  • the first business node 201b can transmit the resource transfer certificate 60c to the second consensus network corresponding to the second blockchain, so that the second consensus node in the second consensus network calls the verification contract 60d corresponding to the resource cross-chain transfer contract.
  • the second consensus node can verify the resource transfer certificate 60c, obtain a second verification result, and return the second verification result to the first business node.
  • the first business node 201b transfers the first virtual resource to the first resource transfer-in address, where FIG6 uses address 203a as an example of the second resource transfer-out address 40c, and uses address 202a as an example of the first resource transfer-in address 20g.
  • a first business node belonging to a business node corresponding to the first blockchain can instruct a second business node belonging to a business node corresponding to the second blockchain through a resource cross-chain transfer request to lock the first virtual resource corresponding to the virtual resource value for the first resource transfer-in address in the second blockchain; wherein the second blockchain is different from the first blockchain; this process can avoid transferring the first virtual resource out of the first resource transfer-in address when the first resource transfer-out address fails to transfer the second virtual resource subsequently, thereby avoiding the computational consumption caused by invalid resource transfer; further, if the second business node successfully locks the first virtual resource, the second virtual resource associated with the virtual resource value in the first resource transfer-out address can be transferred in the first blockchain.
  • the source performs resource transfer processing; after successful transfer, the first business node generates a resource transfer transaction including the first resource transfer address and the virtual resource value, and then obtains the resource transfer certificate generated for the resource transfer transaction; this process can convert the cross-chain transfer of resources into the resource transfer within the chain through the resource transfer transaction and the first virtual resource locked by the second blockchain, so the resource transfer efficiency can be improved; further, according to the resource transfer certificate, the second business node transfers the first virtual resource to the first resource transfer address; this process can transfer resources in the first blockchain and the second blockchain respectively through the resource transfer certificate, avoiding the second virtual resource from being transferred through a third party, so the second virtual resource will not be transferred out of the first blockchain, thereby improving the security of the second virtual resource. It can be seen from the above that through the first virtual resource, the second virtual resource and the resource transfer certificate, the embodiment of the present application can safely and efficiently transfer resources across chains within the first blockchain and the second blockchain.
  • Figure 7 is a flow chart of a data processing method based on blockchain provided in an embodiment of the present application.
  • the data processing method based on blockchain can be executed by a first business node, or by a second business node, or by the first business node and the second business node interactively, without limitation here.
  • the embodiment of the present application is described by taking the first business node as an example, wherein the first business node can be any first business node in the first business network of the embodiment corresponding to Figure 1 above.
  • the data processing method based on blockchain can at least include the following steps S201-S207.
  • Step S201 obtaining a cross-chain resource transfer request initiated by a first account;
  • the cross-chain resource transfer request includes a virtual resource value, a first resource transfer-out address deployed by the first account on the first blockchain, and a first resource transfer-in address deployed by the first account on the second blockchain; the second blockchain is different from the first blockchain.
  • step S201 For the implementation process of step S201, please refer to step S101 in the embodiment corresponding to FIG. 3 above, which will not be described in detail here.
  • Step S202 calling a cross-chain resource transfer contract according to a cross-chain resource transfer request; the cross-chain resource transfer contract is a smart contract synchronized from the first blockchain.
  • a cross-chain resource transfer contract is obtained.
  • the cross-chain resource transfer contract is a contract that is successfully deployed by the cross-chain service device on the first blockchain.
  • the first consensus node in the first blockchain is used to perform on-chain processing on the cross-chain resource transfer contract.
  • the on-chain processing is used to configure the cross-chain resource transfer contract on the first blockchain.
  • the cross-chain service device is a device that supports cross-chain resource transfer.
  • the first account implements the resource transfer process through the cross-chain service device.
  • the cross-chain service device can more safely and efficiently make the first blockchain reach a consensus by deploying a resource cross-chain transfer contract, so as to perform the resource cross-chain transfer process through the calling process of the first business node.
  • FIG8 is a block chain-based resource cross-chain transfer contract synchronization method provided by the embodiment of the present application.
  • the cross-chain service device publishes a resource cross-chain transfer contract to the first blockchain.
  • the resource cross-chain transfer contract is a contract code, and is uploaded to the first blockchain by the cross-chain service device. It has a transaction check function before the transaction is on the chain, a callback function after the transaction is synchronized, and a function of supplementing business information for business transactions.
  • the resource cross-chain transfer contract in the embodiment of the present application is stored in the first blockchain as a storage data, deployed and run on the business node.
  • Step S2022 the first business node synchronizes the resource cross-chain transfer contract.
  • the first business node corresponding to the first blockchain can choose to save synchronously according to its own business type, and verify the correctness and integrity of the contract code through the blockchain hash feature.
  • Step S2023, the cross-chain service device deploys the verification contract to the second blockchain.
  • the verification contract is used to verify the data in the first blockchain, such as the legitimacy of the resource transfer certificate.
  • Step S203 based on the cross-chain resource transfer contract, determine the association relationship between the first blockchain and the second blockchain; the association relationship is used to determine the second business node; the cross-chain resource transfer request is used to instruct the second business node to lock the first virtual resource to be acquired by the first account for the first resource transfer address in the second blockchain; the first business node is the business node corresponding to the first blockchain; the second business node is the business node corresponding to the second blockchain.
  • Figure 9 is a schematic diagram of the association relationship between a first blockchain and a second blockchain provided in an embodiment of the present application.
  • the forms of the first blockchain and the second blockchain can be divided into two types: isomorphic chains and heterogeneous chains.
  • isomorphic chains represent that the chain data structure and network interface (organization method) are the same; heterogeneous chains are the opposite, and the data structure and organization method are different.
  • the first blockchain and the second blockchain are isomorphic chains, the first business node sequence can be run to synchronize the data of the two chains and access each other, because the first business node has both the first blockchain data and the second blockchain data.
  • Heterogeneous chains need to run the SPVs of different chains separately, that is, the first blockchain needs to run the first business node, and the second blockchain needs to run the second business node.
  • the access between SPVs is similar to the program application pull-up, or the background interface access to use each other's data.
  • This process uses the communication relationship between the first business node and the second business node to send a resource cross-chain transfer request for locking the first virtual resource to the second business node, thereby achieving the purpose of locking the first virtual resource more intuitively and quickly.
  • Step S204 If the association relationship is a heterogeneous association relationship, the second business node is called through the resource cross-chain transfer contract; the heterogeneous association relationship is used to indicate that the first business node and the second business node are not the same business node.
  • Step S205 Send the resource cross-chain transfer request to the second business node, wherein the second business node locks the first virtual resource to be acquired by the first account for the first resource transfer-in address according to the resource cross-chain transfer request.
  • step S2051 the first business node obtains a resource cross-chain transfer request.
  • the business object holding the first resource transfer address sends a cross-chain transfer transaction to the first business node through the first resource transfer address.
  • step S2052 the first business node pulls up the second business node.
  • the first business node serves the first blockchain but not the second blockchain.
  • the second business node serves the second blockchain but not the first blockchain.
  • the first business node can call (pull up) the second business node.
  • the second business node locks the first virtual resource in the second blockchain.
  • locking the first virtual resource is similar to placing an order first but not paying. It can be locked in the virtual resource pool corresponding to the second blockchain, or it can be locked in other addresses that are willing to sell virtual resources, such as the second resource transfer address.
  • the association relationship is a heterogeneous association relationship
  • the first virtual resource is locked for the first resource transfer address in the second blockchain through the second business node that does not serve the first blockchain, but the process of the second business node locking the first virtual resource is the same as the process of the first business node locking the first virtual resource.
  • Step S206 If the second service node successfully locks the first virtual resource, a resource transfer transaction including the first resource transfer address and the virtual resource value is generated, and a resource transfer certificate generated for the resource transfer transaction is obtained.
  • step S206 can be found in step S102 in the embodiment corresponding to FIG. 3 above, which is not mentioned here. To elaborate.
  • Step S207 According to the resource transfer certificate, the first virtual resource is transferred to the first resource transfer address in the second blockchain.
  • Step S2071 the first business node transfers the second virtual resource in the first blockchain; step S2072, the first business node pulls up the second business node and transmits the resource transfer certificate; step S2073, the second business node transmits the resource transfer certificate to the second blockchain; step S2074, the second blockchain verifies the resource transfer certificate and transfers the first virtual resource.
  • the data to be transmitted can be signed by its own key, or the data to be transmitted can be encrypted by the other party's key.
  • the transfer of resources on the chain requires the signature of the private key corresponding to the address. The method proposed in the embodiment of the present application can make the address without the need for a custodial private key.
  • the first business node corresponding to the first blockchain instructs the second business node corresponding to the second blockchain to lock the first virtual resource to be obtained by the first account in the second blockchain at the first resource transfer-in address deployed in the second blockchain for the first account through the resource cross-chain transfer request; wherein the second blockchain is different from the first blockchain; through this process, the problem of transferring the first virtual resource to the first resource transfer-in address when the subsequent first resource transfer-out address has not transferred out the second virtual resource can be avoided, so the computing consumption caused by invalid resource transfer can be avoided; if the second business node successfully locks the first virtual resource, the first resource transfer-out address corresponding to the virtual resource value is The associated second virtual resource is processed for resource transfer out; this process converts the cross-chain resource transfer into the resource transfer within the chain through the first virtual resource locked by the second blockchain, thereby improving the efficiency of resource transfer; if the second virtual resource is successfully transferred out, the resource transfer certificate is used
  • FIG 12 is a structural schematic diagram of a blockchain-based data processing device provided in an embodiment of the present application.
  • the blockchain-based data processing device can be run on a first business node, and the blockchain-based data processing device 1 can be used to execute the corresponding steps in the method provided in an embodiment of the present application.
  • the blockchain-based data processing device 1 may include: a first acquisition module 11 and a second acquisition module 12.
  • the first acquisition module 11 is used to obtain a resource cross-chain transfer request initiated by a first account;
  • the resource cross-chain transfer request includes a virtual resource value, a first resource transfer-out address deployed by the first account on the first blockchain, and a first resource transfer-in address deployed by the first account on the second blockchain;
  • the second blockchain is different from the first blockchain;
  • the resource cross-chain transfer request is used to instruct the second business node to lock the first virtual resource to be acquired by the first account for the first resource transfer-in address in the second blockchain, and the first virtual resource corresponds to the virtual resource value;
  • the first business node is the business node corresponding to the first blockchain;
  • the second business node is the business node corresponding to the second blockchain;
  • the second acquisition module 12 is used to perform resource transfer processing on the second virtual resource associated with the virtual resource value in the first resource transfer-out address if the second business node successfully locks the first virtual resource; wherein, if the second virtual resource is successfully transferred out, the first virtual resource is transferred to the first resource transfer-in address in the second blockchain.
  • the second acquisition module 12 is further used to determine, from the first blockchain, a second resource transfer-in address corresponding to the second resource transfer-out address if the second service node locks the first virtual resource from the second resource transfer-out address, the second resource transfer-out address being the address of the second account registered on the second blockchain, the second resource transfer-in address being the address of the second account registered on the first blockchain, and the second resource transfer-in address being the address of the second account registered on the first blockchain.
  • the transfer-in address represents the transfer-out address of the second virtual resource in the first blockchain; and the second virtual resource transferred from the first resource transfer-out address is transferred to the second resource transfer-in address.
  • the second acquisition module 12 is also used to determine the virtual resource pool corresponding to the first blockchain if the second business node locks the first virtual resource from the virtual resource pool corresponding to the second blockchain; and transfer the second virtual resource transferred from the first resource transfer address to the virtual resource pool corresponding to the first blockchain.
  • the second acquisition module 12 is also used to generate a resource transfer certificate if the second virtual resource is successfully transferred out; send the resource transfer certificate to the second blockchain, and the resource transfer certificate is used to instruct the second blockchain to transfer the first virtual resource to the first resource transfer address.
  • the second acquisition module 12 is also used to generate the resource transfer certificate if the second virtual resource is successfully transferred to the second resource transfer address in the first blockchain; or, if the second virtual resource is successfully transferred to the virtual resource pool corresponding to the first blockchain in the first blockchain, generate the resource transfer certificate.
  • the second acquisition module 12 is also used to call a resource cross-chain transfer contract according to the resource cross-chain transfer request; the resource cross-chain transfer contract is a smart contract synchronized from the first blockchain; based on the resource cross-chain transfer contract, determine the association relationship between the first blockchain and the second blockchain; the association relationship is used to determine the second business node.
  • the second acquisition module 12 is also used to obtain the first chain structure of the first blockchain and the second chain structure of the second blockchain based on the resource cross-chain transfer contract, wherein the chain structure includes the chain data structure and organization method of the blockchain; compare the first chain structure and the second chain structure, if the first chain structure is the same as the second chain structure, determine that the association relationship between the first blockchain and the second blockchain is an isomorphic association relationship; if the first chain structure is different from the second chain structure, determine that the association relationship between the first blockchain and the second blockchain is a heterogeneous association relationship.
  • the association relationship includes a homogeneous association relationship, and the homogeneous association relationship is used to indicate that the first service node and the second service node are the same service node;
  • the second acquisition module 12 is also used to, if a resource locking permission response returned by the second resource transfer-out address is obtained in the second blockchain, lock the first virtual resource to be obtained by the first account for the first resource transfer-in address in the second resource transfer-out address according to the resource locking permission response; if no resource locking permission response is obtained in the second blockchain, obtain the first virtual resource for the first resource transfer-in address from the virtual resource pool corresponding to the second blockchain.
  • the second acquisition module 12 is further used to query the third virtual resource held by the second resource transfer-out address according to the resource locking permission response; if the third virtual resource is not less than the first virtual resource corresponding to the virtual resource value, lock the first virtual resource for the first resource transfer-in address from the third virtual resource; if the third virtual resource is less than the first virtual resource, lock the first virtual resource for the first resource transfer-in address from the virtual resource pool corresponding to the second blockchain.
  • the second acquisition module 12 is further used to obtain the third virtual resource from the second resource transfer-out address for the first resource transfer-in address if the third virtual resource is smaller than the first virtual resource; determine the first virtual resource difference between the first virtual resource and the third virtual resource, and lock the first virtual resource difference for the first resource transfer-in address from the virtual resource pool corresponding to the second blockchain.
  • the second acquisition module 12 is also used to call the second business node through the resource cross-chain transfer contract if the association relationship is a heterogeneous association relationship; the heterogeneous association relationship is used to indicate that the first business node and the second business node are not the same business node; the resource cross-chain transfer request is sent to the second business node, wherein the second business node locks the first virtual resource to be acquired by the first account for the first resource transfer address according to the resource cross-chain transfer request.
  • the second acquisition module 12 is further used to acquire a cross-chain resource transfer contract, which is a contract successfully deployed by the cross-chain service device on the first blockchain, and the first consensus node in the first blockchain is used to perform on-chain processing on the cross-chain resource transfer contract, and the on-chain processing is used to transfer the cross-chain resource to the first blockchain.
  • the transfer contract is configured on the first blockchain.
  • the second acquisition module 12 is further used to generate a resource transfer transaction including the virtual resource value and the first resource transfer address if the second virtual resource is transferred out successfully; and obtain the resource transfer certificate generated for the resource transfer transaction.
  • the second acquisition module 12 is also used to send the resource transfer transaction to the first consensus node corresponding to the first blockchain, wherein the first consensus node performs on-chain processing on the resource transfer transaction to obtain an on-chain result; the on-chain result includes an on-chain success result; the on-chain success result is used to instruct the first consensus node to generate the resource transfer certificate for the resource transfer transaction; and obtain the resource transfer certificate returned by the first consensus node.
  • the second acquisition module 12 is also used to verify the resource transfer certificate to obtain a first verification result; under the condition that the first verification result is a first verification pass result, if the first virtual resource is a resource locked in a second resource transfer-out address, the first virtual resource transferred from the second resource transfer-out address is transferred to the first resource transfer-in address; the second resource transfer-out address is an address of a second account deployed in the second blockchain, and the second account is an account holding the first virtual resource; the second resource transfer-in address is an address of the second account deployed on the first blockchain; wherein, if the first virtual resource is a resource locked in a virtual resource pool corresponding to the second blockchain, the first virtual resource locked in the virtual resource pool corresponding to the second blockchain is transferred to the first resource transfer-in address.
  • the second acquisition module 12 is also used to transmit the resource transfer certificate to the second blockchain if the association relationship is a homogeneous association relationship, wherein the second consensus node corresponding to the second blockchain verifies the resource transfer certificate through a verification contract to obtain a second verification result; the homogeneous association relationship is used to indicate that the first business node and the second business node are the same business node; wherein, if the second verification result returned by the second consensus node is a second verification pass result, the first virtual resource is transferred to the first resource transfer address.
  • the first business node corresponding to the first blockchain instructs the second business node corresponding to the second blockchain to lock the first virtual resource to be obtained by the first account at the first resource transfer-in address deployed in the second blockchain for the first account through the resource cross-chain transfer request; wherein the second blockchain is different from the first blockchain; through this process, the problem of transferring the first virtual resource to the first resource transfer-in address when the subsequent first resource transfer-out address has not transferred out the second virtual resource can be avoided, so the computing consumption caused by invalid resource transfer can be avoided; further, if the second business node successfully locks the first virtual resource, the first resource transfer-out address is transferred to the first resource transfer-in address; The second virtual resource associated with the virtual resource value in the address is processed for resource transfer out; this process converts the cross-chain resource transfer into the intra-chain resource transfer through the first virtual resource locked by the second blockchain, thereby improving the efficiency of resource transfer; further, if the second virtual resource
  • the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
  • the communication bus 1002 is used to realize the connection and communication between these components.
  • the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface).
  • the memory 1005 can be a high-speed RAM memory, or it can be a non-volatile memory (non-volatile memory), such as at least one disk storage.
  • the memory 1005 can optionally also be at least one storage device located away from the aforementioned processor 1001.
  • a memory as a computer storage medium 1005 may include an operating system, a network communication module, a user interface module, and a device control application.
  • the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the blockchain-based data processing method as described above.
  • the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method or device based on blockchain in the above embodiments, which will not be repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.
  • the present application also provides a computer-readable storage medium, which stores a computer program.
  • the computer program is executed by a processor, the description of the data processing method or device based on blockchain in the above embodiments is implemented, which will not be repeated here.
  • the description of the beneficial effects of the same method will not be repeated.
  • the above-mentioned computer-readable storage medium can be the blockchain-based data processing device provided in any of the aforementioned embodiments or the internal storage unit of the above-mentioned computer device, such as the hard disk or memory of the computer device.
  • the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device can execute the description of the data processing method or device based on blockchain in the above embodiments, which will not be repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种基于区块链的数据处理方法、设备以及可读存储介质,该方法由第一业务节点执行,该方法包括:获取由第一账户发起的资源跨链转移请求,资源跨链转移请求包括虚拟资源值、第一账户部署在第一区块链上的第一资源转出地址,以及第一账户部署在第二区块链的第一资源转入地址,资源跨链转移请求用于指示第二业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源(S101);若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理(S102)。采用本申请,可以安全且高效地进行资源跨链转移。

Description

一种基于区块链的数据处理方法、设备以及可读存储介质
本申请要求于2022年11月14日提交的申请号为202211421853.3、发明名称为“一种基于区块链的数据处理方法、设备以及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,尤其涉及一种基于区块链的数据处理方法、设备以及可读存储介质。
背景技术
随着网络技术的快速发展以及企业对数据安全的重视,区块链得到了极大的重视和应用。
相关技术中,若不同的区块链之间发生资源跨链转移,需要双方都认可的第三方中介在两个区块链之间进行资源中转,例如:在第一区块链中的第一地址向第二区块链中的第二地址转移虚拟资源时,第一地址需要先将虚拟资源发给第一区块链以及第二区块链共同认可的第三方中介,然后通过第三方中介将该虚拟资源转发给第二地址。
上述资源跨链转移依赖于第三方中介的资源中转,因此资源转移的效率较低,又由于第三方中介会直接接触到虚拟资源,因此还可能存在虚拟资源在第一区块链以及第二区块链之外被盗的风险,进而降低了资源转移的安全性。
发明内容
本申请实施例提供一种基于区块链的数据处理方法、设备以及可读存储介质,可以安全且高效地进行资源跨链转移。
本申请实施例一方面提供了一种基于区块链的数据处理方法,该方法由第一业务节点执行,该方法包括:
获取由第一账户发起的资源跨链转移请求;资源跨链转移请求包括虚拟资源值、第一账户部署在第一区块链上的第一资源转出地址,以及第一账户部署在第二区块链的第一资源转入地址;第二区块链不同于第一区块链;资源跨链转移请求用于指示第二业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源,第一虚拟资源与虚拟资源值对应;第一业务节点是第一区块链对应的业务节点;第二业务节点是第二区块链对应的业务节点;
若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;其中,若所述第二虚拟资源转出成功,将第一虚拟资源在第二区块链中被转入至第一资源转入地址。
本申请实施例一方面提供了一种基于区块链的数据处理装置,该装置运行于第一业务节点,该装置包括:
第一获取模块,用于获取由第一账户发起的资源跨链转移请求;资源跨链转移请求包括虚拟资源值、第一账户部署在第一区块链上的第一资源转出地址,以及第一账户部署在第二区块链的第一资源转入地址;第二区块链不同于第一区块链;资源跨链转移请求用于指示第二业务节点在第二区块链中,为第一资源转入地址锁定第一账户待获取的第一虚拟资源,第一虚拟资源与虚拟资源值对应;第一业务节点是第一区块链对应的业务节点;第二业务节点是第二区块链对应的业务节点;
第二获取模块,用于若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;其中,若所述第二虚拟资源转出成功,所述第一虚拟资源在所述第二区块链中被转入至所述第一资源转入地址。
本申请一方面提供了一种计算机设备,包括:处理器、存储器、网络接口;
上述处理器与上述存储器、上述网络接口相连,其中,上述网络接口用于提供数据通信 功能,上述存储器用于存储计算机程序,上述处理器用于调用上述计算机程序,以使得计算机设备执行本申请实施例中的方法。
本申请实施例一方面提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有计算机程序,上述计算机程序适于由处理器加载并执行本申请实施例中的方法。
本申请实施例一方面提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中;计算机设备的处理器从计算机可读存储介质读取该计算机程序,处理器执行该计算机程序,使得该计算机设备执行本申请实施例中的方法。
本申请实施例提供的技术方案带来的有益效果至少包括:
在获取到由第一账户发起的资源跨链转移请求时,第一区块链对应的第一业务节点通过资源跨链转移请求,指示属于第二区块链对应的第二业务节点在第二区块链中为第一账户部署在第二区块链的第一资源转入地址锁定第一账户待获取的第一虚拟资源;其中,第二区块链不同于第一区块链;通过该过程可以避免后续第一资源转出地址未转出第二虚拟资源时即将第一虚拟资源转入第一资源转入地址的问题,故可以避免无效资源转移所带来的计算消耗;
进一步地,若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;该过程通过第二区块链所锁定的第一虚拟资源,将资源跨链转移转化为链内的资源转移,从而提高资源转移效率;
进一步地,若第二虚拟资源转出成功,在第二区块链中将第一虚拟资源转入至第一资源转入地址;通过在第一区块链以及第二区块链中分别进行资源转移的过程,避免将第一虚拟资源和第二虚拟资源通过第三方进行资源中转,由于第二虚拟资源不会转移出第一区块链外,第一虚拟资源也不转移出第二区块链外,因此可以提高第一虚拟资源和第二虚拟资源的安全性。也即:通过第一虚拟资源、第二虚拟资源以及资源转移凭证,可以在第一区块链以及第二区块链的两链内安全且高效地进行资源跨链转移。
附图说明
图1是本申请实施例提供的一种系统架构示意图;
图2是本申请实施例提供的一种基于区块链的数据处理的场景示意图一;
图3是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图一;
图4是本申请实施例提供的一种基于区块链的数据处理的场景示意图二;
图5是本申请实施例提供的一种基于区块链的数据处理的场景示意图三;
图6是本申请实施例提供的一种基于区块链的数据处理的场景示意图四;
图7是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图二;
图8是本申请实施例提供的一种基于区块链的资源跨链转移合约同步方法的交互示意图;
图9是本申请实施例提供的一种第一区块链以及第二区块链之间的关联关系的示意图;
图10是本申请实施例提供的一种基于区块链的数据处理方法的交互流程图一;
图11是本申请实施例提供的一种基于区块链的数据处理方法的交互流程图二;
图12是本申请实施例提供的一种基于区块链的数据处理装置的结构示意图;
图13是本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
为了便于理解,首先对部分名词进行以下简单解释:
1、区块链:狭义上,区块链是一种以区块为基本单位的链式数据结构,区块中利用数字摘要对之前获取的交易历史进行校验,适合分布式记账场景下防篡改和可扩展性的需求;广义上,区块链还指代区块链结构实现的分布式记账技术,包括分布式共识、隐私与安全保护、点对点通信技术、网络协议、智能合约等。区块链的目标是实现一个分布的数据记录账本,此账本只允许添加,不允许删除。账本底层的基本结构是一个线性的链表。链表由一个个“区块”串联组成,后继区块中记录前继区块的哈希(Hash)值,每个区块(以及区块中的交易) 是否合法,可通过计算哈希值的方式进行快速检验。若网络中的节点提议添加一个新的区块,必须经过共识机制对区块达成共识确认。
2、区块(block):是在区块链网络上承载交易数据的数据包,是一种被标记上时间戳和前继区块对应的哈希值的数据结构,区块经过网络的共识机制验证并确认区块中的交易。区块包括区块头(Block Header)以及区块体(Block Body),区块头可以记录当前区块的元信息,包含当前版本号、前继区块对应的哈希值、时间戳、随机数、默克尔树根(Merkle Root)的哈希值等数据。区块体可以记录一段时间内所生成的详细数据,包括当前区块经过验证的、区块创建过程中生成的所有交易记录或是其他信息,可以理解为账本的一种表现形式。此外,区块体的详细数据可以包括通过默克尔树(Merkle Tree)的哈希过程,生成唯一的Merkle Root记录于区块头。
3、哈希值(hash):也称作信息特征值或特征值,哈希值是通过哈希算法将任意长度的输入数据转换为密码并进行固定输出而生成的,不能通过解密哈希值来检索原始输入数据,它是一个单向的加密函数。在区块链中,每个区块(除了初始区块)都包含前继区块的哈希值,哈希值是区块链技术中的潜力核心基础和最重要的方面,它保留了记录和查看数据的真实性,以及区块链作为一个整体的完整性。
4、区块链节点:区块链网络将区块链节点区分为共识节点(也可以称作核心节点以及全量节点),以及业务节点(也可以称作轻量节点,Simplified Payment Verification,简称SPV)。其中,共识节点负责区块链全网的共识业务;业务节点负责同步共识节点的账本信息,即同步最新的区块数据。无论是共识节点还是业务节点,其内部构造都包括网络通信组件,因为区块链网络本质是一个点对点(Peer to Peer,P2P)网络,需通过P2P组件与区块链网络中的其他节点进行通信。区块链网络中的资源和服务都分散在各个节点上,信息的传输和服务的实现都直接在节点之间进行,无需中间环节或中心化的服务器(第三方)介入。
5、默克尔(Merkle)树、Merkle根:Merkle树是一种典型的二叉树结构,由一个根结点(Merkle根),一组中间节点和一组叶子节点构成。最下层的叶子节点存储数据或其哈希值,其他节点存储其两个子节点内容的哈希值。
6、非对称签名:该算法包括两个密钥,公开密钥(简称公钥,public key)和私有密钥(简称私钥,private key)。公钥与私钥是一对,如果用私钥对数据进行签名,只有用对应的公钥才能验签。因为签名过程和验签过程分别使用两个不同的密钥,所以这种算法称作非对称签名。非对称签名实现机密信息交换的基本过程可以是:甲方生成一对密钥并将公钥公开,甲方需要向其他角色(乙方)发送信息时,使用自己的私钥对机密信息进行签名后再发送给乙方;乙方再用甲方的公钥对签名后的信息进行验签。
7、智能合约(Smart Contract):是一种旨在以信息化方式传播、验证或执行合同的计算机协议。在区块链系统当中,智能合约(简称合约)是一种区块链各节点可以理解并执行的代码,可以执行任意逻辑并得到结果。在实际应用中,智能合约通过区块链上的交易来管理与试用。每条交易相当于对区块链系统的一个远程过程调用(Remote Procedure Call,RPC)请求。如果说智能合约相当于可执行程序,区块链就相当于提供运行环境的操作系统。区块链可以包含多个合约(如本申请中的本地资源跨链转移合约等),以合约账号(Identity,ID)、标识号或名称来区分。
8、资源跨链转移:不同区块链之间的虚拟资源互通,例如区块链A与区块链B进行虚拟资源互通。
请参见图1,图1是本申请实施例提供的一种系统架构示意图。如图1所示,该系统架构可以包括区块链网络集群,本申请实施例不对区块链网络集群中的区块链网络的数量进行限定,可以为两个或两个以上。如图1所示,区块链网络集群可以包括区块链网络101以及区块链网络102。
可选地,区块链网络101可以包括共识网络101e以及业务网络,为了与下文区块链网络 102所包括的业务网络区分,下文将区块链网络101所包括的业务网络称为第一业务网络,将区块链网络102所包括的业务网络称为第二业务网络。第一业务网络中的区块链节点可以称为第一业务节点,本申请实施例不对第一业务网络中的第一业务节点的数量进行限定,可以包括一个或多个第一业务节点,如图1所示,第一业务网络可以包括第一业务节点101d。其中,共识网络101e和第一业务网络可以处在不同网络环境下,通常来说,共识网络101e处于私有网络中,而第一业务网络处于共有网络中。
共识网络101e可以称为第一共识网络,其所包括的区块链节点可以称为第一共识节点,本申请实施例不对共识网络101e中的第一共识节点的数量进行限定,可以包括一个或多个第一共识节点,如图1所示,共识网络101e可以包括第一共识节点101a以及第一共识节点101b。共识网络101e中的第一共识节点(例如图1中的第一共识节点101a以及第一共识节点101b)共同维护区块链101c,区块链101c也可以称为第一区块链。其中,区块链网络102可以包括共识网络102e以及第二业务网络。第二业务网络中的区块链节点可以称为第二业务节点,本申请实施例不对第二业务网络中的第二业务节点的数量进行限定,可以包括二个或多个第二业务节点,如图1所示,第二业务网络可以包括第二业务节点102d。
共识网络102e可以称为第二共识网络,其所包括的区块链节点可以称为第二共识节点,本申请实施例不对共识网络102e中的第二共识节点的数量进行限定,可以包括二个或多个第二共识节点,如图1所示,共识网络102e可以包括第二共识节点102a以及第二共识节点102b。共识网络102e中的第二共识节点(例如图1中的第二共识节点102a以及第二共识节点102b)共同维护区块链102c,区块链102c也可以称为第二区块链。其中,共识网络102e和第二业务网络可以处在不同网络环境下,通常来说,共识网络102e处于私有网络中,而第二业务网络处于共有网络中。
其中,区块链网络101中的区块链节点之间可以存在通信连接,例如第一共识节点101a与第一共识节点101b之间存在通信连接,第一业务节点101d与第一共识节点101a之间存在通信连接。其中,区块链网络102中的区块链节点之间可以存在通信连接,例如第二共识节点102a与第二共识节点102b之间存在通信连接,第二业务节点102d与第二共识节点102a之间存在通信连接。其中,区块链网络101中的任意一个区块链节点,与区块链网络102中的任意一个区块链节点之间可以存在通信连接,例如第一共识节点101a与第二共识节点102b之间存在通信连接,第一业务节点101d与第二业务节点102d之间存在通信连接。其中,本申请实施例不对上述的通信连接的连接方式进行限定,可以通过有线通信方式进行直接或间接地连接,也可以通过无线通信方式进行直接或间接地连接,还可以通过其他方式,本申请在此不做限制。
可选地,区块链网络101包括共识网络101e,用于与区块链网络101进行通信交互的业务网络在区块链网络101之外,业务网络通过部署在其中的业务节点与区块链网络101进行交互,如:业务网络中的第一业务节点部署在区块链网络101之外;同理,区块链网络102包括共识网络102e,用于与区块链网络102进行通信交互的业务网络在区块链网络102之外,业务网络通过部署在其中的业务节点与区块链网络102进行交互,如:业务网络中的第一业务节点部署在区块链网络102之外等。
可以理解的是,区块链节点之间可以通过上述通信连接进行数据或者区块传输。上述区块链节点之间的通信连接可以基于节点标识,对于区块链网络101中的每个区块链节点以及区块链网络102中的每个区块链节点,均具有与其对应的节点标识,而且上述每个区块链节点均可以存储与自身有相连关系的其他区块链节点的节点标识,以便后续根据其他区块链节点的节点标识,将获取到的数据或生成的区块广播至其他区块链节点,例如第一共识节点101a可以维护一个节点标识列表,该节点标识列表保存着其他区块链节点的节点名称和节点标识,如表1所示。
表1
其中,节点标识可为网络之间互联的协议(Internet Protocol,IP)地址以及其他任意一种能够用于标识区块链网络中区块链节点的信息。
假设第一共识节点101a的节点标识为FFFFFF,则第一共识节点101a可以通过节点标识AAAAAA,向第一共识节点101b发送下文描述的资源转移凭证,且第一共识节点101b通过节点标识FFFFFF,可以确定该资源转移凭证是第一共识节点101a所发送的,其他区块链节点之间的数据传输亦如此,故不再一一进行赘述。
可以理解的是,不同的企业所包括的业务数据不同,为了保障业务数据的安全,不同的企业所分别对应的业务数据,被存储于不同的区块链。在本申请实施例中,每个区块链节点(包括区块链网络101中的区块链节点以及区块链网络102中的区块链节点)在进行正常工作时,可以接收到客户端发送的业务交易,并基于接收到的业务交易生成区块,然后进行区块上链处理,即在自己所维护的区块链中进行上链处理。可以理解的是,在本申请的具体实施方式中,涉及到用户信息(例如第一资源转入地址以及第一资源转出地址)等相关的数据,当本申请实施例运用到产品或技术中时,需要获得用户许可或者同意,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。
可以理解的是,图1中的区块链节点(包括区块链网络101中的区块链节点以及区块链网络102中的区块链节点)包括但不限于移动终端或服务器。上述服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,简称CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。上述移动终端包括但不限于手机、电脑、智能语音交互设备、智能家电、车载终端、飞行器等。其中,移动终端和服务器可以通过有线或无线方式进行直接或间接地连接,本申请实施例对此不做限制。
进一步地,请参见图2,图2是本申请实施例提供的一种基于区块链的数据处理的场景示意图一。其中,该数据处理场景的实现过程可以由第一业务节点执行,也可以由第二业务节点执行,还可以由第一业务节点以及第二业务节点交互执行,此处不做限制。为了便于叙述以及理解,本申请实施例以在第一业务节点中进行为例进行叙述,其中,第一业务节点可以为上述图1所对应实施例的第一业务网络中的任意一个第一业务节点。
如图2所示,第一业务节点201b获取由第一账户发起的资源跨链转移请求20a,其中,第一账户的登录设备可以为第一业务节点201b,也可以为与第一业务节点201b具有通信连接关系的终端设备,本申请实施例对此不作限定。本申请实施例将资源跨链转移请求20a示例为图2中的“链1的地址201a转移50资源给链2的地址202a”。其中,图2以“链1”示例第一区块链20c,以“地址201a”示例第一账户配置在第一区块链上的第一资源转出地址20f,以“链2”示例第二区块链20e,以“地址202a”示例第一账户配置在第二区块链上的第一资源转入地址20g,以“50资源”示例虚拟资源值。其中,地址201a归属于第一区块链20c,地址201a当前所持有的虚拟资源的总值为200资源,例如持有200资源的地址201a被存储于第一区块链20c的区块201c中;地址202a归属于第二区块链20e,例如当前未持有虚 拟资源的地址202a被存储于第二区块链20e的区块201e中。因为第二区块链202a与第一区块链201a是两条相互独立的链,故地址201a转移50资源至地址202a属于资源跨链转移。
请再参见图2,第一业务节点201b属于第一区块链20c对应的业务节点,如上文图1所提及的第一业务网络中的业务节点,第二业务节点202b属于第二区块链20e对应的业务节点,如上文图1所提及的第二业务网络中的业务节点。可以理解的是,第一业务节点201b与第二业务节点202b可以为同一个业务节点,也可以为不同的业务节点,本申请实施例暂不对第一业务节点201b以及第二业务节点202b之间的节点关系的确定过程进行描述,请参见下文图3所对应的实施例中步骤S101中的描述。
可以理解的是,若第一业务节点201b与第二业务节点202b为同一个业务节点,则第一业务节点201b部署有两条不同的区块链,即第一区块链20c以及第二区块链20e,故第一业务节点201b可以根据资源跨链转移请求20a直接访问第二区块链20e,并进行后续过程。若第一业务节点201b与第二业务节点202b为不同的业务节点,则第一业务节点201b没有部署第二区块链20e,第二业务节点202b没有部署第一区块链20c,故如图2所示,第一业务节点201b将资源跨链转移请求20a转发至第二业务节点202b。可以理解的是,若第一业务节点201b与第二业务节点202b为同一个业务节点,则第一业务节点201b的后续过程,与下文描述的过程相同,区别仅在于第一业务节点201b与第二业务节点202b不需要数据交互,即第一业务节点201b独立执行即可。
请再参见图2,第二业务节点202b根据资源跨链转移请求20a,在第二区块链20e中,为第一资源转入地址20g(即地址202a)锁定第一账户待获取的第一虚拟资源20d,即图2中的50资源。需要说明的是,此时,第二业务节点202b仅是为了地址202a锁定第一虚拟资源20d(即50资源),以防止第一虚拟资源20d被参与到其他的资源转移处理中;该过程并没有将第一虚拟资源20d转入至地址202a,故可以避免在第一资源转出地址20f(如图2中的地址201a)未成功将第二虚拟资源转出时,需要将已转入至地址202a的第一虚拟资源20d转出至地址202a,进而可以避免无效资源转移所带来的计算消耗。可以理解的是,第一虚拟资源20d对应的虚拟资源值,可以等同于第二虚拟资源对应的虚拟资源值,但第一虚拟资源20d不是第二虚拟资源,第一虚拟资源20d源于第二区块链20e,第二虚拟资源源于第一区块链20c。
若第二业务节点202b成功锁定第一虚拟资源20d,第一业务节点201b在第一区块链20c中,对第一资源转出地址20f中与虚拟资源值相关联的第二虚拟资源进行资源转出处理,即将第二虚拟资源从第一资源转出地址20f中转出,此时,第一资源转出地址20f的当前虚拟资源发生更新,即从200资源更新为150资源。
当第二虚拟资源从第一资源转出地址20f中成功转出,在第二区块链中将第一虚拟资源20d转入第一资源转入地址20g,即地址202a,此时,地址202a的当前虚拟资源发生更新,即从0资源更新为50资源。
综上所述,在资源跨链转移场景中,通过归属于第一区块链的第一虚拟资源以及归属于第二区块链的第二虚拟资源,本申请实施例无需通过第一区块链以及第二区块链之外的第三方中介对待转移的虚拟资源进行资源中转,故不仅可以提高资源转移效率,还可以提高资源转移安全性。此外,通过资源转移凭证,可以确保第二虚拟资源从第一资源转出地址中转出,故可以进一步提高资源转移的安全性。
进一步地,请参见图3,图3是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图一。区块链的数据处理方法可以由第一业务节点执行,也可以由第二业务节点执行,还可以由第一业务节点以及第二业务节点交互执行,此处不做限制。为了便于叙述以及理解,本申请实施例以在第一业务节点中进行为例进行叙述,其中,第一业务节点可以为上述图1所对应实施例的第一业务网络中的任意一个第一业务节点。如图3所示,该基于区块链的数据处理方法至少可以包括以下步骤S101-步骤S102。
步骤S101,获取由第一账户发起的资源跨链转移请求;资源跨链转移请求包括虚拟资源值、第一账户部署在第一区块链上的第一资源转出地址,以及第一账户部署在第二区块链上的第一资源转入地址;第二区块链不同于第一区块链;资源跨链转移请求用于指示第二业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源;第一虚拟资源与虚拟资源值对应,第一业务节点属于第一区块链对应的业务节点;第二业务节点属于第二区块链对应的业务节点。
示意性的,第一账户实现为个人账户或者交易所账户,个人账户用于表征用户个人开设的账户;交易所账户用于表征公司、企业等参与交易的商户开设的账户。
可选地,第一账户在第一区块链上注册,该注册过程使得第一账户能够在第一区块链上进行资源交易过程;此外,第一账户还在第二区块链上注册,该注册注册过程也使得第一账户能够在第二区块链上进行资源交易过程。同理,其他账户也可以在包括第一区块链和第二区块链在内的多个区块链中的至少一个区块链上进行注册过程,以实现在区块链上的资源交易过程。
在一些实施例中,第一业务节点接收第一账户发起的资源跨链转移请求,该资源跨链转移请求用于将第一账户在第一区块链上的资产转移至第二区块链。
示意性的,资源跨链转移请求中包括的虚拟资源值用于表征衡量虚拟资源的单位,以使得资源转移过程符合等价交换原理。此外,资源跨链转移请求中还包括第一资源转出地址和第一资源转入地址,第一资源转出地址是第一账户注册在第一区块链上的地址,第一资源转入地址是第一账户注册在第二区块链上的地址。
可选地,第一资源转出地址可以视为第一账户注册在第一区块链上的账户,用于进行资源交易过程,在本申请实施例中,第一资源转出地址用于转出第二虚拟资源;同理,第一资源转入地址可以视为第一账户注册在第二区块链上的账户,用于进行资源交易过程,在本申请实施例中,第一资源转入地址作为承载第一账户所需转移的第一虚拟资源的地址。
在一些实施例中,第一业务节点接收到资源跨链转移请求后,基于资源跨链转移请求指示第二业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源。
示意性的,当第一业务节点和第二业务节点为同一节点时,第一业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源;当第一业务节点和第二业务节点为不同节点时,第一业务节点和第二业务节点之间具有通信关系,第一业务节点将资源跨链转移请求发送至第二业务节点,以使得第二业务节点基于资源跨链转移请求在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源。
其中,第一虚拟资源是第二区块链对应的虚拟资源,基于虚拟资源值是用于衡量虚拟资源的单位,因此基于虚拟资源值在第二区块链中确定第一账户待获取的第一虚拟资源,该第一虚拟资源与虚拟资源值相对应,用于表征第一虚拟资源是根据虚拟资源值的衡量标准确定的一定数量的虚拟资源。例如:虚拟资源值为50,则第一虚拟资源为等价为50的虚拟资源(50即可视为一定数量)。
其中,第一业务节点属于第一区块链对应的业务节点;第二业务节点属于第二区块链对应的业务节点。示意性的,第一业务节点能够调用第一区块链中的数据;第二业务节点能够调用第二区块链中的数据。
可选地,当第一业务节点和第二业务节点为同一节点时,以第一业务节点为例,第一业务节点不仅能够调用第一区块链中的数据,还可以调用第二区块链中的数据;此外,当第一业务节点和第二业务节点为不同节点时,第一业务节点能够调用第一区块链中的数据;第二业务节点能够调用第二区块链中的数据,第一业务节点和第二业务节点之间借助通信关系,实现间接调用的效果。
在一个可选的实施例中,根据资源跨链转移请求调用资源跨链转移合约;资源跨链转移合约为从第一区块链中同步的智能合约;基于资源跨链转移合约,确定第一区块链以及第二 区块链之间的关联关系;关联关系用于确定第二业务节点。
其中,基于资源跨链转移合约,确定第一区块链以及第二区块链之间的关联关系的可以包括:基于资源跨链转移合约,分别获取第一区块链的第一链结构,以及第二区块链的第二链结构;比较第一链结构以及第二链结构,若第一链结构与第二链结构相同,确定第一区块链以及第二区块链之间的关联关系为同构关联关系;若第一链结构与第二链结构不同,确定第一区块链以及第二区块链之间的关联关系为异构关联关系。
示意性的,链结构包括区块链的链数据结构以及组织方式。第一链结构与第二链结构相同,代表第一区块链和第二区块链分别对应的链数据结构以及组织方式相同;第一链结构与第二链结构不同,代表第一区块链和第二区块链分别对应的链数据结构以及组织方式中的至少一种存在差异。
借助资源跨链转移合约确定第一区块链和第二区块链之间的关联关系,从而明确第一区块链对应的链数据结构和组织方式与第二区块链对应的链数据结构和组织方式之间的关系,对第一业务节点和第二业务节点进行更针对性的分析。从而有利于基于关联关系确定第二业务节点的形式,尽可能减少直接采用第一业务节点和第二业务进行对两个区块链分别进行管理的繁琐性,有利于实现对第一区块链和第二区块链的统筹管理。
其中,关联关系包括表征第一区块链的第一链结构以及第二链结构的结构相同的同构关联关系,还包括第一链结构和第二链结构不同的异构关联关系,从而能够通过同构关联关系和异构关联关系的差异,对第一区块链和第二区块链进行更针对性的管理,避免忽视链结构影响而直接对第一区块链和第二区块链进行分析的低效问题,提高对第一区块链和第二区块链进行综合应用分析的效率。
在一些实施例中,若关联关系为同构关联关系,将资源跨链转移请求发送至第二区块链。
其中,同构关联关系用于指示第一业务节点与第二业务节点为同一个业务节点。
可选地,若在第二区块链中获取到第二资源转出地址返回的资源锁定允许响应,根据资源锁定允许响应,在第二资源转出地址中为第一资源转入地址锁定第一账户待获取的第一虚拟资源。
其中,第二资源转出地址是第二账户部署在第二区块链中的地址,第二账户是持有第一虚拟资源的账户。示意性的,第二账户是与第一账户不同的账户,第二账户在第一区块链和第二区块链上分别进行了注册过程,使得第二账户在第二区块链上对应第二资源转出地址,此外,第二账户在第一区块链上对应第二资源转入地址,从而借助第一账户与第二账户在区块链上的资源交换过程,实现第一账户将第一区块链上的资产转移至第二区块链上的过程。
示意性的,第二账户是与第一账户进行资源交易的账户,当第二区块链接收到资源跨链转移请求后,第二区块链上注册的多个账户对该资源跨链转移请求进行分析,并将多个账户中希望与第一账户进行资源交易的账户作为第二账户,即:第二账户通过注册在第二区块链上的第二资源转出地址返回资源锁定允许响应,以表征第二账户希望与第一账户进行资源交易,并能够在第二区块链上通过将资源转移至第一账户注册在第二区块链上的第一资源转入地址,实现资源交易过程。在资源交易完成前,第二账户通过第二资源转出地址返回资源锁定允许响应,以表征能够对第二资源转出地址所持有资源中的第一虚拟资源进行锁定。
可选地,第二账户为个人账户,或者,第二账户为交易所账户。
示意性的,当第二账户为个人账户,确定该第二账户注册在第二区块链上的第二资源转出地址,该第二资源转出地址实现为用于存储资源的地址形式;或者,当第二账户为交易所账户,该第二账户注册在第二区块链上的第二资源转出地址实现为交易所资源池,该交易所资源池用于表征交易所账户注册在区块链上用于实现资源交易的资源集合。
示意性的,若在第二区块链中获取到第二资源转出地址返回的资源锁定允许响应,即基于资源锁定允许响应确定第二资源转出地址允许转出资源的过程;基于此,根据资源锁定允许响应,在第二资源转出地址中锁定第一账户待获取的第一虚拟资源,且第一虚拟资源是为 第二区块链上第一账户所注册的第一资源转入地址所锁定的资源。
在一些实施例中,若在第二区块链中未获取到资源锁定允许响应,从第二区块链对应的虚拟资源池中为第一资源转入地址获取第一虚拟资源。
示意性的,虚拟资源池是第二区块链对应的资源池,用于表征第二区块链中非账户注册且具有一定资源量的资源集合。可选地,虚拟资源池是第二区块链基于区块链计算过程自动形成的资源池;或者,虚拟资源池是多个账户预先约定并以合约状态注册在第二区块链上的资源池等。
其中,根据是否获取到资源锁定允许响应的情况,确定第二区块链上是否存在愿意被进行资源锁定的第二资源转出地址,由于第二资源转出地址是第二账户注册在第二区块链上的地址,因此该过程能够更直观且明确地知悉第二区块链上是否存在愿意与第一账户进行资源交易的第二账户。若接收到资源锁定允许响应,即可根据发出资源锁定允许响应的第二资源转出地址,从中锁定第一账户待获取的第一虚拟资源;若未接收到资源锁定允许响应,即从第二区块链对应的虚拟资源池中锁定第一账户待获取的第一虚拟资源。该过程既能够更好地知悉是否存在第二账户与第一账户进行资源交易以实现第一账户将第一区块链上的资源转移至第二区块链上的过程,也能够通过第二区块链对应的虚拟资源池的设定,避免在不存在第二账户与第一账户进行资源交易时,第一账户无法独立实现将第一区块链上的资源转移至第二区块链上的过程,从而能够更高效且成功率更好地实现资源跨链转移的过程,提高资源跨链转移的成功率。
其中,根据资源锁定允许响应,在第二资源转出地址中为第一资源转入地址锁定第一账户待获取的第一虚拟资源的过程可以包括:根据资源锁定允许响应,查询第二资源转出地址所持有的第三虚拟资源;若第三虚拟资源不小于虚拟资源值对应的第一虚拟资源,从第三虚拟资源中为第一资源转入地址锁定第一虚拟资源;若第三虚拟资源小于第一虚拟资源,从第二区块链对应的虚拟资源池中为第一资源转入地址锁定第一虚拟资源。
其中,在锁定第一虚拟资源时,考虑第二资源转出地址所持有的第三虚拟资源与第一虚拟资源之间的资源数量关系,避免无法实现充足资源交易的问题。根据第三虚拟资源和第一虚拟资源之间的数量关系,通过综合从第三虚拟资源或从第二区块链对应的虚拟资源池中锁定第一虚拟资源的方式,实现获取足量的第一虚拟资源的目的,提高第一虚拟资源的获取成功率。示意性的,第二资源转出地址持有的第三虚拟资源用于表征第二账户注册在第二区块链上并存储的资源量。基于资源锁定允许响应表征允许对第二资源转出地址内的资源进行锁定,因此查询第二资源转出地址持有的第三虚拟资源,并将第三虚拟资源与第一账户待获取的第一虚拟资源进行比较,即:比较第三虚拟资源对应的资源量与第一虚拟资源的资源量之间的大小。
可选地,若第三虚拟资源不小于第一虚拟资源,即代表能够第一虚拟资源能够从第三虚拟资源中获取,进而从第二资源转出地址所持有的第三虚拟资源中锁定第一虚拟资源,该第一虚拟资源是为第一账户注册在第二区块链上的第一资源转入地址锁定的资源。
可选地,若第三虚拟资源小于第一虚拟资源,即代表无法从第二资源转出地址中获取足够数量的第一虚拟资源,进而从第二区块链对应的虚拟资源池中锁定第一虚拟资源,该第一虚拟资源是为第一账户注册在第二区块链上的第一资源转入地址锁定的资源。
其中,若第三虚拟资源小于第一虚拟资源,在第二区块链对应的虚拟资源池中为第一资源转入地址锁定第一虚拟资源的过程可以包括:若第三虚拟资源小于第一虚拟资源,则为第一资源转入地址获取第三虚拟资源;确定第一虚拟资源以及第三虚拟资源之间的第一虚拟资源差值,在第二区块链对应的虚拟资源池中,为第一资源转入地址获取第一虚拟资源差值。
示意性的,若第三虚拟资源小于第一虚拟资源,由于无法从第二资源转出地址中获取足够数量的第一虚拟资源,因此可以先从第二资源转出地址中获取其持有的第三虚拟资源,由于第三虚拟资源小于第一虚拟资源,可以确定第一虚拟资源与第三虚拟资源之间的差值,得 到第一虚拟资源差值,进而从第二区块链对应的虚拟资源池中锁定第一虚拟资源差值。也即:第一虚拟资源包括从第二资源转出地址获取的第三虚拟资源以及从第二区块链对应的虚拟资源池中锁定的第一虚拟资源差值。
其中,考虑到即便第三虚拟资源小于第一虚拟资源,为了促成账户之间的交易,以充分提高账户之间进行交易的积极性和活跃性,仍然先从第二账户注册在第二区块链中的第二资源转出地址中锁定小于第一虚拟资源的第三虚拟资源,进而从第二区块链对应的虚拟资源池中锁定代表第一虚拟资源和第三虚拟资源差值的第一虚拟资源差值,既实现了第一虚拟资源的足量锁定过程,也有利于账户之间的资源交易过程。
可选地,还可以在第三虚拟资源不足以弥补第一虚拟资源时,从第二区块链上其他账户注册的转出地址中锁定不足量的虚拟资源,实现第一账户借助与多个账户进行资源交易的过程,完成将虚拟资源从第一区块链转移至第二区块链的跨链转移过程。
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。
本申请实施例提出一种部署且运行于业务节点的智能合约,即资源跨链转移合约,该资源跨链转移合约经过区块链的链上验证,然后同步至业务节点。本步骤暂不对资源跨链转移合约的链上认证的过程以及链下同步的过程展开描述,请参见下文图7所对应的实施例中步骤S202中的描述。基于此,本申请实施例提出一种通过资源跨链转移合约实现资源跨链转移的方案,由于资源跨链转移合约是经过链上认证过的代码内容,故可以有效解决运行第三方代码所带来的信任问题。
第一业务节点获取由第一账户发起的资源跨链转移请求,根据资源跨链转移请求,第一业务节点调用资源跨链转移合约,请一并参见图4以及图5,其中,图4是本申请实施例提供的一种基于区块链的数据处理的场景示意图二,图5是本申请实施例提供的一种基于区块链的数据处理的场景示意图三。如图4所示,资源跨链转移合约40a为从第一区块链20c中同步的智能合约,且部署于第一业务节点201b。通过运行资源跨链转移合约40a,第一业务节点201b可以确定第一区块链20c以及第二区块链20e之间的关联关系,关联关系的确定过程可以如下描述。通过运行资源跨链转移合约40a,第一业务节点201b可以分别获取第一区块链20c的第一链结构,以及第二区块链20e的第二链结构。其中,第一链结构可以包括第一区块链20c的链数据结构以及组织方式,同理,第二链结构可以包括第二区块链20e的链数据结构以及组织方式。
请再参见图4,通过资源跨链转移合约40a,第一业务节点201b对第一链结构以及第二链结构进行对比处理,得到第一对比结果40b,若第一对比结果40b为第一链结构与第二链结构相同,则可以确定第一区块链20c以及第二区块链20e之间的关联关系为同构关联关系,也可以称第一区块链20c以及第二区块链20e为同构链。进一步,由于第一链结构与第二链结构相同,故第一业务节点201b可以同时服务第一区块链20c以及第二区块链20e,即第一业务节点201b可以同时维持第一区块链20c以及第二区块链20e,此时第一业务节点201b与第二业务节点202b可以为同一个业务节点。
若第一对比结果40b为第一链结构与第二链结构不同,则可以确定第一区块链20c以及第二区块链20e之间的关联关系为异构关联关系,也可以称第一区块链20c以及第二区块链20e为异构链。进一步,由于第一链结构与第二链结构不同,故服务第一区块链20c的第一业务节点201b,无法同时服务第二区块链20e,因为第一业务节点201b所设置的链数据结构以及组织方式等,与第二区块链20e对应的链数据结构以及组织方式不匹配;同理,服务第二区块链20e的第二业务节点202b,无法同时服务第一区块链20c,此时,第一业务节点201b与第二业务节点202b不为同一个业务节点。
进一步,通过第一区块链20c以及第二区块链20e之间的关联关系,第二业务节点202b可以在第二区块链20e中,为第一资源转入地址20g(如图5中的地址202a)锁定第一虚拟资源20d(如图5中的50资源),该锁定过程如下。若关联关系为同构关联关系,则第一业 务节点201b与第二业务节点202b可以为同一个业务节点,即第一业务节点201b除了维持第一区块链20c,还可以维持不同于第一区块链20c的第二区块链20e。故第一业务节点201b可以将资源跨链转移请求发送至第二区块链20e,若在第二区块链20e中未获取到资源锁定允许响应,即第二账户注册在第二区块链20e的第二资源转出地址未回应资源跨链转移请求,则在第二区块链20e对应的虚拟资源池40e中,为第一资源转入地址20g(即地址202a)锁定第一虚拟资源20d。其中,虚拟资源池40e可以是第二区块链20e为链上地址(包括地址202a以及下文提及的地址203a)所设置的虚拟资源集合,虚拟资源池40e还可以是跨链服务设备所登录的且归属于第二区块链20e的地址。该跨链服务设备向第一区块链20c提供资源跨链转移合约,该资源跨链转移合约在第一区块链20c认证通过后,同步至第一业务节点201b。可以理解的是,第一区块链20c存储的资源跨链转移合约,与第一业务节点201b存储的资源跨链转移合约是相同的,区别仅在于链上存储的资源跨链转移合约是作为存证数据,不在链上运行,即不在第一区块链20c对应的第一共识节点中运行,而资源跨链转移合约在第一业务节点201b中运行。
请再参见图5,若在第二区块链20e中获取到第二资源转出地址40c返回的资源锁定允许响应40d,则第一业务节点201b可以根据资源锁定允许响应40d,在第二资源转出地址40c中,为第一资源转入地址20g获取虚拟资源值对应的第一虚拟资源20d,第二资源转出地址40c归属于第二区块链20e,例如其被存储于第二区块链20e的区块202e中(如:第二账户注册在第二区块链20e的区块202e中)。图5将资源锁定允许响应40d示例为“地址203a向地址202a转入50资源,请地址201a向链1的地址204a转入50资源”,其中,图5将第二资源转出地址40c示例为地址203a,其当前持有W资源,将归属于第一区块链20c的第二资源转入地址示例为地址204a,且响应虚拟资源(即转入至第二资源转入地址的虚拟资源)也为50资源。
可以理解的是,在为第一资源转入地址20g获取(锁定)第一虚拟资源20d前,第一业务节点201b需要检验第二资源转出地址40c当前持有的虚拟资源,上述过程可以如下描述。根据资源锁定允许响应40d,第一业务节点201b查询第二资源转出地址40c(如图5所示例的地址203a)所持有的第三虚拟资源,图5示例为W资源。第一业务节点201b将第三虚拟资源以及第一虚拟资源20d进行对比,得到第二对比结果40f,若第二对比结果40f为第三虚拟资源等于或大于第一虚拟资源20d,则第一业务节点201b可以在第三虚拟资源中,为第一资源转入地址20g获取第一虚拟资源20d,即图5所表示的在地址203a中为地址202a锁定50资源。若第二对比结果40f为第三虚拟资源小于第一虚拟资源20d,则第一业务节点201b在虚拟资源池40e中,为第一资源转入地址20g获取第一虚拟资源20d,如图5所表示的在虚拟资源池40e中为地址202a锁定50资源。可选的,若第三虚拟资源小于第一虚拟资源20d,第一业务节点201b为第一资源转入地址获取第三虚拟资源,进一步,确定第一虚拟资源20d以及第三虚拟资源之间的第一虚拟资源差值,在虚拟资源池40e中,为第一资源转入地址20g获取第一虚拟资源差值。
本步骤暂不对关联关系为异构关联关系的场景展开描述,请参见下文图7所对应的实施例中的描述。
步骤S102,若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理。
示意性的,在第二业务节点成功锁定第一虚拟资源后,第二业务节点向第一业务节点反馈锁定成功消息,以便第一业务节点知悉该锁定成功过程。
可选地,第一业务节点基于锁定成功过程,对第一资源转出地址中的第二虚拟资源进行资源转出处理。其中,第二虚拟资源与虚拟资源值对应,如:第二虚拟资源的资源量与虚拟资源值所表征的资源量相同。由于第一虚拟资源与第二虚拟资源均通过虚拟资源值进行衡量,因此第二虚拟资源的资源量与第一虚拟资源的资源量相同。
示意性的,资源转出处理用于表征第二虚拟资源从第一资源转出地址中转出。可选地,基于资源转出处理将第二虚拟资源转出至第二账户注册在第一区块链中的第二资源转入地址;或者,基于资源转出处理将第二虚拟资源转出至公共资源池等。
在一个可选的实施例中,若第二业务节点从第二资源转出地址中锁定第一虚拟资源,从第一区块链中确定与第二资源转出地址对应的第二资源转入地址。
其中,第二资源转出地址为第二账户注册在第二区块链上的地址,第二资源转入地址为第二账户注册在第一区块链上的地址,第二资源转入地址用于表征在第一区块链中将第二虚拟资源进行转出处理后的转入地址。
示意性的,第二资源转出地址是第二账户部署在第二区块链中的地址,第二账户是持有第一虚拟资源的账户。示意性的,第二账户是与第一账户不同的账户,第二账户在第一区块链和第二区块链上分别进行了注册过程,使得第二账户在第二区块链上对应第二资源转出地址,此外,第二账户在第一区块链上对应第二资源转入地址,从而借助第一账户与第二账户在区块链上的资源交换过程,实现第一账户将第一区块链上的资产转移至第二区块链上的过程。
可选地,第二账户为个人账户,或者,第二账户为交易所账户。
示意性的,当第二账户为个人账户,确定该第二账户注册在第二区块链上的第二资源转出地址,该第二资源转出地址实现为用于存储资源的地址形式;或者,当第二账户为交易所账户,该第二账户注册在第二区块链上的第二资源转出地址实现为交易所资源池,该交易所资源池用于表征交易所账户注册在区块链上用于实现资源交易的资源集合。其中,第二资源转入地址用于表征在第一区块链中将第二虚拟资源进行转出处理后的转入地址。也即:在第一区块链中的第二资源转入地址用于接收从第一资源转出地址转出的第二虚拟资源。
在一些实施例中,基于第二资源转入地址,将从第一资源转出地址转出的第二虚拟资源转入至第二资源转入地址。
上述内容基于锁定第一虚拟资源的位置确定用于转入第二虚拟资源的位置。用于锁定第一虚拟资源的位置若为第二账户注册在第一区块链上的第二资源转入地址,即可以借助第二账户辅助第一账户进行资源跨链转移过程,充分激活账户在区块链上进行交易的活跃性。
用于锁定第一虚拟资源的位置若为第二账户注册在第一区块链上的第二资源转入地址,即可以借助第二账户辅助第一账户进行资源跨链转移过程。
在一个可选的实施例中,若第二业务节点从第二区块链对应的虚拟资源池中锁定第一虚拟资源,确定第一区块链对应的虚拟资源池;将从第一资源转出地址转出的第二虚拟资源转入至第一区块链对应的虚拟资源池。
示意性的,第二区块链对应的虚拟资源池,用于表征第二区块链中非账户注册且具有一定资源量的资源集合。可选地,虚拟资源池是第二区块链基于区块链计算过程自动形成的资源池;或者,虚拟资源池是多个账户预先约定并以合约状态注册在第二区块链上的资源池等。
可选地,若用于转出第一虚拟资源的第二资源转出地址是第二区块链对应的虚拟资源池,从第一区块链中确定第一区块链对应的虚拟资源池,从而将第一区块链对应的虚拟资源池作为用于在第一区块链中转入第二虚拟资源的第二资源转入地址。
其中,若用于锁定第一虚拟资源的位置若为第一区块链对应的虚拟资源池,即可以借助虚拟资源池辅助第一账户进行资源跨链转移过程,充分避免没有账户与第一账户进行交互时无法实现跨链资源转移的目的,提高资源转移成功概率。
其中,若第二虚拟资源转出成功,第一虚拟资源在第二区块链中被转入至第一资源转入地址。示意性的,第一业务节点控制在第一区块链中将第二虚拟资源从第一资源转出地址中成功转出后,指示第二业务节点在第二区块链中将第一虚拟资源转入至第一资源转入地址。也即:第二业务节点将锁定的第一账户待获取的第一虚拟资源转入至第一资源转入地址。
可选地,第一虚拟资源是从第二账户注册在第二区块链上的第二资源转出地址中转出的 资源,第二业务节点将从第二资源转出地址中转出的第一虚拟资源转入至第一账户注册在第二区块链上的第一资源转入地址。
在一个可选的实施例中,若第二虚拟资源转出成功,生成资源转移凭证;根据资源转移凭证,在第二区块链中将第一虚拟资源转入至第一资源转入地址。
其中,资源转移凭证用于表征在第一区块链中已经对第二虚拟资源成功进行了转出。
可选地,若在第一区块链中已经将第二虚拟资源成功从第一资源转出地址中转出,生成资源转移凭证。
可选地,若在第一区块链中将第二虚拟资源成功转入第二资源转入地址,生成资源转移凭证;或者,若在第一区块链中将第二虚拟资源成功转入第一区块链对应的虚拟资源池,生成资源转移凭证。
在一个可选的实施例中,若第二虚拟资源转出成功,生成资源转移凭证;将资源转移凭证发送至第二区块链,资源转移凭证用于指示第二区块链将第一虚拟资源转入至第一资源转入地址。
示意性的,借助资源转移凭证发送至第二区块链的过程,能够使得第二区块链获取到经第一区块链共识后的资源转移凭证,从而有利于使得第二区块链基于资源转移凭证进行更准确的资源转移过程,以对锁定的第一虚拟资源进行后续操作,更针对性的实现对锁定的第一虚拟资源进行资源转移的过程。
在一个可选的实施例中,若在第一区块链中将第二虚拟资源成功转入第二资源转入地址,生成资源转移凭证;或者,若在第一区块链中将第二虚拟资源成功转入第一区块链对应的虚拟资源池,生成资源转移凭证。
充分考虑第二虚拟资源所成功转入的位置的两种情况,基于两种情况均能生成用于指示在第二区块链中将第一虚拟资源转入第一资源转入地址的资源转移凭证,提高将第一虚拟资源转入第一资源转入地址的概率,有利于使得第一账户更快速且安全地实现跨链转移需求。
在一个可选的实施例中,若第二虚拟资源转出成功,生成包括虚拟资源值以及第一资源转出地址的资源转移交易;获取针对资源转移交易生成的资源转移凭证。
其中,资源转移交易用于验证第二虚拟资源是否已经成功转入第二资源转入地址或者第一区块链对应的虚拟资源池。借助资源转移交易的生成,有利于第一区块链对第二虚拟资源的转移情况进行更针对性的确认,通过资源转移交易中的虚拟资源值和第一资源转出地址,能够更直观地对第二虚拟资源的数量和转出地址进行比较和判断,从而有利于第一区块链基于资源转移交易进行共识性分析过程。
在一些实施例中,将资源转移交易发送至第一区块链对应的第一共识节点,其中,第一共识节点对资源转移交易进行上链处理,得到上链结果;上链结果包括上链成功结果;上链成功结果用于指示一共识节点生成针对所资源转移交易的资源转移凭证;获取第一共识节点返回的资源转移凭证。
其中,介绍了通过第一区块链上的第一共识节点对资源转移交易进行共识性分析的过程。第一共识节点能够对资源转移交易进行上链处理,从而根据上链结果的含义确定第一区块链上的各个节点是否对资源转移交易所指示的第二虚拟资源的转出成功进行有效确认,若上链结果为上链成功结果,即第一区块链对资源转移交易进行有效确定,即代表第一区块链对该过程达成共识,则第一共识节点能够基于资源转移交易生成资源转移凭证,以表征该共识情况,实现更安全且有效的共识过程分析描述目的。
请一并参见图6,图6是本申请实施例提供的一种基于区块链的数据处理的场景示意图四。在图6中,第一业务节点201b生成资源转移交易60b,其中,资源转移交易60b可以包括持有200资源的地址201a(即第一资源转出地址20f)以及虚拟资源值。
其中,资源转移交易60b是基于第一资源转出地址20f转出50资源至地址60a后生成的交易,其中,地址60a实现为第二账户注册在第一区块链上的第二资源转入地址;或者,地 址60a实现为第一区块链对应的虚拟资源池。
进一步,第一业务节点201b将资源转移交易60b传输至第一区块链对应的第一共识网络,以使第一共识网络中的第一共识节点对资源转移交易60b进行共识处理,若第一共识节点通过资源转移交易60b的共识,则将资源转移交易60b写入第一区块链,若资源转移交易60b成功写入第一区块链,则资源转移交易60b的上链结果为上链成功结果。此时,第一共识节点生成针对该资源转移交易60b的资源转移凭证60c,该资源转移凭证60c用于指示在第二区块链中将锁定的第一虚拟资源转入至第一资源转入地址。请再参见图6,第一共识节点返回资源转移凭证60c至第一业务节点201b。本申请示例不对资源转移凭证60c的内容进行限定,包括但不限于针对资源转移交易60b的默克尔证明以及读写集合。
在一个可选的实施例中,将资源转移凭证发送至第二区块链,其中,第二区块链对资源转移凭证进行验证处理,得到第一验证结果。
在第一验证结果为第一验证通过结果的条件下,若第一虚拟资源是在第二资源转出地址中锁定的资源,将第二虚拟资源转入至与第二资源转出地址相关联的第二资源转入地址。
其中,第二资源转出地址是第二账户部署在第二区块链中的地址,第二账户是持有第一虚拟资源的账户;第二资源转入地址是第二账户部署在第一区块链上的地址。
在一个可选的实施例中,在第一验证结果为第一验证通过结果的条件下,在第一验证结果为第一验证通过结果的条件下,若第一虚拟资源是在第二资源转出地址中锁定的资源,将从第二资源转出地址中转出的第一虚拟资源转入至第一资源转入地址;第二资源转出地址是第二账户部署在第二区块链中的地址,第二账户是持有第一虚拟资源的账户;第二资源转入地址是第二账户部署在第一区块链上的地址;其中,若第一虚拟资源是在第二区块链对应的虚拟资源池中锁定的资源,第二区块链对应的虚拟资源池中锁定的第一虚拟资源被转入至第一资源转入地址。
其中,借助第一验证结果的通过情况,综合锁定第一虚拟资源的位置,以确定转出第一虚拟资源的位置,将从该位置转出的第一虚拟资源转出至第一资源转入地址,从而更直观地知悉第一虚拟资源的转出和转入情况,便于对第一虚拟资源进行更针对性的控制。在一些实施例中,若第一虚拟资源中的第四虚拟资源是在第二资源转出地址中锁定的资源,且第一虚拟资源中的第二虚拟资源差值是在第二区块链对应的虚拟资源池中锁定的资源,则将第四虚拟资源转入至第二资源转入地址;第二虚拟资源差值用于表征第一虚拟资源与第四虚拟资源的差值;将第二虚拟资源差值转入至第一区块链对应的虚拟资源池。
在一些实施例中,若关联关系为同构关联关系,则将资源转移凭证传输至第二区块链,其中,第二区块链对应的第二共识节点通过验证合约对资源转移凭证进行验证处理,得到第二验证结果。其中,同构关联关系用于指示所述第一业务节点与所述第二业务节点为同一个业务节点;其中,若第二共识节点返回的第二验证结果为第二验证通过结果,第一虚拟资源被转入至第一资源转入地址。
其中,介绍了通过将资源转移凭证转移至第二区块链,以通过第二区块链中的第二共识节点对资源转移凭证进行验证处理,且在第二验证结果为第二验证通过结果,能够将第一虚拟资源转入第一资源转入地址,实现对第一虚拟资源进行安全转移的过程,提高第一虚拟资源的转移可靠性。
若第一虚拟资源属于第二资源转出地址,则通过运行资源跨链转移合约,第一业务节点将第二虚拟资源转入至于第二资源转入地址。若第一虚拟资源属于第二区块链对应的虚拟资源池(为了便于区分,简称为第二虚拟资源池),如图5中所示例的虚拟资源池40e,则通过运行资源跨链转移合约,第一业务节点将第二虚拟资源转入至第一区块链对应的虚拟资源池(为了便于区分,简称为第一虚拟资源池)。可以理解的是,若第二虚拟资源池是第二区块链为链上地址所设置的虚拟资源集合,则第一虚拟资源池也可以是第一区块链为链上地址所设置的虚拟资源集合。若第二虚拟资源池是跨链服务设备所登录的且归属于第二区块链的地址, 则第一虚拟资源池也可以是跨链服务设备所登录的且归属于第一区块链的地址。
若第一区块链与第二区块链之间的关联关系为同构关联关系,则如图6所示,第一业务节点201b可以将资源转移凭证60c传输至第二区块链对应的第二共识网络,以使第二共识网络中的第二共识节点调用与资源跨链转移合约相对应的验证合约60d。通过运行验证合约60d,第二共识节点可以对资源转移凭证60c进行验证处理,得到第二验证结果,并将该第二验证结果返回至第一业务节点。若第二验证结果为第二验证通过结果,则第一业务节点201b将第一虚拟资源转入至第一资源转入地址,其中,图6以地址203a示例第二资源转出地址40c,以地址202a示例第一资源转入地址20g。
在本申请实施例中,在获取到由第一资源转出地址发起的资源跨链转移请求时,属于第一区块链对应的业务节点的第一业务节点通过资源跨链转移请求,可以指示属于第二区块链对应的业务节点的第二业务节点,在第二区块链中为第一资源转入地址锁定虚拟资源值对应的第一虚拟资源;其中,第二区块链不同于第一区块链;该过程可以避免后续第一资源转出地址未转出第二虚拟资源时,将第一虚拟资源转出第一资源转入地址,故可以避免无效资源转移所带来的计算消耗;进一步,若第二业务节点成功锁定第一虚拟资源,可以在第一区块链中,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;在成功转出后,则第一业务节点生成包括第一资源转出地址以及虚拟资源值的资源转移交易,然后获取针对资源转移交易所生成的资源转移凭证;该过程通过资源转移交易以及第二区块链所锁定的第一虚拟资源,可以将资源跨链转移转化为链内的资源转移,故可以提高资源转移效率;进一步,根据资源转移凭证第二业务节点,将第一虚拟资源转入至第一资源转入地址;该过程通过资源转移凭证,可以在第一区块链以及第二区块链中分别进行资源转移,避免将第二虚拟资源通过第三方进行资源中转,故第二虚拟资源不会转移出第一区块链外,进而可以提高第二虚拟资源的安全性。上述可知,通过第一虚拟资源、第二虚拟资源以及资源转移凭证,本申请实施例可以在第一区块链以及第二区块链的两链内安全且高效地进行资源跨链转移。
请参见图7,图7是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图二。该基于区块链的数据处理方法可以由第一业务节点执行,也可以由第二业务节点执行,还可以由第一业务节点以及第二业务节点交互执行,此处不做限制。为了便于叙述以及理解,本申请实施例以在第一业务节点中进行为例进行叙述,其中,第一业务节点可以为上述图1所对应实施例的第一业务网络中的任意一个第一业务节点。如图7所示,该基于区块链的数据处理方法至少可以包括以下步骤S201-步骤S207。
步骤S201,获取由第一账户发起的资源跨链转移请求;资源跨链转移请求包括虚拟资源值、第一账户部署在第一区块链的第一资源转出地址,以及第一账户部署在第二区块链的第一资源转入地址;第二区块链不同于第一区块链。
其中,步骤S201的实现过程,请参见上文图3所对应的实施例中的步骤S101,此处不进行赘述。
步骤S202,根据资源跨链转移请求调用资源跨链转移合约;资源跨链转移合约为从第一区块链中同步的智能合约。
示意性的,获取资源跨链转移合约,资源跨链转移合约是跨链服务设备成功部署在第一区块链上的合约,第一区块链中的第一共识节点用于对资源跨链转移合约进行上链处理,上链处理用于将资源跨链转移合约配置在第一区块链上。
其中,跨链服务设备是支持进行跨链资源转移的设备,示意性的,第一账户通过跨链服务设备实现资源转移过程。跨链服务设备为了实现第一区块链和第二区块链之间的跨链转移过程,通过部署资源跨链转移合约的方式,能够更安全且高效地使得第一区块链达成共识,以通过第一业务节点的调用过程进行资源跨链转移过程。
请一并参见图8,图8是本申请实施例提供的一种基于区块链的资源跨链转移合约同步 方法的交互示意图。如图8所示,步骤S2021,跨链服务设备发布资源跨链转移合约至第一区块链。其中,资源跨链转移合约为一个合约代码,且由跨链服务设备上传至第一区块链,其具备交易上链前的交易检查功能、交易同步后回调功能以及对业务交易进行业务信息补充的功能。本申请实施例中的资源跨链转移合约作为一个存证数据存储于第一区块链,部署且运行于业务节点。步骤S2022、第一业务节点同步资源跨链转移合约。第一区块链对应的第一业务节点可以根据自己的业务类型,选择同步保存,并通过区块链hash特性验证合约代码的正确无损。步骤S2023、跨链服务设备部署验证合约至第二区块链。该验证合约用于验证第一区块链中的数据,例如资源转移凭证的合法性。
步骤S203,基于资源跨链转移合约,确定第一区块链以及第二区块链之间的关联关系;关联关系用于确定第二业务节点;资源跨链转移请求用于指示第二业务节点在第二区块链中为第一资源转入地址锁定第一账户待获取的第一虚拟资源;第一业务节点是第一区块链对应的业务节点;第二业务节点是第二区块链对应的业务节点。
请一并参见图9,图9是本申请实施例提供的一种第一区块链以及第二区块链之间的关联关系的示意图。如图9所示,第一区块链以及第二区块链的形态,可以分为同构链和异构链两种。其中,同构链代表链数据结构与网络接口(组织方式)相同;异构链则相反,数据结构与组织方式不同。若第一区块链以及第二区块链为同构链,则可以运行第一业务节点序来同步两条链的数据并互相访问,因为第一业务节点既有第一区块链数据,又有第二区块链数据。异构链需要分别运行不同链的spv,即第一区块链需要运行第一业务节点,第二区块链需要运行第二业务节点,spv之间的访问类似于程序应用拉起,或者后台接口访问的形式来使用彼此数据。
其中,在异构关联关系下,需要借助第一业务节点和第二业务节点综合实现跨链转移过程,该过程通过第一业务节点和第二业务节点之间的通信关系,通过将用于锁定第一虚拟资源的资源跨链转移请求发送至第二业务节点的方式,从而实现更直观且快速地锁定第一虚拟资源的目的。
步骤S204,若关联关系为异构关联关系,则通过资源跨链转移合约调用第二业务节点;异构关联关系用于指示第一业务节点与第二业务节点不为同一个业务节点。
步骤S205,将资源跨链转移请求发送至第二业务节点,其中,第二业务节点根据资源跨链转移请求为第一资源转入地址锁定第一账户待获取的第一虚拟资源。
关联关系为同构关联关系的场景请参见上述图3所对应的实施例,结合步骤S204-步骤S205描述,本申请实施例用于描述关联关系为异构关联关系的场景。请一并参见图10,图10是本申请实施例提供的一种基于区块链的数据处理方法的交互流程图一。如图10所示,步骤S2051,第一业务节点获取资源跨链转移请求。持有第一资源转出地址的业务对象,通过第一资源转出地址,向第一业务节点发送一笔跨链转移的交易。步骤S2052,第一业务节点拉起第二业务节点。若关联关系为异构关联关系,则第一业务节点服务于第一区块链,而不服务于第二区块链,同理,第二业务节点服务于第二区块链,而不服务于第一区块链,此时,通过本申请实施例中的资源跨链转移合约,第一业务节点可以调用(拉起)第二业务节点。步骤S2053,第二业务节点在第二区块链中锁定第一虚拟资源。其中,锁定第一虚拟资源,类似于先下单,但是未支付,可以是在第二区块链对应的虚拟资源池里锁定,也可以锁定有意愿出售虚拟资源的其它地址,例如第二资源转出地址。可以理解的是,若关联关系为异构关联关系,则通过不服务于第一区块链的第二业务节点,在第二区块链中为第一资源转入地址锁定第一虚拟资源,但第二业务节点锁定第一虚拟资源的过程,与第一业务节点锁定第一虚拟资源的过程相同。
步骤S206,若第二业务节点成功锁定第一虚拟资源,则生成包括第一资源转出地址以及虚拟资源值的资源转移交易,获取针对资源转移交易所生成的资源转移凭证。
其中,步骤S206的实现过程,请参见上文图3所对应的实施例中的步骤S102,此处不 进行赘述。
步骤S207,根据资源转移凭证,在第二区块链中将第一虚拟资源转入至第一资源转入地址。
关联关系为同构关联关系的场景请参见上述图3所对应的实施例,本申请实施例用于描述关联关系为异构关联关系的场景。请一并参见图11,图11是本申请实施例提供的一种基于区块链的数据处理方法的交互流程图二。步骤S2071,第一业务节点在第一区块链中转移第二虚拟资源;步骤S2072,第一业务节点拉起第二业务节点,传递资源转移凭证;步骤S2073,第二业务节点传递资源转移凭证至第二区块链;步骤S2074,第二区块链验证资源转移凭证,转移第一虚拟资源。值得注意的是,第一业务节点以及第二业务节点之间数据传输时,可以通过自己的密钥,对需要传输的数据进行签名,或可以通过对方的密钥,对需要传输的数据进行加密。此外,在链上转移资源需要地址对应的私钥签名,本申请实施例提出的方法可以使地址无需托管私钥。
在本申请实施例中,在获取到由第一账户发起的资源跨链转移请求时,第一区块链对应的第一业务节点通过资源跨链转移请求,指示属于第二区块链对应的第二业务节点在第二区块链中为第一账户部署在第二区块链的第一资源转入地址锁定第一账户待获取的第一虚拟资源;其中,第二区块链不同于第一区块链;通过该过程可以避免后续第一资源转出地址未转出第二虚拟资源时即将第一虚拟资源转入第一资源转入地址的问题,故可以避免无效资源转移所带来的计算消耗;若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;该过程通过第二区块链所锁定的第一虚拟资源,将资源跨链转移转化为链内的资源转移,从而提高资源转移效率;若第二虚拟资源转出成功,资源转移凭证用于指示第二业务节点,在第二区块链中将第一虚拟资源转入至第一资源转入地址;通过在第一区块链以及第二区块链中分别进行资源转移的过程,避免将第一虚拟资源和第二虚拟资源通过第三方进行资源中转,由于第二虚拟资源不会转移出第一区块链外,第一虚拟资源也不转移出第二区块链外,因此可以提高第一虚拟资源和第二虚拟资源的安全性。也即:通过第一虚拟资源、第二虚拟资源以及资源转移凭证,可以在第一区块链以及第二区块链的两链内安全且高效地进行资源跨链转移。
进一步地,请参见图12,图12是本申请实施例提供的一种基于区块链的数据处理装置的结构示意图一。该基于区块链的数据处理装置可以运行于第一业务节点,上述基于区块链的数据处理装置1可以用于执行本申请实施例提供的方法中的相应步骤。如图12所示,该基于区块链的数据处理装置1可以包括:第一获取模块11以及第二获取模块12。
第一获取模块11,用于获取由第一账户发起的资源跨链转移请求;所述资源跨链转移请求包括虚拟资源值、所述第一账户部署在第一区块链上的第一资源转出地址,以及所述第一账户部署在第二区块链的第一资源转入地址;所述第二区块链不同于所述第一区块链;所述资源跨链转移请求用于指示第二业务节点在所述第二区块链中为所述第一资源转入地址锁定所述第一账户待获取的第一虚拟资源,所述第一虚拟资源与所述虚拟资源值对应;所述第一业务节点是所述第一区块链对应的业务节点;所述第二业务节点是所述第二区块链对应的业务节点;
第二获取模块12,用于若所述第二业务节点成功锁定所述第一虚拟资源,对所述第一资源转出地址中与所述虚拟资源值相关联的第二虚拟资源进行资源转出处理;其中,若所述第二虚拟资源转出成功,所述第一虚拟资源在所述第二区块链中被转入至所述第一资源转入地址。
在一个可选的实施例中,第二获取模块12还用于若所述第二业务节点从第二资源转出地址中锁定所述第一虚拟资源,从所述第一区块链中确定与所述第二资源转出地址对应的第二资源转入地址,所述第二资源转出地址为第二账户注册在所述第二区块链上的地址,所述第二资源转入地址为所述第二账户注册在所述第一区块链上的地址,所述第二资源转入地址用 于表征在所述第一区块链中将所述第二虚拟资源进行转出处理后的转入地址;将从所述第一资源转出地址转出的所述第二虚拟资源转入至所述第二资源转入地址。
在一个可选的实施例中,第二获取模块12还用于若所述第二业务节点从第二区块链对应的虚拟资源池中锁定所述第一虚拟资源,确定所述第一区块链对应的虚拟资源池;将从所述第一资源转出地址转出的所述第二虚拟资源转入至所述第一区块链对应的虚拟资源池。
在一个可选的实施例中,第二获取模块12还用于若所述第二虚拟资源转出成功,生成资源转移凭证;将所述资源转移凭证发送至所述第二区块链,所述资源转移凭证用于指示所述第二区块链将所述第一虚拟资源转入至所述第一资源转入地址。
在一个可选的实施例中,第二获取模块12还用于若在第一区块链中将所述第二虚拟资源成功转入第二资源转入地址,生成所述资源转移凭证;或者,若在第一区块链中将所述第二虚拟资源成功转入第一区块链对应的虚拟资源池,生成所述资源转移凭证。
在一个可选的实施例中,第二获取模块12还用于根据所述资源跨链转移请求调用资源跨链转移合约;所述资源跨链转移合约为从所述第一区块链中同步的智能合约;基于所述资源跨链转移合约,确定所述第一区块链以及所述第二区块链之间的关联关系;所述关联关系用于确定所述第二业务节点。
在一个可选的实施例中,第二获取模块12还用于基于所述资源跨链转移合约,分别获取所述第一区块链的第一链结构,以及所述第二区块链的第二链结构,其中链结构包括区块链的链数据结构以及组织方式;比较所述第一链结构以及所述第二链结构,若所述第一链结构与所述第二链结构相同,确定所述第一区块链以及所述第二区块链之间的关联关系为同构关联关系;若所述第一链结构与所述第二链结构不同,确定所述第一区块链以及所述第二区块链之间的关联关系为异构关联关系。
在一个可选的实施例中,关联关系包括同构关联关系,所述同构关联关系用于指示所述第一业务节点与所述第二业务节点为同一个业务节点;
所述第二获取模块12还用于若在所述第二区块链中获取到第二资源转出地址返回的资源锁定允许响应,根据所述资源锁定允许响应,在所述第二资源转出地址中为所述第一资源转入地址锁定所述第一账户待获取的所述第一虚拟资源;若在所述第二区块链中未获取到资源锁定允许响应,从所述第二区块链对应的虚拟资源池中,为所述第一资源转入地址获取所述第一虚拟资源。
在一个可选的实施例中,所述第二获取模块12还用于根据所述资源锁定允许响应,查询所述第二资源转出地址所持有的第三虚拟资源;若所述第三虚拟资源不小于所述虚拟资源值对应的第一虚拟资源,从所述第三虚拟资源中为所述第一资源转入地址锁定所述第一虚拟资源;若所述第三虚拟资源小于所述第一虚拟资源,从所述第二区块链对应的虚拟资源池中为所述第一资源转入地址锁定所述第一虚拟资源。
在一个可选的实施例中,所述第二获取模块12还用于若所述第三虚拟资源小于所述第一虚拟资源,为所述第一资源转入地址从所述第二资源转出地址获取所述第三虚拟资源;确定所述第一虚拟资源以及所述第三虚拟资源之间的第一虚拟资源差值,从所述第二区块链对应的虚拟资源池中为所述第一资源转入地址锁定所述第一虚拟资源差值。
在一个可选的实施例中,所述第二获取模块12还用于若所述关联关系为异构关联关系,通过所述资源跨链转移合约调用所述第二业务节点;所述异构关联关系用于指示所述第一业务节点与所述第二业务节点不为同一个业务节点;将所述资源跨链转移请求发送至所述第二业务节点,其中,所述第二业务节点根据所述资源跨链转移请求为所述第一资源转入地址锁定所述第一账户待获取的所述第一虚拟资源。
在一个可选的实施例中,所述第二获取模块12还用于获取资源跨链转移合约,所述资源跨链转移合约是跨链服务设备成功部署在所述第一区块链上的合约,所述第一区块链中的第一共识节点用于对所述资源跨链转移合约进行上链处理,所述上链处理用于将所述资源跨链 转移合约配置在所述第一区块链上。
在一个可选的实施例中,所述第二获取模块12还用于若所述第二虚拟资源转出成功,生成包括所述虚拟资源值以及所述第一资源转出地址的资源转移交易;获取针对所述资源转移交易生成的所述资源转移凭证。
在一个可选的实施例中,所述第二获取模块12还用于将所述资源转移交易发送至所述第一区块链对应的第一共识节点,其中,所述第一共识节点对所述资源转移交易进行上链处理,得到上链结果;所述上链结果包括上链成功结果;所述上链成功结果用于指示所述第一共识节点生成针对所述资源转移交易的所述资源转移凭证;获取所述第一共识节点返回的所述资源转移凭证。
在一个可选的实施例中,所述第二获取模块12还用于对所述资源转移凭证进行验证处理,得到第一验证结果;在所述第一验证结果为第一验证通过结果的条件下,若所述第一虚拟资源是在第二资源转出地址中锁定的资源,将从所述第二资源转出地址中转出的所述第一虚拟资源转入至所述第一资源转入地址;所述第二资源转出地址是第二账户部署在所述第二区块链中的地址,所述第二账户是持有所述第一虚拟资源的账户;所述第二资源转入地址是所述第二账户部署在所述第一区块链上的地址;其中,若所述第一虚拟资源是在所述第二区块链对应的虚拟资源池中锁定的资源,所述第二区块链对应的虚拟资源池中锁定的第一虚拟资源被转入至所述第一资源转入地址。
在一个可选的实施例中,所述第二获取模块12还用于若所述关联关系为同构关联关系,则将所述资源转移凭证传输至所述第二区块链,其中,所述第二区块链对应的第二共识节点通过验证合约对所述资源转移凭证进行验证处理,得到第二验证结果;所述同构关联关系用于指示所述第一业务节点与所述第二业务节点为同一个业务节点;其中,若所述第二共识节点返回的所述第二验证结果为第二验证通过结果,所述第一虚拟资源被转入至所述第一资源转入地址。
在本申请实施例中,在获取到由第一账户发起的资源跨链转移请求时,第一区块链对应的第一业务节点通过资源跨链转移请求,指示属于第二区块链对应的第二业务节点在第二区块链中为第一账户部署在第二区块链的第一资源转入地址锁定第一账户待获取的第一虚拟资源;其中,第二区块链不同于第一区块链;通过该过程可以避免后续第一资源转出地址未转出第二虚拟资源时即将第一虚拟资源转入第一资源转入地址的问题,故可以避免无效资源转移所带来的计算消耗;进一步地,若第二业务节点成功锁定第一虚拟资源,对第一资源转出地址中与虚拟资源值相关联的第二虚拟资源进行资源转出处理;该过程通过第二区块链所锁定的第一虚拟资源,将资源跨链转移转化为链内的资源转移,从而提高资源转移效率;进一步地,若第二虚拟资源转出成功,在第二区块链中将第一虚拟资源转入至第一资源转入地址;通过在第一区块链以及第二区块链中分别进行资源转移的过程,避免将第一虚拟资源和第二虚拟资源通过第三方进行资源中转,由于第二虚拟资源不会转移出第一区块链外,第一虚拟资源也不转移出第二区块链外,因此可以提高第一虚拟资源和第二虚拟资源的安全性。也即:通过第一虚拟资源、第二虚拟资源以及资源转移凭证,可以在第一区块链以及第二区块链的两链内安全且高效地进行资源跨链转移。
在一个可选的实施例中,请参见图13,图13是本申请实施例提供的一种计算机设备的结构示意图。如图13所示,该计算机设备1000可以包括:至少一个处理器1001,例如CPU,至少一个网络接口1004,用户接口1003,存储器1005,至少一个通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。其中,在一些实施例中,用户接口1003可以包括显示屏(Display)、键盘(Keyboard),网络接口1004可选地可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器1005可选地还可以是至少一个位于远离前述处理器1001的存储装置。如图13所示,作为一种计算机存储介质的存储器 1005可以包括操作系统、网络通信模块、用户接口模块以及设备控制应用程序。
在图13所示的计算机设备1000中,网络接口1004可提供网络通讯功能;而用户接口1003主要用于为用户提供输入的接口;而处理器1001可以用于调用存储器1005中存储的设备控制应用程序,以实现如上所述的基于区块链的数据处理方法。
应当理解,本申请实施例中所描述的计算机设备1000可执行前文各实施例中对基于区块链的数据处理方法或装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现前文各实施例中对基于区块链的数据处理方法或装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
上述计算机可读存储介质可以是前述任一实施例提供的基于区块链的数据处理装置或者上述计算机设备的内部存储单元,例如计算机设备的硬盘或内存。
本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机程序,处理器执行该计算机程序,使得该计算机设备可执行前文各实施例中对基于区块链的数据处理方法或装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (20)

  1. 一种基于区块链的数据处理方法,所述方法由第一业务节点执行,所述方法包括:
    获取由第一账户发起的资源跨链转移请求;所述资源跨链转移请求包括虚拟资源值、所述第一账户部署在第一区块链上的第一资源转出地址,以及所述第一账户部署在第二区块链的第一资源转入地址;所述第二区块链不同于所述第一区块链;所述资源跨链转移请求用于指示第二业务节点在所述第二区块链中为所述第一资源转入地址锁定所述第一账户待获取的第一虚拟资源,所述第一虚拟资源与所述虚拟资源值对应;所述第一业务节点是所述第一区块链对应的业务节点;所述第二业务节点是所述第二区块链对应的业务节点;
    若所述第二业务节点成功锁定所述第一虚拟资源,对所述第一资源转出地址中与所述虚拟资源值相关联的第二虚拟资源进行资源转出处理;其中,若所述第二虚拟资源转出成功,所述第一虚拟资源在所述第二区块链中被转入至所述第一资源转入地址。
  2. 根据权利要求1所述的方法,其中,所述若所述第二业务节点成功锁定所述第一虚拟资源,对所述第一资源转出地址中与所述虚拟资源值相关联的第二虚拟资源进行资源转出处理,包括:
    若所述第二业务节点从第二资源转出地址中锁定所述第一虚拟资源,从所述第一区块链中确定与所述第二资源转出地址对应的第二资源转入地址,所述第二资源转出地址为第二账户注册在所述第二区块链上的地址,所述第二资源转入地址为所述第二账户注册在所述第一区块链上的地址,所述第二资源转入地址用于表征在所述第一区块链中将所述第二虚拟资源进行转出处理后的转入地址;
    将从所述第一资源转出地址转出的所述第二虚拟资源转入至所述第二资源转入地址。
  3. 根据权利要求1所述的方法,其中,所述若所述第二业务节点成功锁定所述第一虚拟资源,对所述第一资源转出地址中与所述虚拟资源值相关联的第二虚拟资源进行资源转出处理,包括:
    若所述第二业务节点从第二区块链对应的虚拟资源池中锁定所述第一虚拟资源,确定所述第一区块链对应的虚拟资源池;
    将从所述第一资源转出地址转出的所述第二虚拟资源转入至所述第一区块链对应的虚拟资源池。
  4. 根据权利要求1至3任一所述的方法,其中,所述方法还包括:
    若所述第二虚拟资源转出成功,生成资源转移凭证;
    将所述资源转移凭证发送至所述第二区块链,所述资源转移凭证用于指示所述第二区块链将所述第一虚拟资源转入至所述第一资源转入地址。
  5. 根据权利要求4所述的方法,其中,所述若所述第二虚拟资源转出成功,生成资源转移凭证,包括:
    若在第一区块链中将所述第二虚拟资源成功转入第二资源转入地址,生成所述资源转移凭证;或者,
    若在第一区块链中将所述第二虚拟资源成功转入第一区块链对应的虚拟资源池,生成所述资源转移凭证。
  6. 根据权利要求1至5任一所述的方法,其中,所述方法还包括:
    根据所述资源跨链转移请求调用资源跨链转移合约;所述资源跨链转移合约为从所述第一区块链中同步的智能合约;
    基于所述资源跨链转移合约,确定所述第一区块链以及所述第二区块链之间的关联关系;所述关联关系用于确定所述第二业务节点。
  7. 根据权利要求6所述的方法,其中,所述基于所述资源跨链转移合约,确定所述第一区块链以及所述第二区块链之间的关联关系,包括:
    基于所述资源跨链转移合约,分别获取所述第一区块链的第一链结构,以及所述第二区块链的第二链结构,其中链结构包括区块链的链数据结构以及组织方式;
    比较所述第一链结构以及所述第二链结构,若所述第一链结构与所述第二链结构相同,确定所述第一区块链以及所述第二区块链之间的关联关系为同构关联关系;
    若所述第一链结构与所述第二链结构不同,确定所述第一区块链以及所述第二区块链之间的关联关系为异构关联关系。
  8. 根据权利要求6所述的方法,其中,所述关联关系包括同构关联关系,所述同构关联关系用于指示所述第一业务节点与所述第二业务节点为同一个业务节点;
    所述方法还包括:
    若在所述第二区块链中获取到第二资源转出地址返回的资源锁定允许响应,根据所述资源锁定允许响应,在所述第二资源转出地址中为所述第一资源转入地址锁定所述第一账户待获取的所述第一虚拟资源;
    若在所述第二区块链中未获取到资源锁定允许响应,从所述第二区块链对应的虚拟资源池中,为所述第一资源转入地址获取所述第一虚拟资源。
  9. 根据权利要求8所述的方法,其中,所述根据所述资源锁定允许响应,在所述第二资源转出地址中为所述第一资源转入地址锁定所述第一账户待获取的所述第一虚拟资源,包括:
    根据所述资源锁定允许响应,查询所述第二资源转出地址所持有的第三虚拟资源;
    若所述第三虚拟资源不小于所述虚拟资源值对应的第一虚拟资源,从所述第三虚拟资源中为所述第一资源转入地址锁定所述第一虚拟资源;
    若所述第三虚拟资源小于所述第一虚拟资源,从所述第二区块链对应的虚拟资源池中为所述第一资源转入地址锁定所述第一虚拟资源。
  10. 根据权利要求9所述的方法,其中,所述若所述第三虚拟资源小于所述第一虚拟资源,从所述第二区块链对应的虚拟资源池中为所述第一资源转入地址锁定所述第一虚拟资源,包括:
    若所述第三虚拟资源小于所述第一虚拟资源,为所述第一资源转入地址从所述第二资源转出地址获取所述第三虚拟资源;
    确定所述第一虚拟资源以及所述第三虚拟资源之间的第一虚拟资源差值,从所述第二区块链对应的虚拟资源池中为所述第一资源转入地址锁定所述第一虚拟资源差值。
  11. 根据权利要求6所述的方法,其中,所述方法还包括:
    若所述关联关系为异构关联关系,通过所述资源跨链转移合约调用所述第二业务节点;所述异构关联关系用于指示所述第一业务节点与所述第二业务节点不为同一个业务节点;
    将所述资源跨链转移请求发送至所述第二业务节点,其中,所述第二业务节点根据所述资源跨链转移请求为所述第一资源转入地址锁定所述第一账户待获取的所述第一虚拟资源。
  12. 根据权利要求6所述的方法,其中,所述方法还包括:
    获取资源跨链转移合约,所述资源跨链转移合约是跨链服务设备成功部署在所述第一区块链上的合约,所述第一区块链中的第一共识节点用于对所述资源跨链转移合约进行上链处理,所述上链处理用于将所述资源跨链转移合约配置在所述第一区块链上。
  13. 根据权利要求4至12任一所述的方法,其中,所述若所述第二虚拟资源转出成功,生成资源转移凭证,包括:
    若所述第二虚拟资源转出成功,生成包括所述虚拟资源值以及所述第一资源转出地址的资源转移交易;
    获取针对所述资源转移交易生成的所述资源转移凭证。
  14. 根据权利要求13所述的方法,其中,所述获取针对所述资源转移交易生成的所述资源转移凭证,包括:
    将所述资源转移交易发送至所述第一区块链对应的第一共识节点,其中,所述第一共识 节点对所述资源转移交易进行上链处理,得到上链结果;所述上链结果包括上链成功结果;所述上链成功结果用于指示所述第一共识节点生成针对所述资源转移交易的所述资源转移凭证;
    获取所述第一共识节点返回的所述资源转移凭证。
  15. 根据权利要求4至14任一所述的方法,其中,所述方法还包括:
    将所述资源转移凭证发送至所述第二区块链,其中,所述第二区块链对所述资源转移凭证进行验证处理,得到第一验证结果;在所述第一验证结果为第一验证通过结果的条件下,所述第一虚拟资源是在第二资源转出地址中锁定的资源,将从所述第二资源转出地址中转出的所述第一虚拟资源转入至所述第一资源转入地址;所述第二资源转出地址是第二账户部署在所述第二区块链中的地址,所述第二账户是持有所述第一虚拟资源的账户;所述第二资源转入地址是所述第二账户部署在所述第一区块链上的地址;其中,若所述第一虚拟资源是在所述第二区块链对应的虚拟资源池中锁定的资源,所述第二区块链对应的虚拟资源池中锁定的第一虚拟资源被转入至所述第一资源转入地址。
  16. 根据权利要求4至10任一所述的方法,其中,所述方法还包括:
    若所述关联关系为同构关联关系,则将所述资源转移凭证传输至所述第二区块链,其中,所述第二区块链对应的第二共识节点通过验证合约对所述资源转移凭证进行验证处理,得到第二验证结果;所述同构关联关系用于指示所述第一业务节点与所述第二业务节点为同一个业务节点;其中,若所述第二共识节点返回的所述第二验证结果为第二验证通过结果,所述第一虚拟资源被转入至所述第一资源转入地址。
  17. 一种基于区块链的数据处理装置,所述装置运行于第一业务节点,所述装置包括:
    第一获取模块,用于获取由第一账户发起的资源跨链转移请求;所述资源跨链转移请求包括虚拟资源值、所述第一账户部署在第一区块链上的第一资源转出地址,以及所述第一账户部署在第二区块链的第一资源转入地址;所述第二区块链不同于所述第一区块链;所述资源跨链转移请求用于指示第二业务节点在所述第二区块链中为所述第一资源转入地址锁定所述第一账户待获取的第一虚拟资源,所述第一虚拟资源与所述虚拟资源值对应;所述第一业务节点是所述第一区块链对应的业务节点;所述第二业务节点是所述第二区块链对应的业务节点;
    第二获取模块,用于若所述第二业务节点成功锁定所述第一虚拟资源,对所述第一资源转出地址中与所述虚拟资源值相关联的第二虚拟资源进行资源转出处理;其中,若所述第二虚拟资源转出成功,所述第一虚拟资源在所述第二区块链中被转入至所述第一资源转入地址。
  18. 一种计算机设备,所述计算机设备包括:处理器、存储器以及网络接口;
    所述处理器与所述存储器、所述网络接口相连,其中,所述网络接口用于提供数据通信功能,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序,以使得所述计算机设备执行权利要求1至16任一项所述的方法。
  19. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序适于由处理器加载并执行,以使得具有所述处理器的计算机设备执行权利要求1至16任一项所述的方法。
  20. 一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序存储在计算机可读存储介质中,所述计算机程序适于由处理器读取并执行,以使得具有所述处理器的计算机设备执行权利要求1至16任一项所述的方法。
PCT/CN2023/111728 2022-11-14 2023-08-08 一种基于区块链的数据处理方法、设备以及可读存储介质 WO2024103856A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/527,493 US20240160755A1 (en) 2022-11-14 2023-12-04 Cross-chain resource transfer using resource transfer certificate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211421853.3A CN118075354A (zh) 2022-11-14 2022-11-14 一种基于区块链的数据处理方法、设备以及可读存储介质
CN202211421853.3 2022-11-14

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/527,493 Continuation US20240160755A1 (en) 2022-11-14 2023-12-04 Cross-chain resource transfer using resource transfer certificate

Publications (1)

Publication Number Publication Date
WO2024103856A1 true WO2024103856A1 (zh) 2024-05-23

Family

ID=91083735

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/111728 WO2024103856A1 (zh) 2022-11-14 2023-08-08 一种基于区块链的数据处理方法、设备以及可读存储介质

Country Status (2)

Country Link
CN (1) CN118075354A (zh)
WO (1) WO2024103856A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111311209A (zh) * 2020-02-03 2020-06-19 腾讯科技(深圳)有限公司 跨区块链的数据处理方法、装置、设备及计算机存储介质
CN111681003A (zh) * 2020-07-07 2020-09-18 腾讯科技(深圳)有限公司 资源跨链转移方法、装置、计算机设备以及存储介质
CN112927073A (zh) * 2021-02-23 2021-06-08 网易(杭州)网络有限公司 跨链数据互换方法、系统、装置、电子设备
US20220292488A1 (en) * 2021-03-15 2022-09-15 TraDove, Inc. Systems and methods for domestic and/or cross border blockchain transaction solutions involving central bank digital currency

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111311209A (zh) * 2020-02-03 2020-06-19 腾讯科技(深圳)有限公司 跨区块链的数据处理方法、装置、设备及计算机存储介质
CN111681003A (zh) * 2020-07-07 2020-09-18 腾讯科技(深圳)有限公司 资源跨链转移方法、装置、计算机设备以及存储介质
CN112927073A (zh) * 2021-02-23 2021-06-08 网易(杭州)网络有限公司 跨链数据互换方法、系统、装置、电子设备
US20220292488A1 (en) * 2021-03-15 2022-09-15 TraDove, Inc. Systems and methods for domestic and/or cross border blockchain transaction solutions involving central bank digital currency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHINA MOBILE: "Discussion on blockchain based approach for cross-domain certificate management in 3GPP system", 3GPP TSG SA WG3 (SECURITY) MEETING #106-E S3-220128, 7 February 2022 (2022-02-07), XP052125455 *

Also Published As

Publication number Publication date
CN118075354A (zh) 2024-05-24

Similar Documents

Publication Publication Date Title
WO2022042301A1 (zh) 一种数据处理方法、装置、智能设备及存储介质
US10708060B2 (en) System and method for blockchain-based notification
US10938551B2 (en) System and method for implementing a resolver service for decentralized identifiers
US10728042B2 (en) System and method for blockchain-based cross-entity authentication
US10756885B2 (en) System and method for blockchain-based cross entity authentication
US11563557B2 (en) Document transfer processing for blockchains
US11159307B2 (en) Ad-hoc trusted groups on a blockchain
US11422981B2 (en) Information management and access control in a database
US20230262126A1 (en) Blockchain-based data processing method and apparatus, device, and readable storage medium
CN113255014A (zh) 一种基于区块链的数据处理方法以及相关设备
CN111211876B (zh) 发送针对数据请求的应答消息的方法及装置、区块链系统
US20230325833A1 (en) Blockchain-based data processing method and apparatus, device, storage medium, and program product
CN112926983A (zh) 一种基于区块链的存证交易加密系统及方法
CN112837023A (zh) 机构的业务协同平台、方法、装置及电子设备
WO2024103856A1 (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
US20240160755A1 (en) Cross-chain resource transfer using resource transfer certificate
WO2024007855A1 (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
WO2024087911A1 (zh) 基于区块链的数据处理方法、装置、设备、存储介质及程序产品
WO2024066974A1 (zh) 基于区块链的数据处理方法、设备以及可读存储介质
WO2024037117A1 (zh) 一种基于区块链的数据处理方法、设备、介质和程序产品
CN117354255A (zh) 区块链网络的事务处理方法、装置、产品、设备和介质
CN115375304A (zh) 一种基于区块链的数据处理方法、装置、设备以及介质
CN117560190A (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
CN116707813A (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
CN113300853A (zh) 金融征信信息管理方法、装置、电子设备及存储介质