Data processing method based on hierarchical chain network and related equipment
By using resource transfer service nodes in the hierarchical chain network, the problem of high resource consumption of main chain resource management contract deployment is solved, efficient extraction and circulation of sub-chain digital resources is achieved, and the circulation of digital resources is improved.
Patent Information
- Application Number
- CN202311507741.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-05-13
AI Technical Summary
In the hierarchical chain network, the deployment of main chain resource management contracts consumes a high resource, resulting in some users refusing to extract sub-chain digital resources back to the main chain, resulting in the inability of resource transfer service providers to recover digital resources, reducing the liquidity of digital resources.
Through the method executed by the resource transfer service node, the cross-chain resource transfer request is received, the target main chain resource management contract address is obtained, and the cross-chain resource transfer processing is performed between the target sub-chain resource management contract and the target main chain resource management contract, reducing the need to deploy the main chain resource management contract in the main blockchain network.
It saves the consumption resources required to extract the digital resources of the sub-chain back to the main chain, and improves the liquidity of digital resources in the hierarchical chain network.
Smart Images

Figure CN119996419A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method based on a layered chain network and related equipment. Background Art
[0002] In some hierarchical chain networks, it is usually possible to include sub-blockchain networks for processing local business and main blockchain networks for processing global business. A core main chain is maintained in the main blockchain network, which is the main chain service corresponding to the entire blockchain network. When the sub-chain corresponding to the sub-blockchain network is created, the relevant information will be recorded in the core main chain.
[0003] In the existing hierarchical chain network, after the digital resources in the main chain are transferred to the main chain resource flow management contract corresponding to the resource transfer service provider, the resource transfer service provider can issue digital resources of equal value in the sub-chain through the sub-chain resource flow management contract, so that users can quickly and cheaply exchange digital resources in the sub-chain and then extract the digital resources back to the main chain. However, the resources consumed in deploying the main chain resource management contract in the main blockchain network are relatively high. For some users, they may not need to exchange digital resources in the main blockchain network for a long time or even never, and will refuse to extract the digital resources in the sub-chain back to the main chain, which will make it impossible for the resource transfer service provider to recover the digital resources obtained by these users, resulting in insufficient circulation of digital resources in the hierarchical chain network. Summary of the invention
[0004] The embodiments of the present application provide a data processing method and related equipment based on a layered chain network, which can save the consumed resources required to extract sub-chain digital resources back to the main chain, thereby improving the circulation of digital resources in the layered chain network.
[0005] On the one hand, an embodiment of the present application provides a data processing method based on a hierarchical chain network, characterized in that the hierarchical chain network includes a main blockchain network and a sub-blockchain network; the main blockchain network is independent of the sub-blockchain network; the method is executed by a resource transfer service node; the method includes:
[0006] Receive a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information;
[0007] Obtain the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when it determines that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information;
[0008] According to the cross-chain resource transfer request, cross-chain resource transfer processing is performed between the target sub-chain resource management contract and the target main chain resource management contract address; the target main chain resource management contract address has the authority to receive digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
[0009] On the one hand, an embodiment of the present application provides a data processing device based on a hierarchical chain network, characterized in that the hierarchical chain network includes a main blockchain network and a sub-blockchain network; the main blockchain network is independent of the sub-blockchain network; the device is run by a resource transfer service node; the device includes:
[0010] A first receiving module is used to receive a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information;
[0011] The address acquisition module is used to obtain the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when it determines that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information;
[0012] The cross-chain transfer module is used to perform cross-chain resource transfer processing between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request; the target main chain resource management contract address has the authority to receive digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
[0013] Among them, the cross-chain transfer module includes:
[0014] A transfer-out unit, used to generate a subchain resource transfer-out transaction according to a cross-chain resource transfer request, and send the subchain resource transfer-out transaction to the subchain blockchain network, so that the subchain blockchain network transfers the first digital resource from the target subchain resource management contract address to the subchain resource flow management contract address corresponding to the subchain resource flow management contract through the target subchain resource management contract after reaching a consensus on the subchain resource transfer-out transaction; the subchain resource flow management contract is a resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the subchain blockchain network;
[0015] The transfer-in unit is used to generate a main chain resource transfer-in transaction according to a cross-chain resource transfer request when receiving a successful transfer-out result for the first digital resource, and send the main chain resource transfer-in transaction to the main blockchain network, so that the main blockchain network transfers the second digital resource from the main chain resource flow management contract address corresponding to the main chain resource flow management contract to the target main chain resource management contract address through the main chain resource flow management contract after reaching a consensus on the main chain resource transfer-in transaction; the main chain resource flow management contract is a resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the main blockchain network; the total resource value of the first digital resource is equal to the total resource value of the second digital resource.
[0016] Wherein, the above-mentioned data processing device further includes:
[0017] The first registration module is used to receive a resource management contract registration request sent by a target object terminal; the resource management contract registration request includes target object information, address public key and contract public key;
[0018] The contract deployment module is used to generate a subchain resource management contract registration transaction according to the contract public key, and send the subchain resource management contract registration transaction to the sub-blockchain network, so that the sub-blockchain network can deploy the target sub-chain resource management contract in the sub-blockchain network through the sub-chain registration contract after reaching a consensus on the sub-chain resource management contract transaction;
[0019] The address determination module is used to determine the target main chain resource management contract address according to the address public key and the main chain registration contract address corresponding to the main chain registration contract when receiving the deployment success result for the target sub-chain resource management contract;
[0020] The relationship recording module is used to record the relationship between the target object information, the target main chain resource management contract address, and the target sub-chain resource management contract.
[0021] The address determination module includes:
[0022] The bytecode generation unit is used to generate the main chain resource management contract code to be deployed according to the address public key, and generate the bytecode to be deployed corresponding to the main chain resource management contract code to be deployed through the bytecode function;
[0023] A hash unit, used for performing hash processing on the bytecode to be deployed to obtain a first hash value;
[0024] The hash unit is also used to obtain the main chain registration contract address corresponding to the main chain registration contract, hash the first hash value, the main chain registration contract address and the random parameters to obtain the target main chain resource management contract address.
[0025] Wherein, the above-mentioned data processing device further includes:
[0026] The first storage module is used to store the target main chain resource management contract address into a preset main chain resource management contract address set;
[0027] The first verification module is used to perform batch registration verification on the preset main chain resource management contract address set to obtain the batch registration verification result;
[0028] The second registration module is used to generate a main chain resource management contract batch registration transaction according to the main chain resource management contract address included in the preset main chain resource management contract address set if the address batch registration verification result is a verification pass result, and send the main chain resource management contract batch registration transaction to the main blockchain network, so that the main blockchain network deploys the main chain resource management contract on the main chain resource management contract address included in the preset main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
[0029] Wherein, the first verification module includes:
[0030] A quantity determination unit, used to obtain the number of main chain resource management contract addresses in a preset main chain resource management contract address set as the number of stored addresses;
[0031] A result determination unit, configured to determine that the address batch registration verification result is a verification pass result if the number of stored addresses is equal to a storage address number threshold;
[0032] The result determination unit is further used to determine that the address batch registration verification result is a verification failure result if the number of stored addresses is less than a storage address number threshold.
[0033] The data processing device further includes:
[0034] The second storage module is used to store the target main chain resource management contract address into the preset main chain resource management contract address set;
[0035] The second verification module is used to continuously detect the waiting time interval between the system time corresponding to the resource transfer service node and the historical address batch registration time; the historical address batch registration time is the time when the resource transfer service node generates the historical main chain resource management contract batch registration transaction;
[0036] The batch address acquisition module is used to acquire M main chain resource management contract addresses from the preset main chain resource management contract address set when it is detected that the waiting time interval reaches the address batch registration period; M is a positive integer;
[0037] The third registration module is used to generate a main chain resource management contract batch registration transaction according to the M main chain resource management contract addresses, and send the main chain resource management contract batch registration transaction to the main blockchain network, so that the main blockchain network can deploy the main chain resource management contract on the M main chain resource management contract addresses respectively through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
[0038] Among them, the batch address acquisition module includes:
[0039] A quantity acquisition unit, used to acquire the number of main chain resource management contract addresses in a preset main chain resource management contract address set as the number of stored addresses;
[0040] An address acquisition unit, configured to determine the main chain resource management contract address in the preset main chain resource management contract address set as M main chain resource management contract addresses if the number of stored addresses is less than or equal to the address batch registration number threshold;
[0041] The address acquisition unit is also used for obtaining priority main chain resource management contract addresses whose number is the address batch registration number threshold from the preset main chain resource management contract address set if the number of stored addresses is greater than the address batch registration number threshold, and determining them as M main chain resource management contract addresses; the time when the priority main chain resource management contract address is stored in the preset main chain resource management contract address set is earlier than the time when the remaining main chain resource management contract addresses are stored in the preset main chain resource management contract address set; the remaining main chain resource management contract addresses are the main chain resource management contract addresses in the preset main chain resource management contract address set excluding the priority main chain resource management contract addresses.
[0042] The above data processing device further includes:
[0043] The main chain transfer module is used to receive the main chain resource transfer request for the target main chain resource management contract address, and query the main chain contract creation status corresponding to the target main chain resource management contract address according to the main chain resource transfer request; the main chain contract creation status is used to characterize the contract deployment status of the main blockchain network on the target main chain resource management contract address;
[0044] The contract registration module is used to obtain the target main chain resource management contract address associated with the target object information if the main chain contract creation status is the main chain contract uncreated status, generate a main chain resource management contract registration transaction according to the target main chain resource management contract address, and send the main chain resource management contract registration transaction to the main blockchain network, so that the main blockchain network deploys the target main chain resource management contract on the target main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract registration transaction;
[0045] The first transfer module is used to perform main chain resource transfer processing on the target main chain resource management contract according to the main chain resource transfer request when receiving the deployment success result for the target main chain resource management contract.
[0046] The above data processing device further includes:
[0047] The second transfer module is used to generate a main chain resource transfer transaction according to the target main chain resource management contract address if the main chain contract creation status is the main chain contract created status, and send the main chain resource transfer transaction to the main blockchain network, so that the main blockchain network can execute the main chain resource transfer transaction through the target main chain resource management contract deployed at the target main chain resource management contract address after reaching a consensus on the main chain resource transfer transaction.
[0048] Among them, the cross-chain resource transfer request also includes the resource transfer quantity;
[0049] The above data processing device further includes:
[0050] A numerical verification module is used to query the resource storage value corresponding to the digital resource stored in the target subchain resource management contract associated with the target object;
[0051] The value verification module is also used to call the address acquisition module to obtain the target main chain resource management contract address associated with the target object information if the resource storage value is greater than or equal to the resource transfer value;
[0052] The numerical verification module is also used to send a cross-chain resource transfer failure prompt message to the target object terminal if the resource storage value is less than the resource transfer value.
[0053] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;
[0054] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide a data communication network element, the above-mentioned memory is used to store a computer program, and the above-mentioned processor is used to call the above-mentioned computer program to execute the method in the embodiment of the present application.
[0055] On one hand, 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.
[0056] On the one hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the embodiment of the present application.
[0057] In the embodiment of the present application, a cross-chain resource transfer request sent by the target object terminal is received, and the cross-chain resource transfer request includes the target object information. Then, the target main chain resource management contract address associated with the target object information is obtained. The target main chain resource management contract address is generated by the resource transfer service node when it is determined that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; and then a cross-chain resource transfer process is performed between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request. Among them, the target main chain resource management contract address has the authority to receive the digital resources transferred from the target sub-chain resource management contract corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process, and the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information. Through the method provided in the embodiment of the present application, a target main chain resource management contract address for storing digital resources in the main chain can be generated for the target object, that is, the target object can directly extract the digital resources in the sub-chain to the target main chain resource management contract address, without the need for the target object to spend resources to deploy the contract in the main blockchain network first, thereby saving the resources required to extract the sub-chain digital resources back to the main chain, and further improving the circulation of digital resources in the layered chain network. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 It is a schematic diagram of a hierarchical structure of a blockchain network provided in an embodiment of the present application;
[0060] Figure 2 This is a schematic diagram of an application scenario of cross-chain resource transfer provided by an embodiment of the present application;
[0061] Figure 3 It is a flowchart of a data processing method based on a hierarchical chain network provided in an embodiment of the present application;
[0062] Figure 4 This is a schematic diagram of a subchain proof submitted to a main chain provided in an embodiment of the present application;
[0063] Figure 5 It is a flowchart of a data processing method based on a hierarchical chain network provided in an embodiment of the present application;
[0064] Figure 6 It is a flowchart of a data processing method based on a hierarchical chain network provided in an embodiment of the present application;
[0065] Figure 7 This is a schematic diagram of an interactive process of digital resource management in a layered blockchain network provided by an embodiment of the present application;
[0066] Figure 8 It is a structural schematic diagram of a data processing device based on a hierarchical chain network provided in an embodiment of the present application;
[0067] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] See also Figure 1 , Figure 1 Schematic diagram of a hierarchical structure of a blockchain network provided in an embodiment of the present application. Figure 1 The hierarchical structure shown is applied to a blockchain data system, such as a blockchain digital resource system. The blockchain digital resource system can be a system composed of multiple blockchain networks. The digital resources can be digital collections, electronic bills, etc. Digital resources can be transferred and circulated in multiple blockchain networks. The blockchain network corresponding to the blockchain digital resource system includes a business network and multiple blockchain networks (i.e., consensus networks). The business network is in the public network, and the blockchain network is in the private network (such as deployed in a private cloud). Figure 1 As shown, the business network can be expressed as Figure 1 The business network 100 shown in FIG. 1 and the multiple blockchain networks can be specifically represented as Figure 1 Blockchain network 200 and blockchain network 300 are shown.
[0070] In such Figure 1In the service network 100 shown, multiple service nodes are deployed, and the multiple service nodes may specifically include Figure 1 The service nodes 10a, 10b, ..., 10n are shown. It is understood that the number of service nodes deployed in the service network 100 is not limited here. As the service demand changes, the number of service nodes can change continuously. It should be understood that the service nodes in the service network 100 do not need to be accounted. In addition, Figure 1 As shown, for each business node running in the business network 100, one or more of the above-mentioned multiple blockchain networks can be accessed through network communication. The number of consensus networks accessed by each business object through the corresponding business node is not limited here. It is understandable that data can also be exchanged between consensus networks through network communication.
[0071] It should be understood that in Figure 1 In the blockchain network 200 shown, multiple blockchain nodes are deployed. The multiple blockchain nodes here may specifically include Figure 1 Blockchain nodes 20a, 20b, 20c and 20d are shown. It should be noted that the number of blockchain nodes deployed in the blockchain network 200 is not limited here, and the number of blockchain nodes here can change continuously as business needs change. Figure 1 As shown, for multiple consensus nodes running in the blockchain network 200, the blockchain maintained together is specifically Figure 1 Blockchain 20e is shown.
[0072] Accordingly, in Figure 1 In the blockchain network 300 shown, multiple blockchain nodes are deployed. The multiple blockchain nodes here may specifically include Figure 1 Blockchain nodes 30a, 30b, 30c and 30d are shown. It should be noted that the number of blockchain nodes deployed in the blockchain network 300 is not limited here, and the number of blockchain nodes here can change continuously as business needs change. Figure 1 As shown, for multiple consensus nodes running in the blockchain network 300, the blockchain maintained together is specifically Figure 1 Blockchain 30e is shown.
[0073] It is understandable that if Figure 1The blockchains in the multiple blockchains shown can be a layer1 type blockchain and multiple layer2 type blockchains. Layer1 refers to the underlying blockchain, which is the underlying foundation for the construction of various layer2 networks. Layer1 functions include: node manager network (used to protect and verify the network), block producer network, and the blockchain itself as well as historical transaction data and network consensus mechanism. Layer2 refers to the blockchain in the second layer blockchain network built on the layer1 public chain to optimize the processing of transactions and calculations.
[0074] For ease of understanding, it can be assumed that the blockchain 20e in the above-mentioned blockchain digital resource system is a layer1 type blockchain. In this case, the blockchain 20e can be called the main blockchain, and the blockchain network 200 can be called the main blockchain network in multiple blockchain networks. At this time, the other blockchains in the multiple blockchain networks can all be layer2 type blockchains built on the blockchain 20e, and the blockchain networks corresponding to the other blockchains can be called sub-blockchain networks in multiple blockchain networks. For example, the blockchain network 300 can be called a sub-blockchain network in multiple blockchain networks, and the blockchain 30e maintained by the blockchain network 300 is called a sub-blockchain. It can be understood that the main blockchain network is independent of the sub-blockchain network, and different sub-blockchain networks are also independent of each other. Therefore, the blockchain network composed of the main blockchain network and the sub-blockchain network can also be called a layered blockchain network. In other words, the blockchain digital resource system can include a layered blockchain network, which can include independent sub-blockchain networks and a main blockchain network. The main blockchain network is used to maintain the main blockchain, and the sub-blockchain network is used to maintain the sub-blockchain. The number of sub-blockchain networks is not limited here. As business needs change, the number of sub-blockchain networks here can change continuously. Here, the circulation of digital resources in the layered blockchain is described by taking the layered blockchain including a main blockchain and a sub-blockchain as an example.
[0075] It should be understood that the blockchain involved in the embodiments of the present application is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism and encryption algorithm, which is mainly used to organize data in chronological order and encrypt it into a ledger to make it impossible to be tampered with or forged, and to verify, store and update data. Blockchain is essentially a decentralized database in which each node stores an identical blockchain.
[0076] In the above blockchain digital resource system, the blockchain node can be responsible for the consensus in the blockchain network where the corresponding blockchain is located, that is, the blockchain node can be the consensus node in the blockchain network where the corresponding blockchain is located. For any of the above two blockchain networks, the specific process of writing the transaction data in the blockchain network into the corresponding blockchain account book (for example, a distributed database) can be that the business client sends the transaction data to a certain business node, and then the transaction data is passed between the business nodes in the business network in the above blockchain network in a baton manner until the blockchain node in the above corresponding blockchain network (for example, the blockchain node 20b in the blockchain network 200) receives the transaction data. At this time, the blockchain node (for example, the blockchain node 20b in the blockchain network 200) packs the transaction data into a block so that it can be subsequently reached with other blockchain nodes. Consensus can be written into the distributed database of the blockchain network (for example, blockchain network 200) where the consensus is passed. Optionally, the aforementioned business client can be a payment client, entertainment client (for example, game client), multimedia client (for example, video client), smart home client, browser, etc. in the blockchain that has the function of displaying data information such as text, images, audio and video.
[0077] Optionally, it is understandable that the embodiment of the present application can also write the block carrying the transaction data and other multiple blocks associated with the block into a distributed database in parallel through the storage layer of the blockchain network (for example, blockchain network 200) to which it belongs after consensus is passed. This can fundamentally break through the limitations of the blockchain structure of the blockchain, and thus effectively improve the storage efficiency of data storage.
[0078] Among them, it can be understood that in the above-mentioned blockchain digital resource system, a smart contract can be deployed on the blockchain of the corresponding blockchain network. The smart contract can be understood as a code executed by each blockchain node in the blockchain digital resource system, and any logic can be executed and the result can be obtained through the smart contract. For example, a business object (such as a user) can initiate a transaction business request (such as a cross-chain resource transfer request) to a resource transfer service node through a business client, and then the resource transfer service node can generate a corresponding business transaction (such as a sub-chain resource transfer transaction) according to the transaction business request to call the smart contract (such as the target sub-chain resource management contract for the sub-chain resource transfer transaction) that has been deployed on the blockchain (such as the above-mentioned blockchain 30e) of the corresponding blockchain network (such as the above-mentioned blockchain network 300).
[0079] Specifically, the business node in the business network can send the business transaction to the blockchain node in the corresponding blockchain network (for example, Figure 1 The blockchain node 30a shown in the figure is used to authenticate the business object of the business transaction through the chain entry of the corresponding blockchain network, and when the identity authentication is successful, the business transaction is allowed to be sent to other blockchain nodes in the corresponding blockchain network (for example, Figure 1 The consensus node 30b shown in FIG. 30a) is used to call these blockchain nodes (e.g., Figure 1 The business transaction is executed by the smart contract running in the blockchain node 30a and the blockchain node 30b shown.
[0080] It should be understood that one or more smart contracts can be deployed on the blockchain (e.g., the blockchain 20e) of the above-mentioned blockchain network (e.g., the above-mentioned blockchain network 200). These smart contracts can be distinguished by the contract call address (also called the contract address), the contract identification number (Identity document, ID) or the contract name, and the transaction business request initiated by the business client can also carry the contract call address or contract identification number or contract name of the smart contract to specify the smart contract to be run.
[0081] It should be understood that in the above blockchain digital resource system, any two blockchain nodes in any blockchain network (for example, blockchain network 200 or blockchain network 300) can form a peer-to-peer network, and the peer-to-peer network can use an application layer protocol running on the Transmission Control Protocol (TCP). In a distributed system, any device such as a server, a terminal, etc. can join and become a blockchain node, wherein each blockchain node can include a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0082] It is understood that the embodiment of the present application can configure a blockchain node for any object (for example, any individual user, any enterprise, any institution, etc.) that accesses the blockchain network. Figure 1 In the business network 100 shown, business node 10a, business node 10b, business node 10c, business node 10d, ..., business node 10n may respectively have a one-to-one correspondence with the corresponding objects that need to be connected to the blockchain network. For example, business node 10a may have a corresponding relationship with the resource transfer service node corresponding to the resource transfer service provider.
[0083] Among them, it can be understood that the resource transfer service node can provide resource transfer services for multiple objects connected to the blockchain network. After receiving the cross-chain resource transfer request sent by the target object terminal, the resource transfer service node can first obtain the associated target main chain resource management contract address according to the target object information contained in the cross-chain resource transfer request, and then perform data transactions with the business node 10a according to the cross-chain resource transfer request to achieve the transfer of digital resources in the target sub-chain resource management contract in the sub-blockchain network (for example, the above-mentioned blockchain network 300) to the target main chain resource management contract address in the main blockchain network (for example, the above-mentioned blockchain network 200). Among them, the target sub-chain resource management contract is a smart contract used by the target object to manage its digital resources in the sub-blockchain network. The digital resources of the target object in the sub-blockchain network are stored in the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract. When the target object wants to exchange its digital resources in the sub-blockchain network, it needs to call the target sub-chain resource management contract to achieve it. Among them, the target main chain resource management contract address is a main chain address in the main blockchain network that can be used to store the digital resources of the target object.
[0084] Among them, it can be understood that the digital resources circulating in the main chain (for example, the above-mentioned blockchain 20e) can be used to represent the ownership of an off-chain item stored on the blockchain, that is, when an object owns a certain digital resource in the main chain, it can be proved that the off-chain item corresponding to the digital resource belongs to the object. Among them, the off-chain item can be media data such as pictures, videos, music, games, etc., or physical items such as houses and vehicles. In addition, the digital resources in the main chain can be transferred to the sub-chain (for example, the above-mentioned blockchain 30e) for circulation. In a feasible embodiment, the digital resources circulating in the sub-chain are essentially the mapping resources corresponding to the digital resources on the main chain, that is, the digital resources in the main chain are not really transferred to the sub-chain, but the digital resources in the main chain are locked in a certain smart contract, and then a digital resource representing the on-chain ownership of the digital resources in the main chain is issued on the sub-chain. By circulating the digital resources of the sub-chain, it is equivalent to circulating the digital resources on the main chain. For example, object 1 transfers digital resource A in the main chain to the subchain, which can be done by transferring digital resource A in the main chain from its own main chain resource management contract to the main chain resource flow management contract corresponding to the resource transfer service provider, and then the resource transfer service provider transfers the digital resource B mapped by the digital resource A in the subchain from the subchain resource flow management contract to the subchain resource management contract of object 1. It can be understood that when object 1 transfers digital resource B to object 2 in the subchain, object 2 can extract digital resource B into the main chain, that is, object 2 transfers digital resource B back to the subchain resource flow management contract in the subchain, and then receives digital resource A transferred by the main chain resource flow management contract in the main chain. However, for the convenience of description, the digital resources in the main chain and their corresponding mapped digital resources in the subchain are usually considered to be the same digital resources.
[0085] It can be understood that in the specific implementation of the present application, related data such as user identity information, user-associated contract address, user-associated digital resource information, etc., when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0086] To understand the implementation process of the above resource transfer service node to transfer cross-chain resources between the target sub-chain resource management contract and the target main chain resource management contract address, please refer to Figure 2 , Figure 2 : is a schematic diagram of an application scenario of cross-chain resource transfer provided by an embodiment of the present application. Figure 2 The game player A associated with the terminal device 20 shown in the figure can be a game player who accesses the above Figure 1 Gamers in the layered blockchain network shown; Figure 2The point transfer service node 21 shown can be the above Figure 1 The above can be Figure 1 A resource transfer service node for data exchange with any business node in the layered blockchain network shown; Figure 2 The service node 22 shown can be the above Figure 1 Any business node in the business network 100 in the layered blockchain network shown, such as business node 22, may be business node 10a; Figure 2 The sub-blockchain network 23 shown can be the above Figure 1 In the layered blockchain network shown in FIG. 300 , the sub-blockchain 23e stored in the sub-blockchain network 23 is the blockchain 30e described above; Figure 2 The main blockchain network 24 shown can be the above Figure 1 In the blockchain network 200 in the layered blockchain network shown, the sub-blockchain 24e stored in the main blockchain network 24 is the above-mentioned blockchain 20e.
[0087] Taking the game scenario as an example, the digital resources circulating in the layered blockchain network can be game points to be exchanged. For example, the game points of game players can be circulated in the sub-blockchain network 23, and the exchange business of game points (such as game points exchanged for role equipment, etc.) can be deployed in the main blockchain network 24. It can be understood that in order to improve the circulation of game points in the sub-chain, that is, to avoid the problem that a large number of game points in the sub-blockchain network 23 are accumulated in the hands of a certain game player for a long time, and new game points can only be continuously issued to other game players, the game party can give game players who transfer game points back to the main blockchain network 24 in time. Certain exchange rewards, such as reducing the game points required for exchange on the basis of the original game points exchange. For some game players who have not yet decided what role equipment to exchange, the game points obtained from the sub-blockchain network 23 can be first extracted back to the main blockchain network 24, and after the game players decide on the role equipment they want to exchange, the transferred game points (i.e., mapped game points, equal value to the game points in the sub-chain) can be exchanged in the main blockchain network 24.
[0088] like Figure 2As shown, game player A can send a cross-chain point transfer request 201 to the point transfer service node 21 corresponding to the game party (i.e., the resource transfer service party) through the associated terminal device 20 to request to transfer his game points in the sub-blockchain network 23 back to the main blockchain network 24. After receiving the cross-chain point transfer request 201, the point transfer service node 21 can obtain the main chain point management contract address B associated with game player A (i.e., the target main chain resource management contract address). It should be noted that because the deployment of the main chain point management contract for managing game points requires certain consumption of resources, the main chain point management contract address B can be generated by the point transfer service node 21 after determining that the sub-chain point management contract C1 (i.e., the target sub-chain resource management contract) associated with the game player is successfully deployed, and is used to store the game points that game player A wants to extract to the main blockchain network 24, so as to avoid the loss caused by the game player A spending resources in advance, but the game points in the main blockchain network may not be used later.
[0089] like Figure 2 As shown, after obtaining the main chain point management contract address B associated with the game player A, the point transfer service node 21 can interact with the business node 22, thereby indirectly exchanging data with the sub-blockchain network 23 and the main blockchain network 24 through the business node 22, so as to realize the transfer of game points between the sub-chain point management contract C1 and the main chain point management contract address B. Specifically, the point transfer service node 21 can first generate a sub-chain point transfer transaction (i.e., the above-mentioned sub-chain resource transfer transaction) through the cross-chain point transfer request 201, and then send the sub-chain point transfer transaction to the sub-blockchain network 23 through the business node 22 to request the sub-blockchain network 23 to complete the sub-chain point transfer transaction, and transfer the 50 game points to be transferred stored in the sub-chain point management contract address C2 corresponding to the sub-chain point management contract C1 corresponding to the game player A to the sub-chain point flow management contract address D2 corresponding to the sub-chain point flow management contract D1 (i.e., the above-mentioned sub-chain resource flow management contract) corresponding to the game party. Then, a main chain points transfer transaction is generated through the cross-chain points transfer request 201, and then the main chain points transfer transaction is sent to the main blockchain network 24 through the business node 22 to request the main blockchain network 24 to complete the main chain points transfer transaction, and the game points with the same total resource value, that is, 50 game points (the game points in a sub-chain and the game points in a main chain are mapped game points to each other, and the corresponding resource values are the same. For game players, the two can be regarded as the same game points), are transferred from the main chain points flow management contract address E2 corresponding to the main chain points flow management contract E1 (that is, the above-mentioned main chain resource flow management contract) corresponding to the game party to the main chain points management contract address B for storage.
[0090] It can be seen that, using the method provided in the embodiment of the present application, the main chain point management contract address B has the authority to receive the game points of game player A in the main chain, but the main chain point management contract is not deployed on the main chain point management contract address B. If game player A does not need to use the game points in the main chain, it is not necessary to deploy the main chain point management contract in the main chain point management contract address C, thereby avoiding unnecessary waste of resources. Among them, the consumed resources refer to the resources required to issue transactions or deploy contracts in the blockchain network.
[0091] For further information, see Figure 3 , Figure 3 It is a flow chart of a data processing method based on a layered chain network provided by an embodiment of the present application. The layered chain network includes a main blockchain network and a sub-blockchain network. The method can be executed by a resource transfer service node. The following will be described by taking the method executed by a resource transfer service node as an example, wherein the data processing method based on the layered chain network can at least include the following steps S101-S103:
[0092] Step S101, receiving a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information.
[0093] Specifically, a cross-chain resource transfer request refers to a request to transfer the digital resources of the target object in the target sub-chain resource management contract to the target main chain resource management contract address. Among them, the target object terminal refers to any terminal device that can interact with the resource transfer service node for data, and the target object is any blockchain user that can deploy its own associated sub-chain resource management contract in the sub-blockchain network. The sub-chain resource management contract associated with the target object can be called the target sub-chain resource management contract. Among them, the sub-chain resource management contract is a smart contract deployed in the sub-blockchain network, which is used to receive, transfer and other business operations on the digital resources stored in the sub-chain resource management contract address. It should be understood that a sub-chain resource management contract is usually associated with only one blockchain user, that is, only its associated blockchain user has the authority to call the sub-chain resource management contract.
[0094] Specifically, the digital resources that the target object has in the blockchain network can be native digital resources issued in the sub-blockchain network, or can be mapped digital resources corresponding to digital resources issued in the main blockchain network in the sub-blockchain network. To facilitate the understanding of native digital resources and mapped digital resources, for example, digital resource 1 is the first digital resource issued in the main blockchain network, then digital resource 1 is the native digital resource in the main blockchain network. When digital resource 1 needs to be transferred to the sub-blockchain network for use, digital resource 1 can be locked in the main blockchain network, and then a digital resource 2 with a mapping relationship with digital resource 1 is issued in the sub-blockchain network. This digital resource 2 is the mapped digital resource corresponding to digital resource 1 in the sub-blockchain network. It can be understood that the resource value of digital resource 1 and digital resource 2 is the same. From the perspective of the blockchain user side, digital resource 1 and digital resource 2 can be regarded as the same digital resource, that is, the native digital resource issued in the main blockchain network and its corresponding mapped digital resource in the sub-blockchain network can be regarded as the same digital resource. Similarly, the native digital resource issued in the sub-blockchain network and its corresponding mapped digital resource in the main blockchain network can also be regarded as the same digital resource. Therefore, it can be understood that when the embodiment of the present application describes transferring digital resources in a sub-blockchain network to a certain address in the main blockchain network, it does not mean that the digital resources in the sub-blockchain network are directly taken to the main blockchain network for use. Instead, after the digital resources to be transferred in the sub-blockchain network are locked, the mapped digital resources corresponding to the digital resources to be transferred in the main blockchain network are transferred to a certain address in the main blockchain network.
[0095] Optionally, the cross-chain resource transfer request also includes a resource transfer value, and then the resource transfer service node can query the resource storage value corresponding to the digital resource stored in the target sub-chain resource management contract associated with the target object; if the resource storage value is greater than or equal to the resource transfer value, step S102 is executed; if the resource storage value is less than the resource transfer value, a cross-chain resource transfer failure prompt message is sent to the target object terminal. Among them, the resource transfer number can refer to the number of digital resources transferred, and the resource storage value can refer to the number of digital resources stored in the target sub-chain resource management contract.
[0096] Step S102, obtaining the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when it determines that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information.
[0097] Specifically, the resource transfer service node can be a computing device that the resource transfer service provider provides resource transfer services for multiple objects. The resource transfer service provider can be a credible enterprise, organization or department, which can provide services for multiple objects to register resource management contracts, and provide objects with operations such as transfer-in, transfer-out, etc. of digital resources of resource management contracts. The resource transfer service provider has its own corresponding smart contract for resource management in the layered blockchain network. It can be understood that when an object has a business need to receive, transfer, exchange, etc. of digital resources in a layered blockchain network, it can first deploy a resource management contract for managing digital resources in the layered blockchain network through the resource transfer service node; if the target object only has a business need to receive digital resources, it can only generate a resource management contract address for receiving and storing digital resources in the layered blockchain network through the resource transfer service node.
[0098] Specifically, the resource transfer service node will record the association relationship between the object information and its associated resource management contract or resource management contract address. Therefore, it can be understood that after receiving a cross-chain resource transfer request, the resource transfer service node can query in the relationship record database, and use the sub-chain resource management contract associated with the object information that is the same as the target object information as the target sub-chain resource management contract, and use the main chain resource management contract address associated with the object information that is the same as the target object information as the target main chain resource management contract address. Among them, the relationship record database may contain one or more object information and the sub-chain resource management contract or main chain resource management contract address associated with each object information.
[0099] It can be understood that if the target object only has multiple business needs such as receiving and transferring digital resources in the sub-blockchain network, and temporarily only has the need to receive digital resources in the main blockchain network, the target object can deploy a target sub-chain resource management contract in the sub-blockchain network through the resource transfer service node, and generate a target main chain resource management contract address for storing digital resources in the main blockchain network through the resource transfer service node. The resource transfer service node will record the object information corresponding to the target object and the association between the target sub-chain resource management contract and the target main chain resource management contract address. It can be understood that the operations such as digital resource transfer in and digital resource transfer out generated by the target object in the sub-blockchain network to the target sub-chain resource management contract are actually carried out between the smart contract of the resource transfer service provider in the sub-blockchain network (such as the sub-chain resource flow management contract described below) or the sub-chain resource management contract corresponding to other objects. Taking the example that the digital resources contacted by the target object are the mapped digital resources in the sub-blockchain network corresponding to the main blockchain network, the corresponding native digital resources in the main blockchain network are generally locked in the smart contract of the resource transfer service provider in the main blockchain network (such as the main chain resource flow management contract described below). The target When an object transfers digital resources in a child blockchain network through the target child chain resource management contract, the corresponding native digital resources in the main blockchain network do not undergo resource transfer. Therefore, if the target object only transfers digital resources in the child blockchain network, it is not necessary to deploy the target main chain resource management contract (i.e., the main chain resource management contract associated with the target object) in the main blockchain network. If the target object needs to extract digital resources from the child blockchain network to the main blockchain network, a target main chain resource management contract address can be generated for the target object, but the target object still does not need to deploy the target main chain resource management contract in the main blockchain network at this time.
[0100] Optionally, a feasible implementation process of the deployment of the target subchain resource management contract and the generation of the target mainchain resource management contract address can be as follows: the resource transfer service node receives the resource management contract registration request sent by the target object terminal, and the resource management contract registration request can include the target object information, the address public key and the contract public key; then, the resource transfer service node can generate a subchain resource management contract registration transaction based on the contract public key, and send the subchain resource management contract registration transaction to the sub-blockchain network, so that the sub-blockchain network can deploy the target subchain resource management contract in the sub-blockchain network through the sub-chain registration contract after reaching a consensus on the subchain resource management contract transaction; when the resource transfer service node receives the successful deployment result for the target subchain resource management contract, the target mainchain resource management contract address can be determined based on the address public key and the mainchain registration contract address corresponding to the mainchain registration contract; finally, the target object information, the target mainchain resource management contract address and the target subchain resource management contract are recorded. Among them, the public key is an important tool for verifying the identity and decryption of the object. A public key usually corresponds to a private key. Data signed by a private key can only be decrypted by its corresponding public key. It is understandable that a resource management contract is usually associated with a pair of public and private keys. The public key is used when the resource management contract is generated to ensure that only the holder of the private key corresponding to the public key can call the resource management contract. Among them, the address public key is the public key that the target object hopes to use to generate the target main chain resource management contract address, and the contract public key is the public key that the target object hopes to use to generate the target subchain resource management contract.
[0101] Optionally, in order to verify that the target object does have the address private key corresponding to the address public key and the contract private key corresponding to the contract public key, the resource management contract registration request may also carry address signature data and contract signature data, wherein the address signature data may be the signature data obtained after the target object terminal signs the contract public key with the address private key, and the contract signature data may be the signature data obtained after the target object terminal signs the address public key with the contract private key. The resource transfer service node may decrypt the address signature data with the address public key. If the decrypted data obtained is the contract public key, it is determined that the target object terminal has the address private key; the resource transfer service node may decrypt the contract signature data with the contract public key. If the decrypted data obtained is the address public key, it is determined that the target object terminal has the contract private key.
[0102] Specifically, a feasible implementation process for determining the target main chain resource management contract address according to the address public key and the main chain registration contract corresponding to the main chain registration contract can be: generating the main chain resource management contract code to be deployed according to the address public key, generating the bytecode to be deployed corresponding to the main chain resource management contract code to be deployed through the bytecode function; performing hash processing on the bytecode to be deployed to obtain the first hash value; obtaining the main chain registration contract address corresponding to the main chain registration contract, and performing hash processing on the first hash value, the main chain registration contract address and the random parameters to obtain the target main chain resource management contract address. For ease of understanding, the above process can be described by formula (1):
[0103] Address=Hash(Hash(bytecode)+deployerAddr+salt)
[0104] Formula (1)
[0105] Among them, bytecode is a function used to generate the bytecode of the contract to be deployed (i.e., the main chain resource management contract). The parameters are determined when the function is called, and are generally information related to the object for which the address needs to be generated, such as the address public key. Among them, deployerAddr refers to the account address that performs the contract deployment operation, that is, the address corresponding to the contract used to deploy the smart management contract (i.e., the main chain registration contract address). Among them, Hash(bytecode) refers to the first hash value obtained by hashing the bytecode. Among them, Address is the target main chain resource management contract address obtained by hashing the first hash value, the main chain registration contract address, and the random parameters. Among them, salt is a random value.
[0106] Specifically, the resource transfer service node sends the subchain resource management contract registration transaction to the sub-blockchain network, so that the sub-blockchain network deploys the target sub-chain resource management contract in the sub-blockchain network through the sub-chain registration contract after reaching the consensus of the sub-chain resource management contract transaction. A feasible implementation example can be: the resource transfer service node sends the sub-chain resource management contract registration transaction to the sub-blockchain node in the sub-blockchain network, and the sub-blockchain node can be any blockchain node in the sub-blockchain network. Then, after the sub-blockchain node verifies the sub-chain resource management contract registration transaction, it sends the sub-chain resource management contract registration transaction to the consensus node cluster in the sub-blockchain network. The consensus node cluster in the sub-blockchain network will perform consensus processing on the sub-chain resource management contract registration transaction according to the consensus mechanism of the sub-blockchain network to obtain a consensus result; if the consensus result is a consensus passing node, the sub-blockchain node can call the sub-chain registration contract to execute the sub-chain resource management contract transaction, thereby completing the deployment of the target sub-chain resource management contract. Among them, the sub-chain registration contract is a smart contract in the sub-blockchain network used to deploy the resource management contract in the sub-blockchain network.
[0107] Optionally, the sub-blockchain network will submit the execution proof corresponding to the sub-chain resource management contract registration transaction to the main blockchain network. For ease of understanding, please refer to Figure 4 , Figure 4 This is a schematic diagram of a subchain proof submitted to the main chain provided in an embodiment of the present application. Figure 4 As shown, it is too wasteful to upload the execution proof of a transaction to the chain alone. Therefore, the sub-blockchain network can usually generate an execution proof transaction based on one or more blocks. Assume that the sub-chain resource management contract registration transaction sent by the resource transfer service node 40 is packaged into the sub-chain block m, and the sub-chain block m can contain multiple transactions in multiple sub-chains. After the sub-chain block m is successfully executed in the sub-blockchain network, the sub-chain block m and the block execution result will be written into the sub-chain for easy query. Then, the sub-blockchain network can also submit the execution proof corresponding to the sub-chain block m to the main blockchain network, so as to obtain the main blockchain network’s recognition of the transactions contained in the sub-chain block m. As shown Figure 4 As shown, the sub-blockchain network can generate an execution proof transaction corresponding to the sub-chain block m, and then send the execution proof transaction to the cross-chain relay, and then transfer it to the main blockchain network through the cross-chain relay. After the main blockchain network reaches a consensus on the execution proof transaction, it will write the execution proof transaction and its corresponding execution result into the main chain. Among them, the cross-chain relay refers to the off-chain cross-chain service device, which is used to forward transactions between the sub-blockchain network and the main blockchain network.
[0108] Step S103, performing cross-chain resource transfer processing between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request; the target main chain resource management contract address has the authority to receive the digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
[0109] Specifically, if the digital resources between the sub-blockchain network and the main blockchain network are not interoperable, the target object transfers the digital resources in the sub-blockchain network to the main blockchain network through the resource transfer service provider. In fact, the first digital resource in the sub-blockchain network is transferred from the target sub-chain resource management contract to the corresponding sub-chain resource flow management contract of the resource transfer service provider in the sub-chain. Then the resource transfer service provider transfers the second digital resource in the main chain that has a mapping relationship with the first digital resource from the main chain resource flow management contract to the target main chain resource management contract address.
[0110] Specifically, a feasible implementation method for performing cross-chain resource transfer processing between the target sub-chain resource management contract and the target main-chain resource management contract address according to the cross-chain resource transfer request can be as follows: generating a sub-chain resource transfer transaction according to the cross-chain resource transfer request, and sending the sub-chain resource transfer transaction to the sub-blockchain network, so that the sub-blockchain network transfers the first digital resource from the target sub-chain resource management contract address to the sub-chain resource flow management contract corresponding to the sub-chain resource flow management contract through the target sub-chain resource management contract after reaching a consensus on the sub-chain resource transfer transaction; the sub-chain resource flow management contract is a resource transfer service provider corresponding to the resource transfer service node in the sub-blockchain network. Resource management contract; when receiving the successful transfer result for the first digital resource, generate a main chain resource transfer transaction according to the cross-chain resource transfer request, and send the main chain resource transfer transaction to the main blockchain network, so that the main blockchain network can transfer the second digital resource from the main chain resource flow management contract address corresponding to the main chain resource flow management contract to the target main chain resource management contract address through the main chain resource flow management contract after reaching a consensus on the main chain resource transfer transaction; the main chain resource flow management contract is the resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the main blockchain network; the total resource value of the first digital resource is equal to the total resource value of the second digital resource. Among them, the implementation scenario of the cross-chain resource transfer processing can be referred to above Figure 2 The implementation process of the cross-chain points transfer process shown will not be repeated here.
[0111] Optionally, the resource transfer service node may receive a main chain resource transfer request for the target main chain resource management contract address, and then query the main chain contract creation status corresponding to the target main chain resource management contract address according to the main chain resource transfer request, and the main chain contract creation status is used to characterize the contract deployment status of the main blockchain network at the target main chain resource management contract address. If the main chain contract creation status is that the main chain contract is not created, the target main chain resource management contract address associated with the target object information is obtained, and a main chain resource management contract registration transaction is generated according to the target main chain resource management contract address, and the main chain resource management contract registration transaction is sent to the main blockchain network, so that the main blockchain network deploys the target main chain resource management contract at the target main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract registration transaction; when a successful deployment result for the target main chain resource management contract is received, the target main chain resource management contract is processed for main chain resource transfer according to the main chain resource transfer request.
[0112] Optionally, if the main chain contract creation status is the main chain contract created status, a main chain resource transfer transaction is generated according to the target main chain resource management contract address, and the main chain resource transfer transaction is sent to the main blockchain network, so that the main blockchain network executes the main chain resource transfer transaction through the target main chain resource management contract deployed at the target main chain resource management contract address after reaching a consensus on the main chain resource transfer transaction.
[0113] Through the method provided in the embodiment of the present application, a target main chain resource management contract address for storing digital resources in the main chain can be generated for the target object, that is, the target object can directly extract the digital resources in the sub-chain to the target main chain resource management contract address, without the need for the target object to spend resources to deploy the contract in the main blockchain network first, thereby saving the resources required to extract the sub-chain digital resources back to the main chain, and further improving the circulation of digital resources in the layered chain network.
[0114] For further information, see Figure 5 , Figure 5 It is a flow chart of a data processing method based on a layered chain network provided by an embodiment of the present application. The layered chain network includes a main blockchain network and a sub-blockchain network. The method can be executed by a resource transfer service node. The following will be described by taking the method executed by a resource transfer service node as an example, wherein the data processing method based on the layered chain network can at least include the following steps S201-S203:
[0115] Step S201, store the target main chain resource management contract address into the preset main chain resource management contract address set.
[0116] Specifically, the resource transfer service node generates the target main chain resource management contract address for the target object in order to prevent the target object from spending resources to deploy the target main chain resource management contract in advance without the need to manage the digital resources in the main chain. If the target object feels that it still needs to use the target main chain resource management contract in the future, it can send a contract batch registration request to the resource transfer service node through the target object terminal. When the resource transfer service node receives the contract batch registration request, it can store the target main chain resource management contract address in the preset main chain resource management contract address set. Among them, the preset main chain resource management contract address is used to store the main chain resource management contract address waiting to be deployed with the corresponding main chain resource management contract.
[0117] Step S202: perform batch registration verification on the preset main chain resource management contract address set to obtain a batch registration verification result.
[0118] Specifically, a feasible implementation process of performing address batch registration verification on the preset main chain resource management contract address set to obtain the address batch registration verification result can be: obtaining the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses; if the number of stored addresses is equal to the storage address number threshold, the address batch registration verification result is determined to be a verification pass result; if the number of stored addresses is less than the storage address number threshold, the address batch registration verification result is determined to be a verification failure result. Among them, the storage address number threshold can be set according to actual conditions, and this application is not limited here, and is used to characterize the number of addresses that the resource transfer service node can register at the same time. For example, the storage address number threshold can be 20. After the resource transfer service node stores the target main chain resource management contract address into the preset main chain resource management contract address set, it can determine the number of main chain resource management contract addresses in the preset main chain resource management contract address set at this time as the number of stored addresses. Assuming that the number of stored addresses is 20, it means that the current number of stored addresses has reached the preset registration number, and step S203 can be executed. If the number of stored addresses is 18, the resource transfer service node continues to wait for the next main chain resource management contract address to be stored in the preset main chain resource management contract address set, and then performs batch registration verification on the preset main chain resource management contract address set again.
[0119] Step S203: If the address batch registration verification result is a verification pass result, a main chain resource management contract batch registration transaction is generated according to the main chain resource management contract address included in the preset main chain resource management contract address set, and the main chain resource management contract batch registration transaction is sent to the main blockchain network.
[0120] Specifically, after the main blockchain network reaches consensus on batch registration transactions through the main chain resource management contract, the main chain resource management contract can be deployed separately on the main chain resource management contract address included in the preset main chain resource management contract address through the main chain registration contract.
[0121] Specifically, a main chain resource management contract batch registration transaction is generated according to the main chain resource management contract address included in the preset main chain resource management contract address set, and the main chain resource management contract batch registration transaction is sent to the main blockchain network. After the main blockchain network reaches a consensus on the main chain resource management contract batch registration transaction, the main chain resource management contract is deployed on the main chain resource management contract address included in the preset main chain resource management contract address through the main chain registration contract. A feasible implementation process can be as follows: the resource transfer service node generates a main chain resource management contract batch registration transaction according to the main chain resource management contract address included in the preset main chain resource management contract address set, and then sends the main chain resource management contract batch registration transaction to the main blockchain network. The main blockchain node can be any blockchain node in the main blockchain network. Then, after the main blockchain node verifies the batch registration transaction of the main chain resource management contract, it sends the batch registration transaction of the main chain resource management contract to the consensus node cluster in the main blockchain network. The consensus node cluster in the main blockchain network will process the batch registration transaction of the main chain resource management contract according to the consensus mechanism of the main blockchain network and obtain the consensus result. If the consensus result is a consensus passing node, the main blockchain node can call the main chain registration contract to execute the batch registration transaction of the main chain resource management contract, thereby deploying the main chain resource management contract on the main chain resource management contract address contained in the preset main chain resource management contract address. Among them, the main chain registration contract is a smart contract in the main blockchain network used to deploy the resource management contract in the main blockchain network.
[0122] By adopting the method provided in the embodiment of the present application, multiple main chain resource management contracts can be deployed in batches in the main blockchain network by using the consumed resources corresponding to sending a transaction (main chain resource management contract batch registration transaction). It is no longer necessary to initiate a separate transaction for the deployment of each main chain resource management contract, which can greatly save the consumed resources required for deploying multiple main chain resource management contracts.
[0123] For further information, see Figure 6 , Figure 6 It is a flow chart of a data processing method based on a layered chain network provided by an embodiment of the present application. The layered chain network includes a main blockchain network and a sub-blockchain network. The method can be executed by a resource transfer service node. The following will be described by taking the method executed by a resource transfer service node as an example, wherein the data processing method based on the layered chain network can at least include the following steps S301-S304:
[0124] Step S301, store the target main chain resource management contract address into the preset main chain resource management contract address set.
[0125] Specifically, the resource transfer service node generates the target main chain resource management contract address for the target object in order to prevent the target object from spending resources to deploy the target main chain resource management contract in advance without the need to manage the digital resources in the main chain. If the target object feels that it still needs to use the target main chain resource management contract in the future, it can send a contract batch registration request to the resource transfer service node through the target object terminal. When the resource transfer service node receives the contract batch registration request, it can store the target main chain resource management contract address in the preset main chain resource management contract address set. Among them, the preset main chain resource management contract address is used to store the main chain resource management contract address waiting to be deployed with the corresponding main chain resource management contract.
[0126] Step S302, continuously detecting the waiting time interval between the system time corresponding to the resource transfer service node and the historical address batch registration time; the historical address batch registration time is the time when the resource transfer service node generates a historical main chain resource management contract batch registration transaction.
[0127] Specifically, a feasible implementation method of continuous detection can be to determine the waiting time interval between the system time corresponding to the resource transfer service node and the historical address batch registration time every time the system time corresponding to the resource transfer service node changes. The waiting time interval can be considered as the time period between the system time and the historical address batch registration time. For example, if the system time is 16:25 and the historical address batch registration time is 16:10, the waiting time interval can be 15 minutes. Of course, the measurement unit can also be hours or seconds, which can be determined according to actual conditions.
[0128] Step S303, when it is detected that the waiting time interval reaches the address batch registration period, M main chain resource management contract addresses are obtained from the preset main chain resource management contract address set; M is a positive integer.
[0129] Specifically, the address batch registration cycle can be a preset time period. For example, the address batch registration cycle is 20 minutes. When the waiting time interval is also 20 minutes, it means that the waiting time interval reaches the address batch registration cycle, and M main chain resource management contract addresses can be obtained from the preset main chain resource management contract address set.
[0130] Specifically, a feasible implementation process for obtaining M main chain resource management contract addresses from a preset main chain resource management contract address set may be: obtaining the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses; if the number of stored addresses is less than or equal to the address batch registration number threshold, determining the main chain resource management contract addresses in the preset main chain resource management contract address set as the M main chain resource management contract addresses; if the number of stored addresses is greater than the address batch registration number threshold, obtaining priority main chain resource management contract addresses whose number is the address batch registration number threshold from the preset main chain resource management contract address set, and determining them as the M main chain resource management contract addresses; the time when the priority main chain resource management contract address is stored in the preset main chain resource management contract address set is earlier than the time when the remaining main chain resource management contract addresses are stored in the preset main chain resource management contract address set; the remaining main chain resource management contract addresses are the main chain resource management contract addresses in the preset main chain resource management contract address set excluding the priority main chain resource management contract addresses. Among them, the address batch registration quantity threshold can be set according to the actual situation, usually the maximum number of addresses that can be registered at the same time (referring to the deployment of the corresponding smart management contract on the address). When the main chain resource management contract address in the preset main chain resource management contract address set exceeds the address batch registration quantity threshold, only the main chain resource management contract address corresponding to the address batch registration quantity threshold can be obtained for registration. For example, the preset main chain resource management contract address set contains {address A1, address A2, address A3, address A4}. Assuming that the main chain resource management contract address stored in the preset main chain resource management contract address set later is located later, the address batch registration quantity threshold is 3, then the resource transfer service node can determine address A1, address A2, and address A3 as the priority main chain resource management contract address, because the storage time corresponding to address A4 is later than the other three addresses, so it can wait until the next cycle to register it. Optionally, if the number of stored addresses is greater than the address batch registration quantity threshold, the addresses in the preset main chain resource management contract address set can also be batch registered twice in this cycle.
[0131] Step S304: Generate a main chain resource management contract batch registration transaction based on the M main chain resource management contract addresses, and send the main chain resource management contract batch registration transaction to the main blockchain network.
[0132] Specifically, after the main blockchain network reaches consensus on batch registration transactions through the main chain resource management contract, the main chain resource management contract can be deployed on M main chain resource management contract addresses through the main chain registration contract.
[0133] Specifically, a main chain resource management contract batch registration transaction is generated according to the M main chain resource management contract addresses, and the main chain resource management contract batch registration transaction is sent to the main blockchain network. After the main blockchain network reaches a consensus on the main chain resource management contract batch registration transaction, the main chain resource management contract is deployed on the M main chain resource management contract addresses through the main chain registration contract. A feasible implementation process can be as follows: the resource transfer service node generates a main chain resource management contract batch registration transaction according to the M main chain resource management contract addresses, and then sends the main chain resource management contract batch registration transaction to the main blockchain node in the main blockchain network. The main blockchain node can As any blockchain node in the main blockchain network, after the main blockchain node verifies the batch registration transaction of the main chain resource management contract, it sends the batch registration transaction of the main chain resource management contract to the consensus node cluster in the main blockchain network. The consensus node cluster in the main blockchain network will process the batch registration transaction of the main chain resource management contract according to the consensus mechanism of the main blockchain network and obtain the consensus result; if the consensus result is a consensus passing node, the main blockchain node can call the main chain registration contract to execute the batch registration transaction of the main chain resource management contract, thereby deploying the main chain resource management contract on M main chain resource management contract addresses respectively. Among them, the main chain registration contract is a smart contract in the main blockchain network used to deploy the resource management contract in the main blockchain network.
[0134] By adopting the method provided in the embodiment of the present application, a transaction (main chain resource management contract batch registration transaction) can be sent regularly to deploy the corresponding main chain resource management contract for multiple main chain resource management contract addresses in the main blockchain network, which not only ensures time but also completes multiple main chain resource management contracts through the consumed resources spent on one transaction. It is no longer necessary to initiate a separate transaction for the deployment of each main chain resource management contract. Not only can the target main chain resource management contract be deployed for the target object within the tolerable period of the target object (usually longer than the address batch registration period), but also the consumed resources required for deploying the target main chain resource management contract can be saved.
[0135] For further information, see Figure 7 , Figure 7 This is a schematic diagram of the interactive process of digital resource management in a layered blockchain network provided by an embodiment of the present application. Figure 7 As shown in the figure, the entire interaction process involves the target object terminal, resource transfer service node, L2 blockchain network (i.e. the above-mentioned sub-blockchain network), L1 blockchain network (i.e. the above-mentioned main blockchain network) and blockchain bridge (i.e. the above-mentioned cross-chain relay). The interaction process of digital resource management in the entire layered blockchain network can be divided into the following three parts:
[0136] 1. L2 resource management contract deployment and generation of L1 resource management contract address:
[0137] Step S711: The target object terminal sends an L2 resource management contract registration request to the resource transfer service node.
[0138] Specifically, the L2 resource management contract registration request (i.e., the resource management contract registration request) is used to apply for registering a resource management contract for the target object associated with the target object terminal in the L2 blockchain network. The resource management contract is a tool for managing and storing the digital resources of the target object in the blockchain. For example, digital resources can be transferred to other objects based on the resource management contract, and digital resources transferred from other objects can be received based on the resource management contract.
[0139] In step S712, the resource transfer service node pre-calculates the L1 resource management contract address of the target object in the L1 blockchain network according to the L2 resource management contract registration request.
[0140] Specifically, the calculation process of the L1 resource management contract address can refer to the above formula (1). Optionally, step S712 can also be executed after step S715 is completed.
[0141] Step S713: The resource transfer service node sends a registration transaction for the target object to the L2 blockchain network.
[0142] Specifically, the registration transaction is used to instruct the L2 blockchain network to register the L2 resource management contract for the target object in the L2 blockchain network.
[0143] Step S714: After the L2 blockchain network reaches consensus on the registration transaction, it registers the L2 resource management contract for the target object.
[0144] Specifically, registering an L2 resource management contract for a target object can be to deploy an L2 resource management contract in the L2 blockchain network that only the target object has the right to call. It can be understood that the registration transaction contains a contract public key associated with the L2 resource management contract. When the L2 resource management contract is successfully deployed, the operation of calling the L2 resource management contract needs to be signed by the contract private key corresponding to the contract public key. Only after the signature is verified, the operation of calling the L2 resource management contract can be executed.
[0145] Step S715, the L2 blockchain network returns the L2 resource management contract address to the target object terminal associated with the target object.
[0146] Optionally, the L2 resource management contract address can be returned to the target object terminal by the resource transfer service node together with the L1 resource management contract address.
[0147] 2. The target object conducts digital resource transactions on the L2 chain:
[0148] Step S721: The target object terminal sends an L2 transaction request to the resource transfer service node.
[0149] Specifically, when the target object wants to perform resource storage, transfer and other operations in the L2 blockchain network through the resource transfer service provider, it can initiate an L2 transaction request to the resource transfer service provider, such as storing 500 target digital resources in the target object's L2 resource management contract.
[0150] Step S722: After receiving the L2 transaction request, the resource transfer service node may send an L2 transaction to the L2 blockchain network.
[0151] Specifically, this L2 transaction carries the private key signature information of the target object. This private key signature information can be carried in the L2 transaction request (the target object keeps the private key itself), or it can be signed by the resource transfer service node using the private key of the target object (the target object authorizes the resource transfer service node to save its own private key). It can be understood that when the L2 transaction consensus is carried out in the L2 blockchain network, the private key signature information will be decrypted with the public key corresponding to the target object. Only when the decryption is passed can the execution of the L2 transaction be agreed.
[0152] Step S723, after the L2 blockchain network reaches a consensus on the L2 transaction, it executes the L2 transaction and then returns the L2 transaction result to the resource transfer service node, which returns the L2 transaction result to the target object terminal.
[0153] Specifically, take the L2 transaction as an example to store 500 target digital resources in the L2 resource management contract of the target object. After the L2 transaction is successfully executed, the L2 resource management contract of the target object will have 500 target digital resources. However, it can be understood that the 500 target digital resources are transferred from the fund pool address of the resource transfer service provider in L2 (that is, the contract address corresponding to the above-mentioned sub-chain resource flow management contract) to the contract address of the L2 resource management contract. At this time, the fund pool of the resource transfer service provider in L1 has not changed.
[0154] In step S724, the L2 blockchain network will generate proof of transactions on the L2 chain in batches and send them to the blockchain bridge.
[0155] In step S725, the blockchain bridge forwards the received proof of the transaction on the L2 chain to the L1 blockchain network, and the L1 blockchain network processes the proof of the transaction on the L2 chain on the chain.
[0156] Specifically, it can be understood that the L2 sub-chain is built on the basis of the L1 main chain. Although the specific content of the transactions generated in the L2 blockchain network does not need to be stored in the L1 main chain, the L2 blockchain network will periodically generate a batch of transaction execution certificates, and then submit them to the L1 blockchain network for chaining in order to obtain the L1 blockchain network's recognition of this batch of transactions.
[0157] 3. The target object conducts resource transfer transactions on the L1 chain:
[0158] Step S731: The target object terminal sends an L1 resource transfer request to the resource transfer service node.
[0159] Specifically, the L1 resource transfer request is used to request to transfer the digital resources of the target object in the L1 blockchain network to other objects.
[0160] In step S732, the resource transfer service node may send an L1 transaction carrying the L1 resource management contract address to the L1 blockchain network.
[0161] Specifically, before sending the L1 resource transfer request, the target object may not have registered an L1 resource management contract in the L1 blockchain network, because the resource transfer service node has previously generated an L1 resource management contract address for it. Therefore, the target object can first store its digital resources in the L1 blockchain network in the L1 resource management contract address. Therefore, after receiving the target object's L1 resource transfer request, the resource transfer service node will first determine whether the target object has a corresponding L1 resource management contract in the L1 blockchain network. If the target object has not registered an L1 resource management contract in the L1 blockchain network, the resource transfer service node needs to send an L1 transaction carrying the L1 resource management contract address to the L1 blockchain network.
[0162] Step S733, after the L1 blockchain network passes the consensus of the L1 transaction, it needs to first create an L1 resource management contract according to the L1 resource management contract address.
[0163] Specifically, the contract address corresponding to the L1 resource management contract is the L1 resource management contract address. The L1 resource management contract can be used to manage the digital resources stored in the L1 resource management contract address.
[0164] Step S734, the L1 blockchain network executes the L1 transaction through the L1 resource management contract, transfers the digital resources stored in the L1 resource management contract address according to the instructions of the L1 transaction, and returns the L1 transaction result after the transfer is successful.
[0165] Through the method provided in the embodiment of the present application, the target object is allowed to use the registered L2 resource management contract on Layer2 (i.e., L2) to perform resource storage, transfer transactions and other operations before actually registering an L1 resource management contract of a certain address on Layer1 (i.e., L1), and extract the digital resources in the L2 resource management contract to the L1 resource management contract address for storage, so that the target object can transfer digital resources from L2 to L1 without spending the resources consumed by deploying the L1 resource management contract.
[0166] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a data processing device based on a layered chain network provided in an embodiment of the present application. The data processing device 1 based on a layered chain network can be a computer program (including program code) running on a computer device, for example, the data processing device is an application software; the data processing device 1 can be used to execute the corresponding steps in the data processing method provided in an embodiment of the present application. Figure 8 As shown, the data processing device 1 may include: a first receiving module 101, an address acquisition module 102 and a cross-chain transfer module 103.
[0167] The first receiving module 101 is used to receive a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information;
[0168] The address acquisition module 102 is used to acquire the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when determining that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information;
[0169] The cross-chain transfer module 103 is used to perform cross-chain resource transfer processing between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request; the target main chain resource management contract address has the authority to receive the digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
[0170] The specific implementation of the first receiving module 101, the address acquisition module 102 and the cross-chain transfer module 103 can be found in the above Figure 3 The specific description of step S101 to step S103 in the corresponding embodiment will not be repeated here.
[0171] Among them, the cross-chain transfer module 103 includes: a transfer-out unit 1031 and a transfer-in unit 1032.
[0172] The transfer-out unit 1031 is used to generate a sub-chain resource transfer transaction according to the cross-chain resource transfer request, and send the sub-chain resource transfer transaction to the sub-blockchain network, so that the sub-blockchain network transfers the first digital resource from the target sub-chain resource management contract address to the sub-chain resource flow management contract corresponding to the sub-chain resource flow management contract through the target sub-chain resource management contract after reaching a consensus on the sub-chain resource transfer transaction; the sub-chain resource flow management contract is a resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the sub-blockchain network;
[0173] The transfer-in unit 1032 is used to generate a main chain resource transfer-in transaction according to the cross-chain resource transfer request when receiving a successful transfer-out result for the first digital resource, and send the main chain resource transfer-in transaction to the main blockchain network, so that the main blockchain network transfers the second digital resource from the main chain resource flow management contract address corresponding to the main chain resource flow management contract to the target main chain resource management contract address through the main chain resource flow management contract after reaching a consensus on the main chain resource transfer-in transaction; the main chain resource flow management contract is a resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the main blockchain network; the total resource value of the first digital resource is equal to the total resource value of the second digital resource.
[0174] The specific implementation of the transfer-out unit 1031 and the transfer-in unit 1032 can refer to the above Figure 3 The specific description of step S103 in the corresponding embodiment will not be repeated here.
[0175] The data processing device 1 further includes: a first registration module 104 , a contract deployment module 105 , an address determination module 106 and a relationship recording module 107 .
[0176] The first registration module 104 is used to receive a resource management contract registration request sent by a target object terminal; the resource management contract registration request includes target object information, address public key and contract public key;
[0177] The contract deployment module 105 is used to generate a sub-chain resource management contract registration transaction according to the contract public key, and send the sub-chain resource management contract registration transaction to the sub-blockchain network, so that the sub-blockchain network can deploy the target sub-chain resource management contract in the sub-blockchain network through the sub-chain registration contract after reaching a consensus on the sub-chain resource management contract transaction;
[0178] The address determination module 106 is used to determine the target main chain resource management contract address according to the address public key and the main chain registration contract address corresponding to the main chain registration contract when receiving the deployment success result for the target sub-chain resource management contract;
[0179] The relationship recording module 107 is used to record the relationship between the target object information, the target main chain resource management contract address and the target sub-chain resource management contract.
[0180] The specific implementation of the first registration module 104, the contract deployment module 105, the address determination module 106 and the relationship recording module 107 can be found in the above Figure 3 The optional description of step S102 in the corresponding embodiment will not be repeated here.
[0181] The address determination module 106 includes: a bytecode generation unit 1061 and a hash unit 1062 .
[0182] The bytecode generation unit 1061 is used to generate the main chain resource management contract code to be deployed according to the address public key, and generate the bytecode to be deployed corresponding to the main chain resource management contract code to be deployed through the bytecode function;
[0183] A hash unit 1062, configured to perform hash processing on the bytecode to be deployed to obtain a first hash value;
[0184] The hash unit 1062 is also used to obtain the main chain registration contract address corresponding to the main chain registration contract, hash the first hash value, the main chain registration contract address and the random parameter to obtain the target main chain resource management contract address.
[0185] The specific implementation of the bytecode generation unit 1061 and the hash unit 1062 can be found in the above Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.
[0186] The data processing device 1 further includes: a first storage module 108 , a first verification module 109 and a second registration module 110 .
[0187] The first storage module 108 is used to store the target main chain resource management contract address into a preset main chain resource management contract address set;
[0188] The first verification module 109 is used to perform batch registration verification on the preset main chain resource management contract address set to obtain the batch registration verification result of the address;
[0189] The second registration module 110 is used to generate a main chain resource management contract batch registration transaction according to the main chain resource management contract address included in the preset main chain resource management contract address set if the address batch registration verification result is a verification pass result, and send the main chain resource management contract batch registration transaction to the main blockchain network, so that the main blockchain network deploys the main chain resource management contract on the main chain resource management contract addresses included in the preset main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
[0190] The specific implementation of the first storage module 108, the first verification module 109 and the second registration module 110 can be found in the above Figure 5 The specific description of steps S201 to S203 in the corresponding embodiment will not be repeated here.
[0191] The first verification module 109 includes: a quantity determination unit 1091 and a result determination unit 1092 .
[0192] The quantity determination unit 1091 is used to obtain the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses;
[0193] A result determination unit 1092, configured to determine that the address batch registration verification result is a verification pass result if the number of stored addresses is equal to a storage address number threshold;
[0194] The result determination unit 1092 is further configured to determine that the address batch registration verification result is a verification failure result if the number of stored addresses is less than a storage address number threshold.
[0195] The specific implementation of the quantity determination unit 1091 and the result determination unit 1092 can be found in the above Figure 5 The specific description of step S202 in the corresponding embodiment will not be repeated here.
[0196] The data processing device 1 further includes: a second storage module 111 , a second verification module 112 , a batch address acquisition module 113 and a third registration module 114 .
[0197] The second storage module 111 is used to store the target main chain resource management contract address into a preset main chain resource management contract address set;
[0198] The second verification module 112 is used to continuously detect the waiting time interval between the system time corresponding to the resource transfer service node and the historical address batch registration time; the historical address batch registration time is the time when the resource transfer service node generates the historical main chain resource management contract batch registration transaction;
[0199] The batch address acquisition module 113 is used to acquire M main chain resource management contract addresses from a preset main chain resource management contract address set when it is detected that the waiting time interval reaches the address batch registration period; M is a positive integer;
[0200] The third registration module 114 is used to generate a main chain resource management contract batch registration transaction according to the M main chain resource management contract addresses, and send the main chain resource management contract batch registration transaction to the main blockchain network, so that the main blockchain network can deploy the main chain resource management contract on the M main chain resource management contract addresses respectively through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
[0201] The specific implementation of the second storage module 111, the second verification module 112, the batch address acquisition module 113 and the third registration module 114 can be found in the above Figure 6 The specific description of steps S301 to S304 in the corresponding embodiment will not be repeated here.
[0202] The batch address acquisition module 113 includes: a quantity acquisition unit 1131 and an address acquisition unit 1132 .
[0203] The quantity acquisition unit 1131 is used to acquire the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses;
[0204] The address acquisition unit 1132 is used to determine the main chain resource management contract address in the preset main chain resource management contract address set as M main chain resource management contract addresses if the number of stored addresses is less than or equal to the address batch registration number threshold;
[0205] The address acquisition unit 1132 is also used to obtain priority main chain resource management contract addresses whose number is the address batch registration number threshold from the preset main chain resource management contract address set if the number of stored addresses is greater than the address batch registration number threshold, and determine them as M main chain resource management contract addresses; the time when the priority main chain resource management contract address is stored in the preset main chain resource management contract address set is earlier than the time when the remaining main chain resource management contract addresses are stored in the preset main chain resource management contract address set; the remaining main chain resource management contract addresses are the main chain resource management contract addresses in the preset main chain resource management contract address set excluding the priority main chain resource management contract addresses.
[0206] The specific implementation of the quantity acquisition unit 1131 and the address acquisition unit 1132 can be found in the above Figure 6 The specific description of step S303 in the corresponding embodiment will not be repeated here.
[0207] Among them, the above-mentioned data processing device 1 also includes: a main chain transfer module 115, a contract registration module 116 and a first transfer module 117.
[0208] The main chain transfer module 115 is used to receive a main chain resource transfer request for a target main chain resource management contract address, and query the main chain contract creation status corresponding to the target main chain resource management contract address according to the main chain resource transfer request; the main chain contract creation status is used to characterize the contract deployment status of the main blockchain network on the target main chain resource management contract address;
[0209] The contract registration module 116 is used to obtain the target main chain resource management contract address associated with the target object information if the main chain contract creation state is the main chain contract uncreated state, generate a main chain resource management contract registration transaction according to the target main chain resource management contract address, and send the main chain resource management contract registration transaction to the main blockchain network, so that the main blockchain network deploys the target main chain resource management contract on the target main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract registration transaction;
[0210] The first transfer module 117 is used to perform main chain resource transfer processing on the target main chain resource management contract according to the main chain resource transfer request when receiving the deployment success result for the target main chain resource management contract.
[0211] The specific implementation of the main chain transfer module 115, the contract registration module 116 and the first transfer module 117 can be found in the above Figure 3 The optional description of step S103 in the corresponding embodiment will not be repeated here.
[0212] The above data processing device 1 further includes: a second transfer module 118 .
[0213] The second transfer module 118 is used to generate a main chain resource transfer transaction according to the target main chain resource management contract address if the main chain contract creation status is the main chain contract created status, and send the main chain resource transfer transaction to the main blockchain network, so that the main blockchain network can execute the main chain resource transfer transaction through the target main chain resource management contract deployed at the target main chain resource management contract address after reaching a consensus on the main chain resource transfer transaction.
[0214] The specific implementation of the second transfer module 118 can be found in the above Figure 3 The optional description of step S103 in the corresponding embodiment will not be repeated here.
[0215] Among them, the cross-chain resource transfer request also includes the resource transfer quantity;
[0216] The above-mentioned data processing device 1 further includes: a numerical verification module 119 .
[0217] A value verification module 119 is used to query the resource storage value corresponding to the digital resource stored in the target subchain resource management contract associated with the target object;
[0218] The value verification module 119 is also used to call the address acquisition module 102 to obtain the target main chain resource management contract address associated with the target object information if the resource storage value is greater than or equal to the resource transfer value;
[0219] The value verification module 119 is also used to send a cross-chain resource transfer failure prompt message to the target object terminal if the resource storage value is less than the resource transfer value.
[0220] The specific implementation of the numerical verification module 119 can be found in the above Figure 3 The optional description of step S101 in the corresponding embodiment will not be repeated here.
[0221] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown above Figure 8 The data processing device 1 in the corresponding embodiment can be applied to a computer device 1000, and the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0222] In such Fig. 9In the computer device 1000 shown, the network interface 1004 can provide a network communication network element; 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 achieve:
[0223] Receive a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information;
[0224] Obtain the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when it determines that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information;
[0225] According to the cross-chain resource transfer request, cross-chain resource transfer processing is performed between the target sub-chain resource management contract and the target main chain resource management contract address; the target main chain resource management contract address has the authority to receive digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
[0226] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 , Figure 5 The description of the data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.
[0227] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, the computer program can execute the above-mentioned data processing device 1. Figure 3 , Figure 5 The description of the above data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0228] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0229] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above Figure 3 , Figure 5 A method provided by any corresponding embodiment.
[0230] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.
[0231] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0232] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of network elements in the above description. Whether these network elements are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0233] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method based on a layered chain network, characterized in that: The hierarchical chain network includes a main blockchain network and a sub-blockchain network; The main blockchain network is independent of the sub-blockchain network; The method is performed by a resource transfer service node; the method comprises: Receiving a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information; Obtaining the target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when determining that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information; According to the cross-chain resource transfer request, cross-chain resource transfer processing is performed between the target sub-chain resource management contract and the target main chain resource management contract address; the target main chain resource management contract address has the authority to receive digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer processing.
2. The method according to claim 1, characterized in that: The cross-chain resource transfer process is performed between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request, including: Generate a subchain resource transfer transaction according to the cross-chain resource transfer request, and send the subchain resource transfer transaction to the subchain blockchain network, so that the subchain blockchain network transfers the first digital resource from the target subchain resource management contract address to the subchain resource flow management contract corresponding to the subchain resource flow management contract through the target subchain resource management contract after reaching a consensus on the subchain resource transfer transaction; the subchain resource flow management contract is a resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the subchain blockchain network; When a successful transfer-out result for the first digital resource is received, a main chain resource transfer-in transaction is generated according to the cross-chain resource transfer request, and the main chain resource transfer-in transaction is sent to the main blockchain network, so that the main blockchain network transfers the second digital resource from the main chain resource flow management contract address corresponding to the main chain resource flow management contract to the target main chain resource management contract address through the main chain resource flow management contract after reaching a consensus on the main chain resource transfer-in transaction; the main chain resource flow management contract is the resource management contract of the resource transfer service provider corresponding to the resource transfer service node in the main blockchain network; the total resource value of the first digital resource is equal to the total resource value of the second digital resource.
3. The method according to claim 1, characterized in that Also includes: Receive a resource management contract registration request sent by a target object terminal; the resource management contract registration request includes target object information, address public key and contract public key; Generate a subchain resource management contract registration transaction according to the contract public key, and send the subchain resource management contract registration transaction to the sub-blockchain network, so that the sub-blockchain network deploys the target subchain resource management contract in the sub-blockchain network through the sub-chain registration contract after reaching a consensus on the sub-chain resource management contract transaction; When receiving the deployment success result for the target subchain resource management contract, determine the target mainchain resource management contract address according to the address public key and the mainchain registration contract address corresponding to the mainchain registration contract; Record the target object information, the target main chain resource management contract address, and the association relationship between the target sub-chain resource management contract.
4. The method according to claim 3, characterized in that: The determining the target main chain resource management contract address according to the address public key and the main chain registration contract address corresponding to the main chain registration contract includes: Generate the main chain resource management contract code to be deployed according to the address public key, and generate the bytecode to be deployed corresponding to the main chain resource management contract code to be deployed through the bytecode function; Performing hash processing on the bytecode to be deployed to obtain a first hash value; Obtain the main chain registration contract address corresponding to the main chain registration contract, perform hash processing on the first hash value, the main chain registration contract address and the random parameter, and obtain the target main chain resource management contract address.
5. The method according to claim 1, characterized in that Also includes: Store the target main chain resource management contract address into the preset main chain resource management contract address set; Performing batch registration verification on the preset main chain resource management contract address set to obtain a batch registration verification result; If the address batch registration verification result is a verification pass result, a main chain resource management contract batch registration transaction is generated according to the main chain resource management contract address included in the preset main chain resource management contract address set, and the main chain resource management contract batch registration transaction is sent to the main blockchain network, so that the main blockchain network deploys the main chain resource management contract on the main chain resource management contract address included in the preset main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
6. The method according to claim 5, characterized in that The performing of address batch registration verification on the preset main chain resource management contract address set to obtain the address batch registration verification result includes: Obtain the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses; If the number of stored addresses is equal to the storage address number threshold, determining that the address batch registration verification result is a verification pass result; If the number of stored addresses is less than the storage address number threshold, it is determined that the address batch registration verification result is a verification failure result.
7. The method according to claim 1, characterized in that Also includes: Store the target main chain resource management contract address into the preset main chain resource management contract address set; Continuously detect the waiting time interval between the system time corresponding to the resource transfer service node and the historical address batch registration time; the historical address batch registration time is the time when the resource transfer service node generates the historical main chain resource management contract batch registration transaction; When it is detected that the waiting time interval reaches the address batch registration period, M main chain resource management contract addresses are obtained from the preset main chain resource management contract address set; M is a positive integer; Generate a main chain resource management contract batch registration transaction according to the M main chain resource management contract addresses, and send the main chain resource management contract batch registration transaction to the main blockchain network, so that the main blockchain network deploys the main chain resource management contracts on the M main chain resource management contract addresses respectively through the main chain registration contract after reaching a consensus on the main chain resource management contract batch registration transaction.
8. The method according to claim 7, characterized in that The obtaining M main chain resource management contract addresses from the preset main chain resource management contract address set includes: Obtain the number of main chain resource management contract addresses in the preset main chain resource management contract address set as the number of stored addresses; If the number of stored addresses is less than or equal to the address batch registration number threshold, the main chain resource management contract address in the preset main chain resource management contract address set is determined as M main chain resource management contract addresses; If the number of stored addresses is greater than the address batch registration number threshold, then obtain the priority main chain resource management contract addresses whose number is the address batch registration number threshold from the preset main chain resource management contract address set, and determine them as M main chain resource management contract addresses; the time when the priority main chain resource management contract address is stored in the preset main chain resource management contract address set is earlier than the time when the remaining main chain resource management contract addresses are stored in the preset main chain resource management contract address set; the remaining main chain resource management contract address is the main chain resource management contract address in the preset main chain resource management contract address set excluding the priority main chain resource management contract address.
9. The method according to claim 1, characterized in that: Also includes: Receive a main chain resource transfer request for the target main chain resource management contract address, and query the main chain contract creation status corresponding to the target main chain resource management contract address according to the main chain resource transfer request; The main chain contract creation status is used to characterize the contract deployment status of the main blockchain network on the target main chain resource management contract address; If the main chain contract creation state is the main chain contract uncreated state, then obtain the target main chain resource management contract address associated with the target object information, generate a main chain resource management contract registration transaction according to the target main chain resource management contract address, and send the main chain resource management contract registration transaction to the main blockchain network, so that the main blockchain network deploys the target main chain resource management contract on the target main chain resource management contract address through the main chain registration contract after reaching a consensus on the main chain resource management contract registration transaction; When a deployment success result for the target main chain resource management contract is received, the target main chain resource management contract is processed for main chain resource transfer according to the main chain resource transfer request.
10. The method according to claim 9, characterized in that Also includes: If the main chain contract creation status is the main chain contract created status, a main chain resource transfer transaction is generated according to the target main chain resource management contract address, and the main chain resource transfer transaction is sent to the main blockchain network, so that the main blockchain network executes the main chain resource transfer transaction through the target main chain resource management contract deployed at the target main chain resource management contract address after reaching a consensus on the main chain resource transfer transaction.
11. The method according to claim 1, characterized in that: The cross-chain resource transfer request also includes a resource transfer value; The method further comprises: Query the resource storage value corresponding to the digital resource stored in the target subchain resource management contract associated with the target object; If the resource storage value is greater than or equal to the resource transfer value, then executing the step of obtaining the target main chain resource management contract address associated with the target object information; If the resource storage value is less than the resource transfer value, a cross-chain resource transfer failure prompt message is sent to the target object terminal.
12. A data processing device based on a layered chain network, characterized in that: The hierarchical chain network includes a main blockchain network and a sub-blockchain network; The main blockchain network is independent of the sub-blockchain network; The device is run by a resource transfer service node; the device comprises: A first receiving module is used to receive a cross-chain resource transfer request sent by a target object terminal; the cross-chain resource transfer request includes target object information; An address acquisition module is used to acquire a target main chain resource management contract address associated with the target object information; the target main chain resource management contract address is generated by the resource transfer service node when determining that the target sub-chain resource management contract associated with the target object information is successfully deployed in the sub-blockchain network; the main chain ownership of the digital resources stored on the target main chain resource management contract address belongs to the target object information; A cross-chain transfer module is used to perform cross-chain resource transfer processing between the target sub-chain resource management contract and the target main chain resource management contract address according to the cross-chain resource transfer request; the target main chain resource management contract address has the authority to receive digital resources transferred from the target sub-chain resource management contract address corresponding to the target sub-chain resource management contract during the cross-chain resource transfer process.
13. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the method described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 can be performed.
Citation Information
Cited By
Resource transfer control method and related device
CN121724763A