Resource processing method based on block chain and related device
The staking and replacement of virtual resources is achieved through blockchain technology, solving the problem of inefficient and risky acquisition of other types of resources without selling virtual resources, improving processing efficiency and ensuring security.
Patent Information
- Application Number
- CN202410006649.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the process of how to pledge virtual resources to acquire other categories of virtual resources without selling them is inefficient and has a risk of value fluctuation.
Through blockchain technology, resource replacement requests are obtained, virtual resources that are staked blockchain addresses are received, and the number of replacements can be determined, and the replacement virtual resources are transferred to the target blockchain address to realize the pledge and replacement of virtual resources.
The efficiency of virtual resource staking processing is improved, losses caused by fluctuations in the value of pledged virtual resources are avoided, and the security and stability of virtual resources are ensured.
Smart Images

Figure CN120258793A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular, to a resource processing method based on blockchain, a resource processing device based on blockchain, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] A blockchain is a series of text records (also known as blocks) concatenated and protected by cryptography. The distributed ledger concatenated by blockchain technology allows two parties to effectively record transactions and can permanently verify these transactions. Blockchain technology can be applied to the field of virtual resources, and different types of virtual resources can be converted using blockchain technology.
[0003] Virtual resource transactions usually involve a resource object selling a part of the virtual resources it holds to obtain other types of virtual resources. However, in some cases, the demand of the resource object is to pledge a certain amount of virtual resources to obtain other types of virtual resources without selling the virtual resources. Therefore, how to implement the pledge of virtual resources is an urgent problem to be solved at present. Summary of the Invention
[0004] Embodiments of this application provide a resource processing method and related devices based on blockchain, which can realize pledging one type of virtual resource and exchanging it for another type of virtual resource, improve the efficiency of virtual resource pledge processing, and avoid losses caused by value fluctuations of the pledged virtual resources.
[0005] On the one hand, embodiments of this application provide a resource processing method based on blockchain, and the method includes:
[0006] Obtain a resource exchange request of a first object, where the resource exchange request is used to request pledging a first quantity of first virtual resources to a second object and exchanging second virtual resources from the second object;
[0007] Receive the first quantity of first virtual resources transferred out from a target blockchain address, and transfer the first quantity of first virtual resources to a pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources;
[0008] Determine a second quantity of the second virtual resources that can be exchanged for the first quantity of first virtual resources;
[0009] Transfer the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
[0010] On the one hand, an embodiment of the present application provides a blockchain-based resource processing device, the device includes:
[0011] An acquisition unit, configured to acquire a resource replacement request of a first object, where the resource replacement request is used to request to pledge a first quantity of first virtual resources to a second object and replace the first virtual resources with second virtual resources from the second object;
[0012] A processing unit, configured to receive the first quantity of first virtual resources transferred out from the target blockchain address, and transfer the first quantity of first virtual resources to a pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources;
[0013] A determination unit, configured to determine a second quantity of second virtual resources that can be replaced by the first quantity of first virtual resources;
[0014] The processing unit is further configured to transfer the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
[0015] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a communication interface, and a memory, the processor, the communication interface, and the memory are interconnected, wherein the memory stores executable program code, and the processor is configured to call the executable program code to implement the blockchain-based resource processing method provided by the embodiment of the present application.
[0016] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions run on a computer, the computer is enabled to implement the blockchain-based resource processing method provided by the embodiment of the present application.
[0017] Correspondingly, an embodiment of the present application further provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device implements the blockchain-based resource processing method provided by the embodiment of the present application.
[0018] Through the blockchain-based resource processing method provided by the embodiment of the present application, a resource replacement request can be obtained and the first quantity of the first virtual resource transferred out from the target blockchain address can be received, and the first virtual resource pledged by the first object can be received, which is convenient for implementing the pledge processing of a type of virtual resource; the first quantity of the first virtual resource can be transferred to the pledge blockchain address, and the pledge blockchain address can store various different types of pledged virtual resources, so as to facilitate the pledge processing of various different types of virtual resources and meet different application requirements; the second quantity of the second virtual resource that can be replaced by the first quantity of the first virtual resource can be determined, making the pledge of virtual resources more reasonable and improving the usage experience; the second quantity of the second virtual resource under the replacement blockchain address can be transferred to the target blockchain address to implement the replacement processing of virtual resources, effectively improving the processing efficiency of virtual resources. At the same time, the method provided by the present application can avoid the loss of virtual resources caused by the value fluctuation of the pledged virtual pledges, effectively ensuring the security of virtual resources; since the replacement blockchain address can store various different types of replacement virtual resources, the method provided by the present application can implement the replacement of various different types of virtual resources and has good universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0020] Figure 1 It is a schematic structural diagram of a blockchain system provided by an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of a block structure provided by an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram of the system architecture of a blockchain-based resource processing system provided by an embodiment of the present application;
[0023] Figure 4 It is a schematic flowchart of a resource processing method based on blockchain provided by an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of a resource pledge method provided by an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of a resource unpledge method provided by an embodiment of the present application;
[0026] Figure 7 It is a schematic flowchart of another resource processing method based on blockchain provided by an embodiment of the present application;
[0027] Figure 8 It is a schematic diagram of another resource pledge method provided by an embodiment of the present application;
[0028] Figure 9 It is a schematic diagram of another resource unpledge method provided by an embodiment of the present application;
[0029] Figure 10 It is a schematic diagram of a resource processing system provided by an embodiment of the present application;
[0030] Figure 11 It is a structural block diagram of a resource processing device based on blockchain provided by an embodiment of the present application;
[0031] Figure 12 It is a structural block diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0032] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0033] It should be noted that the descriptions such as "first" and "second" involved in the embodiments of the present application are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Therefore, the technical features defined with "first" and "second" may explicitly or implicitly include at least one such feature.
[0034] Virtual resource trading usually involves a resource object selling its held original virtual resources and obtaining other types of virtual resources. If the resource object's demand is to obtain the original virtual resources, it needs to use other types of virtual resources for purchase. In some cases, however, the resource object's demand is to pledge the original virtual resources without selling them to obtain other types of virtual resources. Therefore, how to implement the pledge of virtual resources is an urgent problem to be solved currently.
[0035] Based on this, the embodiments of the present application provide a blockchain-based resource processing method, which can obtain a resource replacement request of a first object, where the resource replacement request is used to request pledging a first quantity of first virtual resources to a second object and replacing the first virtual resources with second virtual resources from the second object; receive the first quantity of first virtual resources transferred out from a target blockchain address and transfer the first quantity of first virtual resources to a pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources; determine the second quantity of the second virtual resources that can be replaced by the first quantity of first virtual resources; transfer the second quantity of second virtual resources under a replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources. Through the method provided by the embodiments of the present application, it is possible to pledge one type of virtual resources and replace them with another type of virtual resources, effectively improving the efficiency of virtual resource pledge processing, avoiding losses caused by value fluctuations of the pledged virtual resources, and ensuring the security of virtual resources.
[0036] The resource processing method based on blockchain provided by the embodiments of this application can also be applied to the field of cloud computing. Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services as needed. The cloud computing resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices. The resource processing method based on blockchain provided by the embodiments of this application can be implemented using cloud computing technology: A second object can obtain a resource replacement request of a first object, where the resource replacement request is used to request pledging a first quantity of first virtual resources to the second object and replacing them with second virtual resources from the second object; the second object can also receive the first quantity of first virtual resources transferred out from the target blockchain address and transfer the first quantity of first virtual resources to the pledging blockchain address; the target blockchain address is the blockchain address of the first object, and the pledging blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources; the second object can use cloud computing technology to determine the second quantity of second virtual resources that can be replaced by the first quantity of first virtual resources; and transfer the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources. Through the method provided by the embodiments of this application, it is possible to pledge one type of virtual resource and replace it with another type of virtual resource, which can effectively improve the efficiency of the pledging process of virtual resources and enhance the user experience.
[0037] The blockchain system formed by connecting multiple nodes in the form of network communication involved in the resource processing method based on blockchain provided by this application. Refer to Figure 1 , which is a schematic structural diagram of a blockchain system provided by the embodiments of this application. The blockchain network 101 consists of multiple nodes 102 (any form of computing device connected to the network, such as a server, user terminal) and a client 103; a peer-to-peer network is formed between each node, and the peer-to-peer protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In the blockchain system, any machine such as a server or terminal can join and become a node, and a node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0038] Refer to Figure 1 The functions of each node in the blockchain system shown, and the functions involved include:
[0039] 1. Routing, a basic function of a node, used to support communication between nodes.
[0040] In addition to having routing functions, a node may also have the following functions:
[0041] 2. An application, which is used to be deployed in a blockchain, implements specific services according to actual business requirements, records data related to the implemented functions to form recorded data, carries a digital signature in the recorded data to indicate the source of the task data, and sends the recorded data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the recorded data, they add the recorded data to a temporary block.
[0042] For example, the services implemented by the application include:
[0043] 2.1 Resource storage address, which is used to provide the function of conducting transactions of electronic resources, including initiating a transaction (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After other nodes verify it successfully, as a response acknowledging the validity of the transaction, they deposit the recorded data of the transaction into the temporary block of the blockchain; of course, the resource storage address also supports querying the remaining electronic resources in the electronic resource address.
[0044] 2.2 Shared ledger, which is used to provide functions such as storage, query, and modification of account data. It sends the recorded data of the operations on the account data to other nodes in the blockchain system. After other nodes verify its validity, as a response acknowledging the validity of the account data, they deposit the recorded data into the temporary block and can also send a confirmation to the node that initiated the operation.
[0045] 2.3 Smart contract, a computerized protocol that can execute the terms of a certain contract, implemented through code deployed on the shared ledger and executed when certain conditions are met. According to actual business requirements, the code is used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic resources to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0046] 3. A blockchain includes a series of blocks (Block) that are sequentially connected in the order of generation. Once a new block is added to the blockchain, it will not be removed again. The block records the recorded data submitted by nodes in the blockchain system.
[0047] Please refer to Figure 2 , which is a schematic diagram of a block structure provided by an embodiment of this application. Figure 2 It includes three blocks, Block 1, Block 2, and Block 3. Each block includes data, 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. The blocks are connected through the hash values to form a blockchain. In addition, the block may also include information such as the timestamp when the block is generated.
[0048] Next, the architecture of the blockchain-based resource processing system provided in the embodiments of the present application will be introduced in conjunction with the accompanying drawings.
[0049] Please refer to Figure 3 , which is a schematic diagram of the system architecture of a blockchain-based resource processing system provided in the embodiments of the present application. The blockchain-based resource processing system includes a terminal device 301, a resource pledge server 302, a blockchain network 303 (including multiple nodes, such as Figure 3 node 1, node 2,... node N in, where N is an integer greater than 2) and a resource exchange server 304. The resource pledge server 302 can perform data interaction with the terminal device 301, the nodes in the blockchain network 303, and the resource exchange server 304.
[0050] Among them:
[0051] The terminal device 301 is a device corresponding to the first object. The terminal device 301 can generate a resource replacement request and send the resource replacement request to the resource pledge server 302. The terminal device 301 can be a handheld device with communication functions (such as a smart phone, a tablet computer), a computing device (such as a personal computer (Personal Computer, PC), a vehicle-mounted terminal, a smart voice interaction device, a wearable device, or other intelligent devices, etc., but not limited thereto).
[0052] The resource pledge server 302 is a device corresponding to the second object, can receive the resource replacement request sent by the terminal device 301, and can also store and manage virtual resources. The resource pledge server 302 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0053] The blockchain network 303 can implement the pledge processing of virtual resources according to a smart contract and generate intermediate virtual resources. The blockchain network 303 includes multiple blockchain nodes, and each blockchain node can implement the pledge processing of virtual resources. The specific structure of the blockchain network 303 can be as described above Figure 1 shown.
[0054] The resource exchange server 304 is a device corresponding to a third object. The resource exchange server 304 can implement the conversion process between intermediate virtual resources and replacement virtual resources. The resource exchange server 304 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0055] The following will elaborate in detail on Figure 3 the working principle of the blockchain-based resource processing system as shown:
[0056] The terminal device 301 can send a resource replacement request for a first object to the resource pledge server 302. The resource replacement request is used to request pledging a first quantity of first virtual resources to a second object and replacing the second virtual resources from the second object. The resource pledge server 302 can receive the first quantity of first virtual resources transferred out from the target blockchain address and transfer the first quantity of first virtual resources to the pledge blockchain address. The target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources. The pledged virtual resources include the first virtual resources. The resource pledge server 302 can determine the second quantity of second virtual resources that can be replaced by the first quantity of first virtual resources. If the quantity of the second virtual resources under the replacement blockchain address is greater than or equal to the second quantity, the resource pledge server 302 can directly transfer the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address. The replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources. The replacement virtual resources include the second virtual resources.
[0057] In some cases, if the quantity of the pledged virtual resources of the first category under the pledge blockchain address is greater than or equal to the first set quantity, the resource pledge server 302 can construct a resource replacement transaction that indicates pledging the pledged virtual resources of the first category to replace the third virtual resources. The resource pledge server 302 can send the resource replacement transaction to the block-producing nodes in the blockchain network 303 ( Figure 3Among them, the block-producing node is node 2); the block-producing node executes a resource replacement transaction, transfers the first type of pledged virtual resources under the pledged blockchain address to the smart contract address, and transfers the fourth quantity of the third virtual resources to the cache blockchain address; the cache blockchain address is the blockchain address of the second object for storing intermediate virtual resources, and the intermediate virtual resources include the third virtual resources; the fourth quantity of the third virtual resources matches the first type of pledged virtual resources under the pledged blockchain address. The block-producing node can also generate a data block according to the relevant data of the resource replacement transaction and add the data block to the blockchain.
[0058] In some cases, if the quantity of the second type of intermediate virtual resources under the cache blockchain address is greater than or equal to the second set quantity, the resource pledge server 302 can send a resource exchange request to the resource exchange server 304, and the resource exchange request is used to request to exchange the second type of intermediate virtual resources for replacement virtual resources; the resource pledge server 302 can transfer the second type of intermediate virtual resources under the cache blockchain address to the blockchain address of the third object; the resource exchange server 304 can perform resource exchange processing according to the transferred second type of intermediate virtual resources, transfer the fifth quantity of replacement virtual resources from the blockchain address of the third object to the replacement blockchain address, and the fifth quantity of replacement virtual resources matches the second type of intermediate virtual resources under the cache blockchain address.
[0059] Through the blockchain-based resource processing method provided by the embodiments of the present application, it is possible to pledge one type and replace to obtain another type of virtual resources, and directly use the virtual resources stored under the blockchain address to implement the virtual resource replacement process, effectively improving the processing efficiency and enhancing the usage experience; it is possible to use blockchain technology to implement on-chain virtual resource pledge processing, ensuring the security of virtual resources and the stability of the system.
[0060] It can be understood that the schematic architecture diagram of the blockchain-based resource processing system described in the embodiments of the present application is for more clearly explaining the blockchain-based resource processing method of the embodiments of the present application, and does not constitute a limitation on the blockchain-based resource processing method provided by the embodiments of the present application. For example, the blockchain-based resource processing method provided by the embodiments of the present application can be executed not only by the resource pledge server 302, but also by other devices different from the resource pledge server 302 and capable of communicating with the terminal device 301, the blockchain network 303, and the resource exchange server 304. As is known to those of ordinary skill in the art, Figure 3The numbers of the terminal device 301, the blockchain nodes in the blockchain network 303, the resource pledge server 302, and the resource exchange server 304 are merely illustrative. According to the needs of business implementation, devices and nodes with any number can be configured. Moreover, with the evolution of the system architecture and the emergence of new business scenarios, the blockchain-based resource processing method provided in the embodiments of the present application is equally applicable to similar technical problems.
[0061] It should be noted that the collection and processing of relevant data in this application (such as resource replacement requests, the quantity of virtual resources, etc.) should strictly comply with the requirements of relevant laws and regulations during actual application, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws and regulations and the personal information subject.
[0062] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of a blockchain-based resource processing method provided by an embodiment of the present application. This blockchain-based resource processing method can be implemented by the above-mentioned resource pledge server 302 or by other devices. The process of the blockchain-based resource processing method provided in the embodiments of the present application includes but is not limited to:
[0063] S401. Obtain a resource replacement request of a first object, where the resource replacement request is used to request pledging a first quantity of first virtual resources to a second object and replacing second virtual resources from the second object.
[0064] In the embodiments of the present application, the first object can hold a certain amount of virtual resources and can conduct transactions and pledge processing of virtual resources. The second object can hold a certain amount of virtual resources, can conduct transactions and pledge processing of virtual resources, and can also implement corresponding functions in response to the requests of the first object. In some cases, the first object can pledge a certain amount of virtual resources to obtain other types of virtual resources. When the first object returns the corresponding quantity of other types of virtual resources, it can redeem the pledged virtual resources. Then, the first object sends a resource replacement request, and the second object can obtain the resource replacement request of the first object. This resource replacement request can be used to request pledging a first quantity of first virtual resources to the second object and replacing second virtual resources from the second object. The categories of the first virtual resources and the second virtual resources are different.
[0065] It should be noted that the virtual resources are stored under the blockchain address of the object. The blockchain address of the first object is the target blockchain address, and the quantity of the first virtual resources under the target blockchain address is greater than or equal to the first quantity.
[0066] S402. Receive the first quantity of the first virtual resources transferred out from the target blockchain address, and transfer the first quantity of the first virtual resources to the pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources.
[0067] In the embodiments of the present application, the blockchain address of the first object is the target blockchain address, and the virtual resources held by the first object are stored under the target blockchain address. The second object can receive the first quantity of the first virtual resources transferred out from the target blockchain address, and transfer the first quantity of the first virtual resources to the pledge blockchain address. The pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources can include the first virtual resources or other categories of virtual resources. The pledge blockchain address can store the pledged virtual resources received by the second object, facilitating subsequent direct processing of virtual resources using the pledged virtual resources stored under the pledge blockchain address and improving the processing efficiency.
[0068] It should be noted that the first quantity of the first virtual resources received by the second object transferred out from the target blockchain address can be transferred out by the first object, or obtained by the second object from the target blockchain address, or forwarded by an object different from the first object and the second object (such as a blockchain node in the blockchain network).
[0069] S403. Determine the second quantity of the second virtual resources that can be exchanged for the first quantity of the first virtual resources.
[0070] In the embodiments of the present application, the second object can determine the second quantity of the second virtual resources that can be exchanged for the first quantity of the first virtual resources. The second object can determine the second quantity according to the resource value ratio between the first virtual resources and the second virtual resources, or determine the second quantity according to the relationship between the first virtual resources and other categories of virtual resources. Through the method provided in the embodiments of the present application, the second quantity of the second virtual resources can be determined, ensuring the accuracy and reasonableness of virtual resource pledge and improving the usage experience.
[0071] S404. Transfer the second quantity of the second virtual resources under the exchange blockchain address to the target blockchain address; the exchange blockchain address is the blockchain address of the second object for storing exchange virtual resources, and the exchange virtual resources include the second virtual resources.
[0072] In the embodiments of the present application, the second object may transfer a second quantity of second virtual resources under the replacement blockchain address to the target blockchain address. The replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources. The replacement virtual resources may include second virtual resources or other types of virtual resources. The first object may pledge the first virtual resources to obtain the second virtual resources or other types of virtual resources from the second object. The replacement virtual resources stored under the replacement blockchain address are obtained by the second object sending a resource exchange request to the third object. The resource exchange request is used to request to exchange the intermediate virtual resources under the cache blockchain address for the replacement virtual resources. The cache blockchain address is the blockchain address of the second object for storing intermediate virtual resources. The intermediate virtual resources under the cache blockchain address are obtained by the second object constructing a resource replacement transaction and sending the resource replacement transaction to the block-producing nodes in the blockchain network. The resource replacement transaction may indicate pledging the pledged virtual resources under the above-mentioned pledged blockchain address to replace the intermediate virtual resources. Through the method provided by the embodiments of the present application, it is possible to pledge virtual resources and replace them with other types of virtual resources, avoiding losses caused by value fluctuations of the pledged virtual resources, ensuring the security of virtual resources, and improving the processing efficiency.
[0073] In one embodiment, the second object includes a pledged blockchain address, a cache blockchain address, and a replacement blockchain address. Different types of pledged virtual resources may be stored under the pledged blockchain address, different types of intermediate virtual resources may be stored under the cache blockchain address, and different types of replacement virtual resources may be stored under the replacement blockchain address. Storing virtual resources with different functions under different blockchain addresses can facilitate the second object to process different virtual resources, improve the overall processing efficiency, and also improve the management efficiency of virtual resources.
[0074] It should be noted that, in some cases, the pledged virtual resources stored under the pledged blockchain address may be virtual resources generated based on blockchain technology and tradable over the Internet. The intermediate virtual resources stored under the cache blockchain address may be virtual resources generated based on blockchain technology, tradable over the Internet, and usually with relatively small value fluctuations. The replacement virtual resources stored under the replacement blockchain address may be virtual resources generated based on blockchain technology and recognized by special institutions, etc.
[0075] Please refer to Figure 5 , which is a schematic diagram of a resource pledge method provided by the embodiments of the present application. The blockchain address of the first object is the target blockchain address. Multiple types of virtual resources may be stored under the target blockchain address (such as Figure 5The virtual resources of type A, virtual resources of type B, and the first virtual resource in ), the second object includes a pledge blockchain address and a replacement blockchain address. Among them, the pledge blockchain address stores pledged virtual resources, and the pledged virtual resources include the first virtual resource and virtual resources of type A; the replacement blockchain address stores replacement virtual resources, and the replacement virtual resources include the second virtual resource. Figure 5 It also includes the quantities of various virtual resources: Under the target blockchain address, the quantity of virtual resources of type A is 10, the quantity of virtual resources of type B is 10, and the quantity of the first virtual resource is 20; under the pledge blockchain address, the quantity of the first virtual resource is 10, and the quantity of virtual resources of type A is 5; under the replacement blockchain address, the quantity of the second virtual resource is 30. When conducting virtual resource pledge, the first object sends a resource replacement request to the second object. This resource replacement request is used to request pledging the first quantity (10) of the first virtual resource to the second object and replacing it with the second virtual resource from the second object. The first object transfers out the first quantity (10) of the first virtual resource from the target blockchain address, and the second object transfers the transferred first quantity (10) of the first virtual resource into the pledge blockchain address. The second object can determine the second quantity (20) of the second virtual resource that can be replaced by the first quantity of the first virtual resource, and can transfer the second quantity (20) of the second virtual resource under the replacement blockchain address into the target blockchain address. After the resource transfer is completed, under the target blockchain address, the quantity of the first virtual resource changes from 20 to 10, and the target blockchain address newly adds the second virtual resource with a quantity of 20; under the pledge blockchain address, the quantity of the first virtual resource changes from 10 to 20, and under the replacement blockchain address, the quantity of the second virtual resource changes from 30 to 10. Through the method provided by the embodiments of this application, the pledge and replacement processing of virtual resources can be realized, the efficiency of pledge processing is improved, and the security of virtual resources is ensured.
[0076] In one embodiment, the method provided by this application can also implement the process of unlocking pledged virtual resources: obtain an unlocking request of a first object, where the unlocking request is used to request unlocking processing of the first virtual resources pledged to a second object; receive a third quantity of second virtual resources transferred out from a target blockchain address, and transfer the third quantity of second virtual resources to a replacement blockchain address; the third quantity is determined according to a second quantity and resource growth information; transfer a first quantity of the first virtual resources under a pledged blockchain address to the target blockchain address. If the first object has pledged virtual resources to the second object, the first object can send an unlocking request to the second object, and the unlocking request can be used to request unlocking processing of the first virtual resources pledged to the second object; after the second object obtains the unlocking request of the first object, it can receive a third quantity of second virtual resources transferred out from the target blockchain address of the first object, and transfer the third quantity of second virtual resources to the replacement blockchain address, where the third quantity can be determined according to the second quantity and resource growth information, and the resource growth information can include information such as resource pledge consumption, resource pledge time, and block height. The second object can transfer a first quantity of the first virtual resources under the pledged blockchain address to the target blockchain address.
[0077] For example: The first object pledges 20 first virtual resources to the second object and obtains 30 second virtual resources from the second object. The first object can send an unlocking request to the second object, and the unlocking request is used to request unlocking processing of the 20 first virtual resources pledged to the second object; the third quantity can be determined to be 32 according to the second quantity and resource growth information. After the second object obtains the unlocking request of the first object, it can receive 32 second virtual resources transferred out from the target blockchain address and transfer the 32 second virtual resources to the replacement blockchain address; the second object can transfer 20 first virtual resources under the pledged blockchain address to the target blockchain address. Through the method provided by the embodiment of this application, the redemption processing of virtual resources can be implemented, ensuring the security of virtual resources and the stability of the system.
[0078] It should be noted that assuming the first object has pledged a first quantity of the first virtual resources to the second object, when unlocking, the first object can request to unlock a target quantity of the first virtual resources, and the target quantity can be less than or equal to the first quantity, that is, the first object can unlock part or all of the pledged first virtual resources.
[0079] Please refer to Figure 6, this figure is a schematic diagram of a resource unlocking pledge method provided by an embodiment of the present application. The blockchain address of the first object is the target blockchain address. Under the target blockchain address, there are Class A virtual resources, Class B virtual resources, the first virtual resource, and the second virtual resource. The second object includes a pledge blockchain address and a replacement blockchain address. Among them, the pledge virtual resources are stored under the pledge blockchain address, and the pledge virtual resources include the first virtual resource and Class A virtual resources; the replacement virtual resources are stored under the replacement blockchain address, and the replacement virtual resources include the second virtual resource. Figure 6 It also includes the quantities of various virtual resources: Under the target blockchain address, the quantity of Class A virtual resources is 10, the quantity of Class B virtual resources is 10, the quantity of the first virtual resource is 10, and the quantity of the second virtual resource is 25; under the pledge blockchain address, the quantity of the first virtual resource is 20, and the quantity of Class A virtual resources is 5; under the replacement blockchain address, the quantity of the second virtual resource is 10. The first object has pledged a first quantity of the first virtual resource to the second object. When unlocking the pledge of the virtual resource, the first object can send an unlocking pledge request to the second object, and this unlocking pledge request is used to request the unlocking pledge processing of the first virtual resource pledged to the second object; the second object can receive the third quantity (21) of the second virtual resource transferred from under the target blockchain address (this third quantity is determined according to the second quantity (20) and the resource growth information), and transfer the third quantity (21) of the second virtual resource to the replacement blockchain address. The second object can transfer the first quantity (10) of the first virtual resource under the pledge blockchain address to the target blockchain address. After the resource unlocking pledge processing is completed, under the target blockchain address, the quantity of the first virtual resource changes from 10 to 20, the quantity of the second virtual resource changes from 25 to 4, the quantity of the first virtual resource under the pledge blockchain address changes from 20 to 10, and the quantity of the second virtual resource under the replacement blockchain address changes from 10 to 21. Through the method provided by the embodiment of the present application, the redemption and replacement processing of virtual resources can be realized, the redemption processing efficiency of virtual resources can be improved, and the usage experience can be enhanced.
[0080] Through the blockchain-based resource processing method provided by the embodiment of the present application, it is possible to pledge virtual resources and replace them with other types of virtual resources, or transfer virtual resources and redeem the pledged virtual resources. While ensuring the security of virtual resources, it meets the application requirements; it is possible to pledge multiple different types of virtual resources to obtain different types of virtual resources, which has good universality and can be applied to multiple scenarios; it is possible to use the virtual resources stored under the replacement blockchain address and the virtual resources stored under the pledge blockchain address to realize the pledge and redemption of virtual resources, effectively improving the processing efficiency of virtual resources, effectively saving resources, and avoiding losses caused by value fluctuations of pledged virtual resources.
[0081] Please refer toFigure 7 , Figure 7 is a schematic flowchart of another blockchain-based resource processing method provided by an embodiment of the present application. The blockchain-based resource processing method can be implemented by the above-mentioned resource pledge server 302 or by other devices. The process of the blockchain-based resource processing method provided in the embodiment of the present application includes but is not limited to:
[0082] S701. Obtain a resource exchange request of a first object, where the resource exchange request is used to request pledging a first quantity of first virtual resources to a second object and exchanging second virtual resources from the second object.
[0083] In the embodiment of the present application, the first object can hold a certain amount of virtual resources and can perform transactions and pledge processing of virtual resources. The second object can hold a certain amount of virtual resources, can perform transactions and pledge processing of virtual resources, and can implement corresponding functions in response to the request of the first object. The first object can send a resource exchange request to the second object, and the second object can obtain the resource exchange request of the first object. The resource exchange request can be used to request pledging a first quantity of first virtual resources to the second object and exchanging second virtual resources from the second object. The categories of the first virtual resources and the second virtual resources are different.
[0084] It should be noted that the virtual resources are stored under the blockchain address of the object. The blockchain address of the first object is the target blockchain address, and the quantity of the first virtual resources under the target blockchain address is greater than or equal to the first quantity. The target blockchain address can be analogized to a "resource pool", and the first virtual resources are stored in the "resource pool".
[0085] S702. Receive the first quantity of first virtual resources transferred out from the target blockchain address and transfer the first quantity of first virtual resources to the pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources.
[0086] In the embodiments of the present application, the blockchain address of the first object is the target blockchain address, and the virtual resources held by the first object are stored under the target blockchain address. The second object can receive the first quantity of the first virtual resources transferred out from the target blockchain address and transfer the first quantity of the first virtual resources into the pledge blockchain address. The pledge blockchain address is the blockchain address used by the second object to store the pledged virtual resources. The pledged virtual resources may include the first virtual resources or other categories of virtual resources. The pledge blockchain address can store the pledged virtual resources received by the second object, facilitating subsequent direct processing of the virtual resources using the pledged virtual resources stored under the pledge blockchain address and improving the processing efficiency.
[0087] It should be noted that multiple different categories of pledged virtual resources can be stored under the pledge blockchain address, and different categories of pledged virtual resources are stored separately. For example: A total of 3 categories of pledged virtual resources are stored under the pledge blockchain address, namely type A virtual resources, type B virtual resources, and type C virtual resources. Then the form of the virtual resources stored under the pledge blockchain address can be "20 type A virtual resources", "10 type B virtual resources", and "15 type C virtual resources". Through the method provided by the embodiments of the present application, separate storage of different categories of virtual resources can be achieved, facilitating subsequent related processing of the virtual resources and improving the processing efficiency.
[0088] S703. Determine the second quantity of the second virtual resources that can be exchanged for the first quantity of the first virtual resources.
[0089] In the embodiments of the present application, the second object can determine the second quantity of the second virtual resources that can be exchanged for the first quantity of the first virtual resources. The second object can determine the second quantity according to the resource value ratio between the first virtual resources and the second virtual resources, or can also determine the second quantity according to the relationship between the first virtual resources and other categories of virtual resources. Through the method provided by the embodiments of the present application, the second quantity of the second virtual resources can be determined, ensuring the accuracy and reasonableness of virtual resource pledge and enhancing the usage experience.
[0090] In one embodiment, the second object can determine the second quantity of the second virtual resources that can be exchanged for the first quantity of the first virtual resources according to the pledge configuration information. The pledge configuration information may include information such as the category of the first virtual resources, the category of the second virtual resources, the first quantity, the pledge type, etc. Among them, the pledge type may include the type of pledging the first virtual resources (for example: long-term pledge type, short-term pledge type, current pledge type, etc.). Since the value of virtual resources fluctuates greatly, the second quantity can be determined according to the pledge type. For example: If the value of the first virtual resources fluctuates greatly, the second quantity determined under the long-term pledge type may be less than or greater than the second quantity determined under the short-term pledge type.
[0091] S704. Compare the second quantity with the replacement quantity included in the resource replacement request to obtain a comparison result.
[0092] In the embodiments of the present application, the resource replacement request may further include the replacement quantity of the second virtual resource to be replaced. The second object may compare the second quantity with the replacement quantity to obtain a comparison result. If the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, it means that the second virtual resource transferred by the second object to the first object meets the requirements of the first object, and the transfer of the virtual resource can be directly realized. If the comparison result indicates that the second quantity is less than the replacement data, it means that the second virtual resource transferred by the second object to the first object does not meet the requirements of the first object and further processing is required. Through the method provided by the embodiments of the present application, the universality of the method can be improved, and the requirements of different application scenarios can be met.
[0093] S705. If the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, transfer the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing the replacement virtual resources, and the replacement virtual resources include the second virtual resource.
[0094] In the embodiments of the present application, if the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, the second object may transfer the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address. The replacement blockchain address is the blockchain address of the second object for storing the replacement virtual resources. The replacement virtual resources may include the second virtual resource or other types of virtual resources. The first object may pledge the first virtual resource to obtain the second virtual resource or other types of virtual resources from the second object. The second object may also transfer the replacement quantity of the second virtual resource under the replacement blockchain address to the target blockchain address. For example: The resource replacement request of the first object is used to request pledging 10 first virtual resources to the second object and replacing the second virtual resource from the second object. The resource replacement request further includes the replacement quantity, which is 20. The second object may determine that the second quantity of the second virtual resource that can be replaced by 10 first virtual resources is 21. Compare the replacement quantity with the second quantity. The comparison result indicates that the second quantity (21) is greater than the replacement quantity (20). Then the second object may transfer 21 second virtual resources under the replacement blockchain address to the target blockchain address, or transfer 20 second virtual resources under the replacement blockchain address to the target blockchain address. Through the method provided by the embodiments of the present application, personalized processing of virtual resource pledge can be realized, and the usage experience can be improved.
[0095] In one embodiment, the method provided by this application may further: if the comparison result indicates that the second quantity is less than the replacement quantity, send a prompt message to the first object, where the prompt message is used to prompt the first object whether it is sure to replace the first quantity of first virtual resources with the second quantity of second virtual resources; if a confirmation replacement instruction input by the first object for the prompt message is obtained, execute the step of transferring the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address. The second object compares the replacement quantity with the second quantity. If the comparison result indicates that the second quantity is less than the replacement quantity, the second object may send a prompt message to the first object, and the prompt message may be used to prompt the first object whether it is sure to replace the first quantity of second virtual resources with the second quantity of second virtual resources. After receiving the prompt message, the first object may receive an instruction input for the prompt message (a confirmation replacement instruction or a rejection replacement instruction) and send the received instruction to the second object. If the second object obtains a confirmation replacement instruction input by the first object for the prompt message, the second object may execute the step of transferring the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address; if the second object obtains a rejection replacement instruction input by the first object for the prompt message, the second object may execute the step of transferring the first quantity of first virtual resources under the pledge blockchain address to the target blockchain address, that is, return the transferred first quantity of first virtual resources to the first object and terminate the virtual resource pledge process.
[0096] For example: The resource replacement request of the first object is used to request to pledge 30 first virtual resources to the second object and replace the second virtual resources from the second object. The resource replacement request further includes a replacement quantity of 60; the second object may determine that the second quantity of second virtual resources that can be replaced by 30 first virtual resources is 55, compare the replacement quantity with the second quantity, and the comparison result indicates that the second quantity (55) is less than the replacement quantity (60). Then the second object may send a prompt message to the first object, and the prompt message is used to prompt the first object whether it is sure to replace 30 first virtual resources with 55 second virtual resources. If the second object obtains a confirmation replacement instruction input by the first object for the prompt message, the second object may execute the step of transferring 55 second virtual resources under the replacement blockchain address to the target blockchain address; if the second object obtains a rejection replacement instruction input by the first object for the prompt message, the second object may transfer 30 first virtual resources under the pledge blockchain address to the target blockchain address. Through the method provided by the embodiments of this application, personalized pledge processing of virtual resources can be realized, ensuring the security of virtual resources and making the method provided by this application universal.
[0097] It should be noted that the replacement virtual resources stored under the replacement blockchain address are obtained by the second object sending a resource exchange request to the third object. The resource exchange request is used to request the exchange of the replacement virtual resources by using the intermediate virtual resources stored under the cached blockchain address. The cached blockchain address is the blockchain address of the second object for storing the intermediate virtual resources. The intermediate virtual resources under the cached blockchain address are obtained by the second object constructing a resource replacement transaction and sending the resource replacement transaction to the block-producing node in the blockchain network. The resource replacement transaction can indicate the pledging of the pledged virtual resources under the above-mentioned pledged blockchain address to replace the intermediate virtual resources.
[0098] In one embodiment, the method provided by the present application may further: if the quantity of the pledged virtual resources of the first category under the pledged blockchain address is greater than or equal to the first set quantity, construct a resource replacement transaction, where the resource replacement transaction indicates the pledging of the pledged virtual resources of the first category to replace the third virtual resources; send the resource replacement transaction to the block-producing node in the blockchain network, so that the block-producing node executes the resource replacement transaction, transfers the pledged virtual resources of the first category under the pledged blockchain address to the smart contract address, and transfers the fourth quantity of the third virtual resources to the cached blockchain address; the cached blockchain address is the blockchain address of the second object for storing the intermediate virtual resources, and the intermediate virtual resources include the third virtual resources; the fourth quantity of the third virtual resources matches the pledged virtual resources of the first category under the pledged blockchain address. When the quantity of the pledged virtual resources of the first category under the pledged blockchain address of the second object is greater than or equal to the first set quantity (for example: the quantity of the pledged virtual resources of the first category under the pledged blockchain address is greater than 3% of the total quantity), the second object may construct a resource replacement transaction, and the resource replacement transaction may indicate the pledging of the pledged virtual resources of the first category to replace the third virtual resources. It may also be that when the quantity of the pledged virtual resources of the first category under the pledged blockchain address meets the blockchain transaction conditions, the second object constructs a resource replacement transaction. The first category of pledged virtual resources may be the same as or different from the category of the above-mentioned first virtual resources. The second object may send the resource replacement transaction to the block-producing node in the blockchain network. After receiving the resource replacement transaction, the block-producing node may execute the resource replacement transaction, transfer the pledged virtual resources of the first category under the pledged blockchain address to the smart contract address, and transfer the fourth quantity of the third virtual resources to the cached blockchain address of the second object, where the cached blockchain address is the blockchain address of the second object for storing the intermediate virtual resources, the intermediate virtual resources may include the third virtual resources, and the fourth quantity of the third virtual resources matches the pledged virtual resources of the first category under the pledged blockchain address. The fourth quantity may be determined according to the value ratio between the pledged virtual resources and the third virtual resources, or may be determined according to the pledging type of the pledged virtual resources.
[0099] For example: The quantity of the first type of pledged virtual resources under the pledged blockchain address (which is 25) is greater than the first set quantity. The second object constructs a resource replacement transaction, and this resource replacement transaction instructs to pledge 25 first-type pledged virtual resources to replace the third virtual resource. The second object sends the resource replacement transaction to the block-producing node in the blockchain network. The block-producing node executes this resource replacement transaction, transfers 25 first-type pledged virtual resources under the pledged blockchain address to the smart contract address, and transfers the fourth quantity (20) of the third virtual resource to the cached blockchain address of the second object. This fourth quantity is determined according to the pledge type and pledge quantity of the first type of pledged virtual resources. Through the method provided by the embodiments of the present application, after the pledged virtual resources stored under the pledged blockchain address accumulate to a certain quantity, a resource replacement transaction can be constructed to implement the pledged processing of virtual resources, effectively saving the network resources and computing resources of the system. At the same time, the normal processing of virtual resource pledges is ensured, and the stability of the system is maintained.
[0100] In one embodiment, after the block-producing node executes the resource replacement transaction, it can generate a data block according to the relevant data of the resource replacement transaction and broadcast this data block to multiple consensus nodes in the blockchain network. After each consensus node receives this data block, it can perform verification processing on the resource replacement transaction in this data block. If the verification passes, then this consensus node broadcasts the verification passed information to other nodes in the blockchain network. The block-producing node receives and counts the verification passed information sent by the consensus nodes within a certain period of time. If the ratio of the number of consensus nodes that pass the verification to the number of consensus nodes in the blockchain network is greater than the threshold, it is determined that each node reaches a consensus, and the block-producing node and other nodes add this data block to the blockchain. Through the method provided by the embodiments of the present application, the on-chain processing of the relevant data of the resource replacement transaction can be realized, effectively improving the security and integrity of the data.
[0101] It should be noted that the size of the first set quantity can be adjusted according to different actual application requirements. The block-producing node can execute a resource replacement transaction according to the smart contract, transfer the first-category pledged virtual resources under the pledged blockchain address to the smart contract address, and generate the third virtual resources of the fourth quantity according to the smart contract, and transfer the third virtual resources of the fourth quantity to the cache blockchain address. The smart contract used by the block-producing node can be a decentralized pledge contract. For example, the smart contracts used by the AAVE contract and the MakerDAO platform. The AAVE contract is a decentralized non-custodial liquidity protocol. Liquidity resource providers can provide liquidity by depositing virtual resources into the public fund pool of AAVE and obtain additional resources. Resource acquirers can borrow resources from the public fund pool in various ways with over-collateralization or no collateral. The advantages of the AAVE contract are: it can support more types of virtual resources, has lower interest rates, is safer, and has higher liquidity. The MakerDAO platform is a decentralized virtual resource system based on blockchain technology, which also includes smart contracts associated with virtual resource pledges. The steps to realize virtual resource pledges based on this smart contract can be: 1. Create a pledged virtual resource library and lock in a specific category and quantity of pledged virtual resources; 2. Generate a certain quantity of other categories of virtual resources (for example: the third virtual resources) according to the pledged virtual resources; 3. If you want to retrieve some or all of the pledged virtual resources, the object corresponding to the pledged virtual resource library must transfer out some or all of the third virtual resources it has obtained, and transfer out the stable fees that accumulate during the period of the outstanding third virtual resources; 4. After transferring out the corresponding quantity of the third virtual resources, the pledged virtual resource library can return some or all of the collateral to the blockchain address of the object to realize the redemption of the virtual resources.
[0102] In one embodiment, the method provided by this application may further: if the number of intermediate virtual resources of the second category under the cached blockchain address is greater than or equal to a second set number, send a resource exchange request to a third object, where the resource exchange request is used to request to exchange the intermediate virtual resources of the second category for replacement virtual resources; transfer the intermediate virtual resources of the second category under the cached blockchain address to the blockchain address of the third object; receive the fifth quantity of replacement virtual resources transferred out from the blockchain address of the third object, and transfer the fifth quantity of replacement virtual resources to the replacement blockchain address, where the fifth quantity of replacement virtual resources matches the intermediate virtual resources of the second category under the cached blockchain address. There is a cached blockchain address in the second object for storing intermediate virtual resources. When the number of intermediate virtual resources of the second category under the cached blockchain address is greater than or equal to a second set number (for example: the number of intermediate virtual resources of the second category under the cached blockchain address is greater than 3% of the total amount), the second object may send a resource exchange request to the third object, and the third object can realize the exchange between different categories of virtual resources. The resource exchange request is used to request to exchange the intermediate virtual resources of the second category for replacement virtual resources. The category of the intermediate virtual resources of the second category may be the same as or different from the category of the third virtual resource. It may also be that when the number of intermediate virtual resources of the second category under the cached blockchain address meets the resource exchange condition, the second object sends a resource exchange request to the third object.
[0103] After sending a resource exchange request, the second object can transfer intermediate virtual resources of the second category under the cached blockchain address to the blockchain address of the third object; the third object can determine the fifth quantity according to the quantity of the intermediate virtual resources of the second category transferred in, the category of the intermediate virtual resources of the second category, and the category of the replacement virtual resources, and the third object can transfer the fifth quantity of replacement virtual resources under the blockchain address of the third object to the blockchain address corresponding to the second object. The second object can receive the fifth quantity of replacement virtual resources transferred out from the blockchain address of the third object and transfer the fifth quantity of replacement virtual resources to the replacement blockchain address. For example: if the quantity of the intermediate virtual resources of the second category under the cached blockchain address (which is 40) is greater than the second set quantity, the second object sends a resource exchange request to the third object, and the resource exchange request is used to request to exchange 40 intermediate virtual resources of the second category for replacement virtual resources; the second object can transfer 40 intermediate virtual resources of the second category under the cached blockchain address to the blockchain address of the third object; the third object determines that the fifth quantity of replacement virtual resources that can be exchanged for 40 intermediate virtual resources of the second category is 60; the third object transfers 60 replacement virtual resources under the blockchain address of the third object to the blockchain address corresponding to the second object, and the second object can receive 60 replacement virtual resources transferred out from the blockchain address of the third object and transfer 60 replacement virtual resources to the replacement blockchain address. Through the method provided by the embodiments of the present application, after the intermediate virtual resources stored under the cached blockchain address accumulate to a certain quantity, a resource exchange request can be sent to the third object to implement virtual resource exchange processing, effectively saving the network resources and computing resources of the system, and at the same time ensuring the normal processing of virtual resource pledge and maintaining the stability of the system.
[0104] In one embodiment, a second object obtains a resource replacement request of a first object. The resource replacement request is used to request pledging a first quantity of first virtual resources to the second object and replacing them with second virtual resources from the second object. The second object receives the first quantity of first virtual resources transferred out from a target blockchain address and transfers the first quantity of first virtual resources to a pledge blockchain address. The second object determines a second quantity of second virtual resources that can be replaced with the first quantity of first virtual resources. When the quantity of second virtual resources under a replacement blockchain address is less than the second quantity, the following operations can be performed: The second object constructs a target resource replacement transaction, which indicates pledging the first quantity of first virtual resources to replace third virtual resources. The second object sends the target resource replacement transaction to a block-producing node in the blockchain network, so that the block-producing node executes the target resource replacement transaction, transfers the first quantity of first virtual resources under the pledge blockchain address to a smart contract address, and transfers a target quantity of third virtual resources to a cache blockchain address. The target quantity of third virtual resources matches the first quantity of first virtual resources under the pledge blockchain address. The second object sends a resource exchange request to a third object. The resource exchange request is used to request exchanging the target quantity of third virtual resources for second virtual resources. The second object can transfer the target quantity of third virtual resources under the cache blockchain address to the blockchain address of the third object. The second object can receive the second quantity of second virtual resources transferred out from the blockchain address of the third object and transfer the second quantity of second virtual resources to the replacement blockchain address. The second quantity of second virtual resources matches the target quantity of third virtual resources under the cache blockchain address. The second object transfers the second quantity of second virtual resources to the target blockchain address. Through the method provided by the embodiments of the present application, the pledging and replacement processing of virtual resources can be realized by using blockchain technology. First, the first virtual resources can be pledged to obtain third virtual resources, and the third virtual resources can be exchanged for second virtual resources, ensuring the stability of the system. When the value of the pledged virtual resources fluctuates, no resource loss will occur, ensuring the stability and security of the virtual resources.
[0105] Please refer to Figure 8, this figure is a schematic diagram of another resource pledge method provided by an embodiment of the present application. The figure includes a first object, a second object, and a third object; the blockchain address of the first object is the target blockchain address, and 10 first virtual resources are stored under the target blockchain address. The second object includes a pledge blockchain address, a cache blockchain address, and a replacement blockchain address. Among them, pledge virtual resources are stored under the pledge blockchain address, and the pledge virtual resources include the first virtual resources. At this time, no first virtual resources are stored under the pledge blockchain address, that is, the number of first virtual resources is 0; intermediate virtual resources are stored under the cache blockchain address, and the intermediate virtual resources include the third virtual resources. At this time, no third virtual resources are stored under the cache blockchain address, that is, the number of third virtual resources is 0; replacement virtual resources are stored under the replacement blockchain address, and the replacement virtual resources include the second virtual resources. At this time, no second virtual resources are stored under the replacement blockchain address, that is, the number of second virtual resources is 0; intermediate virtual resources (i.e., the third virtual resources, and the number of third virtual resources is 0 at this time) and replacement virtual resources (i.e., the second virtual resources, and the number of second virtual resources is 30 at this time) are stored under the blockchain address of the third object. When performing resource pledge processing, the first object sends a resource replacement request to the second object, and this resource replacement request is used to request to pledge the first virtual resources with a first quantity (20) to the second object and replace the second virtual resources from the second object. The first object transfers out the first virtual resources with the first quantity (20) from the target blockchain address, and the second object transfers the transferred first virtual resources with the first quantity into the pledge blockchain address. At this time, the number of first virtual resources under the pledge blockchain address changes from 0 to 20; the number of first virtual resources under the target blockchain address changes from 20 to 0. The second object can determine the second quantity (10) of the second virtual resources that can be replaced by the first virtual resources with the first quantity.
[0106] Assume that the quantity (0) of the second virtual resources under the replacement blockchain address is less than the second quantity (10), then the second object can construct a target resource replacement transaction, and this target resource replacement transaction instructs to pledge the first virtual resources with the first quantity to replace the third virtual resources; the second object sends the target resource replacement transaction to the block-producing nodes in the blockchain network so that the block-producing nodes execute the target resource replacement transaction, transfer the first virtual resources with the first quantity (20) under the pledge blockchain address to the smart contract address, and transfer the target quantity (15) of the third virtual resources to the cache blockchain address. The target quantity of the third virtual resources matches the first quantity of the first virtual resources under the pledge blockchain address. At this time, the number of first virtual resources under the pledge blockchain address changes from 20 to 0, the number of first virtual resources under the smart contract address changes from 0 to 20, and the number of third virtual resources under the cache blockchain address changes from 0 to 15.
[0107] The second object sends a resource exchange request to the third object. The resource exchange request is used to request to exchange a target quantity (15) of the third virtual resource for the second virtual resource. The second object can transfer the target quantity (15) of the third virtual resource under the cached blockchain address to the blockchain address of the third object. The second object can receive the second quantity (10) of the second virtual resource transferred out from the blockchain address of the third object and transfer the second quantity (10) of the second virtual resource to the replacement blockchain address. The second quantity (10) of the second virtual resource matches the target quantity (15) of the third virtual resource under the cached blockchain address. At this time, the quantity of the third virtual resource under the cached blockchain address changes from 15 to 0, the quantity of the second virtual resource under the blockchain address of the third object changes from 30 to 20, the quantity of the third virtual resource changes from 0 to 15, and the quantity of the second virtual resource under the replacement blockchain address changes from 0 to 10.
[0108] The second object transfers the second quantity (10) of the second virtual resource from the replacement blockchain address to the target blockchain address. At this time, the quantity of the second virtual resource under the replacement blockchain address changes from 10 to 0, and the quantity of the second virtual resource under the target blockchain address changes from 0 to 10. Through the method provided by the embodiments of the present application, the pledge and replacement processing of virtual resources can be realized, the efficiency of the pledge processing is improved, and the security of the virtual resources is ensured.
[0109] In one embodiment, the method provided by the present application can also realize the process of releasing the pledge of virtual resources: obtain the pledge release request of the first object. The pledge release request is used to request to release the pledge of the first virtual resource pledged to the second object. Receive the third quantity of the second virtual resource transferred out from the target blockchain address and transfer the third quantity of the second virtual resource to the replacement blockchain address. The third quantity is determined according to the second quantity and the resource growth information. Transfer the first quantity of the first virtual resource under the pledged blockchain address to the target blockchain address. If the first object pledges the virtual resource to the second object, the first object can send a pledge release request to the second object. The pledge release request can be used to request to release the pledge of the first virtual resource pledged to the second object. After the second object obtains the pledge release request of the first object, it can receive the third quantity of the second virtual resource transferred out from the target blockchain address of the first object and transfer the third quantity of the second virtual resource to the replacement blockchain address. The third quantity can be determined according to the second quantity and the resource growth information. The second object can transfer the first quantity of the first virtual resource under the pledged blockchain address to the target blockchain address. Through the method provided by the embodiments of the present application, the redemption processing of virtual resources can be realized, the processing efficiency of resource redemption is improved, the security of virtual resources is ensured, and the stability of the system is also ensured.
[0110] In one embodiment, the resource growth information may include information such as resource pledge consumption, resource pledge type, resource pledge time, block height, etc.
[0111] It should be noted that, assuming that the first object pledges a first quantity of the first virtual resource to the second object, when unpledging, the first object may request to unpledge a target quantity of the first virtual resource, and the target quantity may be less than or equal to the first quantity, that is, the first object may unpledge some or all of the pledged first virtual resource.
[0112] In one embodiment, the method provided by this application may further: if the current quantity of the first virtual resource under the pledge blockchain address is less than the first quantity, determine the unpledge quantity of the first virtual resource according to the current quantity and the first quantity; construct a resource unpledge transaction, where the resource unpledge transaction indicates to perform an unpledge process on the unpledge quantity of the first virtual resource; send the unpledge transaction to the block-producing node in the blockchain network, so that the block-producing node executes the unpledge transaction, receives the transferred sixth quantity of the third virtual resource, and transfers the unpledge quantity of the first virtual resource under the smart contract address to the pledge blockchain address; the sixth quantity of the third virtual resource matches the unpledge quantity of the first virtual resource under the smart contract address. If the current quantity of the first virtual resource under the pledge blockchain address of the second object is less than the first quantity, it means that the quantity of the first virtual resource under the pledge blockchain address of the second object is small and cannot meet the needs of the first object. The second object needs to unpledge a part of the first virtual resource from the smart contract address of the blockchain node. The second object can determine the unpledge quantity of the first virtual resource according to the current quantity and the first quantity, and this unpledge quantity indicates the quantity of the virtual resource that the second object needs to unpledge from the blockchain node. The second object can construct a resource unpledge transaction, and this resource unpledge transaction can indicate to perform an unpledge process on the unpledge quantity of the first virtual resource; the second object can send this unpledge transaction to the block-producing node in the blockchain network, and this block-producing node can execute the unpledge transaction, receive the transferred sixth quantity of the third virtual resource, and transfer the unpledge quantity of the first virtual resource under the smart contract address to the pledge blockchain address of the second object, and the sixth quantity of the third virtual resource matches the unpledge quantity of the first virtual resource under the smart contract address.
[0113] For example, if the current quantity of the first virtual resource under the pledged blockchain address is 10, which is less than the first quantity (30), the second object can determine the unpledging quantity of the first virtual resource to be 20 based on the current quantity and the first quantity; the second object can construct a resource unpledging transaction, and this resource unpledging transaction indicates to unpledge 20 first virtual resources; the second object can send the unpledging transaction to the block-producing node in the blockchain network so that the block-producing node executes the unpledging transaction, receives the transferred sixth quantity of the third virtual resource, and transfers the first virtual resource with the unpledging quantity under the smart contract address to the pledged blockchain address; the sixth quantity can be determined according to the unpledging quantity.
[0114] It should be noted that the sixth quantity can be determined according to the unpledging quantity and the pledge growth information, that is, when using the block-producing node to unpledge virtual resources, it is necessary to transfer the third virtual resources of the original quantity and the growth quantity. For example: the second object can send a resource replacement transaction to the block-producing node to pledge 10 first virtual resources and obtain 20 third virtual resources; when unpledging, the second object can send an unpledging transaction to the block-producing node to transfer 23 third virtual resources to unpledge 10 first virtual resources. The sixth quantity is determined according to the original transferred quantity and the growth quantity, the growth quantity can be determined according to the pledge growth information and the unpledging quantity, and the pledge growth information can include information such as the resource pledge type, the pledge time (for example: the pledge duration of the virtual resource is determined by the change of the block height of the blockchain), and the pledged resource quantity. Through the method provided by the embodiments of the present application, the unpledging of virtual resources can be realized, ensuring the security of virtual resources and maintaining the stability of the system.
[0115] In one embodiment, the method provided by the present application may further: if the number of third virtual resources under the cached blockchain address is less than the sixth number, determine the conversion quantity according to the number of third virtual resources and the sixth number under the cached blockchain address, and send a resource conversion request to the third object. The resource conversion request is used to request to exchange the replacement virtual resources under the replacement blockchain address for the third virtual resources of the conversion quantity; transfer the seventh number of replacement virtual resources under the replacement blockchain address to the blockchain address of the third object; receive the third virtual resources of the conversion quantity transferred out from the blockchain address of the third object, and transfer the third virtual resources of the conversion quantity to the cached blockchain address. The seventh number of replacement virtual resources matches the third virtual resources of the conversion quantity. When unlocking the pledge of virtual resources, if the first virtual resources under the pledge blockchain address are insufficient, the second object needs to transfer the third virtual resources to the block-producing node in the blockchain network to unlock the pledge of the first virtual resources. If the third virtual resources under the cached blockchain address are insufficient, the second object needs to transfer the second virtual resources or replacement virtual resources to the third object to exchange for the third virtual resources. If the number of third virtual resources under the cached blockchain address is less than the sixth number, the second object may determine the conversion quantity according to the number of third virtual resources and the sixth number under the cached blockchain address. This conversion quantity is the number of third virtual resources required by the second object; the second object may send a resource conversion request to the third object. This resource conversion request may be used to request to exchange the replacement virtual resources under the replacement blockchain address for the third virtual resources of the conversion quantity; the second object may transfer the seventh number of replacement virtual resources under the replacement blockchain address to the blockchain address of the third object. The seventh number of replacement virtual resources matches the third virtual resources of the conversion quantity; and receive the third virtual resources of the conversion quantity transferred out from the blockchain address of the third object. The second object may transfer the third virtual resources of the conversion quantity to the cached blockchain address, so as to facilitate the second object to use the third virtual resources to unlock the pledge of the first virtual resources.
[0116] For example: the number of third virtual resources under the cached blockchain address (this number is 5) is less than the sixth number (30), then the second object may determine the conversion quantity (25) according to the number of third virtual resources and the sixth number under the cached blockchain address, and send a resource conversion request to the third object. The resource conversion request is used to request to exchange the replacement virtual resources under the replacement blockchain address for 25 third virtual resources; the second object may transfer 25 replacement virtual resources under the replacement blockchain address to the blockchain address of the third object; receive 25 third virtual resources transferred out from the blockchain address of the third object, and transfer 25 third virtual resources to the cached blockchain address. Through the method provided by the embodiments of the present application, the application requirements can be better met, the centralized unlocking of pledges of virtual resources is avoided, the processing efficiency is ensured, the network resources and computing resources of the system are saved, and the security of virtual resources is ensured.
[0117] It should be noted that before the second object transfers the seventh quantity of the replacement virtual resources under the replacement blockchain address to the blockchain address of the third object, the seventh quantity can also be determined according to the conversion quantity and the value ratio between the replacement virtual resources and the third virtual resources. Through the method provided by this application, the rationality of the exchange of different types of virtual resources can be ensured, and the security of the virtual resources and the stability of the system can be guaranteed.
[0118] Please refer to Figure 9 , which is a schematic diagram of another resource unlocking method provided by an embodiment of this application. This figure includes a first object, a second object, and a third object; the blockchain address of the first object is the target blockchain address, and the target blockchain address stores 11 second virtual resources and does not store the first virtual resource (i.e., the quantity of the first virtual resource is 0). The second object includes a pledge blockchain address, a cache blockchain address, and a replacement blockchain address. Among them, the pledge blockchain address stores pledge virtual resources, and the pledge virtual resources include the first virtual resource. At this time, the first virtual resource is not stored under the pledge blockchain address (i.e., the quantity of the first virtual resource is 0); the cache blockchain address stores intermediate virtual resources, and the intermediate virtual resources include the third virtual resource. At this time, the third virtual resource is not stored under the cache blockchain address (i.e., the quantity of the third virtual resource is 0); the replacement blockchain address stores replacement virtual resources, and the replacement virtual resources include the second virtual resource. At this time, the second virtual resource is not stored under the replacement blockchain address (i.e., the quantity of the second virtual resource is 0); the blockchain address of the third object stores intermediate virtual resources and replacement virtual resources. At this time, the quantity of the second virtual resource stored under the blockchain address of the third object is 20, and the quantity of the third virtual resource is 20.
[0119] When performing resource unlocking, the first object can send an unlocking request, which is used to request unlocking processing of the first virtual resource pledged to the second object; the second object can receive the third quantity (11) of the second virtual resources transferred from the target blockchain address and transfer the third quantity (11) of the second virtual resources to the replacement blockchain address. The third quantity (11) is determined according to the second quantity (10) and the resource growth information. At this time, the quantity of the second virtual resources under the target blockchain address changes from 11 to 0, and the quantity of the second virtual resources under the replacement blockchain address changes from 0 to 11.
[0120] Assume that the current quantity of the first virtual resource under the pledge blockchain address is greater than or equal to the first quantity, then the second object can directly transfer the first quantity of the first virtual resource under the pledge blockchain address to the target blockchain address; such as Figure 9As shown, if the current quantity (0) of the first virtual resource under the pledged blockchain address is less than the first quantity (20), the second object can determine the unpledging quantity (20) of the first virtual resource based on the current quantity (0) and the first quantity (20), and construct a resource unpledging transaction, which indicates the unpledging process for the unpledging quantity (20) of the first virtual resource. The second object can send the resource unpledging transaction to the block-producing node in the blockchain network. The block-producing node can execute the unpledging transaction, receive the transferred third virtual resource of the sixth quantity (18) (the third virtual resource of the sixth quantity matches the unpledging quantity of the first virtual resource under the smart contract address), and transfer the first virtual resource of the unpledging quantity (20) under the smart contract address to the pledged blockchain address of the second object. Then, the second object transfers the first virtual resource of the first quantity under the pledged blockchain address to the target blockchain address.
[0121] Assume that the quantity of the third virtual resource under the cached blockchain address of the second object is greater than or equal to the sixth quantity. Then, the second object can directly transfer the third virtual resource of the sixth quantity to the smart contract address; as Figure 9 described, if the quantity (0) of the third virtual resource under the cached blockchain address is less than the sixth quantity (18), the second object can determine the conversion quantity (18) based on the quantity (0) of the third virtual resource under the cached blockchain address and the sixth quantity (18), and send a resource conversion request to the third object. This resource conversion request is used to request the conversion of the third virtual resource of the conversion quantity using the replacement virtual resource under the replacement blockchain address. The second object can transfer the seventh quantity (11) of the replacement virtual resource under the replacement blockchain address to the blockchain address of the third object (the seventh quantity of the replacement virtual resource matches the third virtual resource of the conversion quantity), receive the transferred third virtual resource of the conversion quantity (18) from the blockchain address of the third object, and transfer the third virtual resource of the conversion quantity to the cached blockchain address. At this time, the quantity of the second virtual resource under the replacement blockchain address changes from 11 to 0, the quantity of the second virtual resource under the blockchain address of the third object changes from 20 to 31, the quantity of the third virtual resource changes from 20 to 2, and the quantity of the third virtual resource under the cached blockchain address changes from 0 to 18.
[0122] The second object can then transfer the third virtual resource of the sixth quantity (18) under the cached blockchain address to the smart contract address, receive the transferred first virtual resource of the first quantity (20) from the smart contract address, and transfer the received first virtual resource of the first quantity (20) to the pledged blockchain address. At this time, the quantity of the third virtual resource under the cached blockchain address changes from 18 to 0, the quantity of the third virtual resource under the smart contract address changes from 0 to 18, the quantity of the first virtual resource changes from 20 to 0, and the quantity of the first virtual resource under the pledged blockchain address changes from 0 to 20.
[0123] The second object can transfer the first quantity (20) of the first virtual resources under the pledged blockchain address to the target blockchain address. At this time, the quantity of the first virtual resources under the pledged blockchain address changes from 20 to 0, and the quantity of the first virtual resources under the target blockchain address changes from 0 to 20. Through the method provided by the embodiments of the present application, the unpledging process of virtual resources can be realized by using blockchain technology, which ensures the security of virtual resources, maintains the stability of the resource processing system, and can also effectively avoid the centralized unpledging situation of virtual resources, improving the processing efficiency of resource unpledging.
[0124] Please refer to Figure 10 , which is a schematic diagram of a resource processing system provided by the embodiments of the present application. Figure 10 It includes a terminal device 1001, a resource pledge server 1002, a block-producing node 1003, and a resource exchange server 1004. Among them, the terminal device 1001 corresponds to the first object. The terminal device 1001 includes a display module and a transceiver module. The display module is used to display the quantities of various virtual resources stored under the target blockchain address of the first object, and can also display a virtual resource pledge interface or a virtual resource unpledge interface, and receive the input instructions; the transceiver module is used to send a resource replacement request (or unpledge request) to the resource pledge server. The resource replacement request may include information such as the name of the virtual resource, the category of the virtual resource, and the quantity of the virtual resource, and receive the prompt information sent by the resource pledge server.
[0125] The resource pledge server 1002 corresponds to the above-mentioned second object. The resource pledge server 1002 includes a pledged resource pool (corresponding to the above-mentioned pledged blockchain address), a cached resource pool (corresponding to the above-mentioned cached blockchain address), a replacement resource pool (corresponding to the above-mentioned replacement blockchain address), a resource pledge module, and a resource exchange module. Among them:
[0126] The pledged resource pool is used to store the pledged virtual resources pledged by the first object. Different categories of pledged virtual resources are stored in the pledged resource pool in a classified manner. When the pledged virtual resources stored in the pledged resource pool accumulate to a certain amount, the pledged virtual resources in the pledged resource pool can be processed for resource pledging to obtain intermediate virtual resources.
[0127] The cached resource pool is used to store the intermediate virtual resources obtained by the resource pledge server through the pledged virtual resources. When the intermediate virtual resources stored in the cached resource pool accumulate to a certain amount, the intermediate virtual resources in the cached resource pool can be processed for resource exchange to obtain replacement virtual resources.
[0128] The replacement resource pool is used to store the replacement virtual resources.
[0129] The resource pledge module is used to implement data interaction between the resource pledge server and the block-producing node. The resource pledge module can construct a resource exchange transaction and send it to the block-producing node.
[0130] The resource exchange module is used to implement data interaction between the resource pledge server and the resource exchange server. The resource exchange module can generate a resource exchange request and send the resource exchange request to the resource exchange server.
[0131] The block-producing node 1003 is a node in the blockchain network. The block-producing node includes a blockchain, and the blockchain stores data related to virtual resources. The block-producing node 1003 includes a pledge module, a generation module, and a blockchain. Among them:
[0132] The pledge module can implement the resource exchange transaction sent by the resource pledge server according to the smart contract.
[0133] The generation module can generate a corresponding number of intermediate virtual resources according to the smart contract and the resource exchange transaction, and generate a data block according to the relevant data of the resource exchange transaction, and submit the data block to the blockchain.
[0134] The blockchain stores the relevant data of the resource exchange transaction.
[0135] The resource exchange server 1004 is used to implement the conversion between intermediate virtual resources and exchanged virtual resources. The resource exchange server 1004 includes a transmission module and a conversion module. Among them:
[0136] The transmission module can receive the resource exchange request sent by the resource pledge server 1002.
[0137] The conversion module is used for the mutual conversion between intermediate virtual resources and exchanged virtual resources.
[0138] In the Figure 10 shown resource processing system, the terminal device 1001 can send a resource exchange request to the resource pledge server 1002. The resource exchange request is used to request to pledge a first quantity of a first virtual resource to the resource pledge server 1002 and exchange a second virtual resource from the resource pledge server 1002. The resource pledge server 1002 can receive the first quantity of the first virtual resource transferred from the target blockchain address of the first object and store the first quantity of the first virtual resource in the pledged resource pool. The resource pledge server 1002 can determine the second quantity of the second virtual resource that can be exchanged for the first quantity of the first virtual resource. If the quantity of the second virtual resource in the exchange resource pool of the resource pledge server 1002 is greater than or equal to the second quantity, the resource pledge server 1002 transfers the second quantity of the second virtual resource to the target blockchain address of the terminal device 1001.
[0139] If the number of second virtual resources in the replacement resource pool of the resource pledge server 1002 is less than the second quantity, the resource pledge server 1002 may construct a resource replacement transaction, where the resource replacement transaction instructs to pledge the first virtual resource to replace the third virtual resource; the resource pledge server 1002 sends the resource replacement transaction to the block-producing node 1003, and the block-producing node 1003 implements the resource replacement transaction according to the smart contract, receives the first virtual resource transferred from the resource pledge server 1002, and generates the corresponding quantity of third virtual resources; the block-producing node 1003 transfers the generated third virtual resources to the cache resource pool.
[0140] The resource pledge server 1002 may generate a resource exchange request and send the resource exchange request to the resource exchange server 1004; the resource pledge server 1002 may transfer the corresponding quantity of third virtual resources from the cache resource pool to the blockchain address corresponding to the resource exchange server 1004, and the resource exchange server 1004 implements the resource exchange process and transfers the exchanged second virtual resources to the replacement resource pool.
[0141] After the resource pledge server 1002 receives the exchanged second virtual resources, it may transfer the corresponding quantity of second virtual resources from the replacement resource pool to the blockchain address corresponding to the terminal device 1001, so that the terminal device 1001 can realize the pledge of the first virtual pledge and obtain the second virtual resources. Through the method provided in the embodiments of the present application, the pledge of virtual resources can be realized, the processing efficiency of virtual resources can be improved, and the security of virtual resources is ensured.
[0142] It should be noted that after pledging the virtual resources, the above Figure 10 shown resource processing system can also be used to realize the unpledging of virtual resources and redeem the pledged virtual resources; the implementation method of realizing the unpledging of virtual resources by using the above Figure 10 shown resource processing system is similar to the above method of pledging virtual resources, and the specific implementation manner can refer to the method described in the above embodiments.
[0143] Through the blockchain-based resource processing method provided by the embodiments of the present application, after receiving a resource replacement request or a pledge release request of an object, the virtual resources under the replacement blockchain address or the pledge blockchain address can be directly transferred to the blockchain address of the object, effectively improving the efficiency of virtual resource processing and enhancing the usage experience. When the pledged virtual resources stored under the pledge blockchain address accumulate to a certain quantity, a resource replacement transaction can be constructed to implement the pledge processing of virtual resources, effectively saving the network resources and computing resources of the resource processing system, and at the same time ensuring the stability of the virtual resource pledge processing. The relevant data of the resource replacement transaction or the resource pledge release transaction can be uploaded to the blockchain, effectively improving the security and integrity of the data. The pledge and release of virtual resources can be performed according to requirements, better meeting different application requirements, avoiding the centralized release of virtual resources, and ensuring the processing efficiency of virtual resources. The pledged virtual resources can be pledged to obtain intermediate virtual resources, and then the intermediate virtual resources can be exchanged to obtain replacement virtual resources. By introducing intermediate virtual resources, the security of virtual resource pledge is ensured, and losses of virtual resources caused by value fluctuations of the pledged virtual resources are avoided, ensuring the security of virtual resources.
[0144] Please refer to Figure 11 , Figure 11 which is a structural block diagram of a blockchain-based resource processing device provided by an embodiment of the present application. The device includes:
[0145] An acquisition unit 1101, configured to acquire a resource replacement request of a first object, where the resource replacement request is used to request to pledge a first quantity of first virtual resources to a second object and replace the first virtual resources with second virtual resources from the second object;
[0146] A processing unit 1102, configured to receive the first quantity of first virtual resources transferred out from a target blockchain address and transfer the first quantity of first virtual resources to a pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources;
[0147] A determination unit 1103, configured to determine a second quantity of the second virtual resources that can be replaced by the first quantity of the first virtual resources;
[0148] The processing unit 1102 is further configured to transfer the second quantity of the second virtual resources under a replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
[0149] In one embodiment, the obtaining unit 1101 is further configured to: obtain a pledge release request of the first object, where the pledge release request is used to request a pledge release process for the first virtual resource pledged to the second object; receive a third quantity of the second virtual resource transferred out from the target blockchain address, and transfer the third quantity of the second virtual resource into the replacement blockchain address; the third quantity is determined according to the second quantity and the resource growth information; transfer the first quantity of the first virtual resource under the pledge blockchain address into the target blockchain address.
[0150] In one embodiment, the processing unit 1102 is further configured to: if the quantity of the pledged virtual resources of the first category under the pledge blockchain address is greater than or equal to a first set quantity, construct a resource replacement transaction, where the resource replacement transaction instructs to pledge the pledged virtual resources of the first category to replace the third virtual resource; send the resource replacement transaction to the block-producing node in the blockchain network, so that the block-producing node executes the resource replacement transaction, transfer the pledged virtual resources of the first category under the pledge blockchain address into the smart contract address, and transfer a fourth quantity of the third virtual resource into the cache blockchain address; the cache blockchain address is the blockchain address of the second object for storing intermediate virtual resources, and the intermediate virtual resources include the third virtual resource; the fourth quantity of the third virtual resource matches the pledged virtual resources of the first category under the pledge blockchain address.
[0151] In one embodiment, the processing unit 1102 is further configured to: if the quantity of the intermediate virtual resources of the second category under the cache blockchain address is greater than or equal to a second set quantity, send a resource exchange request to the third object, where the resource exchange request is used to request to exchange the intermediate virtual resources of the second category for the replacement virtual resource; transfer the intermediate virtual resources of the second category under the cache blockchain address into the blockchain address of the third object; receive a fifth quantity of the replacement virtual resource transferred out from the blockchain address of the third object, and transfer the fifth quantity of the replacement virtual resource into the replacement blockchain address, and the fifth quantity of the replacement virtual resource matches the intermediate virtual resources of the second category under the cache blockchain address.
[0152] In one embodiment, the obtaining unit 1101 is further configured to: if the current quantity of the first virtual resource under the pledged blockchain address is less than the first quantity, determine the unpledging quantity of the first virtual resource according to the current quantity and the first quantity; construct a resource unpledging transaction, where the resource unpledging transaction instructs to perform an unpledging process on the unpledging quantity of the first virtual resource; send the unpledging transaction to a block-producing node in the blockchain network, so that the block-producing node executes the unpledging transaction, receives the transferred sixth quantity of the third virtual resource, and transfers the unpledging quantity of the first virtual resource under the smart contract address to the pledged blockchain address; the sixth quantity of the third virtual resource matches the unpledging quantity of the first virtual resource under the smart contract address.
[0153] In one embodiment, the obtaining unit 1101 is further configured to: if the resource replacement request further includes a replacement quantity of the second virtual resource to be replaced, compare the replacement quantity with the second quantity; if the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, perform the step of transferring the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address, or transfer the replacement quantity of the second virtual resource under the replacement blockchain address to the target blockchain address.
[0154] In one embodiment, the obtaining unit 1101 is further configured to: if the comparison result indicates that the second quantity is less than the replacement quantity, send a prompt message to the first object, where the prompt message is used to prompt the first object whether to confirm to replace the first quantity of the first virtual resource with the second quantity of the second virtual resource; if a confirmation replacement instruction input by the first object for the prompt message is obtained, perform the step of transferring the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address.
[0155] It can be understood that the functions of the functional units of the blockchain-based resource processing device in the embodiments of the present application can be specifically implemented according to the blockchain-based resource processing method in the above method embodiments, and the specific implementation process can refer to the relevant descriptions in the above blockchain-based resource processing method embodiments, which will not be elaborated here. In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit including the function of the module or unit.
[0156] After receiving a resource replacement request or a pledge release request of an object, the blockchain-based resource processing device provided by the embodiments of the present application can directly transfer the virtual resources under the replacement blockchain address or the pledge blockchain address to the blockchain address of the object, effectively improving the efficiency of virtual resource processing and enhancing the usage experience. After the pledged virtual resources stored under the pledge blockchain address accumulate to a certain quantity, a resource replacement transaction can be constructed to implement the pledge processing of virtual resources, effectively saving the network resources and computing resources of the resource processing system and ensuring the stability of the pledge processing of virtual resources at the same time. The relevant data of the resource replacement transaction or the resource pledge release transaction can be processed on the chain, effectively improving the security and integrity of the data. The pledge and release of virtual resources can be carried out according to requirements, better meeting different application requirements, avoiding the centralized release of pledged virtual resources, and ensuring the processing efficiency of virtual resources. The pledged virtual resources can be pledged to obtain intermediate virtual resources, and then the intermediate virtual resources can be exchanged to obtain replacement virtual resources. By introducing intermediate virtual resources, the security of virtual resource pledge is ensured, and the loss of virtual resources caused by the value fluctuation of the pledged virtual resources is avoided, ensuring the security of virtual resources.
[0157] Please refer to Figure 12 , Figure 12 which is a structural block diagram of a computer device provided by the embodiments of the present application. The computer device described in the embodiments of the present application includes: a processor 1201, a communication interface 1202, and a memory 1203. Among them, the processor 1201, the communication interface 1202, and the memory 1203 can be connected through a bus or other means. In the embodiments of the present application, the connection through the bus is taken as an example.
[0158] Among them, the processor 1201 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse the power-on and power-off instructions sent by the user to the computer device and control the computer device to perform power-on and power-off operations. Another example is that the CPU can transmit various interactive data between the internal structures of the computer device, and so on. The communication interface 1202 may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi, mobile communication interfaces, etc.), and is controlled by the processor 1201 to send and receive data. The memory 1203 (Memory) is the memory device in the computer device, used to store programs and data. It can be understood that the memory 1203 here can include both the built-in memory of the computer device and, of course, the extended memory supported by the computer device. The memory 1203 provides a storage space, and the operating system of the computer device is stored in this storage space, which may include but is not limited to: Android system, iOS system, Windows Phone system, etc., and this application does not make any limitations in this regard.
[0159] In the embodiment of this application, the processor 1201 performs the following operations by running the executable program code in the memory 1203:
[0160] Obtain a resource replacement request of a first object, where the resource replacement request is used to request to pledge a first quantity of first virtual resources to a second object and replace second virtual resources from the second object;
[0161] Receive the first quantity of first virtual resources transferred out from the target blockchain address, and transfer the first quantity of first virtual resources to the pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources;
[0162] Determine the second quantity of the second virtual resources that can be replaced by the first quantity of the first virtual resources;
[0163] Transfer the second quantity of the second virtual resources under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
[0164] In one embodiment, the processor 1201 is further configured to: obtain a pledge release request of the first object, where the pledge release request is used to request a pledge release process for the first virtual resource pledged to the second object; receive a third quantity of a second virtual resource transferred out from the target blockchain address, and transfer the third quantity of the second virtual resource to the replacement blockchain address; the third quantity is determined according to the second quantity and resource growth information; transfer the first quantity of the first virtual resource under the pledge blockchain address to the target blockchain address.
[0165] In one embodiment, the processor 1201 is further configured to: if the quantity of the pledged virtual resources of the first category under the pledge blockchain address is greater than or equal to a first set quantity, construct a resource replacement transaction, where the resource replacement transaction instructs to pledge the pledged virtual resources of the first category to replace a third virtual resource; send the resource replacement transaction to the block-producing node in the blockchain network, so that the block-producing node executes the resource replacement transaction, transfer the pledged virtual resources of the first category under the pledge blockchain address to the smart contract address, and transfer a fourth quantity of the third virtual resource to the cache blockchain address; the cache blockchain address is the blockchain address of the second object for storing intermediate virtual resources, and the intermediate virtual resources include the third virtual resource; the fourth quantity of the third virtual resource matches the pledged virtual resources of the first category under the pledge blockchain address.
[0166] In one embodiment, the processor 1201 is further configured to: if the quantity of the intermediate virtual resources of the second category under the cache blockchain address is greater than or equal to a second set quantity, send a resource exchange request to a third object, where the resource exchange request is used to request to exchange the intermediate virtual resources of the second category for the replacement virtual resource; transfer the intermediate virtual resources of the second category under the cache blockchain address to the blockchain address of the third object; receive a fifth quantity of the replacement virtual resource transferred out from the blockchain address of the third object, and transfer the fifth quantity of the replacement virtual resource to the replacement blockchain address, where the fifth quantity of the replacement virtual resource matches the intermediate virtual resources of the second category under the cache blockchain address.
[0167] In one embodiment, the processor 1201 is further configured to: if the current quantity of the first virtual resource under the pledged blockchain address is less than the first quantity, determine the unpledged quantity of the first virtual resource according to the current quantity and the first quantity; construct a resource unpledging transaction, where the resource unpledging transaction instructs to perform an unpledging process on the unpledged quantity of the first virtual resource; send the unpledging transaction to a block-producing node in the blockchain network, so that the block-producing node executes the unpledging transaction, receives the transferred sixth quantity of the third virtual resource, and transfers the unpledged quantity of the first virtual resource under the smart contract address to the pledged blockchain address; the sixth quantity of the third virtual resource matches the unpledged quantity of the first virtual resource under the smart contract address.
[0168] In one embodiment, the processor 1201 is further configured to: if the resource replacement request further includes the replacement quantity of the second virtual resource to be replaced, compare the replacement quantity with the second quantity; if the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, execute the step of transferring the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address, or transfer the replacement quantity of the second virtual resource under the replacement blockchain address to the target blockchain address.
[0169] In one embodiment, the processor 1201 is further configured to: if the comparison result indicates that the second quantity is less than the replacement quantity, send a prompt message to the first object, where the prompt message is used to prompt the first object whether to confirm to replace the first quantity of the first virtual resource with the second quantity of the second virtual resource; if a confirmation replacement instruction input by the first object for the prompt message is obtained, execute the step of transferring the second quantity of the second virtual resource under the replacement blockchain address to the target blockchain address.
[0170] In specific implementation, the processor 1201, the communication interface 1202, and the memory 1203 described in the embodiments of the present application may execute the implementation manners of the second object described in a resource processing method based on blockchain provided in the embodiments of the present application, and may also execute the implementation manners described in a resource processing device based on blockchain provided in the embodiments of the present application, which will not be elaborated herein.
[0171] Through the computer device provided by the embodiments of the present application, after receiving a resource replacement request or a pledge release request of an object, the virtual resources under the replacement blockchain address or the pledge blockchain address can be directly transferred to the blockchain address of the object, effectively improving the efficiency of virtual resource processing and enhancing the usage experience; when the pledged virtual resources stored under the pledge blockchain address accumulate to a certain quantity, a resource replacement transaction can be constructed to implement the pledge processing of virtual resources, effectively saving the network resources and computing resources of the resource processing system, and at the same time ensuring the stability of the pledge processing of virtual resources; the relevant data of the resource replacement transaction or the resource pledge release transaction can be processed on the blockchain, effectively improving the security and integrity of the data; the pledge and pledge release of virtual resources can be performed according to requirements, better meeting different application requirements, avoiding the centralized pledge release of virtual resources, and ensuring the processing efficiency of virtual resources; the pledged virtual resources can be pledged to obtain intermediate virtual resources, and then the intermediate virtual resources can be exchanged to obtain replacement virtual resources. By introducing the intermediate virtual resources, the security of virtual resource pledge is ensured, and the loss of virtual resources caused by the value fluctuation of the pledged virtual resources is avoided, ensuring the security of virtual resources.
[0172] The embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored. When it runs on a computer, the computer is enabled to execute the blockchain-based resource processing method as described in the embodiments of the present application. Its specific implementation manner can refer to the foregoing description and will not be elaborated here.
[0173] The embodiments of the present application further provide a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, enabling the computer device to execute the blockchain-based resource processing method as described in the embodiments of the present application. Its specific implementation manner can refer to the foregoing description and will not be elaborated here.
[0174] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0175] In the above embodiments, the descriptions of the respective embodiments each have their own emphasis. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments. Essentially, the technical solution of this application, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a computer, a server, or a network device, etc., specifically, the processor in the computer device) to execute all or part of the steps of the above methods in the respective embodiments of this application. Among them, the aforementioned storage medium may include: various media that can store program codes such as USB flash drives, mobile hard disks, magnetic disks, optical disks, read-only memory (English: Read-Only Memory, abbreviation: ROM), or random access memory (English: Random Access Memory, abbreviation: RAM).
[0176] As described above, the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them; although this application has been described in detail with reference to the foregoing embodiments, it should be understood that: it is still possible to modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the respective embodiments of this application.
Claims
1. A blockchain-based resource processing method, characterized in that, The method includes: Obtaining a resource replacement request of a first object, where the resource replacement request is used to request pledging a first quantity of first virtual resources to a second object and replacing the second virtual resources from the second object; Receiving the first quantity of first virtual resources transferred out from a target blockchain address and transferring the first quantity of first virtual resources to a pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources; Determining a second quantity of the second virtual resources that can be replaced by the first quantity of first virtual resources; Transferring the second quantity of second virtual resources under a replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
2. The method according to claim 1, characterized in that, The method further includes: Obtaining an unpledge request of the first object, where the unpledge request is used to request an unpledge process for the first virtual resources pledged to the second object; Receiving a third quantity of second virtual resources transferred out from the target blockchain address and transferring the third quantity of second virtual resources to the replacement blockchain address; the third quantity is determined according to the second quantity and resource growth information; Transferring the first quantity of first virtual resources under the pledge blockchain address to the target blockchain address.
3. The method according to claim 1 or 2, characterized in that, The method further includes: If the quantity of pledged virtual resources of a first category under the pledge blockchain address is greater than or equal to a first set quantity, constructing a resource replacement transaction, where the resource replacement transaction instructs pledging the pledged virtual resources of the first category to replace third virtual resources; Sending the resource replacement transaction to a block-producing node in the blockchain network, so that the block-producing node executes the resource replacement transaction, transfers the pledged virtual resources of the first category under the pledge blockchain address to a smart contract address, and transfers a fourth quantity of third virtual resources to a cache blockchain address; the cache blockchain address is the blockchain address of the second object for storing intermediate virtual resources, and the intermediate virtual resources include the third virtual resources; the fourth quantity of third virtual resources matches the pledged virtual resources of the first category under the pledge blockchain address.
4. The method according to claim 3, characterized in that, The method further includes: If the quantity of intermediate virtual resources of a second category under the cache blockchain address is greater than or equal to a second set quantity, sending a resource exchange request to a third object, where the resource exchange request is used to request exchanging the intermediate virtual resources of the second category for the replacement virtual resources; Transferring the intermediate virtual resources of the second category under the cache blockchain address to the blockchain address of the third object. Receive a fifth quantity of replacement virtual resources transferred from the blockchain address of the third object, and transfer the fifth quantity of replacement virtual resources to the replacement blockchain address, where the fifth quantity of replacement virtual resources matches the intermediate virtual resources of the second category under the cache blockchain address.
5. The method according to claim 2, wherein The method further includes: If the current quantity of the first virtual resources under the pledge blockchain address is less than the first quantity, determine the unpledge quantity of the first virtual resources according to the current quantity and the first quantity; Construct a resource unpledge transaction, where the resource unpledge transaction instructs to unpledge the unpledge quantity of the first virtual resources; Send the unpledge transaction to the block-producing nodes in the blockchain network, so that the block-producing nodes execute the unpledge transaction, receive the transferred sixth quantity of third virtual resources, and transfer the unpledge quantity of the first virtual resources under the smart contract address to the pledge blockchain address; the sixth quantity of third virtual resources matches the unpledge quantity of the first virtual resources under the smart contract address.
6. The method according to claim 1 or 2, characterized in that, The method further includes: If the resource replacement request further includes the replacement quantity of the second virtual resources to be replaced, compare the replacement quantity with the second quantity; If the comparison result indicates that the second quantity is greater than or equal to the replacement quantity, perform the step of transferring the second quantity of the second virtual resources under the replacement blockchain address to the target blockchain address, or transfer the replacement quantity of the second virtual resources under the replacement blockchain address to the target blockchain address.
7. The method according to claim 6, characterized in that, The method further includes: If the comparison result indicates that the second quantity is less than the replacement quantity, send a prompt message to the first object, where the prompt message is used to prompt the first object whether to determine to replace the first quantity of the first virtual resources with the second quantity of the second virtual resources; If a confirmed replacement instruction input by the first object for the prompt message is obtained, perform the step of transferring the second quantity of the second virtual resources under the replacement blockchain address to the target blockchain address.
8. A blockchain-based resource processing device, characterized in that, The device includes: An acquisition unit, configured to acquire a resource replacement request of a first object, where the resource replacement request is used to request to pledge a first quantity of first virtual resources to a second object and replace the second object with second virtual resources; A processing unit, configured to receive the first quantity of first virtual resources transferred from the target blockchain address, and transfer the first quantity of first virtual resources to the pledge blockchain address; the target blockchain address is the blockchain address of the first object, and the pledge blockchain address is the blockchain address of the second object for storing pledged virtual resources, and the pledged virtual resources include the first virtual resources; A determination unit, configured to determine the second quantity of the second virtual resources that can be replaced by the first quantity of the first virtual resources; The processing unit is further configured to transfer the second quantity of second virtual resources under the replacement blockchain address to the target blockchain address; the replacement blockchain address is the blockchain address of the second object for storing replacement virtual resources, and the replacement virtual resources include the second virtual resources.
9. A computer device, characterized in that, including: a processor, a communication interface, and a memory, where the processor, the communication interface, and the memory are interconnected. Among them, the memory stores executable program code, and the processor is configured to call the executable program code to implement the blockchain-based resource processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Computer instructions are stored in the computer-readable storage medium, and when they run on a computer, the computer is enabled to implement the blockchain-based resource processing method according to any one of claims 1-7.
11. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the blockchain-based resource processing method according to any one of claims 1-7 is implemented.