Data processing method and device based on smart contract, equipment and storage medium

By generating the contract address when registering the account in the blockchain system, the resource data is transferred to the contract address, and the first smart contract is deployed in the second smart contract when reaching the preset number, which solves the maintenance of the blockchain system to maintain the privacy. The high consumption problem of key time realizes the effect of reducing storage space and processor consumption.

CN119379429APending Publication Date: 2025-01-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310935389.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Blockchain systems consume a lot of costs when maintaining the private key of each recharge address, resulting in large consumption of storage space and processors.

Method used

The contract address is generated by generating an account when registering the account in the blockchain system, and the resource data is transferred to the contract address. When the preset number is reached, the second smart contract is used Collect the address to avoid private key verification.

Benefits of technology

It reduces the consumption of storage space and processor, saves the storage space of maintaining the private key, reduces the treatment pressure, and avoids waste of unnecessary intelligent contract deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379429A_ABST
    Figure CN119379429A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on a smart contract, equipment and a storage medium, and belongs to the technical field of computers. The method comprises: in response to a resource transfer request sent by a target account, transferring resource data to a first contract address in a block chain system, the first contract address being an address generated based on the target account when the target account is registered; under the condition that the quantity of the resource data in the first contract address reaches a preset quantity, calling a second smart contract in the block chain system, and deploying a first smart contract located at the first contract address in the block chain system based on a contract code of the first smart contract; and calling the first smart contract, and transferring the resource data in the first contract address where the first smart contract is located to the collection address. Since the contract address of the smart contract is used as the address for storing the resource data, a private key does not need to be used for verification, the storage space consumed for maintaining the private key is saved, and the processing pressure is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data processing method, apparatus, device and storage medium based on smart contracts. Background Art

[0002] With the rapid development of blockchain technology, users can store resource data in the blockchain system. The blockchain system provides each user with their own recharge address, and the user transfers the resource data to the recharge address. Later, in order to facilitate unified management, the blockchain system will transfer the resource data in the recharge addresses of different users to the collection address.

[0003] In order to ensure the security of resource data, it is usually necessary to assign a private key to each user's recharge address. When the resource data in the recharge address is collected, the private key of the recharge address needs to be used for verification. Only after the verification is passed can the resource data be transferred. However, because each recharge address needs to be assigned a private key, the blockchain system needs to spend a lot of money to maintain these private keys. This data processing method consumes a lot of storage space and processors. Summary of the invention

[0004] The embodiment of the present application provides a data processing method, device, equipment and storage medium based on smart contracts, which can reduce the consumption of storage space and processor. The technical solution is as follows:

[0005] On the one hand, a data processing method based on a smart contract is provided, the method comprising:

[0006] In response to a resource transfer request sent by the target account, the resource data is transferred to a first contract address in the blockchain system, where the first contract address is an address generated based on the target account when the target account is registered;

[0007] When the amount of resource data in the first contract address reaches a preset amount, a second smart contract in the blockchain system is called, and based on the contract code of the first smart contract, the first smart contract located at the first contract address is deployed in the blockchain system, the first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract;

[0008] The first smart contract is called to transfer the resource data in the first contract address where the first smart contract is located to the collection address, where the collection address is used to store resource data transferred by any account.

[0009] On the other hand, a data processing device based on a smart contract is provided, the device comprising:

[0010] A transfer module, configured to transfer resource data to a first contract address in the blockchain system in response to a resource transfer request sent by the target account, wherein the first contract address is an address generated based on the target account when the target account is registered;

[0011] A first calling module is used to call a second smart contract in the blockchain system when the amount of resource data in the first contract address reaches a preset amount, and deploy the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract, wherein the first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract;

[0012] The second calling module is used to call the first smart contract and transfer the resource data in the first contract address where the first smart contract is located to the collection address, where the collection address is used to store resource data transferred by any account.

[0013] Optionally, the device further includes an address generation module, configured to:

[0014] In response to the account registration request, register the target account;

[0015] Performing hash processing on the target account to obtain an account hash value of the target account;

[0016] Based on the account hash value, the first contract address in the blockchain system is generated.

[0017] Optionally, the address generation module is used to:

[0018] Obtaining the contract code of the first smart contract and the second contract address of the second smart contract;

[0019] The account hash value, the contract code and the second contract address are processed according to preset rules to obtain the first contract address.

[0020] Optionally, the address generation module is used to:

[0021] Performing hash processing on the contract code to obtain a code hash value of the contract code;

[0022] Concatenate the preset value, the account hash value, the code hash value and the second contract address to obtain a concatenation result;

[0023] The concatenated result is hashed to obtain the first contract address.

[0024] Optionally, the second calling module is further used to call the first smart contract to clear the first smart contract from the blockchain system.

[0025] Optionally, the first calling module is used to:

[0026] When the amount of resource data in the first contract address reaches the preset amount, the account hash value of the target account and the contract code of the first smart contract are passed to the second smart contract, the second smart contract is called, and the first contract address is generated based on the account hash value, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

[0027] Optionally, the second calling module is used to:

[0028] The first smart contract is called, the collection address is determined in the contract code of the first smart contract, and the resource data in the first contract address is transferred to the collection address.

[0029] Optionally, the contract code of the first smart contract also includes a type identifier; the second calling module is used to:

[0030] Calling the first smart contract, and determining the collection address and the type identifier in the contract code of the first smart contract;

[0031] The resource data of the type indicated by the type identifier in the first contract address is transferred to the collection address.

[0032] Optionally, the first contract address stores multiple types of resource data, and the first calling module is used to:

[0033] When the amount of resource data belonging to the target type in the first contract address reaches the preset amount, the account hash value of the target account, the contract code of the first smart contract and the target type identifier are transmitted to the second smart contract, where the target type identifier is used to indicate the target type, and the target type is any one of the multiple types;

[0034] The second smart contract is called, the first contract address is generated based on the account hash value, the target type identifier is written into the contract code, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

[0035] On the other hand, a computer device is provided, comprising a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the data processing method based on the smart contract as described in the above aspects.

[0036] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the data processing method based on the smart contract as described in the above aspects.

[0037] On the other hand, a computer program product is provided, comprising a computer program, which is loaded and executed by a processor to implement the operations performed by the data processing method based on smart contracts as described in the above aspects.

[0038] The solution provided by the embodiment of the present application generates a contract address in a blockchain system when registering an account, and the account transfers resource data to the contract address. When the amount of resource data in the contract address reaches a preset amount, the second smart contract deploys the first smart contract at the contract address based on the contract code of the first smart contract, and then the first smart contract transfers the resource data in the contract address to the collection address. In the present application, since the contract address of the first smart contract is used as the address for storing resource data, the resource data in the contract address of the first smart contract can be directly transferred out through the first smart contract in the future, without the need to use a private key for verification, saving the storage space consumed by maintaining the private key and reducing the processing pressure. In addition, since the present application does not deploy the first smart contract when registering an account, but deploys the first smart contract when it is necessary to collect resource data, it can avoid the waste caused by deploying smart contracts due to the failure to transfer resource data after some accounts are registered, further reducing the consumption of storage space and processors. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 It is a structural diagram of a blockchain system provided by an embodiment of the present application;

[0041] Figure 2 This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;

[0042] Figure 3 It is a structural diagram of an implementation environment provided by an embodiment of the present application;

[0043] Figure 4 It is a flow chart of a data processing method based on a smart contract provided in an embodiment of the present application;

[0044] Figure 5 is a flow chart of another data processing method based on smart contracts provided in an embodiment of the present application;

[0045] Figure 6 is a flowchart of another data processing method based on smart contracts provided in an embodiment of the present application;

[0046] Figure 7 It is a structural diagram of a data processing device based on a smart contract provided in an embodiment of the present application;

[0047] Figure 8 It is a structural diagram of another data processing device based on smart contracts provided in an embodiment of the present application;

[0048] Fig. 9 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;

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

[0050] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0051] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first smart contract can be referred to as a second smart contract, and similarly, a second smart contract can be referred to as a first smart contract.

[0052] Among them, at least one refers to one or more than one, for example, at least one account can be one account, two accounts, three accounts, or any other integer greater than or equal to one. Multiple refers to two or more than two, for example, multiple accounts can be two accounts, three accounts, or any other integer greater than or equal to two. Each refers to each of at least one, for example, each account refers to each account in the multiple accounts, and if the multiple accounts are 3 accounts, each account refers to each account in the 3 accounts.

[0053] It is understandable that in the implementation methods of this application, data related to user information (such as account numbers, contract addresses, resource data, smart contracts) is required. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0054] See also Figure 1 The blockchain system shown, the blockchain system 100 refers to a system for sharing data between nodes, the blockchain system includes a plurality of node devices 101, each of which stores an identical blockchain, and the blockchain is composed of a plurality of blocks, such as Figure 2 As shown, the blockchain is composed of multiple blocks, the genesis block includes a block header and a block body, the block header stores input information feature values, version numbers, timestamps and difficulty values, and the block body stores input information; the next block of the genesis block uses the genesis block as the parent block, and the next block also includes a block header and a block body, and the block header stores the input information feature values ​​of the current block, the block header feature values ​​of the parent block, version numbers, timestamps and difficulty values, and so on, so that the block data stored in each block in the blockchain are associated with the block data stored in the parent block, ensuring the security of the input information in the block. Each node device 101 can receive input information during normal operation, and maintain the blockchain in the blockchain system based on the received input information. In order to ensure information intercommunication within the blockchain system, there can be information connection between each node device 101 in the blockchain system, and information can be transmitted between the node devices 101 through the above information connection. For example, when any node device 101 in the blockchain system receives input information, it verifies the input information. After the verification is completed, it can generate blocks based on the corresponding storage of the information. Subsequently, the node device 101 sends the newly generated blocks to other node devices in the blockchain system where it is located according to the device identifications of other node devices in the blockchain system. Other node devices verify the newly generated blocks and add the newly generated blocks to the blockchain stored in them after the verification is completed, so that the blockchains stored on all node devices in the blockchain system are consistent.

[0055] The data processing method for smart contracts provided in the embodiment of the present application is executed by a node device in the blockchain system, and the node device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an intelligent voice interaction device, a smart home appliance, and a car terminal, etc., but is not limited to this.

[0056] Figure 3 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 3 The implementation environment includes a terminal 301 and a node device 302 in the blockchain system. The terminal 301 and the node device 302 in the blockchain system are connected via a wireless or wired network.

[0057] The terminal 301 has a target account registered in the blockchain system, and a first contract address is generated for the target account when registering the target account. The first contract address is an address in the blockchain system. The terminal 301 sends a resource transfer request to the node device 302 in the blockchain system through the target account. In response to the resource transfer request, the node device 302 transfers the resource data to the first contract address. At the same time, the node device 302 monitors the amount of resource data in the first contract address. When the amount of resource data in the first contract address reaches a preset amount, the node device 302 calls the second smart contract in the blockchain system, deploys the first smart contract located in the first contract address, and calls the first smart contract to transfer the resource data in the first contract address where the first smart contract is located to the collection address in the blockchain system.

[0058] Optionally, the terminal 301 installs an application provided by the blockchain system, which is an arbitrary application. Optionally, the application is an application in the operating system of the terminal 301, or an application provided by a third party. For example, the application is a resource data management application, which has the function of managing resource data, and of course, the resource data management application can also have other functions. The application installed by the user through the terminal 301 can interact with the node device 302 in the blockchain system, and can transfer resource data in other platforms to the first contract address in the blockchain system.

[0059] Figure 4is a flowchart of a data processing method based on a smart contract provided in an embodiment of the present application. The embodiment of the present application is executed by a computer device, for example, the computer device is the above-mentioned Figure 3 Node device in the embodiment shown. Figure 4 , the method comprising:

[0060] 401. The computer device transfers the resource data to a first contract address in the blockchain system in response to a resource transfer request sent by the target account, where the first contract address is an address generated based on the target account when registering the target account.

[0061] The target account is an account registered in the blockchain system. When registering the target account, an address will be generated based on the target account, and the generated address is the first contract address in the blockchain system. Optionally, in the blockchain system, each account corresponds to its own contract address, and the contract address corresponding to each account is generated based on the account. Different accounts have different contract addresses, and there is a one-to-one correspondence between the account and the contract address.

[0062] If the user of the target account wants to store resource data in the blockchain system, the target account sends a resource transfer request to the computer device in the blockchain system. In response to the resource transfer request, the computer device transfers the resource data of the target account to the first contract address of the target account.

[0063] 402. When the amount of resource data in the first contract address reaches a preset amount, the computer device calls the second smart contract in the blockchain system, and deploys the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract. The first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract.

[0064] The computer device monitors the amount of resource data in the first contract address. If the amount of resource data reaches a preset amount, the second smart contract in the blockchain system is called, and based on the contract code of the first smart contract, the first smart contract is deployed in the first contract address. The address of the first smart contract is the first contract address.

[0065] Among them, a smart contract is a contract program written in code, which can be automatically executed on the blockchain. Smart contracts can achieve a variety of functions, such as transferring money, verifying identity, creating digital identities, etc. The contract program of a smart contract is composed of the contract code of the smart contract.

[0066] The first smart contract is used to transfer resource data. The function implemented by the first smart contract is to transfer the resource data in the first contract address where the first smart contract is located. The second smart contract is used to deploy any smart contract. Given a contract code and a contract address, the second smart contract can deploy a smart contract consisting of the contract code in the contract address based on the given contract code and contract address.

[0067] 403. The computer device calls the first smart contract to transfer the resource data in the first contract address where the first smart contract is located to the collection address, and the collection address is used to store the resource data transferred by any account.

[0068] When the computer device calls the second smart contract to deploy the first smart contract, it will automatically call the first smart contract so that the first smart contract transfers the resource data in the first contract address where the first smart contract is located to the collection address. The collection address is an address in the blockchain system, and the collection address is used to store resource data transferred from any account to the blockchain system. This step 403 can be called collecting resource data. In the embodiment of the present application, collecting resource data means uniformly transferring resource data in different addresses in the blockchain system to the collection address, so as to uniformly manage and schedule the resource data transferred to the blockchain system.

[0069] The method provided in the embodiment of the present application generates a contract address in a blockchain system when registering an account, and the account transfers resource data to the contract address. When the amount of resource data in the contract address reaches a preset amount, the second smart contract deploys the first smart contract at the contract address based on the contract code of the first smart contract, and then the first smart contract transfers the resource data in the contract address to the collection address. In the present application, since the contract address of the first smart contract is used as the address for storing resource data, the resource data in the contract address of the first smart contract can be directly transferred out through the first smart contract in the future, without the need to use a private key for verification, saving the storage space consumed by maintaining the private key and reducing the processing pressure. In addition, since the present application does not deploy the first smart contract when registering an account, but deploys the first smart contract when it is necessary to collect resource data, it can avoid the waste caused by deploying smart contracts due to the failure to transfer resource data after some accounts are registered, further reducing the consumption of storage space and processors.

[0070] Above Figure 4 The embodiment shown is only a brief description of the data processing method based on the smart contract. For more detailed processes such as generating the contract address, calling the second smart contract, and calling the first smart contract, please refer to the following Figure 5 The embodiment shown. Figure 5is a flowchart of a data processing method based on a smart contract provided in an embodiment of the present application. The embodiment of the present application is executed by a computer device, for example, the computer device is Figure 3 Node device in the embodiment shown. Figure 5 , the method comprising:

[0071] 501. The computer device registers a target account in response to an account registration request.

[0072] When a user wants to register an account in the blockchain system, the account registration operation is performed on the terminal to trigger an account registration request, and the terminal sends the account registration request to the computer device in the blockchain system. The computer device responds to the account registration request and registers the target account for the user based on the user information carried in the account registration request. The computer device returns the registered target account to the terminal, and the terminal displays the target account to the user.

[0073] 502. The computer device performs hash processing on the target account to obtain an account hash value of the target account, and generates a first contract address in the blockchain system based on the account hash value.

[0074] After registering a target account for a user, the computer device also needs to generate a contract address for the target account so that the subsequent user can transfer resource data to the contract address. Therefore, the computer device performs hash processing on the target account to obtain the account hash value of the target account, and then generates a first contract address based on the account hash value. The first contract address is the address in the blockchain system.

[0075] In the embodiment of the present application, since each account registered in the blockchain system is unique, the contract address calculated based on the account hash value of the account is also unique. Therefore, each account in the blockchain system has its own corresponding contract address, and the contract address of each account is different, so that the resource data transferred to the blockchain system by each account can be isolated, ensuring the security of the resource data.

[0076] In one possible implementation, the computer device also establishes an association relationship between the target account and the first contract address, so that when resource data is subsequently transferred, the first contract address corresponding to the target account can be found according to the established association relationship.

[0077] In another possible implementation, after the computer device generates the first contract address, it also sends the first contract address to the terminal that registers the target account. After logging into the target account, the terminal displays the first contract address so as to present the first contract address to the user, and the user can subsequently transfer resource data to the first contract address.

[0078] In another possible implementation, a computer device generates a first contract address in a blockchain system based on an account hash value, including: obtaining a contract code of a first smart contract and a second contract address of a second smart contract, and processing the account hash value, the contract code, and the second contract address according to preset rules to obtain the first contract address.

[0079] The contract code of the first smart contract refers to the logic code used to constitute the contract program of the first smart contract. The second contract address of the second smart contract refers to the address where the second smart contract is deployed. After obtaining the account hash value, the contract code of the first smart contract and the second contract address, the computer device calculates the account hash value, the contract code and the second contract address according to the preset rules, and the calculated address is the first contract address.

[0080] Optionally, the computer device processes the account hash value, the contract code, and the second contract address according to preset rules to obtain the first contract address, including: hashing the contract code to obtain the code hash value of the contract code, concatenating the preset value, the account hash value, the code hash value, and the second contract address to obtain a concatenated result, and hashing the concatenated result to obtain the first contract address.

[0081] The computer device uses the following formula to determine the first contract address: keccak256 (0xff++address++salt++keccak256(init_code)). Among them, keccak256 represents a hash algorithm (the calculation result is 32 bytes), 0xff represents a preset value, the 0xff is a binary byte code, address represents the second contract address of the second smart contract, salt represents the account hash value, init_code represents the contract code of the first smart contract, and ++ represents the splicing operation. The detailed processing flow is as follows:

[0082] 1. Hash init_code to get a 32-byte binary array, and use the last 20 bytes in the binary array as the code hash value of the contract code. For example, if the numbers in the 32-byte binary array are numbered from 0 to 31, then the numbers numbered 12 to 31 are taken as the code hash value.

[0083] 2. Concatenate 0xff, address, salt and code hash value to get the concatenation result.

[0084] 3. Hash the concatenated result to obtain a 32-byte binary array, and use the last 20 bytes of the binary array as the first contract address.

[0085] 503. The computer device transfers the resource data to the first contract address in the blockchain system in response to the resource transfer request sent by the target account.

[0086] After the user registers a target account in the blockchain system, the resource data can be stored in the blockchain system through the target account. If the user wants to transfer the resource data to the blockchain system, the resource transfer operation is performed on the terminal to trigger a resource transfer request, and the terminal sends the resource transfer request to the computer device in the blockchain system through the target account. In response to the resource transfer request, the computer device transfers the resource data of the target account to the first contract address in the blockchain system.

[0087] In one possible implementation, the target account has a resource account, in which resource data of the target account is stored, and the computer device transfers the resource data in the resource account of the target account to the first contract address in response to the resource transfer request.

[0088] In one possible implementation, the target account is associated with a payment account in a payment application, and the payment account has a resource account, and the resource account is used to store resource data of the payment account. In response to the resource transfer request, the computer device determines the payment account associated with the target account, and transfers the resource data in the payment account to the first contract address.

[0089] In a possible implementation, the resource transfer request carries a first quantity, and the resource transfer request is used to request the transfer of the first quantity of resource data. In response to the resource transfer request, the computer device transfers the first quantity of resource data of the target account to the first contract address.

[0090] In one possible implementation, the blockchain system is used to store resource data of a first type, and the target account has resource data of a second type. The resource transfer request carries a first quantity, and the resource transfer request is used to request the storage of a first quantity of resource data of the first type in the blockchain system. In response to the resource transfer request, the computer device determines the second quantity corresponding to the first quantity based on the replacement relationship between the first type of resource data and the second type of resource data, and the first quantity of the first type of resource data is equivalent to the second quantity of the second type of resource data. The computer device converts the second quantity of the second type of resource data of the target account into the first quantity of the first type of resource data, and transfers the first quantity of the first type of resource data to the first contract address.

[0091] 504. When the amount of resource data in the first contract address reaches a preset amount, the computer device transfers the account hash value of the target account and the contract code of the first smart contract to the second smart contract, calls the second smart contract, generates the first contract address based on the account hash value, and deploys the first smart contract consisting of the contract code and located at the first contract address in the blockchain system.

[0092] The computer device monitors the amount of resource data in the first contract address. Whenever resource data is transferred to the first contract address, the computer device determines whether the amount of resource data in the first contract address reaches a preset amount. If the amount of resource data in the first contract address reaches a preset amount, the computer device obtains the account hash value of the target account and the contract code of the first smart contract, and passes the account hash value and contract code as parameters to the second smart contract in the blockchain system. The second smart contract is a contract program for deploying smart contracts. Therefore, after the account hash value and contract code are passed to the second smart contract, the second smart contract can be called, and the first contract address is generated based on the account hash value. Then, the first smart contract consisting of the contract code and located in the first contract address is deployed in the blockchain system. The first smart contract is a contract program for transferring resource data.

[0093] Among them, the process of the second smart contract generating the first contract address based on the account hash value is the same as the step of generating the first contract address based on the account hash value in the above step 502. The address for storing resource data calculated in the above step 502 is the same as the address for deploying the smart contract calculated in the step 504. In other words, the method used to calculate the address for storing resource data in the above step 502 is the same as the method used to calculate the address for deploying the smart contract in the subsequent step 504. The address for storing resource data calculated in step 502 must be the address for deploying the smart contract calculated in step 504. It can be understood that in the embodiment of the present application, the first contract address of the first smart contract is used as the address for storing resource data transferred by the target account. Furthermore, since the first smart contract has not been deployed when the target account is registered, but the first smart contract is deployed when the amount of resource data in the first contract address of the first smart contract reaches a preset amount, it is equivalent to predicting in advance the first contract address of the first smart contract to be deployed later when the target account is registered, and there is no need to deploy the first smart contract when the target account is registered. Therefore, the waste caused by deploying smart contracts due to the failure to transfer resource data after some accounts are registered can be avoided, thereby reducing the consumption of storage resources and processing resources in the blockchain system.

[0094] 505. The computer device calls the first smart contract, determines the collection address in the contract code of the first smart contract, and transfers the resource data in the first contract address to the collection address.

[0095] The first smart contract is a contract program for transferring resource data. When the computer device successfully deploys the first smart contract through the second smart contract, it automatically calls the first smart contract, determines the collection address in the contract code of the first smart contract, and transfers the resource data in the first contract address where the first smart contract is located to the collection address. The collection address is an address in the blockchain system for storing resource data transferred by each account.

[0096] It should be noted that the blockchain system stores the transaction records of the target account in the blockchain system, such as the amount of resource data transferred from the target account to the blockchain system, the amount of resource data transferred from the target account to the blockchain system, etc. Therefore, based on the transaction records of the target account, the amount of resource data owned by the target account in the blockchain system can be determined. Even if the resource data in the first contract address of the target account is transferred to the collection address, the target account can still use these resource data to conduct transactions in the blockchain system.

[0097] In a possible implementation, the contract code of the first smart contract also includes a type identifier. The computer device calls the first smart contract, determines the collection address in the contract code of the first smart contract, and transfers the resource data in the first contract address to the collection address, including: calling the first smart contract, determining the collection address and the type identifier in the contract code of the first smart contract, and transferring the resource data in the first contract address that belongs to the type indicated by the type identifier to the collection address.

[0098] The type identifier indicates the type of resource data that the first smart contract needs to transfer. The type identifier is used to limit the function of the first smart contract. The first smart contract with the type identifier is used to transfer resource data of the type indicated by the type identifier. The collection address is the address to which the first smart contract needs to transfer the resource data. The collection address and the type identifier are two variables in the contract code of the first smart contract.

[0099] It should also be noted that the contract code mentioned here includes the type identifier and collection address means that the contract code of the first smart contract after deployment includes the type identifier and collection address. Optionally, the type identifier or collection address is a type identifier inherent in the contract code of the first smart contract. When the contract code is generated, the collection address or type identifier in the contract code can be initialized to the expected value. Optionally, the type identifier or collection address is written into the contract code of the first smart contract by the second smart contract when the first smart contract is deployed. Therefore, the type identifier and collection address in the contract code of the first smart contract can be flexibly defined according to actual conditions. Among them, the detailed process of writing the type identifier into the contract code when the second smart contract deploys the first smart contract can be found in the following Figure 6 The embodiment shown.

[0100] 506. The computer device calls the first smart contract and clears the first smart contract from the blockchain system.

[0101] In an embodiment of the present application, after the resource data in the first contract address is transferred to the collection address by using the first smart contract, the first smart contract is called to clear the first smart contract from the blockchain system, thereby saving the resources occupied by the first smart contract and reducing the resources spent on deploying the smart contract.

[0102] It should be noted that the embodiment of the present application takes the example of calling the first smart contract to transfer resource data in step 505 and calling the first smart contract to clear the first smart contract in step 506. In another possible implementation, the steps of transferring resource data and clearing the first smart contract only require one call to the first smart contract, that is, after calling the first smart contract, the first smart contract automatically executes the step of transferring resource data, and after the transfer is completed, the first smart contract is automatically cleared to complete self-destruction.

[0103] It should be noted that after the resource data in the first contract address is transferred to the collection address and the first smart contract is cleared from the blockchain system, the amount of resource data in the first contract address is 0. When the resource transfer request of the target account is received again, the resource data is transferred to the first contract address. When the amount of resource data in the first contract address reaches the preset amount again, the second smart contract is re-called to deploy the first smart contract, the first smart contract is called to transfer the resource data in the first contract address to the collection address, and then the first smart contract is cleared from the blockchain system again, that is, the computer device will execute the above steps 501-506 in a loop.

[0104] It should be noted that the embodiment of the present application only takes the processing of resource data of a target account as an example for explanation, and in actual application, the above steps 501 to 506 can be executed for any account registered in the blockchain system. In one possible implementation, there is only one second smart contract in the blockchain system, and whenever the amount of resource data in the contract address corresponding to any account reaches a preset value, the second smart contract is called, and the first smart contract is deployed in the contract address corresponding to the account, so the first smart contract will be deployed for different accounts in the blockchain system.

[0105] In the embodiment of the present application, two smart contracts are involved, namely, a first smart contract and a second smart contract. The first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract. In one possible implementation, the contents of the first smart contract and the second smart contract are as follows.

[0106] (I) First Smart Contract:

[0107] The first smart contract includes a construction method and two variables, the two variables are the type identifier of resource data and the collection address, the type identifier of resource data and the collection address can be parameters inherent in the contract code of the first smart contract, or can be parameters written into the contract code of the first smart contract when the first smart contract is deployed. The type identifier of resource data indicates the type of resource data to be transferred by the first smart contract, and the collection address is the address to which the first smart contract needs to transfer resource data. The construction method is used to execute the steps of transferring resource data and destroying smart contracts.

[0108] When deploying the first smart contract, the construction method in the first smart contract is automatically executed, and the construction method is used to perform the following operations: 1. Transfer the resource data in the contract address where the first smart contract is located to the collection address; 2. After completing the resource data transfer, clear the first smart contract from the blockchain system.

[0109] (II) Second Smart Contract:

[0110] The second smart contract includes a method named deploy smart contract, which is used to deploy the smart contract. The method includes two parameters, salt and init_code. Salt represents the account hash value, which is the parameter passed in when calling the second smart contract. The account hash value is used to participate in the calculation of the contract address of the smart contract to be deployed, and init_code represents the contract code of the smart contract to be deployed.

[0111] The method provided in the embodiment of the present application generates a contract address in a blockchain system when registering an account, and the account transfers resource data to the contract address. When the amount of resource data in the contract address reaches a preset amount, the second smart contract deploys the first smart contract at the contract address based on the contract code of the first smart contract, and then the first smart contract transfers the resource data in the contract address to the collection address. In the present application, since the contract address of the first smart contract is used as the address for storing resource data, the resource data in the contract address of the first smart contract can be directly transferred out through the first smart contract in the future, without the need to use a private key for verification, saving the storage space consumed by maintaining the private key and reducing the processing pressure. In addition, since the present application does not deploy the first smart contract when registering an account, but deploys the first smart contract when it is necessary to collect resource data, it can avoid the waste caused by deploying smart contracts due to the failure to transfer resource data after some accounts are registered, further reducing the consumption of storage space and processors.

[0112] In an embodiment of the present application, the contract address of the first smart contract to be deployed later is predicted in advance when registering an account, and the contract address is used as the address for storing resource data. Whenever the resource data in the contract address corresponding to the account in the blockchain reaches a preset number, the first smart contract corresponding to the contract address is automatically deployed through the second smart contract deployed in the blockchain system, thereby automatically transferring the resource data in the contract address to the collection address. On the one hand, since the contract address is predictable, and on the other hand, since the second smart contract can automatically deploy the first smart contract, there is no need to deploy the first smart contract when registering an account, but only when the first smart contract is needed to transfer resource data, and the first smart contract is cleared after the transfer of resource data is completed, thereby reducing the number of smart contracts deployed at the same time in the blockchain system, and further saving storage resources and processing resources in the blockchain system.

[0113] Above Figure 5 The embodiment shown does not clearly divide the types of resource data. In another embodiment, a contract address corresponding to an account can store multiple different types of resource data at the same time. In this case, the management method of resource data can refer to the following Figure 6 The embodiment shown.

[0114] Figure 6 is a flow chart of a data processing method based on a smart contract provided in an embodiment of the present application. The embodiment of the present application is executed by a computer device, see Figure 6 , the method comprising:

[0115] 601. The computer device transfers the resource data to a first contract address in the blockchain system in response to a resource transfer request sent by the target account, where the first contract address is an address generated based on the target account when registering the target account.

[0116] In the embodiment of the present application, the first contract address is used to store multiple types of resource data, and the resource transfer request sent by the target account also carries a type identifier, and the computer device transfers the resource data of the type indicated by the type identifier to the first contract address. Different resource transfer requests can carry different type identifiers, and the computer device will transfer different types of resource data to the first contract address, so the first contract address will store multiple types of resource data.

[0117] In addition, the process of step 601 is the same as the process of step 503, which will not be described in detail here.

[0118] 602. When the amount of resource data belonging to the target type in the first contract address reaches a preset amount, the computer device transmits the account hash value of the target account, the contract code of the first smart contract and the target type identifier to the second smart contract, where the target type identifier is used to indicate the target type, which is any one of multiple types.

[0119] The computer device monitors the quantity of each type of resource data in the first contract address. Taking the target type as an example, whenever resource data belonging to the target type is transferred into the first contract address, the computer device determines whether the quantity of resource data belonging to the target type in the first contract address reaches a preset quantity. If the quantity of resource data belonging to the target type reaches a preset quantity, the computer device obtains the account hash value of the target account, the contract code of the first smart contract, and the target type identifier of the target type, and passes the account hash value, contract code, and target type identifier as parameters into the second smart contract in the blockchain system.

[0120] 603. The computer device calls the second smart contract, generates the first contract address based on the account hash value, writes the target type identifier into the contract code, and deploys the first smart contract consisting of the contract code and located at the first contract address in the blockchain system.

[0121] After the computer device passes the account hash value, contract code and target type identifier into the second smart contract, the second smart contract can be called, a first contract address is generated based on the account hash value, and then the target type identifier is written into the contract code, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

[0122] 604. The computer device calls the first smart contract, determines the collection address and the target type identifier in the contract code of the first smart contract, and transfers the resource data of the target type indicated by the target type identifier in the first contract address to the collection address.

[0123] When the computer device successfully deploys the first smart contract through the second smart contract, it automatically calls the first smart contract, determines the collection address and target type identifier in the contract code of the first smart contract, and transfers the resource data belonging to the target type to the collection address in the first contract address where the first smart contract is located.

[0124] According to the method provided in the embodiment of the present application, when multiple types of resource data can be stored in the first contract address, if it is necessary to collect resource data belonging to a target type, when the second smart contract deploys the first smart contract, the type of resource data that needs to be collected is specified by passing the target type identifier of the target type into the contract code of the first smart contract. The first smart contract will automatically transfer the resource data of the specified type to the collection address, thereby improving the flexibility of managing resource data in the blockchain system.

[0125] Figure 7 Schematic diagram of a data processing device based on smart contracts provided in an embodiment of the present application. Figure 7 , the device comprises:

[0126] The transfer module 701 is used to transfer the resource data to the first contract address in the blockchain system in response to the resource transfer request sent by the target account, where the first contract address is the address generated based on the target account when registering the target account;

[0127] The first calling module 702 is used to call the second smart contract in the blockchain system when the amount of resource data in the first contract address reaches a preset amount, and deploy the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract, the first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract;

[0128] The second calling module 703 is used to call the first smart contract and transfer the resource data in the first contract address where the first smart contract is located to the collection address, and the collection address is used to store the resource data transferred by any account.

[0129] The data processing device based on smart contracts provided in the embodiment of the present application generates a contract address in a blockchain system when registering an account, and the account transfers resource data to the contract address. When the amount of resource data in the contract address reaches a preset amount, the second smart contract deploys the first smart contract at the contract address based on the contract code of the first smart contract, and then the first smart contract transfers the resource data in the contract address to the collection address. In the present application, since the contract address of the first smart contract is used as the address for storing resource data, the resource data in the contract address of the first smart contract can be directly transferred out through the first smart contract in the future, without the need to use a private key for verification, saving the storage space consumed by maintaining the private key and reducing the processing pressure. In addition, since the present application does not deploy the first smart contract when registering an account, but deploys the first smart contract when it is necessary to collect resource data, it can avoid the waste caused by deploying smart contracts due to the failure to transfer resource data after some accounts are registered, further reducing the consumption of storage space and processors.

[0130] Alternatively, see Figure 8 The device further includes an address generating module 704, which is used to:

[0131] In response to the account registration request, registering a target account;

[0132] Perform hash processing on the target account to obtain the account hash value of the target account;

[0133] Based on the account hash value, the first contract address in the blockchain system is generated.

[0134] Optionally, the address generation module 704 is used to:

[0135] Obtain the contract code of the first smart contract and the second contract address of the second smart contract;

[0136] The account hash value, contract code and second contract address are processed according to preset rules to obtain the first contract address.

[0137] Optionally, the address generation module 704 is used to:

[0138] Hash the contract code to obtain the code hash value of the contract code;

[0139] Concatenate the preset value, account hash value, code hash value, and second contract address to obtain the concatenation result;

[0140] Hash the concatenated result to get the first contract address.

[0141] Optionally, the second calling module 703 is further used to call the first smart contract to clear the first smart contract from the blockchain system.

[0142] Optionally, the first calling module 702 is used to:

[0143] When the amount of resource data in the first contract address reaches a preset amount, the account hash value of the target account and the contract code of the first smart contract are passed to the second smart contract, the second smart contract is called, and the first contract address is generated based on the account hash value. The first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

[0144] Optionally, the second calling module 703 is used to:

[0145] The first smart contract is called, the collection address is determined in the contract code of the first smart contract, and the resource data in the first contract address is transferred to the collection address.

[0146] Optionally, the contract code of the first smart contract also includes a type identifier; the second calling module 703 is used to:

[0147] Calling the first smart contract, and determining the collection address and type identifier in the contract code of the first smart contract;

[0148] Transfer the resource data of the type indicated by the type identifier in the first contract address to the collection address.

[0149] Optionally, the first contract address stores multiple types of resource data, and the first calling module 702 is used to:

[0150] When the amount of resource data belonging to the target type in the first contract address reaches a preset amount, the account hash value of the target account, the contract code of the first smart contract and the target type identifier are passed to the second smart contract, where the target type identifier is used to indicate the target type, which is any one of multiple types;

[0151] The second smart contract is called, the first contract address is generated based on the account hash value, the target type identifier is written into the contract code, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

[0152] It should be noted that the data processing device based on smart contracts provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the data processing device based on smart contracts provided in the above embodiments and the data processing method embodiment based on smart contracts belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0153] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the data processing method based on smart contracts in the above embodiment.

[0154] Optionally, the computer device is provided as a terminal. Fig. 9 The schematic diagram of the structure of a terminal 900 provided by an exemplary embodiment of the present application is shown. The terminal 900 includes: a processor 901 and a memory 902 .

[0155] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0156] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one computer program, which is used by the processor 901 to implement the data processing method based on the smart contract provided in the method embodiment of the present application.

[0157] In some embodiments, the terminal 900 may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Optionally, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907 and a power supply 908.

[0158] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0159] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0160] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, set on the front panel of the terminal 900; in other embodiments, the display screen 905 can be at least two, respectively set on different surfaces of the terminal 900 or in a folding design; in other embodiments, the display screen 905 can be a flexible display screen, set on the curved surface or folding surface of the terminal 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0161] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal 900, and the rear camera is arranged on the back of the terminal 900. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0162] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.

[0163] The power supply 908 is used to power various components in the terminal 900. The power supply 908 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 908 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0164] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0165] Optionally, the computer device is provided as a server. Fig.10 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1001 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.

[0166] An embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the smart contract-based data processing method of the above embodiment.

[0167] The present application embodiment also provides a computer program product, including a computer program, which is loaded and executed by a processor to implement the operations performed by the data processing method based on smart contracts in the above-mentioned embodiment. In some embodiments, the computer program involved in the embodiment of the present application can be deployed on a computer device for execution, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected by a communication network. Multiple computer devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain system.

[0168] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0169] The above description is only an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A data processing method based on smart contracts, characterized in that: The method comprises: In response to a resource transfer request sent by the target account, the resource data is transferred to a first contract address in the blockchain system, where the first contract address is an address generated based on the target account when the target account is registered; When the amount of resource data in the first contract address reaches a preset amount, a second smart contract in the blockchain system is called, and based on the contract code of the first smart contract, the first smart contract located at the first contract address is deployed in the blockchain system, the first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract; The first smart contract is called to transfer the resource data in the first contract address where the first smart contract is located to the collection address, where the collection address is used to store resource data transferred by any account.

2. The method according to claim 1, characterized in that Before transferring the resource data to the first contract address in the blockchain system in response to the resource transfer request sent by the target account, the method further includes: In response to the account registration request, register the target account; Performing hash processing on the target account to obtain an account hash value of the target account; Based on the account hash value, the first contract address in the blockchain system is generated.

3. The method according to claim 2, characterized in that The generating the first contract address in the blockchain system based on the account hash value includes: Obtaining the contract code of the first smart contract and the second contract address of the second smart contract; The account hash value, the contract code and the second contract address are processed according to preset rules to obtain the first contract address.

4. The method according to claim 3, characterized in that: The processing of the account hash value, the contract code and the second contract address according to a preset rule to obtain the first contract address includes: Performing hash processing on the contract code to obtain a code hash value of the contract code; Concatenate the preset value, the account hash value, the code hash value and the second contract address to obtain a concatenation result; The concatenated result is hashed to obtain the first contract address.

5. The method according to claim 1, characterized in that After calling the first smart contract and transferring the resource data in the first contract address where the first smart contract is located to the collection address, the method further includes: The first smart contract is called to clear the first smart contract from the blockchain system.

6. The method according to claim 1, characterized in that When the amount of resource data in the first contract address reaches a preset amount, calling the second smart contract in the blockchain system, and deploying the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract, includes: When the amount of resource data in the first contract address reaches the preset amount, the account hash value of the target account and the contract code of the first smart contract are passed to the second smart contract, the second smart contract is called, and the first contract address is generated based on the account hash value, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

7. The method according to claim 1, characterized in that The calling of the first smart contract to transfer the resource data in the first contract address where the first smart contract is located to the collection address includes: The first smart contract is called, the collection address is determined in the contract code of the first smart contract, and the resource data in the first contract address is transferred to the collection address.

8. The method according to claim 7, characterized in that The contract code of the first smart contract also includes a type identifier; calling the first smart contract, determining the collection address in the contract code of the first smart contract, and transferring the resource data in the first contract address to the collection address, includes: Calling the first smart contract, and determining the collection address and the type identifier in the contract code of the first smart contract; The resource data of the type indicated by the type identifier in the first contract address is transferred to the collection address.

9. The method according to claim 1, characterized in that: The first contract address stores multiple types of resource data. When the amount of resource data in the first contract address reaches a preset amount, calling a second smart contract in the blockchain system, and deploying the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract, includes: When the amount of resource data belonging to the target type in the first contract address reaches the preset amount, the account hash value of the target account, the contract code of the first smart contract and the target type identifier are transmitted to the second smart contract, where the target type identifier is used to indicate the target type, and the target type is any one of the multiple types; The second smart contract is called, the first contract address is generated based on the account hash value, the target type identifier is written into the contract code, and the first smart contract consisting of the contract code and located at the first contract address is deployed in the blockchain system.

10. A data processing device based on smart contracts, characterized in that: The device comprises: A transfer module, configured to transfer resource data to a first contract address in the blockchain system in response to a resource transfer request sent by the target account, wherein the first contract address is an address generated based on the target account when the target account is registered; A first calling module is used to call a second smart contract in the blockchain system when the amount of resource data in the first contract address reaches a preset amount, and deploy the first smart contract located at the first contract address in the blockchain system based on the contract code of the first smart contract, wherein the first smart contract is used to transfer resource data, and the second smart contract is used to deploy any smart contract; The second calling module is used to call the first smart contract and transfer the resource data in the first contract address where the first smart contract is located to the collection address, where the collection address is used to store resource data transferred by any account.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the smart contract-based data processing method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the smart contract-based data processing method as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that The computer program is loaded and executed by a processor to implement the operations performed by the smart contract-based data processing method as described in any one of claims 1 to 9.