Transaction processing method and device, electronic equipment and storage medium
By using smart contract accounts to associate multiple transaction objects in blockchain transactions and transferring the ownership of these objects in transaction requests, the problem of handling multiple transaction objects is solved, and a more flexible, convenient and secure transaction process is achieved.
Patent Information
- Application Number
- CN202311306341.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2025-04-11
AI Technical Summary
In the transaction process based on blockchain technology, users need to initiate multiple transactions to process multiple transaction objects, resulting in reduced transaction flexibility and convenience and increased transaction costs.
By obtaining the association requests corresponding to multiple transaction objects, obtain the smart contract account for association, and associate multiple transaction objects with the smart contract account respectively. Then, receive the transaction request, find the smart contract corresponding to the smart contract account, and transfer the ownership rights of multiple transaction objects to the object corresponding to the transaction request to the account according to the smart contract.
It realizes the transfer of multiple transaction objects in a single transaction, improves the flexibility and convenience of transactions, reduces transaction costs, and improves the security of transactions through smart contracts.
Smart Images

Figure CN119809627A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically, to a transaction processing method and device, electronic equipment, storage medium, and program product. Background Art
[0002] With the development of blockchain technology, blockchain technology is being applied to more and more fields. In order to improve the security of transactions, transactions are usually conducted based on blockchain technology in related technologies.
[0003] Related technology: In the process of transactions based on blockchain technology, if a user needs to trade multiple transaction objects, multiple transactions need to be initiated, which reduces the flexibility and convenience of the transaction and increases the transaction cost. Summary of the invention
[0004] The embodiments of the present application provide a transaction processing method and device, electronic device, storage medium, and program product, which can improve the flexibility and convenience of transactions and reduce transaction costs.
[0005] According to one aspect of an embodiment of the present application, a transaction processing method is provided, the method comprising:
[0006] According to association requests corresponding to the multiple transaction objects, obtain a smart contract account for association, and associate the multiple transaction objects with the smart contract account respectively;
[0007] Receiving a transaction request for any transaction object among the multiple transaction objects, and searching for a smart contract corresponding to the smart contract account according to the transaction request;
[0008] According to the smart contract corresponding to the smart contract account, the ownership of the multiple transaction objects is transferred to the object transfer-in account corresponding to the transaction request.
[0009] According to one aspect of an embodiment of the present application, a transaction processing method is provided, the method comprising:
[0010] Generate association requests corresponding to multiple transaction objects, and send the association requests to a blockchain node, so that the blockchain node obtains a smart contract account for association according to the association request, and associates the multiple transaction objects with the smart contract account respectively;
[0011] Generate a transaction request corresponding to any transaction object among the multiple transaction objects, and send the transaction request to the blockchain node, so that the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the found smart contract.
[0012] According to one aspect of an embodiment of the present application, a transaction processing device is provided, the device comprising:
[0013] An association module, configured to obtain a smart contract account for association according to association requests corresponding to a plurality of transaction objects, and associate the plurality of transaction objects with the smart contract account respectively;
[0014] A receiving module, configured to receive a transaction request for any transaction object among the multiple transaction objects, and search for a smart contract corresponding to the smart contract account according to the transaction request;
[0015] The transfer module is configured to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account.
[0016] In an exemplary embodiment, based on the aforementioned solution, the association module is specifically configured to: transfer the transaction object from the account to which the transaction object belongs to the smart contract account; or write the identification information of the transaction object into the smart contract account.
[0017] In an exemplary embodiment, based on the above solution, the transfer module is specifically configured to: search for a first transaction object that has not been transferred to the smart contract account from the multiple transaction objects;
[0018] Obtaining the authorization request corresponding to the first transaction object found, and authorizing the smart contract account according to the authorization request to obtain authorization data;
[0019] According to the smart contract corresponding to the smart contract account and the authorization data, the smart contract to which the first transaction object belongs is called to transfer the first transaction object from the account to which the first transaction object belongs to the object transfer-in account.
[0020] In an exemplary embodiment, based on the above solution, the transfer module is specifically configured to: search for a second transaction object that has been transferred to the smart contract account from the multiple transaction objects;
[0021] According to the smart contract corresponding to the smart contract account, the smart contract to which the second transaction object belongs is called to transfer the second transaction object from the smart contract account to the object transfer-in account.
[0022] In an exemplary embodiment, based on the aforementioned solution, the device further includes an updating module configured to: update the controller of the smart contract account to the object transfer account.
[0023] In an exemplary embodiment, based on the aforementioned scheme, the transfer module is specifically configured as follows: if the multiple transaction objects have all been transferred to the smart contract account, the controller of the smart contract account is updated to the transaction transfer-in account to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request.
[0024] In an exemplary embodiment, based on the aforementioned scheme, under the condition that the target transaction object is included in the multiple transaction objects and the controller of the smart contract account is the account to which the target transaction object belongs, the transfer module is specifically configured as follows: according to the smart contract corresponding to the smart contract account, the transaction initiating account corresponding to the transaction request is obtained; if the transaction initiating account matches the controller of the smart contract account, and any of the transaction objects matches the target transaction object, the ownership of the multiple transaction objects is transferred to the object transfer-in account.
[0025] In an exemplary embodiment, based on the aforementioned scheme, the transfer module is specifically configured as follows: if the transaction initiating account matches the controller of the smart contract account, and any transaction object does not match the target transaction object, then any transaction object is transferred to the object transfer-in account.
[0026] In an exemplary embodiment, based on the aforementioned scheme, the association module is specifically configured to: search for the account to which the target transaction object belongs according to the association request corresponding to the target transaction object; create the smart contract account according to the account to which the target transaction object belongs, and associate the target transaction object with the smart contract account.
[0027] In an exemplary embodiment, based on the aforementioned scheme, the association module is specifically configured as follows: obtaining the smart contract type to which the target transaction object belongs; if the smart contract type matches the set smart contract type, creating the smart contract account, and setting the account to which the target transaction object belongs as the controller of the smart contract account; re-searching the account to which the target transaction object belongs; if the re-found account matches the controller of the smart contract account, associating the target transaction object to the smart contract account.
[0028] In an exemplary embodiment, based on the aforementioned scheme, under the condition that the multiple transaction objects also include other transaction objects other than the target transaction object, the association module is specifically configured as follows: according to the association request corresponding to the other transaction object, obtain the account to which the other transaction object belongs and the initiating account of the association request corresponding to the other transaction object; if the account to which the other transaction object belongs matches the controller of the smart contract account, and the initiating account matches the controller of the smart contract account, then associate the other transaction object with the smart contract account.
[0029] According to one aspect of an embodiment of the present application, a transaction processing device is provided, the device comprising:
[0030] An association request module, configured to generate association requests corresponding to a plurality of transaction objects, and send the association requests to a blockchain node, so that the blockchain node obtains a smart contract account for association according to the association request, and associates the plurality of transaction objects with the smart contract account respectively;
[0031] The transaction request module is configured to generate a transaction request corresponding to any transaction object among the multiple transaction objects, and send the transaction request to the blockchain node, so that the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the found smart contract.
[0032] According to one aspect of an embodiment of the present application, there is provided an electronic device, including:
[0033] one or more processors;
[0034] The storage device is used to store one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device implements the transaction processing method as described above.
[0035] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device implements the transaction processing method as described above.
[0036] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the transaction processing method as described above is implemented.
[0037] In the technical solution provided in the embodiments of the present application, a smart contract account for association can be obtained according to association requests corresponding to multiple transaction objects, so as to associate multiple transaction objects with the smart contract accounts respectively; then, a transaction request for any transaction object among the multiple transaction objects is received to find the smart contract corresponding to the smart contract account according to the transaction request, so as to transfer the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the smart contract corresponding to the smart contract account. Compared with the related art, multiple transaction objects are first associated with the smart contract account, so as to realize the transfer of multiple transaction objects in one transaction based on the smart contract corresponding to the smart contract account, thereby improving the flexibility and convenience of transactions, reducing transaction costs, and realizing transactions through smart contracts, thereby improving the security of transactions.
[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a schematic diagram of an implementation environment shown in an exemplary embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of the connection relationship between blocks in the blockchain;
[0041] Figure 3 is a flow chart of a transaction processing method shown in an exemplary embodiment of the present application;
[0042] Figure 4 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0043] Figure 5 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0044] Figure 6 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0045] Figure 7 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0046] Figure 8 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0047] Fig. 9 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0048] Fig.10is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0049] Fig.11 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0050] Fig.12 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0051] Fig.13 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0052] Fig.14 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0053] Fig.15 is a flow chart of a transaction processing method shown in another exemplary embodiment of the present application;
[0054] Fig.16 is a block diagram of a transaction process shown in an exemplary embodiment of the present application;
[0055] Fig.17 is a structural schematic diagram of a transaction processing device shown in another exemplary embodiment of the present application;
[0056] Fig.18 is a structural schematic diagram of a transaction processing device shown in another exemplary embodiment of the present application;
[0057] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0058] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0059] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0060] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0061] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0062] The technical solution of the embodiment of the present application specifically relates to blockchain technology. The technical solution of the embodiment of the present application is described in detail below:
[0063] Related technology: In some trading platforms built on blockchain technology, users can only call one smart contract at a time to initiate a transaction for one transaction object, so that one transaction can only be used for one transaction object. For example, in related technology, the issuance and transfer of NFT (Non-Fungible Token) is usually implemented based on Ethereum's ERC721 protocol. The main code for implementing the transfer is as follows, where the following code is first used to determine whether the NFT to be transferred belongs to the "from" account:
[0064] Require(ERC721.ownerOf(tokenId)==from,"ERC721:transferfromincorrect owner")
[0065] Then use the following code to reduce the amount of NFT data in the "from" account by 1 and increase the number of NFTs in the "to" account by 1, thereby transferring the NFT corresponding to the tokenId (token identification number) to the "to" account.
[0066] _balances[from] -= 1;
[0067] _balances[to]+=1;
[0068] In this transaction mode, only one NFT can be transferred at a time. If the user needs to transfer multiple transaction objects, multiple transactions need to be initiated, which reduces the flexibility and convenience of the transaction. In addition, since each transaction may require a certain handling fee, initiating multiple transactions requires paying the corresponding handling fees for multiple transactions, which increases the transaction cost. Based on this, the embodiments of the present application provide a transaction processing method and device, electronic device, storage medium, and program product, which can improve the flexibility and convenience of transactions and reduce transaction costs.
[0069] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in the present application, which includes a client 110 and a blockchain network.
[0070] Among them, the client 110 can be deployed on terminal devices such as smart phones, tablet computers, laptops, desktop computers, smart speakers, smart watches, car terminals, flying chess, etc.
[0071] The blockchain network includes multiple blockchain nodes 120 (any form of computing devices connected to the blockchain network, such as servers, user terminals, etc.), and the nodes form a peer-to-peer network. The peer-to-peer protocol is an application layer protocol running on the Transmission Control Protocol (TCP). In the blockchain network, any machine such as a server or terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0072] See also Figure 1 The functions of each node in the blockchain system shown include:
[0073] 1) Routing: a basic function of a node, used to support communication between nodes.
[0074] In addition to the routing function, the node can also have the following functions:
[0075] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0076] For example, the services implemented by the application include:
[0077] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify the transaction, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;
[0078] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.
[0079] 2.3) Smart contracts are computerized protocols that can execute the terms of a smart contract. They are implemented through codes deployed on a shared ledger that are executed when certain conditions are met. According to actual business needs, the codes are used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer, and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing smart contracts for transactions, but can also execute smart contracts for processing received information.
[0080] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0081] See also Figure 2 , Figure 2 This is an optional schematic diagram of the block structure provided by an embodiment of the present invention. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0082] In an optional implementation, a user may initiate association requests corresponding to multiple transaction objects in the blockchain network through the client 110, so that the blockchain node 120 obtains the smart contract account used for association according to the association request, and associates the multiple transaction objects with the smart contract account respectively; after the association, the user may initiate a transaction request for any of the multiple transaction objects in the blockchain network through the client 110, so that the blockchain node 120 searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account. Compared with the related technology, it realizes the transfer of multiple transaction objects in one transaction, improves the flexibility and convenience of the transaction, reduces the transaction cost, and realizes the transaction through the smart contract, which improves the security of the transaction.
[0083] It should be noted that this application involves user-related data such as accounts and transaction objects. When the methods of this application are applied to specific products or technologies, the user's permission or consent must be obtained, and the extraction, use and processing of relevant data must comply with local security standards and local laws and regulations.
[0084] See also Figure 3 , Figure 3 is a flowchart of a transaction processing method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0085] like Figure 3 As shown, in an exemplary embodiment, the transaction processing method may include steps S310-S330, which are described in detail as follows:
[0086] Step S310: According to the association requests corresponding to the multiple transaction objects, a smart contract account for association is obtained, and the multiple transaction objects are respectively associated with the smart contract account.
[0087] It should be noted that the transaction object refers to an object that can be traded as a commodity on the Internet, including but not limited to at least one of pictures, songs, game props, videos, NFTs, etc. Among them, NFT is a digital asset that can use blockchain technology to generate digital certificate changes for specific works, artworks, commodities, etc., and realize digital distribution, purchase, collection, use and trading on the basis of protecting their digital copyrights. Among them, NFT can be issued based on protocols such as ERC721.
[0088] A smart contract refers to a computer program stored on the blockchain that can automatically execute the terms of the smart contract. It has features such as event-driven, value transfer, and automatic execution.
[0089] An account is an address used to represent a user's identity, which can be used to store the user's assets (for example, transaction objects), similar to a wallet. In a blockchain network, there are usually two types of accounts. One is an EOA (Externally Owned Account), which is an address controlled by a private key. This address can be used to store assets, and users can initiate transactions for assets in the account based on the private key. The other is a smart contract account, which is a special smart contract. The smart contract address can be used to store assets, and the controller of the account can initiate transactions for the assets stored in the account.
[0090] In order to transfer multiple transaction objects in one transaction, an association request for multiple transaction objects can be initiated in the blockchain network. After receiving the association request, the blockchain node can obtain the smart contract account and associate multiple transaction objects with the smart contract account respectively to associate multiple transaction objects. The association request can be initiated by the user or automatically initiated by the relevant program when the conditions are met.
[0091] Among them, an association request can be initiated for each transaction object, and each association request contains the identification information of a transaction object, so as to associate the corresponding transaction object with the smart contract account according to the association request; or, an association request can be initiated for multiple transaction objects, and the association request contains the identification information of multiple transaction objects, so as to associate multiple transaction objects with the smart contract account according to the association request. Among them, the identification information of the transaction object refers to the information that can uniquely identify the transaction object. For example, for NFT, its identification information can be tokenId (token identification number).
[0092] The specific method of associating the transaction object with the smart contract account can be flexibly set according to actual needs. In an optional example, the identification information of the transaction object can be written into the smart contract account; or, in another optional example, the transaction object can be transferred from the account to which the transaction object belongs to the smart contract account. For details, please refer to the subsequent records and will not be repeated here.
[0093] Optionally, before the association is made, the blockchain node may also authenticate the association request to determine whether the initiator of the association request has the authority to associate the transaction object. If the authority is available, the association request is responded to so as to associate the transaction object with the smart contract account. If the authority is not available, the association request is rejected. Among them, the initiator of the association request may be determined to have the authority to associate the transaction object under the condition that the initiator of the association request matches the account to which the transaction object belongs, or the initiator of the association request has the authorization of the account to which the transaction object belongs. It should be noted that the specific method of verifying whether the initiator of the association request has the authority can be flexibly set according to actual needs. In an optional example, the association request may include signature data generated based on a private key. The blockchain node may search for the public key corresponding to the account to which the transaction object belongs, and verify the signature data based on the public key. If the verification is successful, it indicates that the initiator of the association request has the authority; if the verification fails, it indicates that the initiator of the association request does not have the authority.
[0094] S320, receiving a transaction request for any transaction object among multiple transaction objects, and searching for a smart contract corresponding to the smart contract account according to the transaction request.
[0095] After multiple transaction objects are respectively associated with the same smart contract account, a transaction request for any of the multiple transaction objects can be initiated in the blockchain network. When the blockchain node receives the transaction request, it searches for the smart contract corresponding to the smart contract account associated with the transaction object in the transaction request to conduct transactions based on the smart contract.
[0096] The transaction request may include the identification information of any transaction object, so that the blockchain node can determine the transaction object that needs to be traded based on the identification information; optionally, the transaction request may also include the identification information of the smart contract corresponding to the smart contract account (for example, the smart contract address, etc.), so that the blockchain node can call the smart contract for executing the transaction based on the identification information of the smart contract.
[0097] S330, according to the smart contract corresponding to the smart contract account, the ownership of multiple transaction objects is transferred to the object transfer-in account corresponding to the transaction request.
[0098] The object transfer account is the account used to receive the transaction object in the transaction request. Its account type can be EOA or smart contract account.
[0099] After finding the smart contract corresponding to the smart contract account, the blockchain node can call the smart contract to transfer the ownership of multiple transaction objects to the object transfer-in account corresponding to the transaction request, so that the object transfer-in account can control multiple transaction objects, thereby completing the transaction of multiple transaction objects in one transaction through the smart contract account and the smart contract corresponding to the smart contract account.
[0100] The specific method of transferring the ownership of multiple transaction objects to the object transfer-in account can be flexibly set according to actual needs. In an optional example, multiple transaction objects can be transferred to the object transfer-in account; or, if multiple transaction objects have all been transferred to the smart contract account, the object transfer-in account can also be set as the controller of the smart contract account, so that the object transfer-in account has the control right of the smart contract account, and thus has the ownership of multiple transaction objects.
[0101] It should be noted that after receiving a transaction request for any one of multiple transaction objects, the smart contract corresponding to the smart contract account can be directly called to transfer the multiple transaction objects; or, a designated transaction object can be selected from multiple transaction objects, and only when any transaction object is the designated transaction object, the smart contract corresponding to the smart contract account can be called to transfer the multiple transaction objects.
[0102] exist Figure 3 In the embodiment shown, multiple transaction objects are first associated with a smart contract account. In this way, a user only needs to initiate a transaction request for one transaction object to transfer multiple transaction objects in one transaction based on the smart contract corresponding to the smart contract account, thereby improving the flexibility and convenience of transactions, reducing transaction costs, and realizing transactions through smart contracts, thereby improving the security of transactions.
[0103] In an exemplary embodiment, see Figure 4 , Figure 4 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0104] like Figure 4 As shown, the method includes steps S410 to S430, and steps S320 to S330, wherein steps S410 to S430 are described in detail as follows:
[0105] Step S410: Obtain a smart contract account for association according to association requests corresponding to multiple transaction objects.
[0106] After receiving the association request, the blockchain node can obtain the smart contract account used for association. The smart contract account can be created based on the association request after receiving the association request; or it can be a smart contract account in the created smart contract account, the corresponding smart contract of which can realize the transfer of ownership of multiple transaction objects to the object transfer account corresponding to the transaction request in one transaction. In order to ensure the reliability of the transaction, the smart contract account is not associated with any object other than multiple transaction objects.
[0107] Step S420: Transfer the transaction object from the account to which the transaction object belongs to the smart contract account.
[0108] In order to associate the transaction object with the smart contract account, the transaction object can be directly transferred from the account to which it belongs to the smart contract account.
[0109] Step S430, write the identification information of the transaction object into the smart contract account.
[0110] In order to associate the transaction object with the smart contract account, the identification information of the transaction object can also be written into the smart contract account.
[0111] Optionally, the identification information of the transaction object and the identification information of the smart contract to which the transaction object belongs can also be written into the smart contract account. Among them, the smart contract to which the transaction object belongs refers to the smart contract used to issue the transaction object. The smart contract records the information related to the transaction object and the account to which the transaction object belongs. Through the smart contract, the account to which the transaction object belongs can be changed, thereby realizing the transfer of the transaction object. Therefore, the identification information of the smart contract to which the transaction object belongs is written into the smart contract account, so that the smart contract corresponding to the smart contract account can quickly call the smart contract to which the transaction object belongs with the identification information, thereby realizing the transfer of the transaction object.
[0112] It should be noted that in Figure 4 In the embodiment shown, two methods of managing transaction objects and smart contract accounts are provided. For multiple transaction objects, all of them can adopt the first association method (i.e., the association method corresponding to step S420), or all of them can adopt the second association method (i.e., the association method corresponding to step S430), or some of the transaction objects can adopt the first association method and some of the transaction objects can adopt the second association method. The specific association method can be flexibly set according to actual needs, or it can be marked in the association request corresponding to the transaction object, so as to select the corresponding association method according to the association request.
[0113] in, Figure 4 The specific implementation details of steps S320 to S330 shown in FIG. Figure 3 Steps S320 to S330 shown are not repeated here.
[0114] exist Figure 4 In the illustrated embodiment, the association between the transaction object and the smart account is achieved by transferring the transaction object to the smart contract account, or by writing the identification information of the transaction object into the smart contract account, thereby improving the flexibility of the association.
[0115] In an exemplary embodiment, see Figure 5 , Figure 5 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0116] like Figure 5 As shown, the method includes steps S410 to S430, step S320, and steps S510 to S530, wherein steps S510 to S530 are described in detail as follows:
[0117] Step S510, searching for a first transaction object that has not been transferred to the smart contract account from multiple transaction objects.
[0118] The first transaction object refers to a transaction object that has not been transferred to the smart contract account among multiple transaction objects. For example, if there is a transaction object associated with the second association method among multiple transaction objects, then the transaction object is the first transaction object.
[0119] Since the first transaction object does not belong to the smart contract account, the smart contract account does not have the authority to transfer it. Therefore, it is necessary to find the first transaction object from multiple transaction objects.
[0120] Step S520, obtaining the authorization request corresponding to the first transaction object found, and authorizing the smart contract account according to the authorization request to obtain authorization data.
[0121] The authorization request is used to request authorization for the smart contract account so that the smart contract account has the authority to transfer the first transaction object. The blockchain node can authorize the smart contract account according to the authorization request and obtain authorization data, wherein the authorization data is used to indicate that the smart contract account has the authority to transfer the first transaction object.
[0122] The authorization data can be written into the smart contract to which the first transaction object belongs, so that the smart contract corresponding to the smart contract account can call the smart contract to which the first transaction object belongs. Optionally, the authorization function in the smart contract to which the first transaction object belongs can be called to implement the authorization of the smart contract account, wherein the authorization function can be the approve function. For example, assuming that the transaction object is NFT, authorization can be performed by executing the approve(address_approved, uint256_tokenId) function, wherein _approved represents the authorized address, and tokenId represents the corresponding authorized NFT token identification number.
[0123] Optionally, the authorization process can be performed after receiving the transaction request; or, the authorization process can be performed during the association process. For example, an authorization request can be added to the association request corresponding to the first transaction object, so that the blockchain node associates the first transaction object with the smart contract account according to the association request and authorizes the smart contract account.
[0124] Step S530: According to the smart contract corresponding to the smart contract account and the authorization data, the smart contract to which the first transaction object belongs is called to transfer the first transaction object from the account to which the first transaction object belongs to the object transfer-in account.
[0125] After authorization, the smart contract account has the authority to transfer the first transaction object. Therefore, the smart contract corresponding to the smart contract account can call the smart contract to which the first transaction object belongs based on the authorization data. After the smart contract to which the first transaction object belongs verifies that the smart contract account has the authority to transfer the first transaction object based on the authorization data, the account to which the first transaction object belongs is updated to the object transfer-in account to transfer the first transaction object to the object transfer-in account.
[0126] Optionally, the smart contract to which the first transaction object belongs may include a transfer function for transferring the transaction object, and the transfer function may be called to realize the transfer of the first transaction object. During the transfer process, the identification information of the first transaction object, the account to which the first transaction object belongs before the transfer, and the account to which the first transaction object belongs after the transfer may be input into the transfer function, so that the transfer function realizes the transfer of the first transaction object according to the input parameters. For example, the transfer function may be a transferFrom() function. Assuming that the first transaction object is an NFT, after inputting the parameters, the transfer function is transferFrom(address_from, address_to, uint256_tokenId), where _from is the account to which the NFT belongs before the transfer, _to is the account to which the NFT belongs after the transfer (i.e., the object transfer account), tokenId is the token identification number of the NFT to be transferred, and uint256 represents the data type corresponding to _tokenId.
[0127] It should be noted that Figure 5 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Figure 5 The specific implementation details of steps S410 to S430 shown in FIG. Figure 4 Steps S410 to S430 shown are not repeated here.
[0128] exist Figure 5 In the illustrated embodiment, for the first transaction object that has not been transferred to the smart contract account during the association process, the smart contract account can be authorized first, so that during the transaction process, the smart contract corresponding to the smart contract account can call the smart contract to which the first transaction object belongs based on the authorization data to transfer the first transaction object, thereby improving transaction security while ensuring the convenience and flexibility of the transaction.
[0129] In an exemplary embodiment, see Figure 6 , Figure 6 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0130] like Figure 6 As shown, the method includes steps S410 to S430, step S320, step S510 to S530, and step S610 to S620, wherein the detailed description of steps S610 to S620 is as follows:
[0131] Step S610: searching for a second transaction object that has been transferred to the smart contract account from multiple transaction objects.
[0132] The second transaction object refers to a transaction object that has been transferred to the smart contract account among multiple transaction objects. If the multiple transaction objects include the first transaction object, the multiple transaction objects may also include the second transaction object. For example, if there is a transaction object associated with the first association method among the multiple transaction objects, then the transaction object is the second transaction object.
[0133] Step S620: According to the smart contract corresponding to the smart contract account, the smart contract to which the second transaction object belongs is called to transfer the second transaction object from the smart contract account to the object transfer-in account.
[0134] Since the second transaction object has been transferred to the smart contract account, that is, the smart contract corresponding to the smart contract account has the authority to transfer the second transaction object, the smart contract corresponding to the smart contract account can directly call the smart contract to which the second transaction object belongs to transfer the second transaction object from the smart contract account to the object transfer-in account.
[0135] It should be noted that in Figure 6 In the illustrated embodiment, the ownership of the second transaction object is transferred to the object transfer-in account by transferring the second transaction object to the object transfer-in account. In other embodiments, the controller of the smart contract account may also be updated to the object transfer-in account. Since the controller of the smart contract account is the object transfer-in account, the object transfer-in account has the authority to control the second transaction object, thereby realizing the transfer of the ownership of the second transaction object to the object transfer-in account.
[0136] It should be noted that Figure 6 In the illustrated embodiment, there is no restriction on the execution order of step S510-step S530 and step S610-step S620, wherein step S510-step S530 may be executed first, and then step S610-step S620, or step S610-step S620 may be executed first, and then step S510-step S530, or step S510-step S530 and step S610-step S620 may be executed synchronously. Figure 6 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Figure 6 The specific implementation details of steps S410 to S430 shown in FIG. Figure 4 Steps S410 to S430 are shown. Figure 6 The specific implementation details of steps S510 to S530 shown in FIG. Figure 5Steps S510 to S530 shown are not repeated here.
[0137] exist Figure 6 In the illustrated embodiment, for the second transaction object that has been transferred to the smart contract account during the association process, during the transaction process, the smart contract corresponding to the smart contract account can directly call the smart contract to which the second transaction object belongs to transfer the second transaction object, thereby improving the transaction speed.
[0138] In an exemplary embodiment, see Figure 7 , Figure 7 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0139] like Figure 7 As shown, the method includes steps S410-S430, step S320, step S510-S530, step S610-S620, and step S710, wherein step S710 is described in detail as follows:
[0140] Step S710: Update the controller of the smart contract account to the object transfer account.
[0141] The controller of the smart contract account has the authority to call the smart contract and realize the transfer of multiple transaction objects associated with the smart contract account. Therefore, after the second transaction object is transferred from the smart contract account to the object transfer-in account, that is, after the ownership of multiple transaction objects associated with the smart contract account is transferred to the object transfer-in account, the controller of the smart contract account can also be updated to the object transfer-in account, so that the object transfer-in account has the authority to control the smart contract account, so that the object transfer-in account can also initiate a transaction to trade multiple transaction objects.
[0142] It should be noted that Figure 7 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Figure 7 The specific implementation details of steps S410 to S430 shown in FIG. Figure 4 Steps S410 to S430 are shown. Figure 7 The specific implementation details of steps S510 to S530 shown in FIG. Figure 5 Steps S510 to S530 are shown. Figure 7 The specific implementation details of steps S610 to S620 shown in FIG. Figure 6Steps S610 to S620 shown are not repeated here.
[0143] exist Figure 7 In the illustrated embodiment, after multiple transaction objects associated with a smart contract account are transferred to an object transfer-in account, the controller of the smart contract account is updated to the object transfer-in account, so that the object transfer-in account can control the smart contract account, thereby realizing the transfer of multiple transaction objects in one transaction, thereby improving the flexibility of the transaction.
[0144] In an exemplary embodiment, see Figure 8 , Figure 8 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0145] like Figure 8 As shown, the method includes steps S410 to S430, step S320, and step S810, wherein step S810 is described in detail as follows:
[0146] Step S810: If multiple transaction objects have been transferred to the smart contract account, the controller of the smart contract account is updated to the transaction transfer-in account to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request.
[0147] If multiple transaction objects have been transferred to the smart contract account, for example, if multiple transaction objects are associated with the smart contract account using the first association method mentioned above, the controller of the smart contract account has the ownership rights of multiple transaction objects. Therefore, the controller of the smart contract account can be updated to the transaction transfer account, so that the transaction transfer account has the ownership rights of multiple transaction objects.
[0148] It should be noted that Figure 8 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Figure 8 The specific implementation details of steps S410 to S430 shown in FIG. Figure 4 Steps S410 to S430 shown are not repeated here.
[0149] exist Figure 8 In the illustrated embodiment, during the association process, if multiple transaction objects are transferred to a smart contract account, the ownership of the multiple transaction objects can be transferred to the object transfer account by updating the controller of the smart contract account to the object transfer account, thereby increasing the transaction speed and reducing the complexity of the transaction.
[0150] In an exemplary embodiment, see Fig. 9 , Fig. 9 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0151] like Fig. 9 As shown, under the condition that the target transaction object is included in the multiple transaction objects and the controller of the smart contract account is the account to which the target transaction object belongs, the method includes steps S310-S320 and steps S910-S920, wherein the detailed description of steps S910-S920 is as follows:
[0152] Step S910, according to the smart contract corresponding to the smart contract account, obtain the transaction initiating account corresponding to the transaction request.
[0153] It should be noted that in order to improve the reliability of transactions, a target transaction object is set. Only when a transaction request for the target transaction object is initiated, multiple transaction objects will be transferred to the object transfer account together. Among them, which transaction object among multiple transaction objects is specifically selected as the target transaction object can be flexibly set according to actual needs, wherein the target transaction object can be selected by the user or by the blockchain node. In an optional example, the attached transaction object can be selected as the target transaction object based on the dependency between multiple transaction objects. For example, in a game scene, game equipment is attached to the game character, so the game character can be used as the target transaction object, so that the game character and the game equipment can be traded together; for another example, the clothes of a toy doll are attached to the toy doll, so the toy doll can be used as the target transaction object; for another example, the subtitles of a video are attached to the video, so the video can be used as the target transaction object.
[0154] Optionally, in order to improve the security of the transaction, the account to which the target transaction object belongs can be used as the controller of the smart contract account, so that only the account to which the target transaction object belongs, or the account authorized by the account to which the target transaction object belongs, can call the smart contract corresponding to the smart contract account to complete the transfer of multiple transaction objects.
[0155] Therefore, after receiving a transaction request corresponding to any transaction object among multiple transaction objects, the smart contract corresponding to the smart contract account can be called to find the transaction initiating account corresponding to the transaction request.
[0156] Step S920: If the transaction initiating account matches the controller of the smart contract account, and any transaction object matches the target transaction object, the ownership of multiple transaction objects is transferred to the object transfer account.
[0157] If the transaction initiating account matches the controller of the smart contract account, and any transaction object corresponding to the transaction request matches the target transaction object (that is, any transaction object is the target transaction object), it indicates that the transaction initiating account has the authority to call the smart contract corresponding to the smart contract account to transfer the transaction object, and multiple transaction objects need to be transferred. Therefore, the smart contract corresponding to the smart contract account is called to transfer the ownership of multiple transaction objects to the object transfer-in account corresponding to the transaction request. The specific transfer method can be found in the records of the aforementioned embodiment and will not be repeated here.
[0158] Optionally, the transaction request may include signature data generated based on the private key corresponding to the transaction initiating account, and the public key corresponding to the controller of the smart contract account may be obtained, and the signature data may be verified based on the public key. If the verification is successful, it indicates that the transaction initiating account matches the controller of the smart contract account; if the verification fails, it indicates that the transaction initiating account does not match the controller of the smart contract account. Alternatively, the transaction initiating account may be directly compared with the smart contract account. If the two are the same, it indicates that the transaction initiating account matches the controller of the smart contract account; if the two are different, it indicates that the transaction initiating account does not match the controller of the smart contract account.
[0159] It should be noted that Fig. 9 The specific implementation details of steps S310 to S320 shown in FIG. Figure 3 Steps S310 to S320 shown are not repeated here.
[0160] exist Fig. 9 In the illustrated embodiment, on the one hand, transactions are conducted only when it is determined that the transaction initiating account corresponding to the transaction request is the controller of the smart contract, thereby improving the security of the transaction; on the other hand, the ownership of multiple transaction objects is transferred only when the transaction object corresponding to the transaction request is the target transaction object, thereby improving the reliability and controllability of the transaction.
[0161] In an exemplary embodiment, see Fig.10 , Fig.10 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0162] like Fig.10As shown, the method includes steps S310-S320, steps S910-S920, and step S1010, wherein step S1010 is described in detail as follows:
[0163] Step S1010: If the transaction initiating account matches the controller of the smart contract account, and any transaction object does not match the target transaction object, any transaction object is transferred to the object transfer-in account.
[0164] In order to improve the diversity of transactions, after obtaining the transaction initiating account corresponding to the transaction request, if the transaction initiating account matches the controller corresponding to the smart contract account, and any transaction object does not match the target transaction object, the smart contract corresponding to the smart contract account can be called to transfer any transaction object to the object transfer account. In other words, only any transaction object is transferred during this transaction.
[0165] It should be noted that Fig.10 The specific implementation details of steps S310 to S320 shown in FIG. Figure 3 Steps S310 to S320 are shown. Fig.10 The specific implementation details of steps S910 to S920 shown in FIG. Fig. 9 Steps S910 to S920 shown are not repeated here.
[0166] exist Fig.10 In the illustrated embodiment, the ownership of multiple transaction objects is transferred only when the transaction object corresponding to the transaction request is the target transaction object; and when the transaction object corresponding to the transaction request is another transaction object, only the transaction object corresponding to the transaction request is transferred, thereby improving the diversity of transactions and allowing users to flexibly choose specific transaction methods.
[0167] In an exemplary embodiment, see Fig.11 , Fig.11 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0168] like Fig.11 As shown, the method includes steps S1110 to S1120, step S320, and steps S910 to S920, wherein steps S1110 to S1120 are described in detail as follows:
[0169] Step S1110, searching the account to which the target transaction object belongs according to the association request corresponding to the target transaction object.
[0170] After receiving the association request corresponding to the target transaction object, the account to which the target transaction object belongs can be found to set the account to which the target transaction object belongs as the controller of the smart contract account.
[0171] Optionally, in order to distinguish the association request of the target transaction object from the association requests of other transaction objects, the association request of the target transaction object may add information indicating that the account to which the transaction object belongs is used as the controller of the smart contract account.
[0172] Optionally, the association request of the target transaction object may also include information for creating a smart contract account to request the creation of a smart contract account; that is, the association request of the target transaction object may be an account creation request to create a smart contract account.
[0173] Step S1120: create a smart contract account according to the account to which the target transaction object belongs, and associate the target transaction object with the smart contract account.
[0174] A smart contract account for association is created according to the association request corresponding to the target transaction object, the account to which the target transaction object belongs is used as the controller of the smart contract account, and the target transaction object is associated with the smart contract account. The association method may adopt the first association method or the second association method mentioned above.
[0175] It should be noted that Fig.11 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Fig.11 The specific implementation details of steps S910 to S920 shown in FIG. Fig. 9 Steps S910 to S920 shown are not repeated here.
[0176] exist Fig.11 In the illustrated embodiment, a smart contract account is created based on the account to which the target transaction object belongs, so that after other transaction objects are associated with the smart contract account, they can be traded together with the target transaction object, thereby improving the convenience of transactions.
[0177] In an exemplary embodiment, see Fig.12 , Fig.12 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 120 in the illustrated implementation environment executes.
[0178] like Fig.12As shown, the method includes step S1110, step S1210-step S1240, step S320, and step S910-step S920, wherein the detailed description of step S1210-step S1240 is as follows:
[0179] Step S1210, obtaining the smart contract type to which the target transaction object belongs.
[0180] The smart contract type to which the target transaction object belongs refers to the smart contract type corresponding to the smart contract used to issue the target transaction object.
[0181] Step S1220: If the smart contract type matches the set smart contract type, a smart contract account is created, and the account to which the target transaction object belongs is set as the controller of the smart contract account.
[0182] The set smart contract type is used to determine whether the smart contract is compliant. It can be a smart contract corresponding to a standard NFT protocol. The standard NFT protocol includes but is not limited to the ERG721 protocol, etc.
[0183] After obtaining the smart contract type to which the target transaction object belongs, the smart contract type can be compared with the set smart contract type. If the two match, a smart contract account is created and the account to which the target transaction object belongs is set as the controller of the smart contract account.
[0184] Optionally, if the smart contract type does not match the set smart contract type, the association request corresponding to the target transaction object can be rejected.
[0185] Step S1230, re-searching the account to which the target transaction object belongs.
[0186] After creating a smart contract account, it is necessary to re-search the account to which the target transaction object belongs to determine whether the account to which the target transaction object belongs has changed during the creation of the smart contract account.
[0187] Step S1240: If the re-found account matches the controller of the smart contract account, the target transaction object is associated with the smart contract account.
[0188] If the account to which the target transaction object belongs matches the controller of the smart contract account, it means that the account to which the target transaction object belongs has not changed during the account creation process, and the controller of the smart contract account has the ownership of the target transaction object. Therefore, the target transaction object can be associated with the smart contract account.
[0189] Optionally, if the re-found account does not match the controller of the smart contract account, it may be prohibited to associate the target transaction object with the smart contract account, and determine that the smart contract account creation has failed.
[0190] It should be noted that the supportsInterface function of the EIP165 protocol can be called to find the smart contract type to which the target transaction object belongs, and to determine whether the smart contract type to which the target transaction object belongs matches the set smart contract type; the ownerOf function in the smart contract to which the target transaction object belongs can be called to find the account to which the target transaction object belongs. Fig.12 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Fig.12 The specific implementation details of steps S910 to S920 shown in FIG. Fig. 9 Steps S910 to S920 shown, Fig.12 The specific implementation details of step S1110 shown can be referred to Fig.11 The step S1110 shown is not repeated here.
[0191] exist Fig.12 In the illustrated embodiment, a smart contract account is created only when the smart contract type to which the target transaction object belongs matches the set smart contract type, and the account to which the target transaction object belongs is set as the controller of the smart contract account, thereby ensuring that the smart contract corresponding to the smart contract account can call the smart contract to which the target transaction object belongs, thereby improving the transaction success rate; and, when creating a smart contract account, it is re-verified whether the account to which the target transaction object belongs matches the controller of the smart contract account. If they match, the target transaction object is associated with the smart contract account, thereby avoiding changes in the account to which the target transaction object belongs during the account creation process, resulting in confusion in the ownership of the target transaction object, thereby improving the security and reliability of the transaction.
[0192] In an exemplary embodiment, see Fig.13 , Fig.13 is a flowchart of a transaction processing method shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The blockchain node 130 in the illustrated implementation environment executes.
[0193] like Fig.13As shown, under the condition that the multiple transaction objects also include other transaction objects other than the target transaction object, the method includes steps S1110-step S1120, steps S1310-step S1320, step S320, and steps S910-step S920, wherein steps S1310-step S1320 are described in detail as follows:
[0194] Step S1310: According to the association request corresponding to the other transaction object, the account to which the other transaction object belongs and the account that initiated the association request corresponding to the other transaction object are obtained.
[0195] Other transaction objects refer to transaction objects other than the target transaction object among the multiple transaction objects.
[0196] After receiving the association request corresponding to other transaction objects, the account to which the other transaction objects belong and the account that initiated the association request corresponding to the other transaction objects (ie, the initiating account) may also be obtained.
[0197] If the account to which the other transaction object belongs and the initiating account corresponding to the association request of the other transaction object are obtained, then go to step S1320; if the account to which the other transaction object belongs is not obtained, or the initiating account corresponding to the association request of the other transaction object is not obtained, then the association request corresponding to the other transaction object is rejected.
[0198] Step S1320: If the account to which the other transaction objects belong matches the controller of the smart contract account, and the initiating account matches the controller of the smart contract account, the other transaction objects are associated with the smart contract account.
[0199] Compare the accounts of other transaction objects with the controller of the smart contract account, and compare the initiating account with the controller of the smart contract account. If they match, associate the other transaction objects with the smart contract account. Optionally, if the accounts of other transaction objects do not match the controller of the smart contract account, or the initiating account does not match the controller of the smart contract account, the association request corresponding to the other transaction objects is rejected and the association fails.
[0200] Optionally, before associating other transaction objects with the smart contract account, the smart contract type to which the other transaction objects belong may be compared with the set smart contract type. If the account to which the other transaction objects belong matches the smart contract account, the smart contract type to which the other transaction objects belong matches the set smart contract type, and the initiating account of the association request corresponding to the other transaction objects matches the controller of the smart contract account, the other transaction objects will be associated with the smart contract account; otherwise, the association request corresponding to the other transaction objects will be rejected and the association fails. It should be noted that the specific comparison order between the smart contract type to which other transaction objects belong, the account to which other transaction objects belong, and the initiating account of the association request can be flexibly set according to actual needs. For example, in an optional example, the smart contract type to which other transaction objects belong can be obtained first, and the smart contract type can be compared with the set smart contract type. If the two do not match, the association fails; if the two match, the account to which other transaction objects belong is obtained. If the account to which other transaction objects belong is not obtained, the association fails; if the account to which other transaction objects belong is obtained, the account to which other transaction objects belong is compared with the controller of the smart contract account; if the account to which other transaction objects belong does not match the controller of the smart contract account, the association fails; if the account to which other transaction objects belong matches the controller of the smart contract account, the initiating account of the association request for other transaction objects (i.e., the account that initiates the association request) is obtained, and the initiating account is compared with the controller of the smart contract. If the initiating account does not match the controller of the smart contract, the association fails; if the initiating account matches the controller of the smart contract, the other transaction objects are associated with the smart contract account.
[0201] It should be noted that the supportsInterface function of the EIP165 protocol can be called to find the smart contract type to which other transaction objects belong, and to determine whether the smart contract type to which other transaction objects belong matches the set smart contract type; the ownerOf function in the smart contract to which other transaction objects belong can be called to find the account to which other target transaction objects belong. Fig.13 The specific implementation details of step S320 shown in FIG. Figure 3 In step S320 shown, Fig.13 The specific implementation details of steps S910 to S920 shown in FIG. Fig. 9 Steps S910 to S920 shown, Fig.13 The specific implementation details of steps S1110 to S1120 shown in FIG. Fig.11 Steps S1110 to S1120 shown are not repeated here.
[0202] exist Fig.13In the illustrated embodiment, other transaction objects are associated with the smart contract account only when the accounts to which the other transaction objects belong match the controller of the smart contract account and the initiating accounts corresponding to the association requests of the other transaction objects match the controller of the smart contract account, thereby improving the security of the transaction.
[0203] See also Fig.14 , Fig.14 is a flowchart of a transaction processing method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The client 110 in the illustrated implementation environment executes.
[0204] like Fig.14 As shown, in an exemplary embodiment, the transaction processing method may include steps S1410-S1420, which are described in detail as follows:
[0205] Step S1410, generating association requests corresponding to multiple transaction objects, and sending the association requests to the blockchain node, so that the blockchain node obtains the smart contract account used for association according to the association request, and associates the multiple transaction objects with the smart contract account respectively.
[0206] When multiple transaction objects need to be traded in one transaction, the client can first generate association requests corresponding to the multiple transaction objects and send the association requests to the blockchain node. After receiving the association request, the blockchain node can first obtain the smart contract account used for association, and associate the multiple transaction objects with the smart contract account respectively. The specific association process of the blockchain node can refer to the records of the above embodiment, which will not be repeated here.
[0207] The association request may be initiated by a user through a client, and may be initiated for each transaction object, or may be initiated for multiple transaction objects.
[0208] Step S1420, generate a transaction request corresponding to any transaction object among the multiple transaction objects, and send the transaction request to the blockchain node, so that the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the found smart contract.
[0209] After multiple transaction objects are associated with smart contract accounts respectively, the smart contract corresponding to the smart contract account can realize the transfer of ownership of multiple transaction objects. Therefore, the client can generate a transaction request corresponding to any of the multiple transaction objects and send the transaction request to the blockchain node. After receiving the transaction request, the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of multiple transaction objects to the object transfer-in account corresponding to the transaction request according to the found smart contract. The specific process of the blockchain node executing the transaction can be referred to the records of the aforementioned embodiment, which will not be repeated here.
[0210] The transaction request may be initiated by the user, and any transaction object may also be selected by the user.
[0211] exist Fig.14 In the embodiment shown, the client can request the blockchain node to associate multiple transaction objects with the smart contract account. In this way, the client only needs to initiate a transaction request for one transaction object, and it can transfer multiple transaction objects in one transaction based on the smart contract corresponding to the smart contract account, thereby improving the flexibility and convenience of transactions, reducing transaction costs, and improving the convenience of user operations. In addition, transactions are implemented through smart contracts, which improves the security of transactions.
[0212] In an exemplary embodiment, the target transaction object is the master NFT (i.e., the master non-fungible token) and the other transaction objects are slave NFTs (i.e., slave non-fungible tokens). Fig.15 As shown, the transaction processing method may include steps 1) to 4), which are described in detail as follows:
[0213] Step 1) Select the master NFT and slave NFT.
[0214] It should be noted that an NFT smart contract can issue a series of NFTs. A user often owns multiple NFTs, which can be issued by different NFT smart contracts and stored in the user's corresponding account. For example, user X's account X has the following NFTs:
[0215] [Smart Contract A#1000, Smart Contract B1#1, Smart Contract B2#1, Smart Contract B2#1]
[0216] Among them, the one before “#” represents the address of the NFT smart contract, and the one after it represents the tokenId of the NFT in the corresponding series of NFTs.
[0217] In order to associate multiple NFTs so that they can be transferred in one transaction, user X can select the master NFT and the slave NFT.
[0218] Among them, the master NFT is essentially an NFT issued by an NFT smart contract, which is used to create a smart contract account. The slave NFT is essentially an NFT issued by an NFT smart contract, which can be bound to the master NFT as a whole through the smart contract account for trading. The master NFT can be the most representative of multiple NFTs, or it can be the most important NFT among multiple NFTs. For example, when the transaction processing method is applied to a game scenario, the master NFT can be a game character or game person in the game, and the slave NFT can be a game prop in the game.
[0219] Step 2) Deploy the smart contract account.
[0220] After selecting the main NFT, the user can initiate an account creation request based on the main NFT. The blockchain node can deploy the functions in the smart contract account based on the account creation request. The smart contract account can include the functions shown in Table 1 below:
[0221]
[0222] Table 1
[0223] After constructing the function in the smart contract account, you can call the constructor in the account to deploy the smart contract account. The deployment process can include the following steps 1.1-1.5, which are described in detail as follows:
[0224] In step 1.1, you need to obtain the smart contract to which the main NFT belongs, the tokenId of the main NFT, and the account to which the main NFT belongs, and use the account to which the main NFT belongs as the controller of the smart contract account.
[0225] Among them, the smart contract to which the main NFT belongs, the tokenId of the main NFT, and the account to which the main NFT belongs are used as smart contract parameters to construct a smart contract account.
[0226] Optionally, the account to which the main NFT belongs can be obtained through the ownerOf function of the smart contract to which the main NFT belongs, and the account to which the main NFT belongs can be used as the controller of the smart contract account. For example, assuming that user X selects "Smart Contract A#1000" as the main NFT, the ownerOf function of Smart Contract A can be called to obtain the account to which the NFT belongs, and use it as the controller of the smart contract account. owner :
[0227] Addr owner=A.ownerOf(tlkenId=1000)
[0228] Step 1.2, determine whether the smart contract type to which the main NFT belongs is the set smart contract type. If so, go to step 1.3; if not, the creation fails.
[0229] Optionally, the set smart contract type can be a standard NFT smart contract. The supportsInterface function of the EIP165 protocol can be used to determine whether the smart contract to which the main NFT belongs is a standard NFT smart contract. Continuing with the above example, determine whether smart contract A is a standard NFT smart contract.
[0230] Step 1.3, call the smart contract to which the main NFT belongs, and re-acquire the account to which the main NFT belongs; if obtained, go to step 1.4; if not obtained, the creation fails.
[0231] Among them, you can call the ownerOf function contained in the smart contract to which the main NFT belongs to determine the account to which the main NFT belongs. Continuing with the above example, call the ownerOf function of smart contract A to determine the account Addr to which tokenId = 1000 corresponds to the NFT o .
[0232] Step 1.4, determine whether the account to which the retrieved main NFT belongs matches the controller of the smart contract account; if they match, go to step 1.5, if not, the creation fails.
[0233] Continuing from the above example, let’s determine Addr o Is it related to Addr owner If yes, go to step 1.5. If no, creation fails.
[0234] Step 1.5, write the smart contract to which the main NFT belongs, the tokenId of the main NFT, and the account to which the main NFT belongs into the smart contract account.
[0235] Optionally, the smart contract to which the main NFT belongs, the tokenId of the main NFT, and the account to which the main NFT belongs can be stored as state variables in the smart contract account, and the smart contract account is created. After storage, call the getContractOwner function, and the return value is the account to which the main NFT belongs. Continuing with the above example, the return value is A.ownerOf(tokenId=1000).
[0236] Optionally, after the smart contract account is created successfully, you can use the address Addr of the smart contract account wallet Sent to the account to which the main NFT belongs to notify the user.
[0237] Step 3) will associate the NFT with the smart contract account.
[0238] In this embodiment, the following two methods are provided to associate the slave NFT to the smart contract account, thereby realizing the combination of the master NFT and the slave NFT:
[0239] Method 1, transfer from NFT to smart contract account.
[0240] Among them, the user who owns the slave NFT can initiate an association request, which includes the account to which the slave NFT belongs, the smart contract account, the smart contract to which the slave NFT belongs, and the tokenId of the slave NFT; the blockchain node can call the transfer function in the smart contract to which the slave NFT belongs according to the account to which the slave NFT belongs, the smart contract account, the smart contract to which the slave NFT belongs, and the tokenId of the slave NFT, and transfer the slave NFT from the account to which the slave NFT belongs to the smart contract account. Taking [Smart Contract B1#1] as an example, the transferFrom(address_from,address_to,uint256_tokenId) function of the smart contract B1 can be called, and _from is set to the account to which the slave NFT belongs, that is, account X, and _to is set to the address of the smart contract account, that is, Address. wallet , _tokenId is set to 1 to transfer the slave NFT to the smart contract account. After a successful transfer, the slave NFT belongs to the smart contract account.
[0241] Method 2: Bind the NFT to the NFT smart contract wallet.
[0242] Optionally, the blockchain node can call the bindSubNft function in the smart contract account according to the association request to bind the slave NFT to the smart contract account. The binding process can include the following steps 2.1-2.5, which are described in detail as follows:
[0243] Step 2.1, determine whether the smart contract type to which the NFT belongs is the set smart contract type. If so, go to step 2.2; if not, the binding fails.
[0244] Optionally, the set smart contract type can be a standard NFT smart contract. The supportsInterface function of the EIP165 protocol can be used to determine whether the smart contract to which the NFT belongs is a standard NFT smart contract. Taking [Smart Contract B2#1] as an example, determine whether smart contract B2 is a standard NFT smart contract. If so, go to step 2.2. If not, the binding fails.
[0245] Step 2.2, call the smart contract to which the slave NFT belongs and obtain the account to which the slave NFT belongs; if obtained, go to step 2.3; if not obtained, the association fails.
[0246] Optionally, you can call the ownerOf function contained in the smart contract to which the slave NFT belongs to determine the account to which the slave NFT belongs. Continuing with the above example, call the ownerOf function of smart contract B2 to determine the account Addr1 to which the NFT with tokenId=1 belongs.
[0247] Step 2.3, determine whether the account to which the NFT belongs matches the controller of the smart contract account; if they match, go to step 2.4, if not, the binding fails.
[0248] Continuing with the above example, determine whether Addr1 and Addr owner Are they the same? If so, go to step 2.4; if not, the association fails.
[0249] Step 2.4, determine whether the initiating account of the association request matches the controller of the smart contract. If they match, go to step 2.5. If they do not match, the binding fails.
[0250] That is to say, only the controller of the smart contract can request to associate with the NFT.
[0251] In step 2.5, write the token identification number of the slave NFT and the address of the smart contract account to which the slave NFT belongs into the smart contract account to associate the slave NFT with the smart contract account.
[0252] The token identification number of the slave NFT and the address of the smart contract account to which the slave NFT belongs can be stored in an array in the smart contract account, thereby binding the slave NFT in the smart contract account. B1 ,1) Stored in the smart contract account, where Addr B1 Represents the address of smart contract B1, and 1 represents the token identification number of the NFT.
[0253] Step 4) Trade the NFT associated with the smart contract account.
[0254] For NFTs associated with smart contract accounts, two trading methods are provided:
[0255] The first transaction method: The user can initiate a transaction request for any slave NFT. The blockchain node calls the transferSubNft function in the smart contract account based on the transaction request and transfers the slave NFT to the NFT transfer account corresponding to the transaction.
[0256] Among them, before transferring the slave NFT, it is necessary to first determine whether the slave NFT is associated with the smart contract account using the above method 2. If so, it means that the slave NFT has not been transferred to the smart contract account. Therefore, the smart contract account needs to be authorized. Among them, the user to whom the slave NFT belongs can initiate an authorization request corresponding to the slave NFT. After receiving the authorization request, the blockchain node calls the smart contract to which the slave NFT belongs to implement the authorization of the smart contract account, so that the smart contract account has the authority to transfer the slave NFT. Optionally, you can call the approve(address_approved,uint256_tokenId) function in the smart contract to which the slave NFT belongs, and set _approved to the address Addr of the smart contract account. wallet , set _tokenId to the token identification number of the slave NFT to authorize the slave NFT to the smart contract account so that the smart contract account can transfer the slave NFT.
[0257] During the transfer process, the transferSubNft function can perform the following operations: determine whether the transaction initiating account corresponding to the transaction request is the controller of the smart contract account. If not, the transaction fails; if so, call the ownerOf function in the smart contract to which the slave NFT belongs to obtain the account to which the slave NFT belongs, and determine whether the account to which the slave NFT belongs is a smart contract account. If the account to which the slave NFT belongs is a smart contract account, call the transferFrom function of the smart contract to which the slave NFT belongs to transfer the slave NFT to the corresponding account Y; if the account to which the slave NFT belongs is not a smart contract account, it can be determined whether the smart contract account is authorized. If authorized, call the transferFrom function of the smart contract to which the slave NFT belongs to transfer the slave NFT to the corresponding account Y. If not authorized, the transaction fails. Optionally, the getApproved(uint256_tokenId) function in the smart contract to which the slave NFT belongs can be called to obtain the authorization data corresponding to the slave NFT. If the returned authorization data contains the address of the smart contract account, it indicates that it has been authorized.
[0258] The second transaction method: The user can initiate a transaction request for the main NFT. The blockchain node can call the transferMainNft function in the smart contract account based on the transaction request to transfer the main NFT and the slave NFT to the NFT transfer account corresponding to the transaction.
[0259] Before transferring the slave NFT, it is also necessary to determine whether the slave NFT is associated with the smart contract account using the above method 2. If so, it means that the slave NFT has not been transferred to the smart contract account. Therefore, the smart contract account needs to be authorized. Among them, the user to whom the slave NFT belongs can initiate an authorization request corresponding to the slave NFT. After receiving the authorization request, the blockchain node calls the smart contract to which the slave NFT belongs to implement the authorization of the smart contract account, so that the smart contract account has the authority to transfer the slave NFT. The authorization method is similar to the authorization method introduced in the first transaction method mentioned above, and will not be repeated here. For example, assuming that it is necessary to authorize the slave NFT [smart contract B1#1], [smart contract B2#1], [smart contract B2#1] to the smart contract account, it is necessary to call the approve(address_approved,uint256_tokenId) function of each smart contract to which the slave NFT belongs, and authorize each slave NFT to the smart contract account Addr wallet ,Right now:
[0260] Addr B1 .approve(Addr wallet ,1)
[0261] Addr B2 .approve(Addr wallet ,1)
[0262] Addr B3 .approve(Addr wallet ,1)
[0263] Among them, for the main NFT, if the main NFT has not been transferred to the smart contract account, it is also necessary to call the approve(address_approved,uint256_tokenId) function in the smart contract to which the main NFT belongs to authorize the main NFT to the smart contract account, that is:
[0264] Addr A .approve(Addr wallet ,1000)
[0265] During the transfer process, the transMainSubNft function can perform the following operations: First, determine whether the transaction initiating account corresponding to the transaction request is the controller of the smart contract account, where the controller can call the getContractOwner function to obtain it. If not, the transaction fails; if so, call the transferFrom(address_from,address_to,uint256_tokenId) function of the smart contract to which each slave NFT belongs to transfer all slave NFTs to the NFT transfer-in account; then, call the transferFrom(address_from,address_to,uint256_tokenId) function of the smart contract to which the master NFT belongs to transfer the master NFT to the NFT transfer-in account. Finally, since the account to which the master NFT belongs becomes the NFT transfer-in account, the controller of the smart contract account is updated to the NFT transfer-in account, that is, calling the getContractOwner function returns the NFT transfer-in account, so that the NFT transfer-in account has control over the smart contract account, and thus has control over the master NFT and slave NFT therein. In an example, see Fig.16 As shown, assuming that account X owns the master NFT (master non-fungible token) and the slave NFT (slave non-fungible token), a smart contract account is created based on the master NFT. Account X can initiate a transaction request for the master NFT, thereby transferring the master NFT and the slave NFT to account Y based on the smart contract corresponding to the smart contract account. After the transfer, account Y has control over the smart contract account.
[0266] exist Fig.15 In the illustrated embodiment, a smart contract account is created based on the master NFT, and the slave NFT is associated with the smart contract account, thereby realizing the binding of the master NFT and the slave NFT, and if the user initiates a transaction request for the master NFT, the smart contract corresponding to the smart contract account can transfer both the master NFT and the slave NFT, thereby realizing the transfer of multiple NFTs in one transaction, thereby improving the flexibility and convenience of NFT transactions and reducing transaction costs; and, if the user initiates a transaction request for the slave NFT, the smart contract corresponding to the smart contract account can only transfer the slave NFT, thereby improving the diversity of transactions; and, in the process of association and transaction, account authority verification will be performed, thereby improving the security of transactions.
[0267] See also Fig.17 , Fig.17 FIG. 1 is a block diagram of a transaction processing device shown in an exemplary embodiment of the present application. Fig.17 As shown, the device comprises:
[0268] The association module 1701 is configured to obtain a smart contract account for association according to association requests corresponding to the multiple transaction objects, and associate the multiple transaction objects with the smart contract accounts respectively;
[0269] The receiving module 1702 is configured to receive a transaction request for any transaction object among the multiple transaction objects, and search for a smart contract corresponding to the smart contract account according to the transaction request;
[0270] The transfer module 1703 is configured to transfer the ownership of multiple transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account.
[0271] In an exemplary embodiment, based on the aforementioned solution, the association module 1701 is specifically configured to: transfer the transaction object from the account to which the transaction object belongs to the smart contract account; or, write the identification information of the transaction object into the smart contract account.
[0272] In an exemplary embodiment, based on the above solution, the transfer module 1703 is specifically configured to: search for a first transaction object that has not been transferred to the smart contract account from multiple transaction objects;
[0273] Obtain the authorization request corresponding to the first transaction object found, and authorize the smart contract account according to the authorization request to obtain authorization data;
[0274] According to the smart contract corresponding to the smart contract account and the authorization data, the smart contract to which the first transaction object belongs is called to transfer the first transaction object from the account to which the first transaction object belongs to the object transfer-in account.
[0275] In an exemplary embodiment, based on the above solution, the transfer module 1703 is specifically configured to: search for a second transaction object that has been transferred to the smart contract account from a plurality of transaction objects;
[0276] According to the smart contract corresponding to the smart contract account, the smart contract to which the second transaction object belongs is called to transfer the second transaction object from the smart contract account to the object transfer-in account.
[0277] In an exemplary embodiment, based on the aforementioned solution, the device also includes an update module configured to: update the controller of the smart contract account to the object transfer account.
[0278] In an exemplary embodiment, based on the aforementioned scheme, the transfer module 1703 is specifically configured as follows: if multiple transaction objects have been transferred to the smart contract account, the controller of the smart contract account is updated to the transaction transfer-in account to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request.
[0279] In an exemplary embodiment, based on the aforementioned scheme, under the condition that the target transaction object is included in multiple transaction objects and the controller of the smart contract account is the account to which the target transaction object belongs, the transfer module 1703 is specifically configured as follows: according to the smart contract corresponding to the smart contract account, the transaction initiating account corresponding to the transaction request is obtained; if the transaction initiating account matches the controller of the smart contract account, and any transaction object matches the target transaction object, the ownership of multiple transaction objects is transferred to the object transfer-in account.
[0280] In an exemplary embodiment, based on the aforementioned scheme, the transfer module 1703 is specifically configured as follows: if the transaction initiating account matches the controller of the smart contract account, and any transaction object does not match the target transaction object, then any transaction object is transferred to the object transfer-in account.
[0281] In an exemplary embodiment, based on the aforementioned scheme, the association module 1701 is specifically configured as follows: according to the association request corresponding to the target transaction object, find the account to which the target transaction object belongs; create a smart contract account according to the account to which the target transaction object belongs, and associate the target transaction object with the smart contract account.
[0282] In an exemplary embodiment, based on the aforementioned scheme, the association module 1701 is specifically configured as follows: obtaining the smart contract type to which the target transaction object belongs; if the smart contract type matches the set smart contract type, creating a smart contract account, and setting the account to which the target transaction object belongs as the controller of the smart contract account; re-searching the account to which the target transaction object belongs; if the re-found account matches the controller of the smart contract account, associating the target transaction object to the smart contract account.
[0283] In an exemplary embodiment, based on the aforementioned scheme, under the condition that multiple transaction objects also include other transaction objects in addition to the target transaction object, the association module 1701 is specifically configured as follows: according to the association requests corresponding to the other transaction objects, obtain the accounts to which the other transaction objects belong and the initiating accounts of the association requests corresponding to the other transaction objects; if the accounts to which the other transaction objects belong match the controller of the smart contract account, and the initiating account matches the controller of the smart contract account, then associate the other transaction objects with the smart contract account.
[0284] It should be noted that Fig.17 The transaction processing device provided belongs to the same concept as the transaction processing method corresponding to the blockchain node provided in the above embodiment, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0285] See also Fig.18 , Fig.18It is a block diagram of a transaction processing device shown as an exemplary embodiment of the present application.
[0286] like Fig.18 As shown, the device comprises:
[0287] The association request module 1801 is configured to generate association requests corresponding to multiple transaction objects, and send the association requests to the blockchain node, so that the blockchain node obtains a smart contract account for association according to the association request, and associates the multiple transaction objects with the smart contract accounts respectively;
[0288] The transaction request module 1802 is configured to generate a transaction request corresponding to any transaction object among multiple transaction objects, and send the transaction request to the blockchain node, so that the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the found smart contract.
[0289] It should be noted that Fig.18 The transaction processing device provided and the transaction processing method corresponding to the client provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0290] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, when the one or more computer programs are executed by one or more processors, the electronic device implements the transaction processing method provided in the above-mentioned embodiments.
[0291] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. The electronic device may be Figure 3 The proposal node or verification node shown.
[0292] It should be noted that Fig.19 The computer system 1900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0293] like Fig.19As shown, the computer system 1900 includes a central processing unit (CPU) 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage part 1908 to a random access memory (RAM) 1903, such as executing the transaction processing method in the above embodiment. Various computer programs and data required for system operation are also stored in RAM 1903. CPU 1901, ROM 1902 and RAM 1903 are connected to each other through a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.
[0294] In some embodiments, the following components are connected to the I / O interface 1905: an input section 1906 including a keyboard, a mouse, etc.; an output section 1907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1908 including a hard disk, etc.; and a communication section 1909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1909 performs communication processing via a network such as the Internet. A drive 1910 is also connected to the I / O interface 1905 as needed. A removable medium 1911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1910 as needed, so that a computer program read therefrom is installed into the storage section 1908 as needed.
[0295] In particular, according to an embodiment of the present application, a computer program implementing the transaction processing method may be carried on a computer-readable medium, and the computer program may be downloaded and installed from a network through the communication part 1909 , and / or installed from a removable medium 1911 .
[0296] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a computer program, which may be used by an instruction execution system, device or device or used in combination with it. The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried, and the propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer program contained in the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
[0297] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0298] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0299] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device implements the transaction processing method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0300] Another aspect of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the transaction processing method provided in each of the above embodiments is implemented. The computer program can be stored in a computer-readable storage medium. The computer program product can be a computer program as a product, such as an APP (Application, mobile application software), a web page, a small program, etc.; or, the computer program product can also be a storage medium, a device, a terminal, a virtual machine, etc. containing a computer program.
[0301] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A transaction processing method, characterized in that: The method comprises: Acquire a smart contract account for association according to association requests corresponding to the multiple transaction objects, and associate the multiple transaction objects with the smart contract account respectively; Receiving a transaction request for any transaction object among the multiple transaction objects, and searching for a smart contract corresponding to the smart contract account according to the transaction request; According to the smart contract corresponding to the smart contract account, the ownership of the multiple transaction objects is transferred to the object transfer-in account corresponding to the transaction request.
2. The method according to claim 1, characterized in that The associating the multiple transaction objects with the smart contract accounts respectively includes: Transferring the transaction object from the account to which the transaction object belongs to the smart contract account; or, The identification information of the transaction object is written into the smart contract account.
3. The method according to claim 2, characterized in that The transferring the ownership of the plurality of transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account includes: Searching for a first transaction object that has not been transferred to the smart contract account from the multiple transaction objects; Obtaining the authorization request corresponding to the first transaction object found, and authorizing the smart contract account according to the authorization request to obtain authorization data; According to the smart contract corresponding to the smart contract account and the authorization data, the smart contract to which the first transaction object belongs is called to transfer the first transaction object from the account to which the first transaction object belongs to the object transfer-in account.
4. The method according to claim 3, characterized in that The transferring the ownership of the plurality of transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account includes: Searching for a second transaction object that has been transferred to the smart contract account from the multiple transaction objects; According to the smart contract corresponding to the smart contract account, the smart contract to which the second transaction object belongs is called to transfer the second transaction object from the smart contract account to the object transfer-in account.
5. The method according to claim 4, characterized in that After calling the smart contract to which the second transaction object belongs according to the smart contract corresponding to the smart contract account to transfer the second transaction object from the smart contract account to the object transfer-in account, the method further includes: Update the controller of the smart contract account to the account to which the object is transferred.
6. The method according to claim 2, characterized in that The transferring the ownership of the plurality of transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account includes: If the multiple transaction objects have all been transferred to the smart contract account, the controller of the smart contract account is updated to the transaction transfer-in account, so as to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request.
7. The method according to claim 1, characterized in that The multiple transaction objects include a target transaction object, and the controller of the smart contract account is the account to which the target transaction object belongs; The transferring the ownership of the plurality of transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account includes: According to the smart contract corresponding to the smart contract account, obtain the transaction initiating account corresponding to the transaction request; If the transaction initiating account matches the controller of the smart contract account, and any of the transaction objects matches the target transaction object, the ownership of the multiple transaction objects is transferred to the object transfer account.
8. The method according to claim 7, characterized in that After obtaining the transaction initiating account corresponding to the transaction request according to the smart contract corresponding to the smart contract account, the method further includes: If the transaction initiating account matches the controller of the smart contract account, and any transaction object does not match the target transaction object, then any transaction object is transferred to the object transfer-in account.
9. The method according to claim 7, characterized in that The obtaining, according to association requests corresponding to the plurality of transaction objects, a smart contract account for association, and associating the plurality of transaction objects with the smart contract account respectively, comprises: According to the association request corresponding to the target transaction object, searching for the account to which the target transaction object belongs; The smart contract account is created according to the account to which the target transaction object belongs, and the target transaction object is associated with the smart contract account.
10. The method according to claim 9, characterized in that The step of creating the smart contract account according to the account to which the target transaction object belongs, and associating the target transaction object with the smart contract account includes: Obtain the smart contract type to which the target transaction object belongs; If the smart contract type matches the set smart contract type, the smart contract account is created, and the account to which the target transaction object belongs is set as the controller of the smart contract account; Re-search the account to which the target transaction object belongs; If the re-found account matches the controller of the smart contract account, the target transaction object is associated with the smart contract account.
11. The method according to claim 9, characterized in that The multiple transaction objects further include other transaction objects except the target transaction object; The associating the multiple transaction objects with the smart contract accounts respectively includes: According to the association request corresponding to the other transaction object, acquiring the account to which the other transaction object belongs and the account that initiated the association request corresponding to the other transaction object; If the account to which the other transaction object belongs matches the controller of the smart contract account, and the initiating account matches the controller of the smart contract account, the other transaction object is associated with the smart contract account.
12. A transaction processing method, characterized in that: The method comprises: Generate association requests corresponding to multiple transaction objects, and send the association requests to a blockchain node, so that the blockchain node obtains a smart contract account for association according to the association request, and associates the multiple transaction objects with the smart contract account respectively; Generate a transaction request corresponding to any transaction object among the multiple transaction objects, and send the transaction request to the blockchain node, so that the blockchain node searches for the smart contract corresponding to the smart contract account according to the transaction request, and transfers the ownership of the multiple transaction objects to the object transfer account corresponding to the transaction request according to the found smart contract.
13. A transaction processing device, characterized in that: The device comprises: An association module, configured to obtain a smart contract account for association according to association requests corresponding to a plurality of transaction objects, and associate the plurality of transaction objects with the smart contract account respectively; A receiving module, configured to receive a transaction request for any transaction object among the multiple transaction objects, and search for a smart contract corresponding to the smart contract account according to the transaction request; The transfer module is configured to transfer the ownership of the multiple transaction objects to the object transfer-in account corresponding to the transaction request according to the smart contract corresponding to the smart contract account.
14. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the transaction processing method described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device implements the transaction processing method described in any one of claims 1-12.
16. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the transaction processing method according to any one of claims 1 to 12.