Automatic transaction method and system based on foreground theory and reinforcement learning
Through the automatic trading method based on prospect theory and reinforcement learning, using the quantitative user perception model and differential evolution algorithm, combined with the Q-learning algorithm, the problem of inefficiency in distributed energy trading is solved, and efficient user trading decisions and dynamic pricing are achieved. , improving transaction efficiency and economic benefits.
Patent Information
- Application Number
- CN202410790505.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies are inefficient in distributed energy transactions and cannot effectively handle the uncertainty and heterogeneous decision-making of massive prosumers. It is difficult for traditional transaction models to achieve efficient user preference representation and dynamic pricing.
Using an automatic trading method based on prospect theory and reinforcement learning, by quantifying the user's perception model of gains and losses, combined with the differential evolution algorithm and the Q-learning algorithm based on risk aversion, the buyer's utility model and the seller's dynamic pricing strategy are constructed, and the solution is iteratively solved Buyer and seller trading information and strategies during trading hours.
It improves the economic benefits and transaction efficiency of users, maximizes the individual utility of buyers, realizes automatic transaction decisions among massive prosumers, and provides an efficient transaction reference.
Smart Images

Figure CN118657613A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power market, and specifically relates to an automatic trading method and system based on prospect theory and reinforcement learning. Background Art
[0002] In recent years, the construction scale of distributed resources such as distributed photovoltaic and distributed wind power has been increasing. With the access of a high proportion of distributed new energy power sources to the distribution network, end users have gradually changed from single electricity consumers to integrated producers and consumers, that is, prosumers. The emergence of artificial intelligence technology and home energy management systems has increased the flexibility of energy trading for prosumer users and provided technical support for scientific management and decision-making for massive users.
[0003] Existing research believes that prosumers are always completely rational decision makers who make the best solution based on their own situation. However, in the actual transaction process, it is necessary to consider the limited rationality modeling of different users facing uncertain transactions, so as to characterize the heterogeneity of user preferences and decisions. At the same time, there are a large number of prosumers at the distribution network level, and the traditional transaction model is inefficient through analytical solution. Summary of the invention
[0004] In view of the deficiencies in the prior art, the purpose of the present invention is to provide an automatic trading method and system based on prospect theory and reinforcement learning, which solves the problems in the prior art.
[0005] The purpose of the present invention can be achieved through the following technical solutions:
[0006] An automated trading method based on prospect theory and reinforcement learning, comprising the following steps:
[0007] The perceived losses and benefits of prosumers are modeled based on the value function of prospect theory, and a quantitative user perception model of benefits and losses is obtained;
[0008] Based on the quantitative user perception model of gains and losses, a buyer utility model is constructed and solved using a differential evolution algorithm;
[0009] The seller is modeled as an independent learning agent, and based on the solution of the buyer utility model, a risk-averse Q-learing algorithm is used to perform dynamic pricing for the seller;
[0010] The algorithm for solving the buyer's utility model and the algorithm for solving the seller's dynamic pricing are iterated in sequence to obtain the transaction information and strategies of buyers and sellers in each trading period.
[0011] Furthermore, the quantitative user perception model of gains and losses is:
[0012]
[0013] In the formula, the subscript j of each variable represents the buyer, i represents the seller, S represents the set of sellers; w j represents the amount of electricity demanded by buyer j, ρ i represents the seller price in an hour, ρ j represents the buyer's preferred price in an hour, x ij In an hour, buyer j is willing to pay i The price is to buy from seller i the quantity demanded x ij The percentage value of electrical energy; v(y i ) represents the quantification of the utility of the i-th user; y j represents the total energy purchase cost of the i-th user; k +,j , -k -,j , +,j , -,j is a parameter that controls the degree of loss and risk sensitivity; gb ,ρ gs It is the price at which energy is bought and sold on the grid.
[0014] Furthermore, the buyer utility model is:
[0015]
[0016] In the formula, B represents the buyer set, r i represents the amount of electricity sold by seller i, l ij represents the energy loss parameter considering network loss, l max represents the loss threshold, f(y) represents the sum of perceived utilities of all buyers, ρ gb ,ρ gs It is the price at which energy is bought and sold on the grid.
[0017] Furthermore, the steps of solving the buyer utility model using the differential evolution algorithm include:
[0018] Step 1: Initialize system parameters, including the maximum number of iterations of the differential evolution algorithm G max , population size NP, crossover probability CR, weight coefficient F, maximum tolerable prediction error ε max ;
[0019] Step 2: Iteration count = 0, generate the initial population of differential evolution χ = {x k |k=1,...,NP};
[0020] Step 3: Current population χ={x k |k=1,...,NP} A new generation of population is obtained through differential mutation, crossover and selection The objective function value of the population individuals is obtained by the fitness function;
[0021] Step 4: Select the best individual in the new generation population, call the buyer utility model to calculate the objective function value, and determine whether If so, update so that
[0022] Step 5: Calculate the prediction error ε and determine whether ε ≥ ε max ; If satisfied, add the point to the sample point set and update the optimization model;
[0023] Step 6: Determine whether the iterative termination conditions of differential evolution are met. If so, output the optimal result Output the optimal solution of each producer and consumer's transaction decision x * ; Otherwise, jump to step 3.
[0024] Furthermore, the steps of using the risk-averse based Q-learing algorithm for seller dynamic pricing include:
[0025] 1): Initialize the neural network parameters;
[0026] 2): Input the transaction information of all buyers in the current transaction period t and obtain the status information;
[0027] 3): For all sellers i, initialize various parameters and states in the environment based on the current state s t , select an action, generate an exploration action a t ;
[0028] 4): The environment accepts action a t , feedback reward R t With the new state s t+1 ;
[0029] 5): Calculate the network parameters and gradients, update the Q value and the seller's utility;
[0030] 6): Determine whether the termination condition is met. If so, output the optimal result; otherwise, return to step 6).
[0031] Furthermore, the formula for updating the seller's utility is:
[0032] Q new (s,a)=Q old (s,a)+αv(y i )
[0033]
[0034] y i =R i +γmax a Q(s new ,a)-Q(s,a)
[0035] In the formula, the reward R i represents the reward function value of seller i, γ represents the discount factor, and Q(s,a) represents the expected value after selecting action a in state s.
[0036] An automated trading system based on prospect theory and reinforcement learning, including:
[0037] Model building module: Model the perceived losses and benefits of prosumers based on the value function of prospect theory to obtain a quantitative user perception model of benefits and losses;
[0038] Model solving module: based on the quantitative user's perception model of gains and losses, a buyer utility model is constructed and solved using a differential evolution algorithm;
[0039] Pricing module: Sellers are modeled as independent learning agents, and based on the solution of the buyer utility model, a risk-averse Q-learing algorithm is used to perform dynamic pricing for sellers;
[0040] And, the strategy generation module: iteratively solves the algorithm of the buyer's utility model and the algorithm of the seller's dynamic pricing in turn to obtain the transaction information and strategies of the buyer and seller in each trading period.
[0041] A computer storage medium stores a readable program, which can execute the above-mentioned automatic trading method based on prospect theory and reinforcement learning when the program is run.
[0042] An electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;
[0043] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned automatic trading method based on prospect theory and reinforcement learning.
[0044] A computer program product includes computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the above-mentioned automatic trading method based on prospect theory and reinforcement learning.
[0045] Beneficial effects of the present invention:
[0046] The present invention provides an automatic trading method based on prospect theory and reinforcement learning. It adopts a value function to quantify the intrinsic heterogeneity of different buyers, maximizes the individual utility of buyers, and dynamically decides the optimal selling price of sellers based on the Q-learing algorithm, thereby improving the economic benefits and transaction efficiency of users, and finally realizing automatic transactions among users under massive prosumers, providing a reference for users' transaction decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 is a flow chart of the automatic trading method of the present invention;
[0049] Figure 2 A comparison chart of buyer perceived value of the present invention on two algorithms;
[0050] Figure 3 A comparison chart of the seller reward value of the present invention based on two algorithms;
[0051] Figure 4 A graph showing the relationship between buyer's perceived value and size of the present invention;
[0052] Figure 5 A graph showing the relationship between the reward value and scale of the seller of the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Example 1
[0055] like Figure 1 As shown, an automated trading method based on prospect theory and reinforcement learning includes the following steps:
[0056] S1, based on the value function of prospect theory, the perceived losses and benefits of prosumers are modeled to obtain a quantitative user perception model of benefits and losses;
[0057] First, based on the Prospect Theory (PT) value function, the perceived losses and gains of prosumers are modeled to obtain a quantitative user perception model of gains and losses to capture the user's perceived information on gains and losses. Specifically, there are a set of buyers B, a set of sellers S, and the additional electricity sold by seller i∈S is r i , buyer j∈B’s demand for electricity is w j Then, with x ij ∈[0,1] means buyer j is willing to pay i The price is to buy quantity w from seller i j Energy is a percentage value. There is energy loss in the process of energy transmission in the network, which depends on the energy transmission distance between buyer j and seller i and is proportional to the energy exchanged. Assume that the energy loss parameter is l ij ∈[0,1]. A quantitative user perception model of gains and losses is used to simulate the real user perception in the energy market. The model quantifies the user's perceived utility of gains and losses based on the degree of deviation from the reference point. The quantitative user perception model of gains and losses is expressed as:
[0058]
[0059] In the formula, the subscript j of each variable represents the buyer, i represents the seller, S represents the set of sellers; w j represents the amount of electricity demanded by buyer j, ρ i represents the seller price in an hour, ρ j represents the buyer's preferred price in an hour, x ij In an hour, buyer j is willing to pay i The price is to buy from seller i the quantity demanded x ij The percentage value of electrical energy, unit kWh; v(y i ) represents the quantification of the utility of the i-th user; y j represents the total energy purchase cost of the i-th user; k +,j , -k -,j , +,j , -,j It is a parameter that controls the degree of loss and risk sensitivity, which varies based on factors such as user gender and age; ρ gb ,ρ gs It is the energy buying and selling price of the power grid, which can be set as the on-grid electricity price and the time-of-use electricity price. If there is still a shortage or surplus in the energy transaction of the prosumer, the power grid will act as a bottom-line measure for the prosumer to buy or sell energy.
[0060] It can be seen from formula (1) that when y j >ρ j w jWhen y j < j w j , the utility function decreases.
[0061] S2, based on the quantitative user perception model of gains and losses obtained in S1, builds a buyer utility model and uses the differential evolution algorithm to solve it;
[0062] The buyer utility model expression is:
[0063]
[0064] In the formula, B represents the buyer set, r i represents the amount of electricity sold by seller i, l ij represents the energy loss parameter considering network loss, l max represents the loss threshold, f(y) represents the sum of perceived utilities of all buyers, ρ gb ,ρ gs It is the price at which energy is bought and sold on the grid.
[0065] In formula (3), the problem maximizes the sum of perceived utilities of all buyers. The first constraint prevents the problem from exceeding the amount of energy sold by each seller while incorporating the energy losses of the power lines. The second constraint guarantees an upper limit on the energy demand of each buyer, that is, the buyer will not buy more energy than it needs, and the third constraint limits the loss between buyers and sellers to the loss threshold l. max Finally, the fourth constraint sets the upper and lower bounds of the energy price to the purchase and sale prices of the power grid. It should be noted that this problem is a nonlinear and non-convex optimization problem, so it needs to be solved by heuristic algorithms and other solving methods. In addition, in the above problem, the seller price is considered to be a fixed transaction price as input, but the buyer's expected price (preferred price) will vary.
[0066] The steps of solving the buyer utility model using the differential evolution algorithm include:
[0067] Step 1: Initialize system parameters, including the maximum number of iterations of the differential evolution algorithm G max , population size NP, crossover probability CR, weight coefficient F, maximum tolerable prediction error ε max ;
[0068] Step 2: Iteration count = 0, generate the initial population x = {x k |k=1,...,NP};
[0069] Step 3: Current population x = {x k|k=1,...,NP} A new generation of population is obtained through differential mutation, crossover and selection The objective function value of the population individuals is obtained by the fitness function and needs to satisfy the model constraints, that is, if then if then if then
[0070] Step 4: Select the best individual in the new generation population, call model (3) to calculate the objective function value, and determine whether If so, update so that
[0071] Step 5: Calculate the prediction error ε and determine whether ε ≥ ε max ; If satisfied, add the point to the sample point set and update the optimization model.
[0072] Step 6: Determine whether the iterative termination conditions of differential evolution are met. If so, output the optimal result Output the optimal solution of each producer and consumer's transaction decision x * ; Otherwise, count++ and jump to step 3.
[0073] The differential evolution algorithm is shown in the following table:
[0074]
[0075] S3, models sellers as independent learning agents, and uses the risk-averse Q-learing algorithm to perform dynamic pricing for sellers based on the solution of the buyer utility model;
[0076] After solving the buyer's utility model to obtain the transaction results between the buyer and each seller, the seller's electricity price is updated through the risk-averse Q-learing pricing (PQR) algorithm. In order to dynamically decide the optimal selling price over time, the seller is modeled as an independent learning agent; it is worth noting that in order to protect privacy and avoid conflicts between producers and consumers, these agents cannot access the information of other sellers or buyers.
[0077] The Q-learning algorithm is a model-free learning method based on reinforcement learning. It solves the problem of the optimal decision-making strategy of the intelligent agent in a given environment by learning the Q value function of the target system. It is mainly based on the optimal Q value function and the Bellman equation for prediction and exploration. Its core is to require the optimal Q value function. This process has both Markov decision properties, which can be used to simulate the random strategies and returns that can be achieved by the intelligent agent in an environment with Markov properties of the system state. It is usually described by elements such as state space S, action space A, reward function R, and state transition rate P. For the buyer's pricing strategy, the modeling process of each main element is as follows.
[0078] 1) State Space
[0079] The state space in the Q-learing formula is determined by the grid electricity price (ρ gb ) and retail electricity price (ρ gs ) and discretized by step size δ, that is,
[0080] 2) Action Space
[0081] The action space consists of price-increasing actions, price-decreasing actions, and no-change actions, i.e., a∈{+δ, −δ, 0}, where δ is the amount by which the price increases or decreases.
[0082] 3) Reward Function
[0083] The reward function of seller i is the total profit in the current trading period, that is, R i =(ρ i +a)∑ j∈B x ij w j .
[0084] To update the q-value, the following Q-learing update rule is considered, which includes the seller’s perceived utility based on the PT value function.
[0085] Q new (s,a)=Q old (s,a)+αv(y i ) (4)
[0086]
[0087] y i =R i +γmax a Q(s new ,a)-Q(s,a) (6)
[0088] Among them, y iis the Temporal Difference error of the current iteration round of the i-th seller, v(y i ) is a transformation of the TD error to capture each seller’s personalized perceived utility of loss and gain. a is the learning rate for updating the q value in formula (4). In addition, it should be noted that the action selection is based on a greedy exploration-exploitation strategy.
[0089] When the system learns the optimal strategy, based on the selected action, the new selling price, reward, and q-value are updated according to formulas (4)-(6). The updated selling price is then sent to the respective seller i for the next trading cycle.
[0090] The steps to implement dynamic pricing for sellers using the risk-averse Q-learing algorithm include:
[0091] Step 1: Initialize the neural network parameters;
[0092] Step 2: Enter the transaction information of all buyers in the current trading period t and obtain the status information;
[0093] Step 3: For all sellers i, initialize the parameters and states in the environment based on the current state s t , select an action, generate an exploration action a t ;
[0094] Step 4: The environment accepts action a t , feedback reward R t With the new state s t+1 ;
[0095] Step 5: Calculate the parameters and gradients of the online Q network based on Q new (s,a)=Q old (s,a)+αv(y i ) formula updates the Q value; updates the seller’s utility y i =R i +γmax a Q(s new ,a)-Q(s,a).
[0096] Step 6: Determine whether the termination condition is met. If so, output the optimal result; otherwise, return to step 2.
[0097] The PQR algorithm is as follows:
[0098]
[0099] S4, iteratively solving the buyer's utility model algorithm and the seller's dynamic pricing algorithm in turn, and obtaining the transaction information and strategies of the buyer and seller in each trading period;
[0100] The specific steps to obtain the transaction information and strategies of buyers and sellers in each trading period include:
[0101] Step 1: Initialize the parameters of Algorithm 1 and Algorithm 2, including the initial electricity price, buyer preference parameters, and the maximum number of iterations ep that can be tolerated max ;
[0102] Step 2: Set the number of iterations l to 0;
[0103] Step 3: Enter the seller's selling price set S l , iteratively run the DEA algorithm during this trading period;
[0104] Step 4: Obtain the buyer's expected electricity purchase price set B l , the PQR algorithm will be based on B l Calculate the reward for executing energy transactions as input for iteration;
[0105] Step 5: Iteration number l++.
[0106] Step 6: Determine whether the termination condition is met. If so, output the optimal result B l-best and S l-best ; Otherwise, return to step 3.
[0107] Example 2
[0108] The electrical energy is allocated using a greedy heuristic method that allocates the cheapest seller to the buyer based on the order of registration in the system, while the final price of each transaction follows the mid-market pricing, which is the middle of the seller and buyer asking prices. In this example, a system with 40 prosumers is considered, evenly divided into buyers and sellers.
[0109] The reference price of each seller is initially randomly sampled from the range [0.09, 0.12]. It is then updated using PQR in each iteration. The reference price of each buyer is selected in the range [0.06, 0.10] and is considered static during the experiment (365 days). Specifically, the gain risk aversion parameter (ζ+)∈[0.60, 0.88], loss risk seeking parameter (ζ-)∈[0.52, 1.0], and loss aversion parameters (k+), (k-)∈[2.10, 2.61] for each buyer are sampled.
[0110] The proposed algorithm is compared with the Rule-based (abbreviated as Rule) trading algorithm. Rule uses a greedy heuristic to allocate energy, assigning the cheapest seller to the buyer according to the order in which the sellers are registered in the system, and the final price of each transaction follows the market middle price, which is the middle value of the seller and buyer's asking price.
[0111] Scenario 1: The performance of the considered methods over time is studied. Two performance metrics are considered, namely the objective value of the buyer and the cumulative reward of the seller.
[0112] like Figure 2 and Figure 3 As shown, the moving average is 10 days. In this experiment, we considered 15 buyers and 15 sellers. The advantage of the proposed algorithm over Rule is more prominent during the period from April to October, because both energy demand and production are higher during this period. The greedy nature of Rule reduces the quality of matching results, which significantly reduces the perceived value of buyers. Note that the target value of buyers is negative because the price they pay is higher than the reference purchase price. Therefore, from the perspective of prospect theory, the transaction is regarded as a loss. Nevertheless, the proposed algorithm optimizes the energy allocation to maximize the perceived value of buyers. In addition, the proposed algorithm can dynamically learn the seller's price through the PQR algorithm, thereby generating higher returns than Rule. The seller's returns of both methods decrease after mid-September due to the reduction of energy production in winter.
[0113] Scenario 2: Test the scalability of the system size. Specifically, increase the system from 5 sellers and 5 buyers to 20 sellers and 20 buyers in proportion;
[0114] like Figure 4 and Figure 5 As shown in Figure 2, it shows the total perceived value of buyers and the returns of sellers in one year. By considering the PT value function, the proposed algorithm has a greater advantage over the Rule for both sellers and buyers when the system scale increases. Numerically, the proposed algorithm increases the perceived value of buyers by 26% while ensuring that the profits of sellers increase by 7%.
[0115] The method of the present invention may be implemented in hardware, firmware, or as software or computer code that may be stored in a recording medium (such as a CDROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded over a network and will be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, processor, or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.
[0116] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. An automatic trading method based on prospect theory and reinforcement learning, characterized in that: The following steps are involved: Based on the value function of prospect theory, the perceived losses and benefits of prosumers are modeled to obtain a quantitative user perception model of benefits and losses. Based on the quantitative user perception model of gains and losses, a buyer utility model is constructed and solved using a differential evolution algorithm; The seller is modeled as an independent learning agent, and based on the solution of the buyer utility model, a risk-averse Q-learing algorithm is used to perform dynamic pricing for the seller; The algorithm for solving the buyer's utility model and the algorithm for solving the seller's dynamic pricing are iterated in sequence to obtain the transaction information and strategies of buyers and sellers in each trading period.
2. The automatic trading method based on prospect theory and reinforcement learning according to claim 1, characterized in that: The quantitative user perception model of gains and losses is: In the formula, the subscript j of each variable represents the buyer, i represents the seller, S represents the set of sellers; w j represents the amount of electricity demanded by buyer j, ρ i represents the seller price in an hour, ρ j represents the buyer's preferred price in an hour, x ij In an hour, buyer j is willing to pay i The price is to buy from seller i the quantity demanded x ij The percentage value of electrical energy; v(y i ) represents the quantification of the utility of the i-th user; y j represents the total energy purchase cost of the i-th user; k +,j , -k -,j , +,j , -,j is a parameter that controls the degree of loss and risk sensitivity; gb , ρ gs It is the price at which energy is bought and sold on the grid.
3. The automatic trading method based on prospect theory and reinforcement learning according to claim 2, characterized in that: The buyer utility model is: In the formula, B represents the buyer set, r i represents the amount of electricity sold by seller i, l ij represents the energy loss parameter considering network loss, l max represents the loss threshold, f(y) represents the sum of perceived utilities of all buyers, ρ gb ,ρ gs It is the price at which energy is bought and sold on the grid.
4. The automatic trading method based on prospect theory and reinforcement learning according to claim 3, characterized in that: The steps of solving the buyer utility model using the differential evolution algorithm include: Step 1: Initialize system parameters, including the maximum number of iterations of the differential evolution algorithm, population size, crossover probability, weight coefficient, and maximum tolerable prediction error ε max ; Step 2: Iteration number to generate the initial population for differential evolution Step 3: Current population A new generation of population is obtained through differential mutation, crossover and selection The objective function value of the population individuals is obtained by the fitness function; Step 4: Select the best individual in the new generation population, call the buyer utility model to calculate the objective function value, and determine whether If so, update so that Step 5: Calculate the prediction error ε and determine whether ε ≥ ε max ; If satisfied, add the point to the sample point set and update the optimization model; Step 6: Determine whether the iterative termination conditions of differential evolution are met. If so, output the optimal result Output the optimal solution for each producer-consumer transaction decision; otherwise, jump to step 3.
5. The automatic trading method based on prospect theory and reinforcement learning according to claim 4, characterized in that: The steps to implement dynamic pricing for sellers using the risk-averse Q-learing algorithm include: 1): Initialize the neural network parameters; 2): Input the transaction information of all buyers in the current transaction period t and obtain the status information; 3): For all sellers i, initialize various parameters and states in the environment based on the current state s t , select an action, generate an exploration action a t ; 4): The environment accepts action a t , feedback reward R t With the new state s t+1 ; 5): Calculate the parameters and gradients of the network, update the Q value and the seller's utility; 6): Determine whether the termination condition is met. If so, output the optimal result; otherwise, return to step 6).
6. The automatic trading method based on prospect theory and reinforcement learning according to claim 5, characterized in that: The formula for updating the seller's utility is: Q new (s,a)=Q old (s,a)+αv(y i ) y i =R i +γmax a Q(s new ,a)-Q(s,a) In the formula, the reward R i represents the reward function value of seller i, γ represents the discount factor, and Q(s,a) represents the expected value after selecting action a in state s.
7. An automatic trading system based on prospect theory and reinforcement learning, characterized in that: include: Model building module: Model the perceived losses and benefits of prosumers based on the value function of prospect theory to obtain a quantitative user perception model of benefits and losses; Model solving module: based on the quantitative user's perception model of gains and losses, a buyer utility model is constructed and solved using a differential evolution algorithm; Pricing module: Sellers are modeled as independent learning agents, and based on the solution of the buyer utility model, a risk-averse Q-learing algorithm is used to perform dynamic pricing for sellers; And, the strategy generation module: iteratively solves the algorithm of the buyer's utility model and the algorithm of the seller's dynamic pricing in turn to obtain the transaction information and strategies of the buyer and seller in each trading period.
8. A computer storage medium storing a readable program, characterized in that: When the program is running, it can execute the automatic trading method based on prospect theory and reinforcement learning as described in any one of claims 1 to 6.
9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to an automatic trading method based on prospect theory and reinforcement learning as described in any one of claims 1 to 6.
10. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to an automatic trading method based on prospect theory and reinforcement learning as described in any one of claims 1 to 6.
