Electric water heater demand response optimization method, device and medium

By constructing demand response optimization knowledge rules and reinforcement learning models for electric water heaters, combined with electricity price trend signals and hot water demand, control actions are generated, which solves the problems of low efficiency and high cost of household electric water heaters in demand response environments, and realizes the improvement of electricity bills. reduction and load balancing.

CN113850503BActive Publication Date: 2024-10-18GUANGDONG POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111125770.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2024-10-18
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

In the existing technology, it is difficult for household electric water heaters to efficiently optimize heating time in a demand response environment, resulting in high electricity bills and unbalanced load on the power system. Existing methods suffer from low efficiency and high costs.

Method used

By constructing knowledge rules and reinforcement learning models for demand response optimization of electric water heaters, combined with electricity price trend signals and hot water demand, control actions are generated, and through reinforcement learning model training, the heating strategy of the electric water heaters is optimized to achieve automated response.

Benefits of technology

It achieves efficient and automated optimization of electric water heaters under the uncertainty of electricity prices and ambient water temperature, reduces user electricity bills and improves the load balance of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113850503B_ABST
    Figure CN113850503B_ABST
Patent Text Reader

Abstract

The present invention discloses an electric water heater demand response optimization method, device and medium. The method comprises: determining knowledge rules for electric water heater demand response optimization according to acquired relevant data and constructing a reinforcement learning model, combining the electricity price trend indication signal of the electric water heater control period, generating a first control action and a second control action for electric water heater demand response optimization, inputting a preset control action selector for processing, selecting one of the first control action and the second control action for simulation according to a preset probability, combining a reinforcement learning state quantity and a preset reinforcement learning reward function to determine a reinforcement learning sample, inputting the reinforcement learning sample into the reinforcement learning model for training until convergence, and outputting a third control action to control the actual operation of the electric water heater. The present invention improves the efficiency of electric water heater demand response optimization by combining knowledge rules and reinforcement learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system optimization, and in particular to an electric water heater demand response optimization method, equipment and medium. Background Art

[0002] With the increasing emphasis on energy conservation and emission reduction, the implementation of power demand response as an important measure for energy conservation and emission reduction is becoming more and more vigorous. Household water heaters are important power loads and important targets for the implementation of demand response. This requires electric water heaters to have the ability to respond to electricity price signals to adjust the heating time, thereby achieving the purpose of reducing electricity bills. Household water heaters are installed in residential buildings, and residents are sensitive to disturbances. It is not appropriate to achieve demand response through manual adjustment. Therefore, water heaters are required to automatically adapt to various uncertainties such as electricity prices, ambient water temperature, and hot water demand to achieve automated demand response.

[0003] The common control method for household water heaters is to "maximize user comfort" without considering electricity price fluctuations, so that the hot water temperature in the electric water heater is always maintained at a specific value. This method is fully automated and does not require the development of a specific control scheme for each water heater. However, in a demand response environment, electricity prices change dynamically, and this method does not distinguish between electricity price fluctuations, which will cause users to spend more on electricity bills. At the same time, the power system sets electricity prices based on load balancing requirements. Since this method does not respond to electricity prices, it may consume power system resources to balance loads, causing an increase in total social energy consumption.

[0004] The prior art has conducted a lot of research on the demand response of water heaters, and these studies can be roughly divided into three categories. The first category is rule-based demand response optimization. This type of research mainly uses certain rules to decide the heating time of the water heater based on the changing trend of electricity prices in the next few hours and the current hot water temperature and other information. This type of method has the advantages of simplicity and automation, but this method does not take into account the thermodynamic characteristics of the water heater and it is difficult to obtain a global optimization solution. The second category is demand response optimization based on optimization methods. This method establishes a thermodynamic mathematical model of the water heater, combines the predicted electricity price, ambient water temperature, hot water demand, ambient temperature and other information for a period of time in the future, and uses mathematical methods to solve the optimization equation to obtain the optimal solution. This method can obtain a global optimization solution, but this method is user-specific and belongs to a case-by-case solution method, which is difficult to promote to thousands of households. The third category is learning-based demand response optimization. The overall idea of ​​this type of method is to obtain the water heater demand response optimization operation data, and then use this data to train the machine learning network. After the network converges, it is used for the water heater demand response optimization. This method has the advantage of adaptive system uncertainty and is easy to realize demand response automation. However, the optimization solution of electric water heater demand response is very sparse. At present, how to efficiently explore the optimization solution to reduce the sample collection cost and ensure the real-time optimization is still a difficult problem. Summary of the invention

[0005] The object of the present invention is to provide a method, device and medium for optimizing demand response of electric water heaters, so as to solve the current problems of low efficiency and high cost of optimizing demand response of electric water heaters.

[0006] To achieve the above object, the present invention provides an electric water heater demand response optimization method, comprising:

[0007] According to the starting hot water temperature on the target scheduling day, the electricity price at each time period on the target scheduling day, the ambient water temperature at each time period on the target scheduling day, and the hot water demand at each time period on the target scheduling day, the knowledge rules for optimizing the demand response of the electric water heater are determined and a reinforcement learning model is constructed;

[0008] Obtaining an electricity price trend indication signal of the electric water heater control period, and combining the knowledge rule of the electric water heater demand response optimization and the constructed reinforcement learning model to generate a first control action and a second control action for the electric water heater demand response optimization;

[0009] Inputting the first control action and the second control action into a preset control action selector for processing, so that the control action selector outputs one of the first control action and the second control action according to a preset probability;

[0010] According to the control action output by the control action selector, the control action is input to the data-driven electric water heater model to perform simulation, and the reinforcement learning sample is determined by combining the reinforcement learning state quantity and the preset reinforcement learning reward function;

[0011] The reinforcement learning samples are input into the reinforcement learning model for training until convergence, and the third control action outputted by the reinforcement learning model is used to control the actual operation of the electric water heater.

[0012] Preferably, the first control action of generating the electric water heater demand response optimization includes:

[0013] Divide the target scheduling day into time segments according to the control cycle of the electric water heater and number them in sequence;

[0014] Determining the electricity price trend indication signal according to the electricity price of the nth period and the electricity price of a preset period;

[0015] Referring to the knowledge rule of the electric water heater demand response optimization, the first control action is determined according to the electricity price trend indication signal, the hot water temperature of the electric water heater in the nth time period and the central value of the user's comfortable hot water temperature range.

[0016] Preferably, the step of determining the electricity price trend indication signal according to obtaining the electricity price in the nth period and the electricity price in a preset period includes:

[0017] Obtaining an average value of the electricity price during the preset period;

[0018] Compare the electricity price of the nth time period with the average value of the electricity price of the preset time period to obtain the electricity price trend indication signal, wherein the electricity price trend indication signal includes any one of the first electricity price trend indication signal, the second electricity price trend indication signal and the third electricity price trend indication signal; wherein,

[0019] If the electricity price in the nth time period is greater than the average value of the electricity price in the preset time period, obtaining the first electricity price trend indication signal;

[0020] If the electricity price in the nth time period is less than the average value of the electricity price in the preset time period, obtaining the second electricity price trend indication signal;

[0021] If the electricity price in the nth time period is equal to the average value of the electricity prices in the preset time period, the third electricity price trend indication signal is obtained.

[0022] Preferably, referring to the knowledge rule of the electric water heater demand response optimization, determining the first control action according to the electricity price trend indication signal, the hot water temperature of the electric water heater in the nth time period and the center value of the user's comfortable hot water temperature range includes:

[0023] Comparing the hot water temperature of the electric water heater in the nth time period with the central value of the user's comfortable hot water temperature interval, and combining the electricity price trend indication signal with the average value of the hot water demand in the preset time period, determining the first control action, wherein the first control action includes an instruction for the electric water heater to heat at rated power or an instruction for the electric water heater not to heat;

[0024] If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with the electricity price trend indication signal and the average value of the hot water demand in the preset time period is not zero, then an instruction for the electric water heater to heat at rated power is obtained; otherwise, an instruction for the electric water heater not to heat is obtained.

[0025] Preferably, if the hot water temperature of the electric water heater in the nth time period is less than the central value of the user's comfortable hot water temperature range, combined with the electricity price trend indication signal and the average value of the hot water demand in the preset time period is not zero, then obtaining the electric water heater heating instruction with rated power includes:

[0026] The average value of the hot water demand in the preset time period includes the average value of the hot water demand from the nth time period to the G1th time period or the average value of the hot water demand from the nth time period to the G2th time period, wherein:

[0027] G1=n+N0;

[0028]

[0029] Where N0 represents the time window length, represents the ambient water temperature in the nth period, W inc Indicates the temperature rise of the electric water heater, W set Indicates the center value of the user's comfortable hot water temperature range;

[0030] If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with the second electricity price trend indication signal and the average value of the hot water demand from the nth time period to the G1th time period is not zero, then obtain the electric water heater heating instruction with rated power;

[0031] If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with one of the electricity price trend indication signals other than the second electricity price trend indication signal, and the average value of the hot water demand from the nth time period to the G2th time period is not zero, then an instruction for the electric water heater to heat at rated power is obtained.

[0032] Preferably, the first control action and the second control action are input into a preset control action selector for processing, so that the control action selector outputs one of the first control action and the second control action according to a preset probability, including:

[0033] The first control action and the second control action are input into a preset control action selector for processing, and the first control action is determined according to a preset probability P1, and the second control action is determined according to a preset probability P2; wherein, P2=1-P1, and the values ​​of the preset probability P1 and the preset probability P2 are controlled by a reinforcement learning process.

[0034] Preferably, inputting the reinforcement learning sample into the reinforcement learning model for training includes:

[0035] The reinforcement learning sample includes: the reinforcement learning state quantity of the nth period, the reinforcement learning state quantity of the (n+1)th period, the first control action, and a preset reinforcement learning reward function generated according to the first control action;

[0036] The reinforcement learning samples are input into a preset sample pool and its management rules, M reinforcement learning samples are obtained, and the M reinforcement learning samples are input into the reinforcement learning model for training.

[0037] Preferably, after inputting the reinforcement learning sample into the reinforcement learning model for training until convergence, outputting a third control action to control the actual operation of the electric water heater includes:

[0038] The reinforcement learning model includes a target network and an evaluation network;

[0039] Inputting the M reinforcement learning samples into the target network to obtain evaluation network parameters;

[0040] Whether the evaluation network has converged is determined by inputting the evaluation network parameters and the state quantity of the nth time period into the evaluation network, and after convergence, a third control action is output to control the actual operation of the electric water heater.

[0041] The present invention also provides a terminal device, comprising:

[0042] one or more processors;

[0043] A memory, coupled to the processor, for storing one or more programs;

[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the electric water heater demand response optimization method as described in any one of the above items.

[0045] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the electric water heater demand response optimization method as described in any one of the above items.

[0046] Compared with the prior art, the beneficial effects of the present invention are:

[0047] According to the heating control signal of the electric water heater, the knowledge rules for optimizing the demand response of the electric water heater are constructed, and the first control action is obtained. According to the preset reinforcement learning model for optimizing the demand response of the electric water heater, the second control action is obtained, and one of the first control action and the second control action is selected according to the preset probability. The preset data-driven electric water heater model is input to perform simulation, and the reinforcement learning sample is determined by combining the reinforcement learning state quantity and the preset reinforcement learning reward function. After the reinforcement learning sample is input into the reinforcement learning model for training until convergence, the third control action is output to control the actual operation of the electric water heater. By combining knowledge rules and reinforcement learning, the uncertainty of electricity price and ambient water temperature can be adapted with high precision, automaticity and high efficiency, and the electricity bill of the user's electric water heater can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 It is a flow chart of an electric water heater demand response optimization method provided by a certain embodiment of the present invention;

[0050] Figure 2 is a schematic diagram of a knowledge and reinforcement learning fusion mechanism provided by another embodiment of the present invention;

[0051] Figure 3 is a working principle diagram of a converged reinforcement learning model provided by another embodiment of the present invention;

[0052] Figure 4 It is a schematic diagram of a reinforcement learning model for optimizing electric water heater demand response based on DQN provided by an embodiment of the present invention;

[0053] Figure 5 is a structural diagram of a target network and an evaluation network provided by another embodiment of the present invention;

[0054] Figure 6 It is a structural diagram of a computer terminal device provided by a certain embodiment of the present invention. DETAILED DESCRIPTION

[0055] 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.

[0056] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.

[0057] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0058] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0059] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.

[0060] See also Figure 1 A certain embodiment of the present invention provides an electric water heater demand response optimization method, comprising the following steps:

[0061] S101: Determine the knowledge rules for optimizing the demand response of electric water heaters and construct a reinforcement learning model based on the starting hot water temperature of the target scheduling day, the electricity price at each time period on the target scheduling day, the ambient water temperature at each time period on the target scheduling day, and the hot water demand at each time period on the target scheduling day.

[0062] S102: Obtain an electricity price trend indication signal of the electric water heater control period, and generate a first control action and a second control action of the electric water heater demand response optimization in accordance with the knowledge rules of the electric water heater demand response optimization and the constructed reinforcement learning model.

[0063] Specifically, the following information of the target scheduling day is obtained: hot water temperature in the starting period, electricity price in each period of 24 hours, ambient water temperature in each period of 24 hours, hot water demand in each period of 24 hours, and rated power and rated capacity of the electric water heater. With the goal of reducing the electricity expenditure of the electric water heater, knowledge rules for optimizing the demand response of the electric water heater are established.

[0064] The hot water temperature at the start time, the electricity price in each period of 24 hours, the ambient water temperature in each period of 24 hours, and the hot water demand in each period of 24 hours are obtained to meet the user's comfort requirements and minimize the electricity bill of the electric water heater in the next 24 hours. A reinforcement learning model for demand response optimization of electric water heaters based on DQN is established.

[0065] According to the control cycle of the electric water heater, the time is segmented and numbered in sequence, and the electricity price trend indication signal is determined according to the electricity price of the nth time period and the electricity price of the preset time period, and the first control action is obtained according to the electricity price trend indication signal, the hot water temperature of the electric water heater in the nth time period, and the center value of the user's comfortable hot water temperature range. Specifically, assuming that the control cycle of the electric water heater is t0, that is, a time period length t0, the t0 value is not greater than 1.5 hours and not less than 0.25 hours, and the default value is 1 hour, the time is segmented with t0 as the interval, and the time periods are numbered in sequence according to the natural number order.

[0066] The average value of the electricity price in the preset period is obtained, and the electricity price in the nth period is compared with the average value of the electricity price in the preset period to obtain an electricity price trend indication signal, wherein the electricity price trend indication signal includes any one of the first electricity price trend indication signal, the second electricity price trend indication signal and the third electricity price trend indication signal. p The first electricity price trend indication signal, the second electricity price trend indication signal and the third electricity price trend indication signal have values ​​of -1, 0 and 1 respectively, and determine c p The specific method of calculating the value is as follows: if the current processing period is the nth period, the following rules are executed in sequence to generate c p .

[0067] If the electricity price in the nth period is greater than the average of the electricity prices in the preset period, a first electricity price trend indication signal is obtained, specifically: if the electricity price P in the nth period is n If it is greater than the average electricity price in period G1, let c p =-1, where N0 represents the time window length, N0 is an integer greater than 1, the time covered by G1 is not less than 3 hours and not more than 23 hours, and the default value of N0 is 6, where G1=n+N0.

[0068] If the electricity price in the nth period is less than the average electricity price in the preset period, a second electricity price trend indication signal is obtained. n If it is less than the average electricity price in period G1, let c p =1.

[0069] If the electricity price in the nth period is equal to the average electricity price in the preset period, a third electricity price trend indication signal is obtained, c p =0.

[0070] The knowledge rule generation for the heating control of the electric water heater is as follows: assuming that the current time is the nth period, the following rules are executed in sequence to generate the heating control signal of the electric water heater in the nth period based on the knowledge rule: 1 means the electric water heater is heating at rated power in the nth period. 0 indicates that the electric water heater does not heat during the nth period. The hot water temperature of the electric water heater during the nth period is compared with the central value of the user's comfortable hot water temperature interval, and the first control action is determined by combining the electricity price trend indication signal with the average value of the hot water demand during the preset period, wherein the first control action includes the electric water heater heating instruction at rated power or the electric water heater not heating instruction.

[0071] If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with the electricity price trend indication signal and the average value of the hot water demand in the preset time period is not zero, then the electric water heater is given a heating instruction at rated power, otherwise, the electric water heater is given a non-heating instruction. The average value of the hot water demand in the preset time period includes the average value of the hot water demand from the nth time period to the G1th time period [n,n+N0] or the average value of the hot water demand from the nth time period to the G2th time period [n,n+N1], where G1 and G2 are represented as follows:

[0072] G1=n+N0;

[0073]

[0074] Where N0 represents the time window length, represents the ambient water temperature in the nth period, W incis the temperature that rises when the electric water heater heats the rated volume of water of the electric water heater at rated power for t0 time, int means rounding, t0 is the control period of the electric water heater, W set Indicates the center value of the user's comfortable hot water temperature range.

[0075] If the hot water temperature of the electric water heater in the nth period is less than the center value of the user's comfortable hot water temperature range, combined with the second electricity price trend indication signal and the average value of the hot water demand from the nth period to the G1th period is not zero, then obtain the electric water heater heating instruction at rated power. Specifically, if And c p =1, and the average value of hot water demand from period n to period G1 is not 0, then let in, is the hot water temperature of the electric water heater in the nth period, W set is the center value of the user's comfortable hot water temperature range, W set =0.5(W max +W min ), where W min , W max They are respectively the lower and upper limits of hot water temperature required for user comfort.

[0076] If the hot water temperature of the electric water heater in the nth period is less than the center value of the user's comfortable hot water temperature range, combined with one of the non-second electricity price trend indication signals in the electricity price trend indication signal, and the average value of the hot water demand from the nth period to the G2th period is not zero, then obtain the electric water heater heating instruction at rated power. Specifically, if And c p ≠1, and the average value of hot water demand from the nth period to the G2th period is not 0, then let Otherwise,

[0077] S103: Inputting the first control action and the second control action into a preset control action selector for processing, so that the control action selector outputs one of the first control action and the second control action according to a preset probability.

[0078] S104: Inputting the control action output by the control action selector into the data-driven electric water heater model to perform simulation, and determining a reinforcement learning sample in combination with the reinforcement learning state quantity and a preset reinforcement learning reward function.

[0079] See also Figure 2 and Figure 3Specifically, the first control action is determined according to the preset probability P1, and the data-driven electric water heater model is input to perform simulation, and the reinforcement learning state quantity and the preset reinforcement learning reward function are combined to obtain reinforcement learning samples, and the second control action is determined according to the preset probability P2, and the data-driven electric water heater model is input to perform simulation, and the reinforcement learning state quantity and the preset reinforcement learning reward function are combined to obtain reinforcement learning samples, wherein P2=1-P1.

[0080] Based on the following information of the target scheduling day: hot water temperature in the starting period, electricity price in each period of 24 hours, ambient water temperature in each period of 24 hours, and hot water demand in each period of 24 hours, a reinforcement learning model for demand response optimization of electric water heaters based on DQN is established with the goal of meeting user comfort requirements and minimizing the electricity bill of electric water heaters in the next 24 hours. DQN refers to deep Q network.

[0081] See also Figure 4 The established DQN-based reinforcement learning model for electric water heater demand response optimization is carried out in the following steps:

[0082] 1) Design the state quantity of reinforcement learning, the state quantity s in the nth period n Designed for Where N is the total number of time periods covered by 24 hours, N = int(24 / t0), d n represents the hot water demand in the nth period, P1, The subscript 1 of d1 refers to the starting period of a training round, and n=1 also refers to the starting period of a training round.

[0083] 2) Design reinforcement learning action space, using x n represents the control action in the nth period, and the corresponding action space is x n =0 and x n =1, where x n 1 means that the electric water heater is heating at rated power in the nth period, x n A value of 0 indicates that the electric water heater does not heat during the nth period.

[0084] 3) Design a reward function for reinforcement learning. The components of the immediate reward are the electricity cost generated by the electric water heater and the penalty for the hot water temperature not meeting the user's comfort requirements. n represents the immediate reward generated by the control action in the nth period, then r n =-P n x n P rate t o -αC n , where P rate is the rated power of the electric water heater, Cn It is a sign that the temperature in the nth period does not meet the user's comfort requirements. or Time C n =1, when Time C n =0, α is the penalty coefficient, which is a positive number, and the default value is 20P n P rate t o .

[0085] 4) Based on DQN, a deep reinforcement learning network of a reinforcement learning model for optimizing the demand response of electric water heaters is designed. The designed reinforcement learning network is characterized in that the entire deep reinforcement learning network is constructed based on DNN, where DNN refers to Deep Neural Networks, i.e., deep neural networks. The deep reinforcement learning network consists of two parts: an evaluation network and a target network. The evaluation network and the target network have the same structure. The structural characteristics of the two networks are:

[0086] The network is a DNN, which is a 4-layer feedforward neural network, with 1 input layer, 2 hidden layers, and 1 output layer, arranged in the order of input layer, hidden layer 1, hidden layer 2, and output layer. The input layer has 3N+2 neurons. If the prediction time is the nth period, each neuron in the input layer is connected one by one in sequence. n An element in , that is, the input of each neuron at time n is P1, P2, ..., P N , d1,d2,…,d N ,n, Hidden layer 1 has int[(3N+2) / 2] neurons. Hidden layer 1 is fully connected to the input layer, hidden layer 1 is fully connected to hidden layer 2, and has no connection with other layers. Int means rounding to the nearest integer. Hidden layer 2 has int[(3N+2) / 2] neurons. Hidden layer 2 is fully connected to hidden layer 1, hidden layer 2 is fully connected to the output layer, and has no connection with other layers. The output layer contains 2 neurons. The output layer is fully connected to hidden layer 2 and has no connection with other layers. If the time period processed is the nth time period, the two outputs correspond to Q(s n ,x n |x n =0), Q(s n ,x n |x n =0), where Q(s n ,x n ) is in s n Control action x in state n The value expression Q(s n ,x n )=rn +γmaxQ(s n+1 ,x n+1 ),in γ ∈(0,1) is the discount factor, and max means selecting the maximum value.

[0087] S105: After inputting the reinforcement learning sample into the reinforcement learning model for training until convergence, a third control action is output to control the actual operation of the electric water heater.

[0088] See also Figure 5 Specifically, the reinforcement learning sample includes the state quantity of the nth time period, the state quantity of the n+1th time period, the control action output by the control action selector, and the reward function generated by the control action. The reinforcement learning sample is input into a preset sample pool and its management rules to obtain M reinforcement learning samples. The M reinforcement learning samples are input into the reinforcement learning model for training. The reinforcement learning model includes a target network and an evaluation network. The M reinforcement learning samples are input into the target network to obtain the evaluation network parameters. According to the evaluation network parameters and the state quantity of the nth time period being input into the evaluation network, it is determined that the evaluation network has converged. The third control action is output to control the actual operation of the electric water heater. The following training steps are performed based on the reinforcement learning model.

[0089] Training algorithm step 1: Randomly initialize the evaluation network parameter θ, copy θ to the target network parameter θ′, and generate 2M reinforcement learning samples (s based on the knowledge rules of the electric water heater demand response optimization in step S101 and the data-driven electric water heater model. n ,x n ,r n ,s n+1 ) Initialize the sample pool, where M is the number of samples sampled in each batch of reinforcement learning, M is an integer not less than 20, the default value of M is 60, the initialization working period n=1, and the initialization training round number k=1.

[0090] Training algorithm step 2: selection of dominant strategy actions and evaluation of network convergence, as follows:

[0091] 1) Obtain and record the dominant strategy control action of the evaluation network. If the current time is the nth period, then the dominant strategy control action of the nth period for: Among them, argmaxQ(s n ,x n ) means in state s n Under this condition, the control action that can make Q obtain the maximum value and calculate the control action reward of the dominant strategy in the nth period Its formula is

[0092] 2) Evaluate the network convergence judgment, calculate the total return of the dominant strategy control action in each training round, and the total return of the dominant strategy control action in the kth training round The calculation formula is If continuous C nc Training rounds The change does not exceed r th And C n If the values ​​are all 0, the evaluation network is judged to have converged, otherwise, the evaluation network is judged to have not converged, where r th is the return change threshold, which is no greater than 0.02P n P rate t o A positive number, the default value is 0.02P n P rate t o , C nc The number of consecutive stable rounds should be a natural number not less than 10. The default value is 10.

[0093] 3) If the evaluation network has converged in the nth period, the reinforcement learning training is exited and Sent to the actual electric water heater to control the work of the actual electric water heater.

[0094] 4) If the evaluation network does not converge in the nth period, the following training algorithm is executed.

[0095] Step 3 of the training algorithm: obtain M samples from the sample pool and its management rule module. The method is to first apply for M samples from the sample pool and its management rule module, and then the sample pool and its management rule module returns M samples. The sampling method is built into the sample pool and its management rule module.

[0096] Training algorithm step 4: exploration and exploitation coordination, if using represents the output of the reinforcement learning model for optimizing the demand response of electric water heaters in the nth period, and the probability ε is used to With probability (1-ε) Randomly pick a value from 0 or 1 and Sent to the control action selector for subsequent processing, where ε is the probability of selecting the dominant strategy, the value range is [0.8, 1], and the default value is 0.9. A value of 1 means that the electric water heater is heating at rated power in the nth period. A value of 0 indicates that the electric water heater does not heat during the nth period.

[0097] Training algorithm step 5: Calculate the i-th sample (s i ,x i ,r i ,s i+1 )’s target value yi , the calculation formula is: if i is the terminal step, then y i =r i , if i is other, then y i =r i +γmaxQ'(s i+1 ,x i+1 ), where Q′(s i+1 ,x i+1 ) is the target network at input s i+1 Output when .

[0098] Training algorithm step 6: Calculate the loss function L, which is calculated as follows: Where Q(s i ,x i ) is the evaluation network on input s i When the instruction x i The corresponding output.

[0099] Training Algorithm Step 7: Use θ v represents the parameter set of the evaluation network obtained in the vth iteration, ρ represents the learning rate, and the network parameters are updated according to the gradient back propagation algorithm. The network parameter update formula is:

[0100] Training algorithm step 8: Let n=n+1. If n>N, execute the following training algorithm 9 in sequence; otherwise, jump to the above training algorithm step 2.

[0101] Training algorithm step 9: Let n = 1, k = k + 1, when k / C e2t When the result is an integer, the parameters θ′ of the target network are updated with the parameters θ of the evaluation network, and the training algorithm is jumped to step 2. e2t If the result is not an integer, jump directly to step 2 of the training algorithm, where C e2t is the target network update period, a positive integer not less than 10, and the default value is 15.

[0102] A control action selector is established, which is used to select a control action from the first control action generated by the knowledge rule of the electric water heater demand response optimization and the second control action generated by the reinforcement learning model of the electric water heater demand response optimization according to a preset probability in each control action step and send it to the data-driven electric water heater model. The preset probability is characterized in that the probability is controlled by the reinforcement learning process, wherein the probability control method is: according to the probability P1=e -βk Select the first control action generated by the knowledge rule for optimizing the demand response of electric water heaters, according to the probability P2 = 1-e -βk Select the second control action generated by the reinforcement learning model for optimizing the demand response of electric water heaters, that is, in the nth period, according to the probability e- βk choose By probability (1-e- βk )choose Enter the x for the subsequent link n is the control action output by the control action selector, where β is the probability control factor, which is a positive number and has a default value of 0.005.

[0103] A data-driven water heater model with an average relative error of no more than 8% in hot water temperature simulation is selected. According to the control action output by the control action selector, as well as the hot water temperature, ambient water temperature, and hot water demand of the current electric water heater, the temperature of the water heater in the next period is simulated, and reinforcement learning samples are generated. The samples are sent to the sample pool and its management rule module, which specifically includes the following steps:

[0104] 1) A data-driven electric water heater model with a hot water temperature simulation error of no more than 8% is selected for the target electric water heater. When its input is the current control action, the current hot water temperature of the electric water heater, the current ambient water temperature, and the current hot water demand, the output is the hot water temperature at the beginning of the next period.

[0105] 2) Initiate simulation: If the simulation period is n, start from s n Winning d n , combined with x n , using the data-driven electric water heater model to simulate According to the simulation results, we can get

[0106] 3) According to r n =-P n x n P rate t o -αC n Calculate the immediate return r n .

[0107] 4) Construct reinforcement learning samples (s n ,x n ,r n ,s n+1 ), sent to the sample pool and its management rule module.

[0108] The sample pool and its management rules are established. This module receives and manages the reinforcement learning samples output from the data-driven electric water heater model simulation. The sample pool management rules are characterized by managing the sample pool according to the first-in-first-out rule. New samples are written at the top of the sample pool. When the sample pool capacity is insufficient, the earlier the sample enters the sample pool, the earlier it is deleted from the sample pool. After receiving the sample application for the reinforcement learning model for electric water heater demand response optimization, the sample application specifies the number of samples from the top of the sample pool and returns the sample to the reinforcement learning model. After the reinforcement learning model for electric water heater demand response optimization is trained to convergence, the reinforcement learning model outputs control actions to the actual electric water heater to control the operation of the actual electric water heater.

[0109] In the early stage of reinforcement learning, this embodiment uses near-optimal samples generated by knowledge rules with a high probability to train the reinforcement learning network, so that the reinforcement learning network can quickly extract the knowledge in the knowledge rules of water heater demand response. Compared with the traditional reinforcement learning for electric water heater demand response optimization, it has a faster convergence speed. In the later stage of reinforcement learning, it uses samples generated by free exploration with a high probability to train the reinforcement learning network. Compared with the traditional rule-based electric water heater demand response optimization, which is difficult to obtain the global optimal solution, the present invention has the ability to obtain the global optimal solution through free exploration, realizes the learning of the reinforcement learning network based on the electric water heater model, avoids the reinforcement learning from frequently interfering with the operation of the water heater due to the need for trial and error, effectively ensures the comfort of the user and the safety of the electric water heater, and the data-driven electric water heater model required by this embodiment is not high in precision and easy to obtain. The present invention can realize the automation of electric water heater demand response, can be applied to electric water heaters of different families, and automatically optimize the electricity bill of the electric water heater when the electricity price, ambient water temperature, and user hot water demand change.

[0110] See also Figure 6 , a certain embodiment of the present invention provides a terminal device, including:

[0111] one or more processors;

[0112] A memory, coupled to the processor, for storing one or more programs;

[0113] When the one or more programs are executed by the one or more processors, the one or more processors implement the electric water heater demand response optimization method as described above.

[0114] The processor is used to control the overall operation of the computer terminal device to complete all or part of the steps of the above-mentioned electric water heater demand response optimization method. The memory is used to store various types of data to support the operation of the computer terminal device, and these data may include, for example, instructions for any application or method used to operate on the computer terminal device, and data related to the application. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0115] In an exemplary embodiment, the computer terminal device can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, ASC), digital signal processors (Digital Signal Processor, DSP), digital signal processing devices (Digital Signal Processing Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field Programmable Gate Array, FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned electric water heater demand response optimization method and achieve the same technical effect as the above-mentioned method.

[0116] In another exemplary embodiment, a computer-readable storage medium including a computer program is also provided, and when the computer program is executed by a processor, the steps of the electric water heater demand response optimization method in any of the above embodiments are implemented. For example, the computer-readable storage medium can be the above-mentioned memory including program instructions, and the above-mentioned program instructions can be executed by a processor of a computer terminal device to complete the above-mentioned electric water heater demand response optimization method and achieve the same technical effect as the above-mentioned method.

[0117] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for optimizing demand response of electric water heaters. It is characterized in that include: According to the starting hot water temperature on the target scheduling day, the electricity price at each time period on the target scheduling day, the ambient water temperature at each time period on the target scheduling day, and the hot water demand at each time period on the target scheduling day, the knowledge rules for optimizing the demand response of the electric water heater are determined and a reinforcement learning model is constructed; Obtaining an electricity price trend indication signal of the electric water heater control period, and combining the knowledge rule of the electric water heater demand response optimization and the constructed reinforcement learning model to generate a first control action and a second control action for the electric water heater demand response optimization; Inputting the first control action and the second control action into a preset control action selector for processing, so that the control action selector outputs one of the first control action and the second control action according to a preset probability; According to the control action output by the control action selector, the control action is input to the data-driven electric water heater model to perform simulation, and the reinforcement learning sample is determined by combining the reinforcement learning state quantity and the preset reinforcement learning reward function; Inputting the reinforcement learning sample into the reinforcement learning model for training until convergence, and using the third control action outputted by the reinforcement learning model to control the actual operation of the electric water heater; The first control action of generating the electric water heater demand response optimization comprises: Divide the target scheduling day into time segments according to the control cycle of the electric water heater and number them in sequence; Determining the electricity price trend indication signal according to the electricity price of the nth period and the electricity price of a preset period; Referring to the knowledge rule of the electric water heater demand response optimization, determining the first control action according to the electricity price trend indication signal, the hot water temperature of the electric water heater in the nth time period, and the center value of the user's comfortable hot water temperature range; The step of determining the electricity price trend indication signal according to obtaining the electricity price in the nth period and the electricity price in the preset period includes: Obtaining an average value of the electricity price during the preset period; Compare the electricity price of the nth time period with the average value of the electricity price of the preset time period to obtain the electricity price trend indication signal, wherein the electricity price trend indication signal includes any one of the first electricity price trend indication signal, the second electricity price trend indication signal and the third electricity price trend indication signal; wherein, If the electricity price in the nth time period is greater than the average value of the electricity price in the preset time period, obtaining the first electricity price trend indication signal; If the electricity price in the nth time period is less than the average value of the electricity price in the preset time period, obtaining the second electricity price trend indication signal; If the electricity price in the nth time period is equal to the average value of the electricity prices in the preset time period, obtaining the third electricity price trend indication signal; The first control action is determined by referring to the knowledge rule of the electric water heater demand response optimization and according to the electricity price trend indication signal, the hot water temperature of the electric water heater in the nth time period and the center value of the user's comfortable hot water temperature range, including: Comparing the hot water temperature of the electric water heater in the nth time period with the central value of the user's comfortable hot water temperature interval, and combining the electricity price trend indication signal with the average value of the hot water demand in the preset time period, determining the first control action, wherein the first control action includes an instruction for the electric water heater to heat at rated power or an instruction for the electric water heater not to heat; If the hot water temperature of the electric water heater in the nth time period is less than the central value of the user's comfortable hot water temperature range, combined with the electricity price trend indication signal and the average value of the hot water demand in the preset time period is not zero, then obtain the electric water heater with rated power heating instruction, otherwise, obtain the electric water heater non-heating instruction; If the hot water temperature of the electric water heater in the nth time period is less than the central value of the user's comfortable hot water temperature range, combined with the electricity price trend indication signal and the average value of the hot water demand in the preset time period is not zero, then obtaining the electric water heater heating instruction with rated power, including: The average value of the hot water demand in the preset time period includes the average value of the hot water demand from the nth time period to the G1th time period or the average value of the hot water demand from the nth time period to the G2th time period, wherein: ; ; In the formula, represents the time window length, represents the ambient water temperature at the nth period, Indicates the temperature rise of the electric water heater. Indicates the center value of the user's comfortable hot water temperature range; If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with the second electricity price trend indication signal and the average value of the hot water demand from the nth time period to the G1th time period is not zero, then obtain the electric water heater heating instruction with rated power; If the hot water temperature of the electric water heater in the nth time period is less than the center value of the user's comfortable hot water temperature range, combined with one of the electricity price trend indication signals other than the second electricity price trend indication signal, and the average value of the hot water demand from the nth time period to the G2th time period is not zero, then an instruction for the electric water heater to heat at rated power is obtained.

2. The electric water heater demand response optimization method according to claim 1, It is characterized in that Inputting the first control action and the second control action into a preset control action selector for processing, so that the control action selector outputs one of the first control action and the second control action according to a preset probability, includes: The first control action and the second control action are input into a preset control action selector for processing, and the first control action is determined according to a preset probability P1, and the second control action is determined according to a preset probability P2; wherein P2=1-P1, and the values ​​of the preset probability P1 and the preset probability P2 are controlled by a reinforcement learning process.

3. The electric water heater demand response optimization method according to claim 1, It is characterized in that The step of inputting the reinforcement learning sample into the reinforcement learning model for training includes: The reinforcement learning sample includes: the reinforcement learning state quantity of the nth period, the reinforcement learning state quantity of the (n+1)th period, the first control action, and a preset reinforcement learning reward function generated according to the first control action; The reinforcement learning samples are input into a preset sample pool and its management rules, M reinforcement learning samples are obtained, and the M reinforcement learning samples are input into the reinforcement learning model for training.

4. The electric water heater demand response optimization method according to claim 3, It is characterized in that After inputting the reinforcement learning sample into the reinforcement learning model for training until convergence, outputting a third control action to control the actual operation of the electric water heater includes: The reinforcement learning model includes a target network and an evaluation network; Inputting the M reinforcement learning samples into the target network to obtain evaluation network parameters; Whether the evaluation network has converged is determined by inputting the evaluation network parameters and the state quantity of the nth time period into the evaluation network, and after convergence, a third control action is output to control the actual operation of the electric water heater.

5. A computer terminal device, It is characterized in that include: one or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the electric water heater demand response optimization method as described in any one of claims 1 to 4.

6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the electric water heater demand response optimization method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Intelligent electric water heater heat preservation gear load control method based on deep reinforcement learning

    CN112510719A

  • Message-based demand response systems and methods

    US20190086882A1