Computing power transaction method, device and equipment, readable storage medium and program product
By optimizing pricing strategies through blockchain networks and the WOLF algorithm, the game between computing power providers and demand nodes is played, solving the problem of profit imbalance in computing power trading and achieving transparent, secure, and efficient profit maximization in computing power trading.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-22
AI Technical Summary
In existing technologies, computing power trading lacks a flexible and fair profit balancing mechanism, making it impossible to maximize and balance profits between computing power providers and computing power demanders.
By leveraging the blockchain network and the learning parameters and WOLF algorithm to optimize pricing strategies, computing power providers and demand nodes engage in a game of strategy to achieve dynamic pricing and ordering of computing resources, satisfying equilibrium conditions to maximize profits for both parties.
It maximizes and balances the profits of both parties in computing power transactions, avoids resource monopolies and unfair transactions, and improves the utilization efficiency of computing resources as well as the transparency and security of transactions.
Smart Images

Figure CN122072929A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and in particular to a computing power trading method, apparatus, device, readable storage medium, and program product. Background Technology
[0002] Blockchain computing power trading enables transparent peer-to-peer buying and selling through smart contracts, avoiding the risks of centralization. It relies on the distributed ledger of the blockchain to ensure transaction transparency, uses cryptography (such as hash algorithms) for security, and automatically executes contracts through a consensus mechanism. This model allows computing power to circulate freely like a commodity. However, current computing power trading technologies lack a flexible and fair profit balancing mechanism, failing to maximize and balance profits between computing-power providers (CPPs) and computing power demanders. Summary of the Invention
[0003] The purpose of this invention is to provide a computing power trading method, apparatus, device, readable storage medium, and program product to solve the problem of the lack of a trading mechanism in the prior art that maximizes and balances profits between CPPs and computing power demanders.
[0004] To address the aforementioned technical problems, embodiments of the present invention provide a computing power trading method, applied to a computing power providing node, comprising:
[0005] The first pricing information of computing resources is written into the blockchain network, wherein the first pricing information is determined based on a pricing strategy;
[0006] Through the blockchain network, the first ordering information of the computing resources written by the computing power demanding node is obtained, wherein the first ordering information is determined based on the first pricing information; the pricing strategy is optimized using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and the pricing strategy is updated, wherein the learning parameters are dynamically adjusted based on the quick win or learn WOLF algorithm, and the first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing node;
[0007] When the pricing strategy satisfies the equilibrium condition, the target pricing information of the computing resource is determined according to the pricing strategy, and the target pricing information is written into the blockchain network.
[0008] The target ordering information for the computing resources written by the computing power demand node is obtained through the blockchain network, wherein the target ordering information is determined based on the target pricing information;
[0009] According to the target order information, the computing resources are configured to multiple computing power demand nodes through the blockchain network.
[0010] Optionally, the method further includes:
[0011] If the pricing strategy does not meet the equilibrium condition, the first pricing information of the computing resource is determined according to the pricing strategy, and the first pricing information is written into the blockchain network.
[0012] Optionally, the equilibrium condition includes at least one of the following:
[0013] The number of optimization attempts for the pricing strategy exceeds the first threshold;
[0014] The absolute value of the difference between the price strategy obtained in the current state and the price strategy obtained in the previous state is less than or equal to the second threshold.
[0015] Optionally, the step of optimizing the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and updating the pricing strategy, includes: calculating the value prediction information of the current state based on the first ordering information, the first pricing information, and the value function, wherein the value function is constructed based on the first objective function;
[0016] Based on the value prediction information, the current state price strategy benchmark, and the price strategy, the price strategy is evaluated to obtain the evaluation result and the learning parameters corresponding to the evaluation result, wherein the price strategy is used to generate the first pricing information;
[0017] The price strategy in the current state is updated based on the learning parameters to obtain the updated price strategy.
[0018] Optionally, the step of evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy to obtain the evaluation result and the learning parameters corresponding to the evaluation result includes:
[0019] Based on the value prediction information and the current state of the price strategy, determine the first value outcome of the price strategy;
[0020] Based on the value prediction information and the current state of the price strategy benchmark, a second value result for the price strategy benchmark is determined;
[0021] Based on the first value result and the second value result, the price strategy in the current state is evaluated to obtain an evaluation result;
[0022] Based on the evaluation results, the corresponding learning parameters are determined, wherein different evaluation results correspond to different learning parameters.
[0023] Optionally, determining the corresponding learning parameters based on the evaluation results includes:
[0024] If the evaluation result indicates that the first value result is greater than or equal to the second value result, a first learning parameter is determined;
[0025] If the evaluation result indicates that the first value result is less than the second value result, a second learning parameter is determined;
[0026] Wherein, the learning rate of the first learning parameter is less than the learning rate of the second learning parameter.
[0027] Optionally, before evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy, the method further includes:
[0028] Obtain the pricing strategy benchmark for the current state, wherein the pricing strategy benchmark for the initial state is determined based on the pre-configured pricing range of the computing resources, and both the first pricing information and the target pricing information are within the pricing range;
[0029] Get the cumulative number of states between the current state and the initial state;
[0030] The price strategy benchmark is updated based on the cumulative number of states and the price strategy of the current state to obtain the updated price strategy benchmark.
[0031] Optionally, the method further includes:
[0032] If the computing power demand node completes the task according to the configured computing resources, the first profit of the computing power providing node is calculated based on the target pricing information, the target ordering information, and the resource cost.
[0033] This invention also provides a computing power trading method, applied to computing power demand nodes, including:
[0034] Obtain task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks;
[0035] The pricing information of computing resources written by the computing power providing nodes can be obtained through the blockchain network.
[0036] Based on the task requirements, the pricing information, and the second objective function, the ordering information for the computing resources is determined, wherein the second objective function is used to maximize the profit of the computing power demand node;
[0037] The ordering information of the computing resources is written into the blockchain network, wherein the ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy, wherein the pricing strategy is used to determine the pricing information, and the learning parameters are dynamically adjusted according to the WOLF algorithm;
[0038] The computing resources configured by the computing power providing node through the blockchain network are obtained, wherein the computing resources are configured based on target order information, which represents the order information most recently sent at the current time.
[0039] Optionally, the method further includes:
[0040] Based on the task requirements, the computing power allocation ratio between the first role and the second role is determined, wherein the first role is used to perform blockchain mining tasks on the blockchain using computing power, and the second role is used to perform artificial intelligence service tasks using computing power.
[0041] The method further includes, after obtaining the computing resources configured by the computing power providing node through the blockchain network:
[0042] Based on the configured computing resources, the first role and the second role are used to perform corresponding tasks.
[0043] Optionally, the method further includes:
[0044] Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the first income information obtained by the first role in executing the task;
[0045] Based on the AI service task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the second income information obtained by the second role in performing the task;
[0046] The second profit of the computing power demand node is calculated based on the first revenue information, the second revenue information, the target order information, and the target pricing information, wherein the target pricing information is the pricing information corresponding to the demand of the target order information.
[0047] Optionally, the blockchain mining task includes training a target model, and the trained target model is used to perform the artificial intelligence service task;
[0048] The step of calculating the first income information obtained by the first role in executing the task based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role includes:
[0049] Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, the first role is used to train the target model to obtain the trained target model and the loss function of the target model.
[0050] The loss function of the target model is evaluated according to the consensus protocol PoLe learned, and it is determined that the first role meets the award conditions.
[0051] If the first role meets the award conditions, the first income information obtained by the first role in performing the task is calculated based on the pre-configured reward information.
[0052] This invention also provides a computing power trading device, applied to a computing power providing node, comprising:
[0053] The first writing module is used to write the first pricing information of computing resources into the blockchain network, wherein the first pricing information is determined based on a pricing strategy;
[0054] The first acquisition module is used to acquire, through the blockchain network, the first ordering information of the computing resources written by the computing power demand node, wherein the first ordering information is determined based on the first pricing information;
[0055] The first optimization module is used to optimize the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and update the pricing strategy. The learning parameters are dynamically adjusted based on the Fast Win or Learn WOLF algorithm. The first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing nodes.
[0056] The second writing module is used to determine the target pricing information of the computing resources according to the price strategy when the price strategy meets the equilibrium condition, and write the target pricing information into the blockchain network.
[0057] The second acquisition module is used to acquire, through the blockchain network, the target ordering information of the computing resources written by the computing power demand node, wherein the target ordering information is determined based on the target pricing information;
[0058] The first configuration module is used to configure the computing resources to multiple computing power demand nodes respectively through the blockchain network according to the target order information.
[0059] This invention also provides a computing power trading device, applied to computing power demand nodes, comprising:
[0060] The third acquisition module is used to acquire task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks.
[0061] The fourth acquisition module is used to obtain pricing information of computing resources written by computing power providing nodes through the blockchain network;
[0062] The first processing module is used to determine the ordering information of the computing resources based on the task requirements, the pricing information, and the second objective function, wherein the second objective function is used to maximize the profit of the computing power demand node;
[0063] The third writing module is used to write the ordering information of the computing resources into the blockchain network. The ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy. The pricing strategy is used to determine the pricing information. The learning parameters are dynamically adjusted according to the WOLF algorithm.
[0064] The fifth acquisition module is used to acquire the computing resources configured by the computing power providing node through the blockchain network, wherein the computing resources are configured based on target order information, and the target order information represents the order information most recently sent at the current time.
[0065] This invention also provides a network device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the computing power trading method as described in any of the preceding embodiments.
[0066] This invention also provides a readable storage medium, comprising: a program stored on the readable storage medium, wherein when the program is executed by a processor, it implements the steps of the computing power trading method as described in any of the preceding claims.
[0067] This invention also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the computing power trading method as described in any of the preceding embodiments.
[0068] At least one of the above technical solutions of the present invention has the following beneficial effects:
[0069] The above scheme provides a computing power trading method. The method applied to computing power providing nodes includes: writing first pricing information of computing resources into a blockchain network, wherein the first pricing information is determined based on a pricing strategy; obtaining first ordering information of computing resources written by computing power demand nodes through the blockchain network, wherein the first ordering information is determined based on the first pricing information; optimizing the pricing strategy using learning parameters based on a first objective function, the first pricing information, and the first ordering information, and updating the pricing strategy, wherein the learning parameters are dynamically adjusted based on a fast win or learn WOLF algorithm, and the first objective function indicates that the optimization direction of the pricing strategy is to maximize the profit of the computing power providing nodes; determining target pricing information of computing resources according to the pricing strategy when the pricing strategy satisfies the equilibrium condition, and writing the target pricing information into the blockchain network; obtaining target ordering information of computing resources written by computing power demand nodes through the blockchain network, wherein the target ordering information is determined based on the target pricing information; and configuring computing resources to multiple computing power demand nodes respectively through the blockchain network according to the target ordering information. The above scheme introduces a game theory mechanism and the WOLF algorithm. The computing power providing node acts as the leader in the game and uses the WOLF algorithm to find a price strategy that satisfies the equilibrium condition. Based on this, it sets prices to maximize the profits of both the computing power providing node and the computing power demanding node. This can maximize and balance the interests of both parties in the computing power transaction and avoid resource monopoly and unfair transactions.
[0070] The method applied to computing power demand nodes includes: obtaining task demands, which include order information for executing blockchain mining tasks and / or executing artificial intelligence tasks; obtaining pricing information of computing resources written by computing power providing nodes through the blockchain network; determining order information of computing resources based on task demands, pricing information, and a second objective function, wherein the second objective function is used to maximize the profit of computing power demand nodes; writing the order information of computing resources into the blockchain network, wherein the order information is used to enable computing power providing nodes to optimize pricing strategies using learning parameters and update pricing strategies, wherein the pricing strategy is used to determine pricing information, and the learning parameters are dynamically adjusted according to the WOLF algorithm; and obtaining computing resources configured by computing power providing nodes through the blockchain network, wherein the computing resources are configured based on target order information, which represents the order information most recently sent at the current time. The above scheme introduces a game theory mechanism and the WOLF algorithm. The computing power demand node acts as a follower in the game, while the computing power supply node dynamically adjusts the pricing using the WOLF algorithm. The computing power demand node adjusts its ordering information according to the pricing, so as to maximize the profits of both the computing power supply node and the computing power demand node. This can maximize and balance the interests of both parties in the computing power transaction and avoid resource monopoly and unfair transactions. Attached Figure Description
[0071] Figure 1 This is a flowchart illustrating a computing power trading method according to one embodiment of the present invention;
[0072] Figure 2 This is a schematic diagram illustrating the division of labor among the various roles that a computing power demand node can play in an embodiment of the present invention.
[0073] Figure 3 This is a schematic diagram of the WOLF-based computing power trading process according to an embodiment of the present invention;
[0074] Figure 4 This is a flowchart illustrating a computing power trading method according to another embodiment of the present invention;
[0075] Figure 5 A schematic diagram illustrating the process of a computing power-demanding node executing a blockchain mining task according to an embodiment of the present invention;
[0076] Figure 6 This is a schematic diagram of the structure of a computing power trading device according to one embodiment of the present invention;
[0077] Figure 7 This is a schematic diagram of the structure of a computing power trading device according to another embodiment of the present invention. Detailed Implementation
[0078] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0079] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0080] This invention provides a computing power trading framework, comprising a computing power demander layer, a computing power provider layer, and a blockchain network layer. The specific functions and responsibilities of each layer are as follows:
[0081] Computing Power Demand Layer: This layer contains a group of computing power demanders whose tasks include Artificial Intelligence (AI) training and AI inference. On one hand, as blockchain miners, they train models based on the Proof of Learning (PoLe) consensus protocol, participate in the consensus process through model training, and obtain block rewards. On the other hand, as AI service providers, they perform model inference, build and run decentralized applications (DApps), and provide artificial intelligence services to the outside world.
[0082] Computing Power Provider Layer: This layer integrates computing resources from different computing nodes through resource pooling. Typically, computing nodes within a computing framework are widely distributed and heterogeneous, resulting in diverse computing resources. The CPP (Computing Power Provider Layer) manages and allocates computing resources based on the needs of computing power requesters, ensuring they receive the necessary computing power. Simultaneously, the CPP and computing power requesters establish reasonable pricing strategies to achieve efficient allocation and flexible trading of computing power. Furthermore, the CPP needs to interact with the blockchain network layer to ensure the trustworthiness and security of computing power transactions.
[0083] Blockchain Network Layer: This layer provides the fundamental support for trusted computing power transactions. Leveraging the characteristics of blockchain technology, it ensures the decentralization, transparency, and security of computing power transactions. The blockchain is responsible for recording various information during the computing power transaction process, such as computing power allocation, transaction prices, and mining rewards, ensuring the immutability and traceability of transactions. Simultaneously, by adopting PoLe, treating neural network (NN) training as a working problem, it combines the learning process with blockchain mining, thereby improving the utilization efficiency of computing resources and providing computing power demanders with the opportunity to participate in blockchain mining.
[0084] like Figure 1 As shown, this embodiment of the invention provides a computing power trading method, applied to a computing power providing node, including:
[0085] Step S101: Write the first pricing information of computing resources into the blockchain network, wherein the first pricing information is determined based on a pricing strategy;
[0086] In step S101, the computing power providing node determines the first pricing information for computing resources based on the pricing strategy, current market demand, and resource supply, and publishes this first pricing information on the blockchain for computing power demanding nodes to view. The first pricing information must meet the following conditions:
[0087] A. The unit price of resources is calculated in the first pricing information. Within the pre-set unit price range within, that is ;
[0088] B. The unit price of the resource is calculated in the first pricing information. The demand elasticity of computing power users needs to be considered in order to balance resource supply and demand.
[0089] Step S102: Obtain the first ordering information of the computing resources written by the computing power demand node through the blockchain network, wherein the first ordering information is determined based on the first pricing information;
[0090] In step S102, after the computing power demanding node obtains the first pricing information on the blockchain network, it determines the first order information based on the first pricing information and writes the first order information into the blockchain network. At this time, the computing power providing node can obtain the first order information through the blockchain network. The first order information must meet the following conditions:
[0091] A. The purchase quantity F of the calculated resources in the first order information is within the preset purchase quantity range. within, that is , This represents the i-th node with the highest computing power requirement.
[0092] B. The purchase quantity F of computing resources in the first order information needs to take into account the computing requirements and budget of the AI task.
[0093] Step S103: Based on the first objective function, the first pricing information, and the first ordering information, optimize the pricing strategy using learning parameters and update the pricing strategy. The learning parameters are dynamically adjusted based on the Fast Win or Learn WOLF algorithm. The first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing nodes.
[0094] In step S103, in order to maximize and balance the interests of both parties in the computing power transaction, this embodiment of the invention provides a strategy optimization method based on the win or learn fast (WOLF) algorithm to continuously optimize the price strategy.
[0095] The profit earned by a computing power provider node is defined as the subscription fee of the computing power demanding node minus the service cost. Specifically, CPP determines its strategy space based on the demand provided by the computing power demander. Pricing strategies for computing resources within the system to achieve profitability. To maximize this objective, the formula for the first objective function is as follows:
[0096]
[0097] in, This represents the electricity cost per unit of computing resources. This represents the unit price of the computational resource. This represents the minimum value within a pre-defined unit price range. This represents the maximum value within a pre-defined unit price range. This represents the amount of computing resources ordered for the i-th computing power demand node.
[0098] Step S104: If the price strategy satisfies the equilibrium condition, determine the target pricing information of the computing resource according to the price strategy, and write the target pricing information into the blockchain network.
[0099] In step S104, the maximum number of iterations for strategy optimization is preset. and convergence threshold ,based on and The equilibrium conditions of the game are set. When the price strategy satisfies the equilibrium conditions, the strategy optimization ends, and the target pricing information of the computing resources is determined based on the current price strategy.
[0100] Step S105: Obtain the target ordering information of the computing resources written by the computing power demand node through the blockchain network, wherein the target ordering information is determined based on the target pricing information;
[0101] Step S106: According to the target order information, configure the computing resources to the multiple computing power demand nodes through the blockchain network.
[0102] In step S106, the computing power providing node, based on the finally confirmed target order information, configures (i.e., rents) computing resources to the computing power requesting node through the blockchain network, enabling the computing power requesting party to execute tasks according to the configured (i.e., rented) computing resources. For example... Figure 2 As shown, computing power demanders can play multiple roles. They can participate in mining tasks as blockchain miners or provide AI services as AI service providers. Therefore, the computing resources configured by the computing power providing node to the computing power demanding node can be used to perform both blockchain mining tasks and AI service tasks. The computing power ratio between the two tasks is determined by the computing power demanding node.
[0103] In addition, the blockchain network will record all the above-mentioned transaction processes and the process of the computing power demander executing tasks. The recorded content of the blockchain network includes, but is not limited to, the timestamp of the transaction, the identity information of the transaction participants, the amount of computing resources in the transaction, the unit price of computing resources, the total cost, the mining rewards obtained by the computing resources in executing blockchain mining tasks, and the execution results of the computing resources in executing AI service tasks.
[0104] In this embodiment of the invention, the computing power trading problem is modeled as a Stackelberg game with a single leader and multiple followers. The computing power provider (CPP) acts as the leader, and the computing power demanders act as followers. The computing power provider uses the WOLF algorithm to find a pricing strategy that satisfies the equilibrium condition and sets its price accordingly. The computing power demanders adjust their ordering information based on the pricing to maximize the profits of both the provider and demanders. This approach maximizes and balances the interests of both parties in the computing power trading, avoiding resource monopolies and unfair transactions.
[0105] One optional implementation method involves initializing the trading environment before step S101. This specifically includes the following steps:
[0106] (1) Initialize the blockchain network, including network nodes, consensus mechanism, etc.
[0107] (2) Set the basic requirements parameters for AI services, including bandwidth, latency requirements, etc.
[0108] (3) Construct a computing power resource pool and integrate computing resources from different computing nodes.
[0109] (4) Set the minimum unit price of computing power provided by the computing power providing node to be The maximum unit price of computing power is Set the minimum amount of computing resources to be purchased for the node requesting computing power. The maximum amount of computing resources that can be purchased is .
[0110] In one embodiment, optionally, the method further includes:
[0111] If the pricing strategy does not meet the equilibrium condition, the first pricing information of the computing resource is determined according to the pricing strategy, and the first pricing information is written into the blockchain network.
[0112] In this embodiment of the invention, if the pricing strategy does not meet the equilibrium condition, it indicates that the current pricing strategy is not the optimal pricing strategy and needs to be further optimized. The first pricing information of computing resources is determined based on the current pricing strategy, and the iteration steps S101-S103 are repeated until the pricing strategy meets the equilibrium condition.
[0113] In one embodiment, the equilibrium condition may optionally include at least one of the following:
[0114] The number of optimization attempts for the pricing strategy exceeds the first threshold;
[0115] The absolute value of the difference between the price strategy obtained in the current state and the price strategy obtained in the previous state is less than or equal to the second threshold.
[0116] In one embodiment of the present invention, the equilibrium condition is as follows: In another implementation method, the equilibrium condition is: In another implementation method, the equilibrium condition is: or ;
[0117] in, This indicates the number of iterations and optimizations of the current pricing strategy. This represents the maximum number of iterations (i.e., the first threshold) for optimizing the pre-configured price strategy. This indicates the currently determined pricing strategy. This indicates the pricing strategy determined in the previous stage. This indicates the pre-configured second threshold value.
[0118] In one embodiment, optionally, the step of optimizing the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and updating the pricing strategy, includes: calculating the value prediction information of the current state based on the first ordering information, the first pricing information, and a value function, wherein the value function is constructed based on the first objective function;
[0119] Based on the value prediction information, the current state price strategy benchmark, and the price strategy, the price strategy is evaluated to obtain the evaluation result and the learning parameters corresponding to the evaluation result, wherein the price strategy is used to generate the first pricing information;
[0120] The price strategy in the current state is updated based on the learning parameters to obtain the updated price strategy.
[0121] In this embodiment of the invention, the price strategy optimization method in step S103 is described, such as... Figure 3 As shown, at the beginning of the algorithm, the parameters are initialized first: assuming the state of the computing power demand node is set... Computing power provides the state of the nodes. ,set up This represents the computing power purchase behavior where a node submits order information, denoted as . This represents the unit price of computing resources provided by a given node, where... The action space of the node representing the computing power demand. This indicates that computing power provides the action space for nodes, and the learning parameters include... and ,in .
[0122] In the time slot Initially, the reward function representing the computing power providing nodes and computing power demanding nodes is as follows:
[0123] The computing power provides the nodes with the state observed by the underlying model. Set a uniform unit price for computing power. , For each Markov Decision Process (MDP), the reward function is:
[0124]
[0125] in, This indicates the reward that computing power provides to nodes. The computing power provides the nodes with the state observed by the underlying model. A uniform unit price for computing resources is set. Indicate cost;
[0126] The computing power demand node observed the computing power supply node in the time slot. After calculating the unit price of computing resources, each person determines the purchase behavior to be submitted based on their own status. Define the MDP for the computing power demander, with the reward function as follows:
[0127]
[0128] in, This represents the reward for nodes that require computing power. This indicates the allocation of computing resources for mining tasks. This represents the profit per unit of computing power generated by fulfilling business requirements. It is a weighting factor, representing the first Individual computing power demand nodes tend to consider the importance of payment costs to total profit. The token effect parameter represents the monetary value equivalent to mining. It is the profit that computing power demand nodes obtain from mining tasks.
[0129] When optimizing the pricing strategy, firstly, based on the first ordering information, the first pricing information, and the value function, the value prediction information for the current state is calculated, as shown in the following formula:
[0130]
[0131] Among them, the left side of the formula Indicates the current state after the update. The value prediction information, on the right side of the formula. Indicates the current state before the update. Value prediction information, The initial value is 0. This represents the unit price of the current computing resources. (i.e., the reward information corresponding to the unit price in the first pricing information) Indicates the learning rate. This represents the discount factor.
[0132] Then, this embodiment of the invention introduces a price strategy benchmark to represent the average benchmark of the price strategy, used to evaluate whether the price strategy in the current state is a "win" or a "failure," thereby determining the subsequent learning direction and selecting the corresponding learning parameters. .
[0133] Finally, the price strategy for the current state is updated based on the learned parameters to maximize the cumulative reward, resulting in the updated price strategy, as shown in the following formula:
[0134]
[0135]
[0136] Among them, the left side of the formula Indicates the current state after the update. The pricing strategy, the right side of the formula Indicates the current state before the update. Pricing strategy, Indicates the selected learning parameters. It is the size of the CPP action set, defined. .
[0137] In one embodiment, optionally, the step of evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy to obtain the evaluation result and the learning parameters corresponding to the evaluation result includes:
[0138] Based on the value prediction information and the current state of the price strategy, determine the first value outcome of the price strategy;
[0139] Based on the value prediction information and the current state of the price strategy benchmark, a second value result for the price strategy benchmark is determined;
[0140] Based on the first value result and the second value result, the price strategy in the current state is evaluated to obtain an evaluation result;
[0141] Based on the evaluation results, the corresponding learning parameters are determined, wherein different evaluation results correspond to different learning parameters.
[0142] In this embodiment of the invention, a learning parameter is provided. Specifically, before updating the price strategy, the first value outcome of the price strategy is determined based on the value prediction information and the current state of the price strategy, using the following formula:
[0143]
[0144] in, This indicates the pricing strategy before the current state was updated. This represents the value prediction information after the current state is updated. This indicates the primary value outcome.
[0145] Based on the value forecast information and the current state of the price strategy benchmark, the second value result of the price strategy benchmark is determined using the following formula:
[0146]
[0147] in, This represents the price strategy benchmark after the current state is updated. This represents the value prediction information after the current state is updated. This indicates a second value outcome.
[0148] according to and An evaluation is conducted to determine the corresponding learning parameters, wherein different evaluation results correspond to different learning parameters.
[0149] In one implementation, optionally, determining the corresponding learning parameters based on the evaluation result includes:
[0150] If the evaluation result indicates that the first value result is greater than or equal to the second value result, a first learning parameter is determined;
[0151] If the evaluation result indicates that the first value result is less than the second value result, a second learning parameter is determined;
[0152] Wherein, the learning rate of the first learning parameter is less than the learning rate of the second learning parameter.
[0153] In this embodiment of the invention, the method for determining the learning parameters is further described, if This indicates that the current price strategy is in a "winning" state, so let ,like This indicates that the current price strategy is in a "failed" state, so let ,in .
[0154] In one embodiment, optionally, before evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy, the method further includes:
[0155] Obtain the pricing strategy benchmark for the current state, wherein the pricing strategy benchmark for the initial state is determined based on the pre-configured pricing range of the computing resources, and both the first pricing information and the target pricing information are within the pricing range;
[0156] Get the cumulative number of states between the current state and the initial state;
[0157] The price strategy benchmark is updated based on the cumulative number of states and the price strategy of the current state to obtain the updated price strategy benchmark.
[0158] In this embodiment of the invention, the price strategy benchmark is also dynamically updated. Before updating the price strategy, the price strategy benchmark needs to be updated first. The price strategy benchmark is updated based on the cumulative number of states and the price strategy of the current state, as shown in the following formula:
[0159]
[0160]
[0161]
[0162] in, The left side of the formula represents the cumulative number of states. Indicates the current state after the update. The price strategy benchmark, the right side of the formula Indicates the current state before the update. The benchmark for pricing strategies, Indicates the current state before the update. The pricing strategy; the initial value of the pricing strategy benchmark during the first iteration. .
[0163] In one embodiment, optionally, the method further includes:
[0164] If the computing power demand node completes the task according to the configured computing resources, the first profit of the computing power providing node is calculated based on the target pricing information, the target ordering information, and the resource cost.
[0165] In this embodiment of the invention, when it is detected that a computing power requesting node completes a task according to the configured computing resources, the computing power providing node charges a corresponding fee based on the amount of computing resources purchased as determined in the order information submitted by the computing power requesting node. Simultaneously, it deducts the costs incurred in providing these resources, including but not limited to maintenance costs of the computing resources, electricity consumption costs, and operating costs of the blockchain network, thereby calculating the first profit actually obtained by the computing power provider. The formula is as follows:
[0166]
[0167] in, This represents the unit price of the computational resource. This represents the amount of computing resources purchased by the i-th computing power requesting node. This indicates the cost of resources.
[0168] like Figure 4 As shown, this embodiment of the invention also provides a computing power trading method, applied to computing power demand nodes, including:
[0169] Step S401: Obtain task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks.
[0170] In step S401, the computing power requester can play multiple roles, either as a blockchain miner participating in mining tasks or as an AI service provider executing AI service tasks. Therefore, the task request includes order information for executing blockchain mining tasks and / or executing artificial intelligence tasks, such as... Figure 2 As shown, the job descriptions for different roles are as follows:
[0171] (1) AI service provider. Use rented computing resources to run intelligent DApps, perform AI tasks, and provide artificial intelligence services to external parties.
[0172] (2) Blockchain miners. The training process of AI is treated as a mining problem. As the mining problem is solved, the training task of the computing power demanders will accelerate. At this time, the computing power demanders use some computing resources to participate in blockchain mining, strive for the right to record transactions on the blockchain, and obtain block rewards.
[0173] Step S402: Obtain pricing information for computing resources written by computing power providing nodes through the blockchain network;
[0174] In step S402, after determining the pricing information, the computing power providing node writes the pricing information into the blockchain network. After the computing power providing node writes the pricing information into the blockchain network, the computing power demanding node obtains the pricing information through the blockchain network. The pricing information must meet the following conditions:
[0175] A. The unit price of the resource is calculated in the pricing information. Within the pre-set unit price range within, that is ;
[0176] B. Calculate the unit price of resources in the pricing information. The demand elasticity of computing power users needs to be considered in order to balance resource supply and demand.
[0177] Step S403: Determine the ordering information of the computing resources based on the task requirements, the pricing information, and the second objective function, wherein the second objective function is used to maximize the profit of the computing power demand node;
[0178] In step S403, the computing power demand node determines the ordering information for computing resources based on task requirements, pricing information, and a second objective function. The ordering information includes calculations based on task requirements and pricing information to maximize profit. The amount of computing resources ordered; specifically, the formula for the second objective function is as follows:
[0179]
[0180]
[0181] in, This indicates the allocation of computing resources for mining tasks. This represents the profit per unit of computing power generated by fulfilling business requirements. It is a weighting factor, representing the first Individual computing power demand nodes tend to consider the importance of payment costs to total profit. The token effect parameter represents the monetary value equivalent to mining. It is the profit that computing power demand nodes obtain from mining tasks; This indicates the preset purchase quantity range.
[0182] Step S404: Write the ordering information of the computing resources into the blockchain network. The ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy. The pricing strategy is used to determine the pricing information. The learning parameters are dynamically adjusted according to the WOLF algorithm.
[0183] In step S104, the ordering information of computing resources is written into the blockchain network. At this time, the computing power providing node can obtain the ordering information through the blockchain network. After the computing power providing node obtains the ordering information, in order to maximize and balance the interests of both parties in the computing power transaction, the computing power providing node optimizes the pricing strategy based on the Win or Learnfast (WOLF) algorithm and uses the optimized pricing strategy to calculate new pricing information. The learning parameters in the optimization process are dynamically adjusted according to the WOLF algorithm.
[0184] Step S405: Obtain the computing resources configured by the computing power providing node through the blockchain network, wherein the computing resources are configured based on target order information, and the target order information represents the order information most recently sent at the current time.
[0185] In step S405, after the computing power providing node agrees to the order information submitted by the computing power requesting node, it will rent the corresponding amount of computing resources from the computing power providing node according to the order information. The computing power requesting node can use the rented computing resources to perform tasks.
[0186] In this embodiment of the invention, the computing power trading problem is modeled as a Stackelberg game with a single leader and multiple followers. The computing power providing node acts as the leader, and the computing power demanders act as followers. The computing power providing node uses the WOLF algorithm to find a pricing strategy that satisfies the equilibrium condition and sets its price accordingly. The computing power demanders adjust their ordering information based on the pricing to maximize the profits of both the computing power providing node and the computing power demanders. This approach maximizes and balances the interests of both parties in the computing power trading, avoiding resource monopolies and unfair transactions.
[0187] One optional implementation method involves initializing the trading environment before step S401. This specifically includes the following steps:
[0188] (1) Initialize the blockchain network, including network nodes, consensus mechanism, etc.
[0189] (2) Set the basic requirements parameters for AI services, including bandwidth, latency requirements, etc.
[0190] (3) Construct a computing power resource pool and integrate computing resources from different computing nodes.
[0191] (4) Set the minimum unit price of computing power provided by the computing power providing node to be The maximum unit price of computing power is Set the minimum amount of computing resources to be purchased for the node requesting computing power. The maximum amount of computing resources that can be purchased is .
[0192] In one embodiment, optionally, the method further includes:
[0193] Based on the task requirements, the computing power allocation ratio between the first role and the second role is determined, wherein the first role is used to perform blockchain mining tasks on the blockchain using computing power, and the second role is used to perform artificial intelligence service tasks using computing power.
[0194] The method further includes, after obtaining the computing resources configured by the computing power providing node through the blockchain network:
[0195] Based on the configured computing resources, the first role and the second role are used to perform corresponding tasks.
[0196] In this embodiment of the invention, the computing power demander can play multiple roles. The computing power demanding node pre-allocates computing power allocation ratios among different roles based on task requirements. The first role is the blockchain miner, used to execute blockchain mining tasks; the second role is the AI service provider, used to execute AI service tasks. Specifically, the job descriptions of the different roles are as follows:
[0197] The first role: Treat the AI training process as a mining puzzle. As the mining puzzle is solved, the training task of the nodes requiring computing power will accelerate. At this time, the nodes using computing power participate in blockchain mining using some of their computing resources, striving for the right to record transactions on the blockchain in order to obtain block rewards.
[0198] Second role: Use rented computing resources to run intelligent DApps, perform AI tasks, and provide artificial intelligence services to external parties.
[0199] In one embodiment, optionally, the method further includes:
[0200] Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the first income information obtained by the first role in executing the task;
[0201] Based on the AI service task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the second income information obtained by the second role in performing the task;
[0202] The second profit of the computing power demand node is calculated based on the first revenue information, the second revenue information, the target order information, and the target pricing information, wherein the target pricing information is the pricing information corresponding to the demand of the target order information.
[0203] In this embodiment of the invention, after a computing power demand node executes a corresponding task using rented computing resources, it calculates and allocates a corresponding second profit. This second profit includes profits from blockchain mining tasks and profits from performing manual services. Specifically, on one hand, the computing power demand node calculates first revenue information based on the ratio of computing resources between the first and second roles and the rewards obtained by the first role in blockchain mining. On the other hand, the computing power demand node calculates second revenue information based on the ratio of computing resources between the first and second roles and the execution results of the second role in AI service tasks. For example, if a computing power demand node successfully completes a high-value AI training or inference task using rented computing resources, and the output results of these tasks meet the expected goals, it will obtain corresponding business revenue, thereby increasing its profit.
[0204] Finally, based on the first revenue information, the second revenue information, the target order information, and the target pricing information, the second profit of the computing power demand node is calculated using the following formula:
[0205]
[0206] in, Indicates the second profit. This indicates the allocation of computing resources for mining tasks. This represents the profit per unit of computing power generated by fulfilling business requirements. It is a weighting factor, representing the first Individual computing power demand nodes tend to consider the importance of payment costs to total profit. The token effect parameter represents the monetary value equivalent to mining. It is the profit that the computing power demand node obtains from mining tasks, i.e., the first income information; This indicates the preset purchase quantity range.
[0207] Furthermore, it should be noted that computing power demand nodes can dynamically adjust their profit distribution strategies based on factors such as the allocation ratio between their roles in mining and AI services, as well as changes in the market environment, in order to maximize profits.
[0208] In one embodiment, the blockchain mining task may include training a target model, and the trained target model is used to perform the artificial intelligence service task.
[0209] The step of calculating the first income information obtained by the first role in executing the task based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role includes:
[0210] Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, the first role is used to train the target model to obtain the trained target model and the loss function of the target model.
[0211] The loss function of the target model is evaluated according to the consensus protocol PoLe learned, and it is determined that the first role meets the award conditions.
[0212] If the first role meets the award conditions, the first income information obtained by the first role in performing the task is calculated based on the pre-configured reward information.
[0213] In this embodiment of the invention, the blockchain network adopts the PoLe protocol, treating the local training process as a jigsaw puzzle. A neural network with a smaller loss function can efficiently provide high-quality AI services. For example... Figure 5 As shown, the winner will issue a block and receive further rewards. After consensus is reached, other computing power demand nodes will modify the parameters in the NN based on the winner's transactions. To execute the PoLe process among computing power demand nodes, validation using the same standard dataset containing only normal data is required. The model can only be deployed if its results on the standard dataset meet the standards. The first income information obtained by computing power demand nodes from mining. The calculation is as follows:
[0214] Step 1: Assume the computing power demand nodes Decide to allocate a portion of computing power To execute a blockchain mining task, the computing power required by the nodes in the entire blockchain network... The proportion of computing power used to perform blockchain mining tasks is:
[0215]
[0216] Step Two: Similar to Proof of Work (PoW), solving learning-based problems can be described as a random variable constrained by a Poisson distribution. Therefore, the computing power requirement nodes... The probability that blockchain miners will successfully solve this type of problem and reach a consensus is:
[0217]
[0218] in, This represents constant parameters related to learning jigsaw puzzles. This indicates the propagation time required for a block to reach consensus. Specifically, It's about block size. Transmission factors Evaluation metrics for each blockchain miner's solution to a learning-based puzzle. A linear function, i.e. In PoLe, With a given training time Related, that is Without sacrificing generality, we assume that each block contains an equal number of transactions, i.e. In addition, from computing power demand nodes The loss function value of the training neural network for blockchain miners is used as the evaluation metric. .
[0219] Step 3: If a blockchain miner on a node with high computing power successfully solves a learning-based problem, it broadcasts its solution to the entire network. Simultaneously, other nodes in the network verify the correctness of the solution and reach consensus. The first blockchain miner to successfully win the right to record transactions will receive a reward. Similarly, blockchain miners can receive rewards in two ways: successful mining rewards are... Performance bonus is The performance bonus is defined as the performance bonus coefficient. With blockchain size The product between them, that is Therefore, computing power demand nodes The profit obtained from mining is defined as follows:
[0220]
[0221] The present invention also provides an embodiment using the aforementioned computing power trading method, the specific implementation process of which includes:
[0222] Step 1: Initialize the transaction environment, set the basic parameters of the blockchain network and PoLe consensus algorithm, the basic parameters of computing power requirements, the range of computing resource purchase quantity and unit price, and integrate the computing power resource pool.
[0223] Step 2: Allocate multiple computing power demand nodes, allowing computing power demanders to assume multiple roles, including AI service providers and blockchain miners. Each computing power demand node can dynamically allocate its computing power ratio between AI service providers and blockchain miners according to task requirements and strategies.
[0224] Step 3: The computing power providing nodes first set the initial pricing information for computing resources. Based on the current market demand and resource supply, they set the initial pricing information and publish it on the blockchain. The unit price of computing resources in the initial pricing information needs to be within a limited range, while also taking into account the demand elasticity of the computing power requesting nodes.
[0225] Step 4: The computing power requesting node submits a purchase request. This request includes initial order information. Specifically, based on its own task requirements and the initial pricing information submitted by the computing power providing node, the requesting node determines the amount of computing resources it needs to purchase, forms the initial order information, and submits the purchase request. The amount of computing resources must be within a preset range and optimized according to the AI task's computing needs and budget.
[0226] Step 5: Model the computing power trading problem as a single-leader-multiple-follower Stackelberg game, with computing power providing nodes as leaders and computing power demanding nodes as followers. The computing power providing nodes optimize the pricing strategy using the learned parameters based on the first objective function, the first pricing information, and the first ordering information, update the pricing strategy, and update the pricing information based on the pricing strategy.
[0227] Step Six: The computing power demand node recalculates and uploads the order information based on the revised pricing information;
[0228] It should be noted that steps five and six are a continuous iterative and game-theoretic process. When the computing power providing node determines that the current pricing information meets the game equilibrium conditions, it determines the pricing information as the final target pricing information. Subsequently, the ordering information determined by the computing power demanding node based on the target pricing information becomes the final target ordering information, thereby maximizing the profits of both.
[0229] Step 7: The computing power providing node rents computing resources from the computing power demanding node based on the final target order information.
[0230] Step 8: Nodes requiring computing power are allocated the rented computing resources for blockchain mining or executing AI service tasks according to their assigned roles. Successful blockchain miners will receive corresponding rewards, while AI service providers will run intelligent DApps, offering artificial intelligence services and earning revenue based on performance.
[0231] Step Nine: After Step Eight, calculate the profits of both parties based on the target pricing information, target order information, and the revenue of the computing power demand node. Specifically, the computing power providing node charges the computing power demand node a fee and pays the cost based on the target order information, calculating the first profit; the computing power demand node adjusts its profit based on the cost of purchasing computing resources, mining revenue, and external AI service demand, calculating the second profit.
[0232] Step 10: Use blockchain technology to record and verify all the above computing power transactions and mining activities.
[0233] like Figure 6 As shown, this embodiment of the invention also provides a computing power trading device, applied to a computing power providing node, comprising:
[0234] The first writing module 601 is used to write the first pricing information of computing resources into the blockchain network, wherein the first pricing information is determined based on a pricing strategy;
[0235] The first acquisition module 602 is used to acquire, through the blockchain network, the first ordering information of the computing resources written by the computing power demand node, wherein the first ordering information is determined based on the first pricing information;
[0236] The first optimization module 603 is used to optimize the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and update the pricing strategy. The learning parameters are dynamically adjusted based on the Fast Win or Learn WOLF algorithm. The first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing nodes.
[0237] The second writing module 604 is used to determine the target pricing information of the computing resources according to the price strategy when the price strategy meets the equilibrium condition, and write the target pricing information into the blockchain network.
[0238] The second acquisition module 605 is used to acquire, through the blockchain network, the target ordering information of the computing resources written by the computing power demand node, wherein the target ordering information is determined based on the target pricing information;
[0239] The first configuration module 606 is used to configure the computing resources to multiple computing power demand nodes respectively through the blockchain network according to the target order information.
[0240] Optionally, the device further includes:
[0241] The fourth writing module is used to determine the first pricing information of the computing resource according to the pricing strategy when the pricing strategy does not meet the equilibrium condition, and to write the first pricing information into the blockchain network.
[0242] Optionally, the balancing conditions in the second write module 604 and / or the fourth write module include at least one of the following:
[0243] The number of optimization attempts for the pricing strategy exceeds the first threshold;
[0244] The absolute value of the difference between the price strategy obtained in the current state and the price strategy obtained in the previous state is less than or equal to the second threshold.
[0245] Optionally, the first optimization module 603 includes: a first calculation submodule, configured to calculate the value prediction information of the current state based on the first ordering information, the first pricing information, and the value function, wherein the value function is constructed based on a first objective function;
[0246] The first evaluation submodule is used to evaluate the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy, and obtain the evaluation result and the learning parameters corresponding to the evaluation result, wherein the price strategy is used to generate the first pricing information;
[0247] The first update submodule is used to update the price strategy in the current state according to the learning parameters to obtain the updated price strategy.
[0248] Optionally, the first evaluation submodule includes:
[0249] The first determining unit is configured to determine the first value result of the price strategy based on the value prediction information and the current state of the price strategy;
[0250] The second determining unit is used to determine the second value result of the price strategy benchmark based on the value prediction information and the current state price strategy benchmark.
[0251] The first evaluation unit is used to evaluate the pricing strategy in the current state based on the first value result and the second value result, and obtain an evaluation result;
[0252] The fourth determining unit is used to determine the corresponding learning parameters based on the evaluation results, wherein different evaluation results correspond to different learning parameters.
[0253] Optionally, the fourth determining unit includes:
[0254] The fifth determining unit is configured to determine a first learning parameter when the evaluation result indicates that the first value result is greater than or equal to the second value result;
[0255] The sixth determining unit is configured to determine a second learning parameter when the evaluation result indicates that the first value result is less than the second value result;
[0256] Wherein, the learning rate of the first learning parameter is less than the learning rate of the second learning parameter.
[0257] Optionally, the device further includes:
[0258] The sixth acquisition module is used to acquire the price strategy benchmark of the current state, wherein the price strategy benchmark of the initial state is determined according to the pre-configured pricing range of the computing resources, and both the first pricing information and the target pricing information are within the pricing range;
[0259] The seventh acquisition module is used to acquire the cumulative number of states between the current state and the initial state;
[0260] The price strategy benchmark is updated based on the cumulative number of states and the price strategy of the current state to obtain the updated price strategy benchmark.
[0261] Optionally, the device further includes:
[0262] The first calculation module is used to calculate the first profit of the computing power providing node based on the target pricing information, the target ordering information, and the resource cost when it is detected that the computing power demand node completes the task according to the configured computing resources.
[0263] It should be noted that the embodiments of this device are devices corresponding to the embodiments of the above methods. All implementations in the embodiments of the above methods are applicable to the embodiments of this device and can achieve the same technical effect.
[0264] like Figure 7 As shown, this embodiment of the invention also provides a computing power trading device, applied to a computing power demand node, comprising:
[0265] The third acquisition module 701 is used to acquire task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks.
[0266] The fourth acquisition module 702 is used to acquire pricing information of computing resources written by computing power providing nodes through the blockchain network;
[0267] The first processing module 703 is used to determine the ordering information of the computing resources based on the task requirements, the pricing information, and the second objective function, wherein the second objective function is used to maximize the profit of the computing power demand node;
[0268] The third writing module 704 is used to write the ordering information of the computing resources into the blockchain network. The ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy. The pricing strategy is used to determine the pricing information. The learning parameters are dynamically adjusted according to the WOLF algorithm.
[0269] The fifth acquisition module 705 is used to acquire the computing resources configured by the computing power providing node through the blockchain network, wherein the computing resources are configured based on target order information, and the target order information represents the order information most recently sent at the current time.
[0270] Optionally, the device further includes:
[0271] The first determining module is used to determine the computing power allocation ratio between the first role and the second role according to the task requirements, wherein the first role is used to use computing power to perform blockchain mining tasks on the blockchain, and the second role is used to use computing power to perform artificial intelligence service tasks.
[0272] The method further includes, after obtaining the computing resources configured by the computing power providing node through the blockchain network:
[0273] The first execution module is used to execute corresponding tasks using the first role and the second role according to the configured computing resources.
[0274] Optionally, the device further includes:
[0275] The second calculation module is used to calculate the first income information obtained by the first role in performing the task based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role.
[0276] The third calculation module is used to calculate the second income information obtained by the second role in performing the task based on the artificial intelligence service task, the configured computing resources, and the computing power allocation ratio between the first role and the second role.
[0277] The fourth calculation module is used to calculate the second profit of the computing power demand node based on the first revenue information, the second revenue information, the target order information, and the target pricing information, wherein the target pricing information is the pricing information of the demand corresponding to the target order information.
[0278] Optionally, the blockchain mining task in the second computing module includes training a target model, and the trained target model is used to perform the artificial intelligence service task;
[0279] The second computing module includes:
[0280] The first mining unit is used to train the target model using the first role based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, so as to obtain the trained target model and the loss function of the target model.
[0281] The second evaluation unit is used to evaluate the loss function of the target model according to the learned consensus protocol PoLe, and determine whether the first role meets the award conditions.
[0282] The first calculation unit is used to calculate the first income information obtained by the first character in performing the task, based on the pre-configured reward information, when the first character meets the award conditions.
[0283] It should be noted that the embodiments of this device are devices corresponding to the embodiments of the above methods. All implementations in the embodiments of the above methods are applicable to the embodiments of this device and can achieve the same technical effect.
[0284] This invention also provides a network device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the computing power trading method as described above and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0285] This invention also provides a readable storage medium, comprising: a program stored on the readable storage medium, wherein when the program is executed by a processor, it implements the steps of the computing power trading method described in any of the preceding claims, and achieves the same technical effect; to avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0286] This invention also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the steps of the computing power trading method described in any of the preceding claims and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0287] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0288] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A computing power trading method, characterized in that, Applied to computing power providing nodes, including: The first pricing information of computing resources is written into the blockchain network, wherein the first pricing information is determined based on a pricing strategy; The blockchain network is used to obtain the first ordering information of the computing resources written by the computing power demand node, wherein the first ordering information is determined based on the first pricing information. Based on the first objective function, the first pricing information, and the first ordering information, the pricing strategy is optimized using learning parameters, and the pricing strategy is updated. The learning parameters are dynamically adjusted based on the Fast Win or Learn WOLF algorithm. The first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing nodes. When the pricing strategy satisfies the equilibrium condition, the target pricing information of the computing resource is determined according to the pricing strategy, and the target pricing information is written into the blockchain network. The target ordering information for the computing resources written by the computing power demand node is obtained through the blockchain network, wherein the target ordering information is determined based on the target pricing information; According to the target order information, the computing resources are configured to multiple computing power demand nodes through the blockchain network.
2. The computing power trading method according to claim 1, characterized in that, The method further includes: If the pricing strategy does not meet the equilibrium condition, the first pricing information of the computing resource is determined according to the pricing strategy, and the first pricing information is written into the blockchain network.
3. The computing power trading method according to claim 1 or 2, characterized in that, The equilibrium condition includes at least one of the following: The number of optimization attempts for the pricing strategy exceeds the first threshold; The absolute value of the difference between the price strategy obtained in the current state and the price strategy obtained in the previous state is less than or equal to the second threshold.
4. The computing power trading method according to claim 1, characterized in that, The step of optimizing the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and updating the pricing strategy, includes: calculating the value prediction information of the current state based on the first ordering information, the first pricing information, and the value function, wherein the value function is constructed based on the first objective function; Based on the value prediction information, the current state price strategy benchmark, and the price strategy, the price strategy is evaluated to obtain the evaluation result and the learning parameters corresponding to the evaluation result, wherein the price strategy is used to generate the first pricing information; The price strategy in the current state is updated based on the learning parameters to obtain the updated price strategy.
5. The computing power trading method according to claim 4, characterized in that, The step of evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy to obtain the evaluation result and the learning parameters corresponding to the evaluation result includes: Based on the value prediction information and the current state of the price strategy, determine the first value outcome of the price strategy; Based on the value prediction information and the current state of the price strategy benchmark, a second value result for the price strategy benchmark is determined; Based on the first value result and the second value result, the price strategy in the current state is evaluated to obtain an evaluation result; Based on the evaluation results, the corresponding learning parameters are determined, wherein different evaluation results correspond to different learning parameters.
6. The computing power trading method according to claim 5, characterized in that, The step of determining the corresponding learning parameters based on the evaluation results includes: If the evaluation result indicates that the first value result is greater than or equal to the second value result, a first learning parameter is determined; If the evaluation result indicates that the first value result is less than the second value result, a second learning parameter is determined; Wherein, the learning rate of the first learning parameter is less than the learning rate of the second learning parameter.
7. The computing power trading method according to claim 4, characterized in that, Before evaluating the price strategy based on the value prediction information, the current state price strategy benchmark, and the price strategy, the method further includes: Obtain the pricing strategy benchmark for the current state, wherein the pricing strategy benchmark for the initial state is determined based on the pre-configured pricing range of the computing resources, and both the first pricing information and the target pricing information are within the pricing range; Get the cumulative number of states between the current state and the initial state; The price strategy benchmark is updated based on the cumulative number of states and the price strategy of the current state to obtain the updated price strategy benchmark.
8. The computing power trading method according to claim 1, characterized in that, The method further includes: If the computing power demand node completes the task according to the configured computing resources, the first profit of the computing power providing node is calculated based on the target pricing information, the target ordering information, and the resource cost.
9. A method for trading computing power, characterized in that, Applied to nodes with computing power requirements, including: Obtain task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks; The pricing information of computing resources written by the computing power providing nodes can be obtained through the blockchain network. Based on the task requirements, the pricing information, and the second objective function, the ordering information for the computing resources is determined, wherein the second objective function is used to maximize the profit of the computing power demand node; The ordering information of the computing resources is written into the blockchain network, wherein the ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy, wherein the pricing strategy is used to determine the pricing information, and the learning parameters are dynamically adjusted according to the WOLF algorithm; The computing resources configured by the computing power providing node through the blockchain network are obtained, wherein the computing resources are configured based on target order information, which represents the order information most recently sent at the current time.
10. The computing power trading method according to claim 9, characterized in that, The method further includes: Based on the task requirements, the computing power allocation ratio between the first role and the second role is determined, wherein the first role is used to perform blockchain mining tasks on the blockchain using computing power, and the second role is used to perform artificial intelligence service tasks using computing power. The method further includes, after obtaining the computing resources configured by the computing power providing node through the blockchain network: Based on the configured computing resources, the first role and the second role are used to perform corresponding tasks.
11. The computing power trading method according to claim 10, characterized in that, The method further includes: Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the first income information obtained by the first role in executing the task; Based on the AI service task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, calculate the second income information obtained by the second role in performing the task; The second profit of the computing power demand node is calculated based on the first revenue information, the second revenue information, the target order information, and the target pricing information, wherein the target pricing information is the pricing information corresponding to the demand of the target order information.
12. The computing power trading method according to claim 11, characterized in that, The blockchain mining task includes training a target model, and the trained target model is used to execute the artificial intelligence service task. The step of calculating the first income information obtained by the first role in executing the task based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role includes: Based on the blockchain mining task, the configured computing resources, and the computing power allocation ratio between the first role and the second role, the first role is used to train the target model to obtain the trained target model and the loss function of the target model. The loss function of the target model is evaluated according to the consensus protocol PoLe learned, and it is determined that the first role meets the award conditions. If the first role meets the award conditions, the first income information obtained by the first role in performing the task is calculated based on the pre-configured reward information.
13. A computing power trading device, characterized in that, Applied to computing power providing nodes, including: The first writing module is used to write the first pricing information of computing resources into the blockchain network, wherein the first pricing information is determined based on a pricing strategy; The first acquisition module is used to acquire, through the blockchain network, the first ordering information of the computing resources written by the computing power demand node, wherein the first ordering information is determined based on the first pricing information; The first optimization module is used to optimize the pricing strategy using learning parameters based on the first objective function, the first pricing information, and the first ordering information, and update the pricing strategy. The learning parameters are dynamically adjusted based on the Fast Win or Learn WOLF algorithm. The first objective function is used to indicate the optimization direction of the pricing strategy as maximizing the profit of the computing power providing nodes. The second writing module is used to determine the target pricing information of the computing resources according to the pricing strategy when the pricing strategy meets the equilibrium condition, and to write the target pricing information into the blockchain network. The second acquisition module is used to acquire, through the blockchain network, the target ordering information of the computing resources written by the computing power demand node, wherein the target ordering information is determined based on the target pricing information; The first configuration module is used to configure the computing resources to multiple computing power demand nodes respectively through the blockchain network according to the target order information.
14. A computing power trading device, characterized in that, Applied to nodes with computing power requirements, including: The third acquisition module is used to acquire task requirements, which include order information for performing blockchain mining tasks and / or performing artificial intelligence tasks. The fourth acquisition module is used to obtain pricing information of computing resources written by computing power providing nodes through the blockchain network; The first processing module is used to determine the ordering information of the computing resources based on the task requirements, the pricing information, and the second objective function, wherein the second objective function is used to maximize the profit of the computing power demand node; The third writing module is used to write the ordering information of the computing resources into the blockchain network. The ordering information is used to enable the computing power providing node to optimize the pricing strategy using learning parameters and update the pricing strategy. The pricing strategy is used to determine the pricing information. The learning parameters are dynamically adjusted according to the WOLF algorithm. The fifth acquisition module is used to acquire the computing resources configured by the computing power providing node through the blockchain network, wherein the computing resources are configured based on target order information, and the target order information represents the order information most recently sent at the current time.
15. A network device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the computing power trading method as described in any one of claims 1 to 8 or the computing power trading method as described in any one of claims 9 to 12.
16. A readable storage medium, characterized in that, include: The readable storage medium stores a program that, when executed by a processor, implements the steps of the computing power trading method as described in any one of claims 1 to 8 or the steps of the computing power trading method as described in any one of claims 9 to 12.
17. A computer program product, characterized in that, It includes computer instructions, which, when executed by a processor, implement the steps of the computing power trading method as described in any one of claims 1 to 8 or the steps of the computing power trading method as described in any one of claims 9 to 12.