Disclosure of Invention
In order to solve the technical problems, the application provides a method, a device, computer equipment and a storage medium for processing virtual resource data.
In a first aspect, the present application provides a method of processing virtual resource data, comprising:
receiving a transaction request of each node in a blockchain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
Calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information;
adding the first attribute value into the first resource attribute information to obtain updated first resource attribute information;
and saving the first virtual resource identifier and the updated first resource attribute information.
In a second aspect, the present application provides an apparatus for processing virtual resource data, comprising:
the transaction request receiving module is used for receiving transaction requests of all nodes in the blockchain system, wherein the transaction requests carry a first virtual resource identifier;
the resource attribute information acquisition module is used for acquiring resource attribute information corresponding to the first virtual resource identifier to acquire first resource attribute information;
the exchange module is used for calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information;
the attribute updating module is used for adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information;
and the data storage module is used for storing the first virtual resource identifier and updated first resource attribute information.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
Receiving a transaction request of each node in a blockchain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information;
adding the first attribute value into the first resource attribute information to obtain updated first resource attribute information;
and saving the first virtual resource identifier and the updated first resource attribute information.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
receiving a transaction request of each node in a blockchain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information;
adding the first attribute value into the first resource attribute information to obtain updated first resource attribute information;
and saving the first virtual resource identifier and the updated first resource attribute information.
The method, the device, the computer equipment and the storage medium for processing the virtual resource data. Because the blockchain system has the characteristic of difficult manipulation and counterfeiting, the transaction of the virtual resource is accessed into the blockchain system, and the blockchain system is adopted to save the data in the transaction process so as to ensure the safety and the reliability of the data.
In one embodiment, a method of processing virtual resource data is provided, comprising:
receiving a data acquisition request sent by a transaction node according to a transaction request, wherein the data acquisition request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
the method comprises the steps of sending first resource attribute information to a transaction node, enabling the transaction node to calculate to obtain a first attribute value according to the first resource attribute information and a preset exchange rule, and adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information;
receiving updated first resource attribute information returned by the transaction node;
and saving the updated first resource attribute information.
In one embodiment, an apparatus for processing virtual resource data is provided, comprising:
The data acquisition request receiving module is used for receiving a data acquisition request sent by the transaction node according to the transaction request, wherein the data acquisition request carries a first virtual resource identifier;
the resource attribute acquisition module is used for acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
the data sending module is used for sending the first resource attribute information to the transaction node so that the transaction node calculates a first attribute value according to the first resource attribute information and a preset exchange rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information;
the attribute receiving module is used for receiving updated first resource attribute information returned by the transaction node;
and the attribute preservation module is used for preserving the updated first resource attribute information.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
receiving a data acquisition request sent by a transaction node according to a transaction request, wherein the data acquisition request carries a first virtual resource identifier;
Acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
the method comprises the steps of sending first resource attribute information to a transaction node, enabling the transaction node to calculate to obtain a first attribute value according to the first resource attribute information and a preset exchange rule, and adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information;
receiving updated first resource attribute information returned by the transaction node;
and saving the updated first resource attribute information.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
receiving a data acquisition request sent by a transaction node according to a transaction request, wherein the data acquisition request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information;
the method comprises the steps of sending first resource attribute information to a transaction node, enabling the transaction node to calculate to obtain a first attribute value according to the first resource attribute information and a preset exchange rule, and adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information;
Receiving updated first resource attribute information returned by the transaction node;
and saving the updated first resource attribute information.
The method, the device, the computer equipment and the storage medium for processing the virtual resource data. Because the blockchain system has the characteristic of difficult manipulation and counterfeiting, the transaction of the virtual resource is accessed into the blockchain system, and the blockchain system is adopted to save the data in the transaction process so as to ensure the safety and the reliability of the data.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
FIG. 1 is an application environment diagram of a method of processing virtual resource data in one embodiment. Referring to fig. 1, the method of processing virtual resource data is applied to a system of processing virtual resource data. The system for processing virtual resource data includes node group 110 (node 111 and node 112), transaction node 120, node group 110 and transaction node 120 all belonging to nodes on a blockchain system. The transaction node 120 and the node group 110 are connected by a network. Node group 110 and transaction node 120 are computer devices, which may be terminals or servers. The transaction node 120 may be a server. The terminal can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer and the like. The server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
As shown in FIG. 2, in one embodiment, a method of processing virtual resource data is provided. The present embodiment is mainly exemplified by the application of the method to the transaction node 120 in fig. 1. Referring to fig. 2, the method for processing virtual resource data specifically includes the following steps:
in step S201, a transaction request is received for each node in the blockchain system.
In this embodiment, the transaction request carries a first virtual resource identifier.
Step S202, obtaining resource attribute information corresponding to the first virtual resource identifier, and obtaining the first resource attribute information.
Specifically, the transaction request refers to computer request instructions for requesting a transaction virtual resource. The virtual resource identifier is an identifier for identifying a virtual resource, where the virtual resource identifier is not limited to a resource that may be used to conduct transactions, such as a resource that includes virtual scene data, virtual video data, virtual props, virtual coins, and the like. The resource attribute information is attribute information for describing a resource, and includes a type of a virtual resource, a usage method, a virtual material and a corresponding material type, a time when the virtual resource is generated, and the like. The first resource attribute information refers to resource attribute information of the first virtual resource identifier.
Step S203, calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information.
Step S204, adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information.
Step S205, save the first virtual resource identifier and the updated first resource attribute information.
Specifically, the preset exchange rule refers to an exchange relationship between an attribute value in a predefined transaction node and a virtual resource, and the exchange relationship may be fixed or may change along with a change of a demand, for example, the exchange relationship is updated according to a supply-demand relationship of a transaction market. Searching a preset exchange rule, and calculating an attribute value according to the exchange rule corresponding to the first virtual resource identifier and the first resource attribute information to obtain a first attribute value. And adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information. I.e. the first resource attribute information includes the attribute of the first attribute value. The first attribute value is used for measuring the value of the resource corresponding to the first virtual resource identifier and storing updated first resource attribute information. And sending the first attribute value according to the account information corresponding to the first resource identifier, so that the attribute value is stored in the account information corresponding to the first resource identifier. And returning the attribute value resources corresponding to the virtual resources of the transaction to the corresponding accounts after the transaction is completed. If the user A requests the transaction of the virtual resource A, the resource attribute of the virtual resource A is sent to the transaction node, the attribute value of the virtual resource A is calculated according to the preset redemption rule stored on the transaction node, the attribute value A is obtained, and the attribute value A is sent to the user A. The transaction request to each platform is executed through the transaction node in the blockchain system, so that the transactions of different platforms can be completed, and the blockchain system is difficult to tamper and forge, so that the accuracy of transaction data is ensured by adopting the blockchain system to execute the transaction process and save the data in the transaction process.
In one embodiment, the updated first resource attribute information is sent to each node of the blockchain system to cause each node to save the first resource attribute information.
Specifically, after the transaction is executed in the transaction node, the updated first resource attribute information is broadcast to each node in the blockchain after the obtained updated first resource attribute information is broadcast, so that each node in the blockchain system stores the updated first resource attribute information. And information generated in the transaction process is stored in each node in the blockchain, so that the reliability of transaction data is ensured.
In one embodiment, the method for processing virtual resource data further includes:
step S301, obtaining resource attribute information corresponding to the second virtual resource identifier, and obtaining second resource attribute information.
In this embodiment, the transaction request also carries a second virtual resource identifier.
Step S302, calculating to obtain a second attribute value according to a preset exchange rule and second resource attribute information.
Step S303, adding the second attribute value to the second resource attribute information to obtain updated second resource attribute information.
Step S304, the updated second resource attribute information is sent to each node of the blockchain system, so that each node stores the second resource attribute information.
Step S305, acquiring the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
Step S306, the resource binding information and the first resource attribute information of the second virtual resource identifier are used as the attribute information of the first virtual resource identifier, and the attribute information of the first virtual resource identifier is stored.
Step S307, the resource binding information and the second resource attribute information of the first virtual resource identifier are used as the attribute information of the second virtual resource identifier, and the attribute information of the second virtual resource identifier is stored.
Specifically, the transaction request carries the second virtual resource identifier, that is, the transaction request is to execute the transaction of the resource attribute corresponding to the first virtual resource identifier and the second virtual resource identifier. And acquiring resource attribute information corresponding to the second virtual resource identifier, and calculating an attribute value of the resource attribute information corresponding to the second virtual resource according to a preset exchange rule to obtain a second attribute value. And adding the second attribute value to the second resource attribute information to obtain updated second resource attribute information. And sending the updated second resource attribute information to each node of the blockchain system so that each node can store the second resource attribute information. The resource attribute corresponding to the first virtual resource identifier and the resource attribute corresponding to the second virtual resource identifier are directly traded. And acquiring and exchanging resource binding information corresponding to the first virtual resource identifier and resource binding information corresponding to the second virtual resource identifier. Wherein the resource binding information is information for representing an owner of the virtual resource, the resource binding information includes, but is not limited to, platform information, account information, and the like. And taking the exchanged resource binding information of the first virtual resource identifier and the resource attribute information of the first virtual resource identifier as the attribute information of the first virtual resource identifier, and storing the attribute information of the first virtual resource identifier. And taking the exchanged resource binding information of the second virtual resource identifier and the resource attribute information of the second virtual resource identifier as the attribute information of the second virtual resource identifier, and storing the attribute information of the second virtual resource identifier.
In one embodiment, the attribute information of the first virtual resource identifier is sent according to the resource binding information of the first virtual resource identifier, and the attribute information of the second virtual resource is sent according to the resource binding information of the second virtual resource identifier.
Specifically, the resource attribute information of the first virtual resource identifier is sent according to the resource binding information in the exchanged first virtual resource identifier. And sending the resource attribute information of the second virtual resource identifier according to the resource binding information in the exchanged second virtual resource identifier. If the first virtual resource is identified as prop A, the resource binding information is identified as account A in game A, the second virtual resource is identified as prop B, the resource binding information is identified as account B in game B, namely prop A resource binding information is modified as account B in game B, and prop B resource binding information is modified as account A in game A. Wherein game a and game B may be the same or different games. And sending the prop A to an account B in the game B. Prop B is sent to account a in game a.
In one embodiment, the attribute information of the first virtual resource identifier is sent to each node of the blockchain system, so that each node stores the attribute information of the first virtual resource identifier, and the attribute information of the second virtual resource identifier is sent to each node of the blockchain system, so that each node stores the attribute information of the second virtual resource identifier.
Specifically, after the transaction is executed in the transaction node, the obtained attribute information corresponding to the first virtual resource identifier and the attribute information corresponding to the second virtual resource identifier are broadcasted to each node in the blockchain, so that each node in the blockchain system stores the attribute information corresponding to the first virtual resource identifier and the attribute information corresponding to the second virtual resource identifier. And information generated in the transaction process is stored in each node in the blockchain, so that the reliability of transaction data is ensured.
In one embodiment, a transaction state corresponding to a first virtual resource identifier is obtained, a first transaction state is obtained, a transaction state corresponding to a second virtual resource identifier is obtained, a second transaction state is obtained, and when the first transaction state is a tradable state and the second transaction state is a tradable state, resource binding information of the first virtual resource identifier and resource binding information of the second virtual resource identifier are obtained.
Specifically, the transaction state is a state for explaining that the virtual resource is in, including but not limited to a tradable state and a non-tradable state. The tradable state and the non-tradable state can be divided into a plurality of sub-transaction states, and specific settings can be customized according to requirements. The first transaction state is a transaction state of resource attribute information corresponding to the first virtual resource identifier, and the second transaction state is a transaction state of resource attribute information corresponding to the second virtual resource identifier. When the first transaction state is the tradable state and the second transaction state is the tradable state, the transaction of two different virtual resources can be performed, and when both are in the tradable state, the process proceeds to step S305. Before the game resource trade, whether the trade state of the game resource is tradable or not is confirmed, so that the validity of the trade can be ensured, and invalid trade is avoided.
In one embodiment, when the first attribute value and the second attribute value are not equivalent, calculating a difference between the first attribute value and the second attribute value; and when the difference value is greater than zero, acquiring a third attribute value from an account corresponding to the binding information of the second virtual resource identifier, wherein the third attribute value is equal to the difference value, executing the acquisition of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
Specifically, when the first attribute value and the second attribute value are not equivalent, two virtual resources representing both sides of the transaction cannot be subjected to equivalent exchange, and the corresponding attribute value can be obtained from the side with low value for normal transaction, so that the transaction can be equivalently performed. Namely, calculating the difference value between the first attribute value and the second attribute value, judging whether the difference value is larger than zero, wherein the difference value larger than zero indicates that the first attribute value is larger than the second attribute value, and acquiring the attribute value equivalent to the difference value, namely, the third attribute value, from the account corresponding to the second virtual resource identifier, wherein the attribute value can be directly the attribute value in the user account or can be replaced by the virtual resource equivalent to the third attribute value in the account.
In one embodiment, when the difference value is smaller than zero, a fourth attribute value is obtained from the account corresponding to the binding information of the first virtual resource identifier, the fourth attribute value is equal to the absolute value of the difference value, the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier are obtained, and the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier are stored.
Specifically, when the difference value is smaller than zero, the first attribute value is smaller than the second attribute value, and the attribute value with the absolute value of the difference value and the like, namely the fourth attribute value, needs to be obtained from the account corresponding to the first virtual resource identifier, and the fourth attribute value can be the attribute value in the direct user account or can be replaced by the virtual resource with the value with the fourth attribute value and the like in the account.
The method for processing the virtual resource data accesses the transaction of the virtual resources among various platforms through the transaction equipment, so that the transaction among the virtual resources among different platforms is realized, and the transaction is more convenient and efficient.
As shown in FIG. 3, in one embodiment, a method of processing virtual resource data is provided. The present embodiment is mainly exemplified by the application of the method to the node 110 in fig. 1. Referring to fig. 3, the method for processing virtual resource data specifically includes the following steps:
Step S401, a data acquisition request sent by a transaction node according to a transaction request is received.
In this embodiment, the data acquisition request carries the first virtual resource identifier.
Step S402, obtaining resource attribute information corresponding to the first virtual resource identifier, and obtaining the first resource attribute information.
Step S403, the first resource attribute information is sent to the transaction node, so that the transaction node calculates a first attribute value according to the first resource attribute information and a preset exchange rule, and the first attribute value is added to the first resource attribute information to obtain updated first resource attribute information.
Step S404, receiving updated first resource attribute information returned by the transaction node.
Step S405, the updated first resource attribute information is saved.
Specifically, the transaction request is computer instructions for trading virtual resources. The data acquisition request is computer instructions for acquiring resource attribute information. The resource attribute information is attribute information for describing a resource, and includes a type of a virtual resource, a usage method, a virtual material and a corresponding material type, a time when the virtual resource is generated, and the like. Wherein the virtual resource identifies, but is not limited to, a resource that may be used to conduct a transaction, such as a resource that includes virtual scene data, virtual video data, virtual props, virtual coins, and the like. The first resource attribute information refers to resource attribute information of the first virtual resource identifier. The preset exchange rule refers to an exchange relationship between an attribute value and a virtual resource in a predefined transaction node, and the exchange relationship can be fixed or can be changed along with the change of the demand, such as updating the exchange relationship according to the supply-demand relationship of the transaction market. Searching a preset exchange rule, and calculating an attribute value according to the exchange rule corresponding to the first virtual resource identifier and the first resource attribute information to obtain a first attribute value. And adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information. And the transaction node returns the updated first resource attribute information to the account corresponding to the first virtual resource node, and stores the updated first resource attribute information. Because the blockchain system has the characteristics of difficult tampering and counterfeiting, the blockchain system is adopted to execute the transaction process and save the data in the transaction process, thereby ensuring the accuracy of the transaction data.
In a specific embodiment, referring to fig. 4, two parties of a transaction are an account a and an account B, where the account a provides a virtual resource a, the account B provides money, the virtual resource a is used as a first resource, an attribute value is used as a second resource, the account B purchases the virtual resource a with the attribute value, before the transaction, an attribute included in the virtual resource a is virtual resource basic information, the virtual resource basic information (resource attribute information) includes a generation time, a function, a forging material, and the like of the virtual resource, the resource binding information includes a platform identifier and an account identifier, and the like, and after the transaction is performed, the transaction information of the virtual resource a includes a transaction time, a transaction account, a transaction mode, and a transaction compensation, where the transaction compensation may be an attribute value or other resource such as a prop. The only way that virtual resources with a platform can be traded is that corresponding virtual resource trading modules are provided in the platform.
In a specific embodiment, the account and the third party exchange conduct transactions, referring to fig. 5, the two sides of the transaction include an account a and an exchange and an account C, wherein the account a and the exchange are the account C and the exchange in the first transaction, the second transaction is the account C and the exchange transaction, and as the transactions increase, transaction information of each transaction is recorded in the transaction information, for example, transaction information 1 is the transaction of the account a and the exchange, and transaction information 2 is the transaction of the account C and the exchange.
In one particular embodiment, the cross-platform transaction, referring to FIG. 6, is conducted by way of an exchange. The figure comprises two different platforms, namely a platform A and a platform B, wherein an account A in the platform A and an account B conduct virtual resource transaction, an account C in the platform B and an account D conduct virtual resource transaction, and the transaction between the account B and the account D, namely the transaction between the virtual resource A and the virtual resource D is conducted through a transaction center.
Fig. 2 and 3 are flow diagrams of a method of processing virtual resource data in one embodiment. It should be understood that, although the steps in the flowcharts of fig. 2 and 3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 and 3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of the other steps or sub-steps of other steps.
In one embodiment, as shown in FIG. 7, there is provided an apparatus 200 for processing virtual resource data, comprising:
the transaction request receiving module 201 is configured to receive a transaction request of each node in the blockchain system, where the transaction request carries a first virtual resource identifier.
The resource attribute information obtaining module 202 is configured to obtain resource attribute information corresponding to the first virtual resource identifier, thereby obtaining first resource attribute information.
And the exchange module 203 is configured to calculate a first attribute value according to a preset exchange rule and first resource attribute information.
The attribute updating module 204 is configured to add the first attribute value to the first resource attribute information, to obtain updated first resource attribute information.
The data saving module 205 is configured to save the first virtual resource identifier and updated first resource attribute information.
In one embodiment, the apparatus 200 for processing virtual resource data further includes:
and the data sending module is used for sending the updated first resource attribute information to each node of the blockchain system so as to enable each node to store the first resource attribute information.
In one embodiment, the apparatus 200 for processing virtual resource data further includes:
The resource attribute information obtaining module 202 is further configured to obtain resource attribute information corresponding to the second virtual resource identifier, thereby obtaining second resource attribute information.
The exchange module 203 is further configured to calculate a second attribute value according to a preset exchange rule and second resource attribute information.
The attribute updating module 204 is further configured to add the second attribute value to the second resource attribute information, to obtain updated second resource attribute information.
The data sending module is further configured to send the updated second resource attribute information to each node of the blockchain system, so that each node stores the second resource attribute information.
The resource binding information acquisition module is used for acquiring the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
The attribute updating module is used for taking the resource binding information and the first resource attribute information of the second virtual resource identifier as the attribute information of the first virtual resource identifier, storing the attribute information of the first virtual resource identifier, taking the resource binding information and the second resource attribute information of the first virtual resource identifier as the attribute information of the second virtual resource identifier, and storing the attribute information of the second virtual resource identifier.
In one embodiment, the data transmission module further includes: and sending the attribute information of the first virtual resource identifier to each node of the blockchain system so that each node can store the attribute information of the first virtual resource identifier, and sending the attribute information of the second virtual resource identifier to each node of the blockchain system so that each node can store the attribute information of the second virtual resource identifier.
In one embodiment, the apparatus 200 for processing virtual resource data further includes:
the transaction state acquisition module is used for acquiring the transaction state corresponding to the first virtual resource identifier to obtain a first transaction state, and acquiring the transaction state corresponding to the second virtual resource identifier to obtain a second transaction state.
The resource binding information acquisition module is further configured to execute acquiring the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier when the first transaction state is a tradable state and the second transaction state is a tradable state.
In one embodiment, the apparatus 200 for processing virtual resource data further includes:
and the difference value calculating module is used for calculating the difference value of the first attribute value and the second attribute value when the first attribute value and the second attribute value are not equivalent.
The binding information acquisition module is further configured to acquire a third attribute value from an account corresponding to the binding information of the second virtual resource identifier when the difference value is greater than zero, perform acquiring the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and store the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, the binding information obtaining module is further configured to obtain a fourth attribute value from the account corresponding to the binding information of the first virtual resource identifier when the difference value is less than zero, where the fourth attribute value is equal to the absolute value of the difference value, perform obtaining the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and store the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, as shown in FIG. 8, an apparatus 300 for processing virtual resource data is provided, comprising:
the data acquisition request receiving module 301 is configured to receive a data acquisition request sent by a transaction node according to a transaction request, where the data acquisition request carries a first virtual resource identifier.
The resource attribute obtaining module 302 is configured to obtain resource attribute information corresponding to the first virtual resource identifier, and obtain first resource attribute information.
The data sending module 303 is configured to send the first resource attribute information to the transaction node, so that the transaction node calculates a first attribute value according to the first resource attribute information and a preset exchange rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information.
The attribute receiving module 304 is configured to receive updated first resource attribute information returned by the transaction node.
The attribute preservation module 305 is configured to preserve updated first resource attribute information.
FIG. 9 illustrates an internal block diagram of a computer device in one embodiment. The computer device may specifically be node group 110 (or transaction node 120) of fig. 1. As shown in fig. 9, the computer device is connected to the processor, the memory, the network interface, the input device and the display screen through a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program which, when executed by a processor, causes the processor to implement a method of processing virtual resource data. The internal memory may also have stored therein a computer program which, when executed by the processor, causes the processor to perform a method of processing virtual resource data. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, the apparatus for processing virtual resource data provided by the present application may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 9. The memory of the computer device may store various program modules constituting the apparatus for processing virtual resource data, such as the transaction request receiving module 201, the resource attribute information acquiring module 202, the redemption module 203, the attribute updating module 204 and the data holding module 205 shown in fig. 7. The computer program of each program module causes a processor to execute the steps of the method of processing virtual resource data of each embodiment of the present application described in the present specification.
For example, a data acquisition request receiving module 301, a resource attribute acquiring module 302, a data transmitting module 303, an attribute receiving module 304, and an attribute holding module 305 shown in fig. 8. The computer program of each program module causes a processor to execute the steps of the method of processing virtual resource data of each embodiment of the present application described in the present specification.
For example, the computer device shown in fig. 9 may execute the transaction request for receiving each node in the blockchain system by the transaction request receiving module 201 in the apparatus for processing virtual resource data 200 shown in fig. 7, where the transaction request carries the first virtual resource identifier. The computer device may obtain the first resource attribute information by executing the resource attribute information obtaining module 202 to obtain the resource attribute information corresponding to the first virtual resource identifier. The computer device may calculate the first attribute value by performing the conversion module 203 according to a preset conversion rule and the first resource attribute information. The computer device may perform adding the first attribute value to the first resource attribute information via the attribute update module 204 to obtain updated first resource attribute information. The computer device may perform saving the first virtual resource identification and updated first resource attribute information via the data saving module 205.
The computer device shown in fig. 9 may execute the data acquisition request sent by the receiving transaction node according to the transaction request by using the data acquisition request receiving module 301 in the apparatus 300 for processing virtual resource data shown in fig. 8, where the data acquisition request carries the first virtual resource identifier. The computer device may obtain the first resource attribute information by executing the resource attribute obtaining module 302 to obtain the resource attribute information corresponding to the first virtual resource identifier. The computer device may send the first resource attribute information to the transaction node through the data sending module 303, so that the transaction node calculates a first attribute value according to the first resource attribute information and a preset exchange rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information. The computer device may execute the receive transaction node to return updated first resource attribute information via the attribute receiving module 304. The computer device may perform saving the updated first resource attribute information via the attribute saving module 305.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program: receiving a transaction request of each node in a blockchain system, wherein the transaction request carries a first virtual resource identifier; acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information; calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information; adding the first attribute value into the first resource attribute information to obtain updated first resource attribute information; and saving the first virtual resource identifier and the updated first resource attribute information.
In one embodiment, the processor, when executing the computer program, performs the steps of: and sending the updated first resource attribute information to each node of the blockchain system so that each node can store the first resource attribute information.
In one embodiment, the transaction request also carries a second virtual resource identifier, and the processor when executing the computer program performs the steps of: acquiring resource attribute information corresponding to the second virtual resource identifier to obtain second resource attribute information; calculating to obtain a second attribute value according to a preset exchange rule and second resource attribute information; adding the second attribute value into the second resource attribute information to obtain updated second resource attribute information; transmitting the updated second resource attribute information to each node of the blockchain system so that each node stores the second resource attribute information; acquiring resource binding information of a first virtual resource identifier and resource binding information of a second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier; taking the resource binding information and the first resource attribute information of the second virtual resource identifier as the attribute information of the first virtual resource identifier, and storing the attribute information of the first virtual resource identifier; and taking the resource binding information and the second resource attribute information of the first virtual resource identifier as the attribute information of the second virtual resource identifier, and storing the attribute information of the second virtual resource identifier.
In one embodiment, the processor when executing the computer program further performs the steps of: transmitting attribute information of the first virtual resource identifier to each node of the blockchain system so that each node stores the attribute information of the first virtual resource identifier; and sending the attribute information of the second virtual resource identifier to each node of the blockchain system so that each node can store the attribute information of the second virtual resource identifier.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a transaction state corresponding to a first virtual resource identifier to obtain a first transaction state; acquiring a transaction state corresponding to the second virtual resource identifier to obtain a second transaction state; and when the first transaction state is a tradable state and the second transaction state is a tradable state, executing to acquire the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, the processor when executing the computer program further performs the steps of: when the first attribute value and the second attribute value are not equivalent, calculating a difference value between the first attribute value and the second attribute value; and when the difference value is greater than zero, acquiring a third attribute value from an account corresponding to the binding information of the second virtual resource identifier, wherein the third attribute value is equal to the difference value, executing the acquisition of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, the processor when executing the computer program further performs the steps of: and when the difference value is smaller than zero, acquiring a fourth attribute value from the account corresponding to the binding information of the first virtual resource identifier, wherein the fourth attribute value is equal to the absolute value of the difference value, executing the acquisition of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program: receiving a data acquisition request sent by a transaction node according to a transaction request, wherein the data acquisition request carries a first virtual resource identifier; acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information; the method comprises the steps of sending first resource attribute information to a transaction node, enabling the transaction node to calculate to obtain a first attribute value according to the first resource attribute information and a preset exchange rule, and adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information; receiving updated first resource attribute information returned by the transaction node; and saving the updated first resource attribute information.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a transaction request of each node in a blockchain system, wherein the transaction request carries a first virtual resource identifier; acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information; calculating to obtain a first attribute value according to a preset exchange rule and first resource attribute information; adding the first attribute value into the first resource attribute information to obtain updated first resource attribute information; and saving the first virtual resource identifier and the updated first resource attribute information.
In one embodiment, the computer program when executed by the processor further performs the steps of: and sending the updated first resource attribute information to each node of the blockchain system so that each node can store the first resource attribute information.
In one embodiment, the transaction request further carries a second virtual resource identification, the computer program when executed by the processor further implementing the steps of: acquiring resource attribute information corresponding to the second virtual resource identifier to obtain second resource attribute information; calculating to obtain a second attribute value according to a preset exchange rule and second resource attribute information; adding the second attribute value into the second resource attribute information to obtain updated second resource attribute information; transmitting the updated second resource attribute information to each node of the blockchain system so that each node stores the second resource attribute information; acquiring resource binding information of a first virtual resource identifier and resource binding information of a second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier; taking the resource binding information and the first resource attribute information of the second virtual resource identifier as the attribute information of the first virtual resource identifier, and storing the attribute information of the first virtual resource identifier; and taking the resource binding information and the second resource attribute information of the first virtual resource identifier as the attribute information of the second virtual resource identifier, and storing the attribute information of the second virtual resource identifier.
In one embodiment, the processor when executing the computer program further performs the steps of: transmitting attribute information of the first virtual resource identifier to each node of the blockchain system so that each node stores the attribute information of the first virtual resource identifier; and sending the attribute information of the second virtual resource identifier to each node of the blockchain system so that each node can store the attribute information of the second virtual resource identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a transaction state corresponding to a first virtual resource identifier to obtain a first transaction state; acquiring a transaction state corresponding to the second virtual resource identifier to obtain a second transaction state; and when the first transaction state is a tradable state and the second transaction state is a tradable state, executing to acquire the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the first attribute value and the second attribute value are not equivalent, calculating a difference value between the first attribute value and the second attribute value; and when the difference value is greater than zero, acquiring a third attribute value from an account corresponding to the binding information of the second virtual resource identifier, wherein the third attribute value is equal to the difference value, executing the acquisition of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: and when the difference value is smaller than zero, acquiring a fourth attribute value from the account corresponding to the binding information of the first virtual resource identifier, wherein the fourth attribute value is equal to the absolute value of the difference value, executing the acquisition of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier, and storing the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a data acquisition request sent by a transaction node according to a transaction request, wherein the data acquisition request carries a first virtual resource identifier; acquiring resource attribute information corresponding to a first virtual resource identifier to obtain first resource attribute information; the method comprises the steps of sending first resource attribute information to a transaction node, enabling the transaction node to calculate to obtain a first attribute value according to the first resource attribute information and a preset exchange rule, and adding the first attribute value to the first resource attribute information to obtain updated first resource attribute information; receiving updated first resource attribute information returned by the transaction node; and saving the updated first resource attribute information.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.