Disclosure of Invention
In order to solve the technical problem, the present application provides a method, an apparatus, a computer device, and a storage medium for processing virtual resource data.
In a first aspect, the present application provides a method for processing virtual resource data, including:
receiving a transaction request of each node in a block chain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
calculating to obtain a first attribute value according to a preset exchange rule and the first resource attribute information;
adding the first attribute value to 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, including:
the transaction request receiving module is used for receiving transaction requests of all nodes in the blockchain system, and the transaction requests carry first virtual resource identifiers;
the resource attribute information acquisition module is used for acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
the exchange module is used for calculating to obtain a first attribute value according to a preset exchange rule and the 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 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 following steps when executing the computer program:
receiving a transaction request of each node in a block chain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
calculating to obtain a first attribute value according to a preset exchange rule and the first resource attribute information;
adding the first attribute value to 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, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a transaction request of each node in a block chain system, wherein the transaction request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
calculating to obtain a first attribute value according to a preset exchange rule and the first resource attribute information;
adding the first attribute value to 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 are provided. The blockchain system has the characteristic of being difficult to tamper and forge, so that the transaction of the virtual resources is accessed into the blockchain system, and the safety and reliability of data are ensured by adopting the blockchain system to store data in the transaction process.
In one embodiment, a method for processing virtual resource data is provided, including:
receiving a data acquisition request sent by a transaction node according to the transaction request, wherein the data acquisition request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
sending the first resource attribute information to a transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion 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, including:
the data acquisition request receiving module is used for receiving a data acquisition request sent by the transaction node according to the transaction request, and 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 can calculate a first attribute value according to the first resource attribute information and a preset conversion rule, and the first attribute value is added to the first resource attribute information to obtain updated first resource attribute information;
the attribute receiving module is used for receiving the updated first resource attribute information returned by the transaction node;
and the attribute storage module is used for storing 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 following steps when executing the computer program:
receiving a data acquisition request sent by a transaction node according to the transaction request, wherein the data acquisition request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
sending the first resource attribute information to a transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion 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, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a data acquisition request sent by a transaction node according to the transaction request, wherein the data acquisition request carries a first virtual resource identifier;
acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information;
sending the first resource attribute information to a transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion 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 are provided. The blockchain system has the characteristic of being difficult to tamper and forge, so that the transaction of the virtual resources is accessed into the blockchain system, and the safety and reliability of data are ensured by adopting the blockchain system to store data in the transaction process.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a diagram of an application environment for 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 for processing virtual resource data. The system for processing virtual resource data comprises a node group 110 (a node 111 and a node 112), a trading node 120, wherein the node group 110 and the trading node 120 belong to nodes on a blockchain system. The trading node 120 and the node group 110 are connected via a network. The node group 110 and the transaction node 120 are computer devices, wherein the computer devices may be terminals or servers. The transaction node 120 may be a server. The terminal may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically 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 consisting of a plurality of servers.
As shown in FIG. 2, in one embodiment, a method of processing virtual resource data is provided. The embodiment is mainly illustrated by applying 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:
step S201, a transaction request of each node in the blockchain system is received.
In this embodiment, the transaction request carries the first virtual resource identifier.
Step S202, resource attribute information corresponding to the first virtual resource identifier is obtained, and the first resource attribute information is obtained.
In particular, a transaction request refers to a computer request instruction for requesting a transaction of a virtual resource. The virtual resource identifier is an identifier for identifying a virtual resource, wherein the virtual resource identifier is not limited to a resource that can be used for conducting a transaction, such as a resource including virtual scene data, virtual video data, virtual items, virtual coins, and the like. The resource attribute information is attribute information for describing a resource, and the resource attribute information includes a type of a virtual resource, a use method, a virtual material and a corresponding material type, a time for generating the virtual resource, 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 the first resource attribute information.
Step S204, adding the first attribute value to the first resource attribute information to obtain the updated first resource attribute information.
Step S205, saving the first virtual resource identifier and the updated first resource attribute information.
Specifically, the preset exchange rule refers to an exchange relationship between the attribute value in the transaction node and the virtual resource, which is customized in advance, and the exchange relationship may be fixed, or may change along with a change in demand, for example, the exchange relationship is updated according to a supply-demand relationship in a transaction market. And searching the preset exchange rule about the exchange rule corresponding to the first virtual resource identifier and the first resource attribute information to calculate the attribute value, and obtaining the first attribute value. And adding the first attribute value to the first resource attribute information to obtain the updated first resource attribute information. I.e. the attribute in which the first attribute value is included in the first resource attribute information. And the first attribute value is used for measuring the value of the resource corresponding to the first virtual resource identifier and storing the 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. Namely, after the transaction is completed, the attribute value resource corresponding to the virtual resource of the transaction is returned to the corresponding account. If the user A sends a request for trading the virtual resource A, the resource attribute of the virtual resource A is sent to a trading node, the attribute value of the virtual resource A is calculated according to a preset exchange rule stored on the trading node to obtain an attribute value A, and the attribute value A is sent to the user A. The block chain system has the characteristics of difficult tampering and counterfeiting, and the accuracy of transaction data is ensured by adopting the block chain system to execute the transaction process and store the data in the transaction process.
In one embodiment, the updated first resource attribute information is sent to each node of the blockchain system, such that each node maintains the first resource attribute information.
Specifically, after the transaction is executed in the transaction node, the updated first resource attribute information is broadcasted to each node in the blockchain, 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 block chain, so that the reliability of transaction data is ensured.
In an embodiment, the method for processing virtual resource data further includes:
step S301, acquiring resource attribute information corresponding to the second virtual resource identifier to obtain second resource attribute information.
In this embodiment, the transaction request further 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, add the second attribute value to the second resource attribute information to obtain updated second resource attribute information.
Step S304, sending the updated second resource attribute information 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, using 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.
Specifically, the transaction request carries the second virtual resource identifier, that is, the transaction request is a transaction for executing 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 block chain system so that each node stores the second resource attribute information. And directly trading the resource attribute corresponding to the first virtual resource identifier and the resource attribute corresponding to the second virtual resource identifier. 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. Where resource binding information is information used to represent the 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 identifier is the prop A, the resource binding information is the account A in the game A, the second virtual resource identifier is the prop B, and the resource binding information is the account B in the game B, namely the prop A resource binding information is modified into the account B in the game B, and the prop B resource binding information is modified into the account A in the game A. Where 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. And sending the prop B to the account A in the 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 obtained attribute information corresponding to the second virtual resource identifier are broadcast to each node in the block chain, so that each node in the block chain 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 block chain, 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, and when the first transaction state is a tradable state and the second transaction state is a tradable state, the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier are obtained.
Specifically, the trading state is used to describe the state of the virtual resource, including but not limited to a tradable state and a non-tradable state. The tradable state and the non-tradable state can be further divided into a plurality of sub-tradable states, and specific settings can be customized according to requirements. The first transaction state is the transaction state of the resource attribute information corresponding to the first virtual resource identifier, and similarly, the second transaction state is the transaction state of the resource attribute information corresponding to the second virtual resource identifier. When the first transaction state is a tradable state and the second transaction state is a tradable state, the transaction of two different virtual resources can be executed, and when the first transaction state and the second transaction state are tradable states, the process proceeds to step S305. Whether the transaction state of the game resources is tradable or not is confirmed before the transaction of the game resources, so that the effectiveness of the transaction can be ensured, and the execution of invalid transaction is avoided.
In one embodiment, 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 larger than zero, acquiring a third attribute value from the 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, the two virtual resources representing the two parties of the transaction cannot be equivalently exchanged, and the corresponding attribute value can be acquired from the party with low value so that the transaction can be equivalently performed. The difference value between the first attribute value and the second attribute value is calculated, whether the difference value is greater than zero or not is judged, the difference value is greater than zero, the first attribute value is greater than the second attribute value, and an attribute value equivalent to the difference value, namely a third attribute value, needs to be acquired from an 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 a virtual resource with the value equivalent to the third attribute value in the account.
In one embodiment, when the difference is less than zero, a fourth attribute value is obtained from the account corresponding to the binding information of the first virtual resource identifier, where the fourth attribute value is equal to the absolute value of the difference, the obtaining of the resource binding information of the first virtual resource identifier and the resource binding information of the second virtual resource identifier is executed, 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 is less than zero, it indicates that the first attribute value is less than the second attribute value, and an attribute value of a value such as an absolute value of the difference, that is, a fourth attribute value, needs to be acquired from the account corresponding to the first virtual resource identifier, where the fourth attribute value may be directly an attribute value in the user account, or may be replaced with a virtual resource of a value such as a fourth attribute value 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, realizes the transaction among the virtual resources among different platforms, and leads the transaction to be 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 illustrated by applying 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, receiving a data acquisition request sent by the transaction node according to the transaction request.
In this embodiment, the data acquisition request carries the first virtual resource identifier.
Step S402, acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information.
Step S403, sending the first resource attribute information to the transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information.
Step S404, receiving the updated first resource attribute information returned by the trading node.
Step S405, saving the updated first resource attribute information.
In particular, the transaction request is computer instructions for trading the virtual resource. The data acquisition request is computer instructions for acquiring resource attribute information. The resource attribute information is attribute information for describing a resource, and the resource attribute information includes a type of a virtual resource, a use method, a virtual material and a corresponding material type, a time for generating the virtual resource, and the like. The virtual resource identifies, but is not limited to, resources that can be used to conduct transactions, such as resources including virtual scene data, virtual video data, virtual props, virtual coins, and so on. 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 the attribute values in the pre-defined transaction nodes and the virtual resources, and the exchange relationship can be fixed and can also change along with the change of demands, such as updating the exchange relationship according to the supply and demand relationship of a transaction market. And searching the preset exchange rule about the exchange rule corresponding to the first virtual resource identifier and the first resource attribute information to calculate the attribute value, and obtaining the first attribute value. And adding the first attribute value to the first resource attribute information to obtain the updated first resource attribute information. And the transaction node returns the updated first resource attribute information to an account corresponding to the first virtual resource node, and stores the updated first resource attribute information. The blockchain system has the characteristic of being difficult to tamper and forge, and the accuracy of transaction data is ensured by adopting the blockchain system to execute a transaction process and store data in the transaction process.
In a specific embodiment, referring to fig. 4, two transaction parties 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 serves as a first resource, an attribute value serves as a second resource, and the account B purchases the virtual resource a with the attribute value, where before a transaction, an attribute included in the virtual resource a is virtual resource basic information, the virtual resource basic information (resource attribute information) includes generation time, a function, a forging material, and the like of the virtual resource, the resource binding information includes a platform identifier, an account identifier, and the like, and after a transaction is performed, the transaction information of the virtual resource a includes transaction time, a transaction account, a transaction mode, and transaction fees, where the transaction fees may be other resources such as an attribute value or props. The virtual resources on the same platform can be traded only by providing a corresponding virtual resource trading module in the platform.
In a specific embodiment, the account is transacted with a third-party exchange, and referring to fig. 5, the two parties of the transaction include an account a and an exchange and an account C, where the account a and the exchange transact in the first transaction, and the account C and the exchange transact in the second transaction, and as the number of transactions increases, transaction information of each time is recorded in the transaction information, for example, the transaction information 1 is the transaction between the account a and the exchange, and the transaction information 2 is the transaction between the account C and the exchange.
In one particular embodiment, cross-platform trading, referring to FIG. 6, cross-platform trading is conducted through an exchange. The figure comprises two different platforms, namely a platform A and a platform B, wherein an account A and an account B in the platform A perform virtual resource transaction, an account C and an account D in the platform B perform 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 performed through a trading exchange.
Fig. 2 and 3 are flow diagrams illustrating a method for processing virtual resource data according to an 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, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided an apparatus 200 for processing virtual resource data, comprising:
a transaction request receiving module 201, configured to receive a transaction request of each node in the blockchain system, where the transaction request carries the 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, so as to obtain first resource attribute information.
The exchange module 203 is configured to calculate a first attribute value according to a preset exchange rule and the 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.
And the data saving module 205 is configured to save the first virtual resource identifier and the updated first resource attribute information.
In an 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 block chain system so that each node stores the first resource attribute information.
In an 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, so as to obtain 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.
And 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.
And 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 sending 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 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 stores the attribute information of the second virtual resource identifier.
In an embodiment, the apparatus 200 for processing virtual resource data further includes:
and the transaction state acquisition module is used for acquiring the transaction state corresponding to the first virtual resource identifier to obtain the first transaction state, and acquiring the transaction state corresponding to the second virtual resource identifier to obtain the second transaction state.
The resource binding information obtaining module is further configured to execute obtaining of 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 an 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 obtaining module is further configured to, when the difference is greater than zero, obtain a third attribute value from an account corresponding to the binding information of the second virtual resource identifier, where the third attribute value is equal to the difference, perform obtaining of 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 an embodiment, the binding information obtaining module is further configured to, when the difference is smaller than zero, obtain a fourth attribute value from the account corresponding to the binding information of the first virtual resource identifier, where the fourth attribute value is equal to an absolute value of the difference, perform obtaining of 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, there is provided an apparatus 300 for processing virtual resource data, comprising:
the data obtaining request receiving module 301 is configured to receive a data obtaining request sent by a transaction node according to a transaction request, where the data obtaining 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, so as to 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 conversion rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information.
And the attribute receiving module 304 is configured to receive the first resource attribute information updated by the transaction node.
An attribute saving module 305, configured to save the updated first resource attribute information.
FIG. 9 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the node group 110 (or the transaction node 120) in fig. 1. As shown in fig. 9, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected via a system bus. Wherein the memory includes a non-volatile 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 that, when executed by the processor, causes the processor to implement a method of processing virtual resource data. The internal memory may also have stored therein a computer program that, 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, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the apparatus for processing virtual resource data provided herein 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 a transaction request receiving module 201, a resource attribute information acquiring module 202, a redemption module 203, an attribute updating module 204 and a data saving module 205 shown in fig. 7. The computer program constituted by the respective program modules causes the processor to execute the steps in the method of processing virtual resource data of the embodiments of the present application described in the present specification.
For example, the data acquisition request receiving module 301, the resource attribute acquiring module 302, the data transmitting module 303, the attribute receiving module 304, and the attribute storing module 305 shown in fig. 8. The computer program constituted by the respective program modules causes the processor to execute the steps in the method of processing virtual resource data of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 9 may perform receiving, by the transaction request receiving module 201 in the apparatus 200 for processing virtual resource data shown in fig. 7, a transaction request of each node in the blockchain system, where the transaction request carries the first virtual resource identifier. The computer device may execute, by the resource attribute information obtaining module 202, obtaining resource attribute information corresponding to the first virtual resource identifier, to obtain the first resource attribute information. The computer device can calculate the first attribute value according to the preset exchange rule and the first resource attribute information through the exchange module 203. 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 the saving of the first virtual resource identification and the updated first resource attribute information by the data saving module 205.
The computer device shown in fig. 9 may execute, by using the data acquisition request receiving module 301 in the apparatus 300 for processing virtual resource data shown in fig. 8, receiving 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 computer device may execute, by the resource attribute obtaining module 302, obtaining resource attribute information corresponding to the first virtual resource identifier, to obtain first resource attribute information. 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 the preset conversion rule, and adds the first attribute value to the first resource attribute information to obtain updated first resource attribute information. The computer device may perform receiving the updated first resource attribute information back by the transaction node via the attribute receiving module 304. The saving of updated first resource attribute information may be performed by the computer device 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 following steps when executing the computer program: receiving a transaction request of each node in a block chain system, wherein the transaction request carries a first virtual resource identifier; acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information; calculating to obtain a first attribute value according to a preset exchange rule and the first resource attribute information; adding the first attribute value to 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 block chain system so that each node stores the first resource attribute information.
In one embodiment, the transaction request further carries a second virtual resource identifier, and the processor when executing the computer program performs the following steps: 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 to the second resource attribute information to obtain updated second resource attribute information; sending the updated second resource attribute information to each node of the block chain 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; the resource binding information of the second virtual resource identifier and the first resource attribute information are used as the attribute information of the first virtual resource identifier, and the attribute information of the first virtual resource identifier is stored; 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: sending the attribute information of the first virtual resource identifier to each node of the block chain 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 block chain system so that each node stores 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 the 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 larger than zero, acquiring a third attribute value from the 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 less 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 following steps when executing the computer program: receiving a data acquisition request sent by a transaction node according to the transaction request, wherein the data acquisition request carries a first virtual resource identifier; acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information; sending the first resource attribute information to a transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion 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 block chain system, wherein the transaction request carries a first virtual resource identifier; acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information; calculating to obtain a first attribute value according to a preset exchange rule and the first resource attribute information; adding the first attribute value to 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 block chain system so that each node stores the first resource attribute information.
In one embodiment, the transaction request further carries a second virtual resource identifier, and the computer program when executed by the processor further 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 to the second resource attribute information to obtain updated second resource attribute information; sending the updated second resource attribute information to each node of the block chain 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; the resource binding information of the second virtual resource identifier and the first resource attribute information are used as the attribute information of the first virtual resource identifier, and the attribute information of the first virtual resource identifier is stored; 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: sending the attribute information of the first virtual resource identifier to each node of the block chain 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 block chain system so that each node stores 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 the 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 larger than zero, acquiring a third attribute value from the 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 less 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 the transaction request, wherein the data acquisition request carries a first virtual resource identifier; acquiring resource attribute information corresponding to the first virtual resource identifier to obtain first resource attribute information; sending the first resource attribute information to a transaction node, so that the transaction node calculates to obtain a first attribute value according to the first resource attribute information and a preset conversion 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.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present 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.