Blockchain-based set exchange method and apparatus for available resource quotas
Blockchain-based exchange method and apparatus for available resource quotas are disclosed. An example of method comprises: selecting, by a management node of a blockchain network, a set of object nodes as a target object according to a selection rule; determining, by the management node for each object node in the target object, a resource quota; determining, by the management node for the each object node, virtual resources corresponding to the resource quota as virtual resource decrements corresponding to the object node; and constructing, by the management node, a quota exchange transaction comprising the determined virtual resource decrements corresponding to the object node, and adding the quota exchange transaction to a blockchain on the blockchain network.
1. A method, comprising:
issuing, by a management node of a blockchain computer network, virtual resources to a plurality of object nodes through a blockchain as transaction media, wherein the blockchain is on the blockchain computer network;
performing, by one or more blockchain nodes of the blockchain computer network, consensus verification on a smart contract, wherein the smart contract comprises computer code executable to select a target object, wherein the computer code comprises a selection rule;
storing, by the one or more blockchain nodes, the smart contract on the blockchain;
selecting, by the management node, a set of object nodes from the plurality of object nodes according to the selection rule by invoking the smart contract stored on the blockchain, wherein the target object comprises the set of object nodes;
determining, by the management node for each of the object nodes, an amount of designated remaining virtual resources of the issued virtual resources corresponding to the each object node stored on the blockchain;
determining, by the management node for the target object, an amount of designated remaining virtual resources by accumulating the amounts of designated remaining virtual resources corresponding to each of the object nodes in the target object;
determining, by the management node for the target object, a resource quota based on the amount of designated remaining virtual resources corresponding to the target object;
determining, by the management node for each of the object nodes, virtual resource decrements corresponding to each of the object nodes based on the resource quota for the target object;
constructing, by the management node, a quota exchange transaction comprising the determined virtual resource decrements corresponding to each of the object nodes,
sending, by the management node, the quota exchange transaction to the one or more blockchain nodes of the blockchain computer network;
performing, by the one or more blockchain nodes, consensus verification on the quota exchange transaction;
determining, by the one or more blockchain nodes, that the consensus verification on the quota exchange transaction succeeds; and
based on the determination that the consensus verification on the quota exchange transaction succeeds, deducting, by one or more blockchain nodes of the blockchain network, the determined virtual resource decrements by executing the quota exchange transaction.
2. The method according to claim 1 , wherein determining the resource quota comprises:
determining a total resource quota for the set of object nodes;
obtaining an earning ratio corresponding to each of the object nodes in the target object; and
obtaining, according to the earning ratio, the resource quota for each of the object nodes in the target object.
3. The method according to claim 2 , wherein determining the resource quota comprises:
determining the amount of designated remaining virtual resources corresponding to the target object as the total resource quota;
the amount of designated remaining virtual resources corresponding to the target object is a sum of amounts of designated remaining virtual resources corresponding to the object nodes in the target object; and
for each of the object nodes, the amount of designated remaining virtual resources is preassigned by a user corresponding to each of the object nodes.
4. The method according to claim 2 , wherein obtaining the earning ratio comprises:
determining, for each of the object nodes, a ratio of the amount of designated remaining virtual resources corresponding to each of the object nodes to the amount of designated remaining virtual resources corresponding to the target object, as the earning ratio corresponding to the each object node.
5. The method according to claim 1 , wherein:
each of the object nodes are configured to receive virtual resource increments through copyright use transactions.
6. The method according to claim 1 , wherein:
the selection rule comprises a competitiveness representation value algorithm;
selecting the set of object nodes as the target object according to the selection rule comprises:
determining, by the management node for each of the object nodes, a competitiveness representation value by using the competitiveness representation value algorithm, and
selecting a preset quantity of object nodes as the target object according to the competitiveness representation value respectively corresponding to each of the object nodes; and
for each of the object nodes, a larger competitiveness representation value increases a chance of being selected.
7. One or more non-transitory computer-readable storage media storing instructions executable by one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising:
issuing virtual resources to a plurality of object nodes through a blockchain as transaction media;
performing consensus verification on a smart contract, wherein the smart contract comprises computer code executable to select a target object, wherein the computer code comprises a selection rule;
storing the smart contract on the blockchain;
selecting a set of object nodes from the plurality of object nodes according to the selection rule by invoking the smart contract stored on the blockchain, wherein the target object comprises the set of object nodes;
determining, for each of the object nodes, an amount of designated remaining virtual resources of the issued virtual resources corresponding to the each object node stored on the blockchain;
determining, for the target object, an amount of designated remaining virtual resources by accumulating the amounts of designated remaining virtual resources corresponding to each of the object nodes in the target object;
determining, for the target object, a resource quota based on the amount of designated remaining virtual resources corresponding to the target object;
determining, for each of the object nodes, virtual resource decrements corresponding to each of the object nodes based on the resource quota for the target object;
constructing a quota exchange transaction comprising the determined virtual resource decrements corresponding to each of the object nodes,
sending the quota exchange transaction to the one or more blockchain nodes;
performing consensus verification on the quota exchange transaction;
determining that the consensus verification on the quota exchange transaction succeeds; and
based on the determination that the consensus verification on the quota exchange transaction succeeds, deducting the determined virtual resource decrements by executing the quota exchange transaction.
8. The one or more non-transitory computer-readable storage media according to claim 7 , wherein determining the resource quota comprises:
determining a total resource quota for the set of object nodes;
obtaining an earning ratio corresponding to each of the object nodes in the target object; and
obtaining, according to the earning ratio, the resource quota for each of the object nodes in the target object.
9. The one or more non-transitory computer-readable storage media according to claim 8 , wherein determining the resource quota comprises:
determining the amount of designated remaining virtual resources corresponding to the target object as the total resource quota;
the amount of designated remaining virtual resources corresponding to the target object is a sum of amounts of designated remaining virtual resources corresponding to the object nodes in the target object; and
for each of the object nodes, the amount of designated remaining virtual resources is preassigned by a user corresponding to each of the object nodes.
10. The one or more non-transitory computer-readable storage media according to claim 8 , wherein obtaining the earning ratio comprises:
determining, for each of the object nodes, a ratio of the amount of designated remaining virtual resources corresponding to each of the object nodes to the amount of designated remaining virtual resources corresponding to the target object, as the earning ratio corresponding to the each object node.
11. The one or more non-transitory computer-readable storage media according to claim 7 , wherein:
each of the object nodes are configured to receive virtual resource increments through copyright use transactions.
12. The one or more non-transitory computer-readable storage media according to claim 7 , wherein:
the selection rule comprises a competitiveness representation value algorithm;
selecting the set of object nodes as the target object according to the selection rule comprises:
determining, for each of the object nodes, a competitiveness representation value by using the competitiveness representation value algorithm, and
selecting a preset quantity of object nodes as the target object according to the competitiveness representation value respectively corresponding to each of the object nodes; and
for each of the object nodes, a larger competitiveness representation value increases a chance of being selected.
13. A system, comprising one or more processors and one or more non-transitory computer-readable storage media storing instructions executable by the one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising:
issuing virtual resources to a plurality of object nodes through a blockchain as transaction media;
performing consensus verification on a smart contract, wherein the smart contract comprises computer code executable to select a target object, wherein the computer code comprises a selection rule;
storing the smart contract on the blockchain;
selecting a set of object nodes from the plurality of object nodes according to the selection rule by invoking the smart contract stored on the blockchain, wherein the target object comprises the set of object nodes;
determining, for each of the object nodes, an amount of designated remaining virtual resources of the issued virtual resources corresponding to the each object node stored on the blockchain;
determining, by the management node for the target object, an amount of designated remaining virtual resources by accumulating the amounts of designated remaining virtual resources corresponding to each of the object nodes in the target object;
determining, for the target object, a resource quota based on the amount of designated remaining virtual resources corresponding to the target object;
determining, for each of the object nodes, virtual resource decrements corresponding to each of the object nodes based on the resource quota for the target object;
constructing a quota exchange transaction comprising the determined virtual resource decrements corresponding to each of the object nodes,
sending the quota exchange transaction to the one or more blockchain nodes;
performing consensus verification on the quota exchange transaction;
determining that the consensus verification on the quota exchange transaction succeeds; and
based on the determination that the consensus verification on the quota exchange transaction succeeds, deducting the determined virtual resource decrements by executing the quota exchange transaction.
14. The system according to claim 13 , wherein determining the resource quota comprises:
determining a total resource quota for the set of object nodes;
obtaining an earning ratio corresponding to each of the object nodes in the target object; and
obtaining, according to the earning ratio, the resource quota for each of the object nodes in the target object.
15. The system according to claim 14 , wherein determining the resource quota comprises:
determining the amount of designated remaining virtual resources corresponding to the target object as the total resource quota;
the amount of designated remaining virtual resources corresponding to the target object is a sum of amounts of designated remaining virtual resources corresponding to the object nodes in the target object; and
for each of the object nodes, the amount of designated remaining virtual resources is preassigned by a user corresponding to each of the object nodes.
16. The system according to claim 14 , wherein obtaining the earning ratio comprises:
determining, for each of the object nodes, a ratio of the amount of designated remaining virtual resources corresponding to each of the object nodes to the amount of designated remaining virtual resources corresponding to the target object, as the earning ratio corresponding to the each object node.
17. The system according to claim 13 , wherein:
the selection rule comprises a competitiveness representation value algorithm;
selecting the set of object nodes as the target object according to the selection rule comprises:
determining, for each of the object nodes, a competitiveness representation value by using the competitiveness representation value algorithm, and
selecting a preset quantity of object nodes as the target object according to the competitiveness representation value respectively corresponding to each of the object nodes; and
for each of the object nodes, a larger competitiveness representation value increases a chance of being selected.