Intelligent energy management method and system based on AI algorithm group and large model system

The intelligent energy management system optimizes charging, discharging, and temperature control using AI algorithms to address inefficiencies in energy storage systems, minimizing costs and emissions.

CN118195348BActive Publication Date: 2024-12-20CELL TRANNERGY TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410349713.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-12-20
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

Existing energy storage systems fail to optimally adjust charging and discharging strategies based on real-time electricity price fluctuations and temperature regulation, leading to inefficiencies and increased costs, while neglecting the impact of carbon emissions management.

Method used

An intelligent energy management system utilizing AI algorithms and large model systems for real-time monitoring, predicting electricity prices and temperatures, and optimizing charging, discharging, and temperature control strategies to minimize costs and carbon footprint.

Benefits of technology

The system efficiently adjusts energy storage operations to match real-time electricity prices and temperatures, reducing costs and carbon emissions, ensuring safe and optimal performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118195348B_ABST
    Figure CN118195348B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of energy storage management technology, and more specifically, to a smart energy management method and system based on an AI algorithm group and a large model system, the method comprising: real-time monitoring and collecting operating data of the status of each energy storage device; obtaining forecast data of electricity prices from an energy exchange; inputting a time into a pre-constructed time-demand mathematical model to obtain a corresponding forecast demand, inputting the forecast data of the amount of electricity, the forecast demand and the electricity price into a pre-constructed first machine learning model to output a charging and discharging optimization strategy, i.e., an action; sending charging and discharging instructions to the energy storage device according to the charging and discharging optimization strategy; inputting the current temperature into a pre-constructed second machine learning model to output a temperature adjustment strategy for adjusting to a preset suitable temperature with the minimum amount of electricity required; the present invention implements the concept of low-carbon and environmental protection, and meets the needs and safety of energy storage at the lowest cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of energy storage management technology, and more specifically, to an intelligent energy management method and system based on an AI algorithm group and a large model system. Background Art

[0002] Energy Storage Systems (ESS) are an integral part of modern energy networks. Their main function is to store excess energy for subsequent use. These systems help balance supply and demand and improve energy efficiency, especially in the field of renewable energy. Among them, lithium battery technology has become an important component of energy storage systems due to its high energy density and long life.

[0003] Lithium battery management chip (AFE) and system (BMS)

[0004] AFE (Analog Front End): This is a key component in the lithium battery management system. It is responsible for measuring the voltage, current and temperature of the battery cell and is an important part of data acquisition.

[0005] BMS (Battery Management System): responsible for monitoring and managing the charging and discharging of the battery, protecting the battery from running safely, extending its service life, and improving energy efficiency. BMS achieves these functions by collecting data provided by AFE in real time.

[0006] Energy storage inverter (PCS) and energy management system (EMS)

[0007] PCS (Power Conversion System): This is the equipment in the energy storage system that is responsible for converting electrical energy from one form to another, such as converting direct current to alternating current. It plays a central role in the process of importing and exporting energy.

[0008] EMS (Energy Management System): Responsible for optimizing the operation of the energy storage system and achieving efficient use of energy. EMS manages and dispatches energy storage resources through algorithms and strategies, responds to external grid demand or price signals, and optimizes economic benefits and reliability.

[0009] Carbon asset management

[0010] Carbon asset management involves monitoring, reporting and verifying a company's carbon emissions, as well as developing emission reduction strategies and participating in carbon trading. As global attention to carbon emissions increases, effective carbon asset management has become a key part of corporate sustainable development.

[0011] In the above context, the management of energy storage systems requires not only the optimization of battery performance, but also the efficiency of the entire energy network and the management of carbon footprint. Therefore, it is an inevitable trend for the industry to develop an integrated solution that uses AI algorithms and large model systems to achieve these goals. AI and big data technologies can provide deeper data analysis, prediction and optimization capabilities, making energy storage systems more efficient, intelligent and green.

[0012] In distributed energy storage systems, how to optimize lithium battery management, improve energy utilization efficiency, and at the same time achieve intelligent deployment of energy networks and effective management of carbon assets is a key technical challenge.

[0013] The prior art is as follows:

[0014] For example, the Chinese patent with publication number CN115000992A discloses a control system for a green backup power supply for a data center. Although the above system can realize energy storage management, research and practical application of the above method or system and the prior art have found that the above method or system and the prior art have at least the following defects:

[0015] The following problems still exist in the prior art:

[0016] The fluctuation of electricity prices at different times is not taken into account. The fluctuation of electricity prices will affect the energy storage cost and the user's usage cost. In the actual operation process, the use of data centers combined with algorithms takes too long to make judgments. The use of machine learning, that is, AI technology, can respond quickly to real-time data and adjust strategies accordingly, which is more flexible. Secondly, the energy cost of temperature regulation is not considered. Temperature regulation itself requires electricity, and the speed of natural regulation cannot keep up with demand. At the same time, temperature regulation cannot be completed instantly. Before reaching the planned temperature, it is inevitable to face the influence of physical natural phenomena and the possible influence of the previous decision. Therefore, under the overall goal of low-carbon emissions, temperature regulation must naturally use AI technology to plan the lowest-cost charging and discharging strategy. Summary of the invention

[0017] In order to overcome the above-mentioned defects of the prior art, the present invention provides an intelligent energy management method and system based on an AI algorithm group and a large model system, which can adjust the charging and discharging strategy and temperature regulation strategy of the energy storage device according to the time, the temperature of the energy storage device and the electricity price forecast data of the energy exchange, so that the energy storage device can save costs as much as possible while meeting the needs, improve efficiency, and respond to the concept of green environmental protection.

[0018] Smart energy management method based on AI algorithm group and large model system, including:

[0019] Real-time monitoring and collection of operating data of each energy storage device status;

[0020] Obtain forecast data on electricity prices from energy exchanges;

[0021] Input the time to the pre-built time-demand mathematical model to obtain the corresponding predicted demand, input the predicted data of power, predicted demand and electricity price to the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action;

[0022] Sending charging and discharging instructions to energy storage devices according to the charging and discharging optimization strategy;

[0023] Input the current temperature into a pre-built second machine learning model to output a temperature regulation strategy that adjusts the current temperature to the minimum amount of electricity required to set a preset suitable temperature;

[0024] A temperature adjustment instruction is sent to the energy storage device according to the temperature adjustment strategy for adjusting to the preset suitable temperature with the minimum amount of electricity required.

[0025] Furthermore, the operating data includes time, power consumption, unit energy storage cost, current temperature and preset suitable temperature.

[0026] Furthermore, the method for constructing the time-demand mathematical model includes:

[0027] yt=Trend(t)+Seasonal(t);

[0028] Where Trend(t) represents the daily cumulative trend part; Seasonal(t) represents the periodic component;

[0029] Trend(t) is set to:

[0030] Trend(t)=a+bt;

[0031] Among them, a and b are regression parameters;

[0032] Seasonal(t) is set to:

[0033]

[0034] In the formula, t is the time, 7 represents the weekly cycle, c1 and c2 are the Fourier regression coefficients, π is the pi, and the historical time and the corresponding historical forecast demand data are used to estimate a, b, c1 and c2 using the least squares method;

[0035] When forecasting, input t and calculate the sum of Trend(t) and Seasonal(t) according to the formula to get yt, where yt is the forecast demand.

[0036] Furthermore, the method for constructing the first machine learning model includes:

[0037] Step 1: Design the first machine learning model state space;

[0038] S = {prediction data of electricity price, electricity quantity, predicted demand}, S is the state;

[0039] Step 2: Design the first machine learning model action space;

[0040] A = {charging (floating point number between 0-1, representing the charging ratio), discharging (floating point number between 0-1, representing the discharging ratio), selling surplus electricity (whether the remaining part of the electricity minus the predicted demand exceeds r% of the electricity, r is a value greater than 0, if it exceeds, the excess part will be sold to the grid as surplus electricity, if not, the amount of surplus electricity sold is 0)}, A is the action;

[0041] Step 3: construct a Q network. The method of constructing a Q network includes:

[0042] The Q network consists of an input layer, two hidden layers and an output layer; the hidden layers include the first hidden layer and the second hidden layer; the number of input nodes of the input layer is the dimension of the state variable, and the state variables include power, predicted demand and electricity price; it is set to 3 nodes, and the 3 nodes correspond to the predicted data of power, predicted demand and electricity price respectively; the number of hidden nodes in the first hidden layer is 32, and the general formula for calculating each hidden node in the first hidden layer includes:

[0043] z=w1×x+b1;

[0044] In the formula, x is the input layer data, that is, the predicted data of electricity, predicted demand and electricity price, w1 is the weight parameter of the hidden node from the input layer to any first hidden layer, b1 is the bias parameter, and z is the result of each hidden node in the first hidden layer;

[0045] The formula for the activation function ReLU(z) of the first hidden layer is:

[0046] ReLU(z)=max(0,z);

[0047] The number of hidden nodes in the second hidden layer is 64. The general formula for calculating the number of hidden nodes in each second hidden layer includes:

[0048] j = w2 × a + b2;

[0049] a = ReLU(j);

[0050] ReLU(j)=max(0,j)

[0051] Where a is the output result of the first hidden layer, w2 is the weight parameter of the number of hidden nodes from the first hidden layer to the second hidden layer, b2 is the bias parameter; ReLU(j) function is the activation function of the second hidden layer;

[0052] The number of output nodes in the output layer is 3, corresponding to the three actions in A. The general formula for calculating the output nodes of each output layer includes:

[0053] e=w3×d+b3;

[0054] Q = e;

[0055] ReLU(e)=max(0,e)

[0056] Where, e is the output result of the second hidden layer, w3 is the weight parameter of the output node from the second hidden layer to the output layer, b3 is the bias parameter, Q is the result vector of all output layer nodes; ReLU(e) function is the activation function of the output layer;

[0057] Step 4: Design reward function:

[0058] The time unit is defined as one hour, and rewards are given after each hour. The reward indicators include:

[0059] Electricity cost: Calculate the charge amount in the current hour × the predicted electricity price:

[0060] Energy storage cost: calculate the amount of charge in the current hour × unit energy storage cost;

[0061] Sales revenue: Calculate the amount of surplus electricity sold in the current hour × the predicted data of electricity price;

[0062] Demand cost: If the forecast demand is not met, that is, the forecast demand minus the electricity is a positive number, then this positive number is the demand gap; if the forecast demand minus the electricity is a negative number, then the demand gap is 0, and the demand cost penalty is formulated according to the forecast data of demand gap × electricity price;

[0063] The formula for the reward function R is:

[0064] R = - electricity cost - energy storage cost + sales revenue - demand cost;

[0065] In the formula, the demand cost is adjustable, the initial value of the demand cost is the predicted data of the electricity price, the reward value is γ decayed, the γ value is 0.9, and the final reward value is fed back to the Q network to update, and the first machine learning model is continuously optimized according to the actual operation data.

[0066] Furthermore, the first machine learning model training method includes:

[0067] Collect data. Each time the first machine learning model runs, obtain the state S, select action A, reward R and next state S'; add the collected (S, A, R, S') samples to the replay pool, sample the training set, and randomly sample a batch of sampled data from the replay pool every predetermined step length. The batch size is set to 32; for each sampled data, use the current target Q network to calculate the maximum Q value of the state S'. The target Q value formula is:

[0068] Y = R + γ × maxQ'(S', A');

[0069] Where Y is the target Q value; A' is the next action; Q' is the next Q value;

[0070] Input S into the current Q network to predict Q(S, A), and solve the loss function value of the Q value: loss function value MSE1, Using the optimizer, apply the gradient to update the parameters, update each parameter of each layer of the Q network with a learning rate α, and the parameter update direction is to subtract the gradient. The formula is:

[0071] θ = θ - α × θ MSE1;

[0072] In the formula, θ is a parameter;

[0073] Every C steps, the current Q network parameter θ is replaced with the target Q network parameter θ′, where C is the preset value; the training process is repeated, data is continuously collected, and the Q network is trained until the MSE converges.

[0074] Furthermore, the method for constructing the second machine learning model includes:

[0075] The recorded multiple sets of temperature data are used as training sets D. The temperature data sets include the current temperature, action, and the difference between the power at the current temperature and the power when adjusted to the preset suitable temperature. The state F is defined, F = {0, 1, 2...η} represents all possible temperature values, η is any value greater than or equal to 0, and the action H is defined, H = {heating β℃, cooling g℃}. The linear regression model is designed. The linear regression model is:

[0076] LR(n)=u0+u1x1+u2x2+u3x3;

[0077] Where x1 is the current temperature, x2 is the square of the current temperature, x3 is the difference between the current temperature and the preset suitable temperature, u1, u2 and u3 are the linear regression model parameters, and are obtained by gradient descent method based on the training set D;

[0078] Establish the dynamic programming equation V(F), the equation is:

[0079] V(F)=min{V(F-1)+LR(F-1, heating β℃),V(F+1)+LR(F+1, cooling g℃)};

[0080] Wherein, function LR is a linear regression model, V(F) is the state value function in dynamic programming, β is any value greater than or equal to 0, and g is any value greater than or equal to 0;

[0081] Reversely solve the temperature regulation strategy π*(H) that adjusts to the preset suitable temperature with the minimum amount of electricity. The reverse solution of the dynamic programming equation includes:

[0082] Define the optimal value function V(target state) = 0, then consider the adjacent states, and find the optimal value functions of these states according to the dynamic programming equation, continue to diffuse to all states, find the optimal value function of each state F, and according to the minimization principle of the equation, determine the temperature control strategy π*(H) with the minimum amount of electricity required to adjust to the preset suitable temperature under state F.

[0083] Furthermore, the training method of the second machine learning model includes:

[0084] Split D into training data set, validation data set and test data set, use linear regression model LR as the state value function of dynamic programming; define loss function MSE2, In the formula, is the number of samples, yi is the actual power change value of the i-th sample, is the power change value of the i-th sample predicted by the model;

[0085] The training data set is forward calculated to predict the power change, and the parameter update gradient is backward calculated. The gradient descent method SGD is used to continuously update u1, u2 and u3 to minimize the loss. After multiple rounds of iterations, if the loss value of the verification data set no longer decreases, the update is stopped. The obtained parameters u1, u2 and u3 are used to calculate the temperature adjustment strategy π*(H) required to adjust to the preset suitable temperature with the minimum power consumption. The performance of π*(H) is evaluated on the test data set. If the performance is not ideal, more data is collected and the training process is repeated until MSE2 converges.

[0086] A smart energy management system based on AI algorithm group and large model system implements a smart energy management method based on AI algorithm group and large model system. The system includes:

[0087] The monitoring module is used to monitor and collect the operating data of each energy storage device in real time, and send all the operating data of the energy storage devices to the optimization scheduling module and the temperature control module;

[0088] The price forecast module is used to obtain the forecast data of electricity prices from the energy exchange and input the forecast data of electricity prices into the optimization scheduling module;

[0089] The optimization scheduling module inputs the time into the pre-built time-demand mathematical model to obtain the corresponding predicted demand, inputs the predicted data of the power, predicted demand and power price into the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action, and sends the optimization strategy of charging and discharging to the first execution management module;

[0090] A first execution management module sends charge and discharge instructions to the energy storage device according to the charge and discharge optimization strategy;

[0091] The temperature control module inputs the current temperature to the pre-built second machine learning model to output a temperature regulation strategy that adjusts the temperature to the preset suitable temperature with the least amount of electricity required;

[0092] The second execution management module sends a temperature adjustment instruction to the energy storage device according to a temperature adjustment strategy for adjusting to a preset suitable temperature with a minimum amount of electricity.

[0093] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a smart energy management method based on an AI algorithm group and a large model system is implemented.

[0094] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, a smart energy management method based on an AI algorithm group and a large model system is implemented.

[0095] Beneficial effects: This embodiment provides the effects and advantages of a smart energy management method and system based on an AI algorithm group and a large model system through the present invention:

[0096] The present invention optimizes the charging and discharging strategies of energy storage equipment through machine learning, and makes the optimal charging and discharging strategies according to the real-time predicted electricity price fluctuations; adopts modular design, clearly divides specific functional modules such as monitoring module, price forecast module, optimization scheduling module, temperature control module, etc., which can be easily applied to energy storage systems of different scales and types, which is conducive to the later system maintenance and expansion; uses machine learning algorithms for optimization scheduling and temperature control, can continuously learn and optimize strategies according to real-time operation data, consider more practical factors, and has stronger performance than traditional mathematical models; makes full use of electricity price information and demand forecast information, designs reward functions to achieve multi-objective optimization, and can minimize costs while ensuring safety; the training process is reasonably designed to systematically collect data and update parameters, and the model convergence is good; the temperature control model uses dynamic programming to achieve global optimization, and aims to achieve the preset suitable temperature with the lowest electricity, which is in line with the concept of low carbon and environmental protection; deployed on distributed energy storage hardware equipment, it can execute scheduling strategies and temperature control instructions in real time, and has strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Figure 1 This is a schematic diagram of data transmission of a smart energy management system based on an AI algorithm group and a large model system in Example 1 of the present invention;

[0098] Figure 2 This is a connection diagram of a smart energy management system based on an AI algorithm group and a large model system in Example 1 of the present invention;

[0099] Figure 3 This is a connection diagram of a smart energy management system based on an AI algorithm group and a large model system in Example 2 of the present invention;

[0100] Figure 4 This is a flow chart of the smart energy management method based on AI algorithm group and large model system of the present invention;

[0101] Figure 5 is a schematic diagram of an electronic device of the present invention;

[0102] Figure 6 Schematic diagram of the storage medium of the present invention. DETAILED DESCRIPTION

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

[0104] Example 1

[0105] See also Figure 1 and Figure 2 As shown, the smart energy management system based on AI algorithm group and large model system described in this embodiment includes a monitoring module, a price forecast module, an optimization scheduling module and a first execution management module. The modules are connected by wired and / or wireless means to realize data transmission.

[0106] The monitoring module is used to monitor and collect the operating data of each energy storage device in real time, and send all the operating data of the energy storage devices to the optimization scheduling module. The operating data includes time, power consumption and unit energy storage cost;

[0107] It affects the electricity price at all times. For example, the electricity price is higher during the day and lower at night. The power is the remaining power of the energy storage device. The amount of remaining power will affect the optimization strategy of charging and discharging. For example, if the power is too low, it needs to be charged so that the stored power can meet customer needs. If the power is surplus, the surplus power can be sold to the power grid to recover the cost and prevent energy waste. The unit energy storage fee affects the energy storage cost of the energy storage device.

[0108] The price forecast module is used to obtain the forecast data of electricity prices from the energy exchange and input the forecast data of electricity prices into the optimization scheduling module. The forecast data of electricity prices will affect the optimization strategy of charging and discharging. For example, if the forecast data of short-term electricity prices shows that it will rise tomorrow, it will be necessary to charge part of the battery in advance today to prepare for a rainy day. When it is measured that the electricity price starts to fall, charging is stopped and the electricity price continues to fall. When it is measured that the electricity price starts to rise, discharging is started to reduce the electricity cost.

[0109] The optimization scheduling module inputs the time to the pre-built time-demand mathematical model to obtain the corresponding predicted demand, inputs the predicted data of power, predicted demand and power price to the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action, and sends the optimization strategy of charging and discharging to the first execution management module. The optimization strategy of charging and discharging is such as charging 20% ​​or discharging 50%;

[0110] The method for constructing the time-demand mathematical model includes:

[0111] yt=Trend(t)+Seasonal(t);

[0112] Where Trend(t) represents the daily cumulative trend part; Seasonal(t) represents the periodic component;

[0113] Trend(t) can be set to:

[0114] Trend(t)=a+bt;

[0115] Among them, a and b are regression parameters;

[0116] Seasonal(t) can be set to:

[0117]

[0118] In the formula, t is the time (hour), 7 represents the weekly cycle, c1 and c2 are the Fourier regression coefficients, π is the pi, and the historical time and the corresponding historical forecast demand data are used to estimate a, b, c1 and c2 using the least squares method;

[0119] When forecasting, input t and calculate the sum of Trend(t) and Seasonal(t) according to the formula to get yt, where yt is the forecast demand.

[0120] The method for constructing the first machine learning model includes:

[0121] Step 1: Design the first machine learning model state space;

[0122] S = {prediction data of electricity price, electricity quantity, predicted demand}; S is the state;

[0123] Step 2: Design the first machine learning model action space;

[0124] A = {charging (floating point number between 0-1, representing the charging ratio), discharging (floating point number between 0-1, representing the discharging ratio), selling surplus electricity (whether the remaining part of the electricity minus the predicted demand exceeds r% of the electricity, r is a value greater than 0, if it exceeds, the excess part will be sold to the grid as surplus electricity, if not, the amount of surplus electricity sold is 0)}, A is the action;

[0125] Step 3: Construct the Q network. The specific method of constructing the Q network includes:

[0126] The Q network consists of an input layer, two hidden layers and an output layer; the hidden layers include the first hidden layer and the second hidden layer; the number of input nodes of the input layer is the dimension of the state variable, and the state variables include power, predicted demand and electricity price; it is set to 3 nodes, and the 3 nodes correspond to the predicted data of power, predicted demand and electricity price respectively; the number of hidden nodes in the first hidden layer is 32, and the general formula for calculating each hidden node in the first hidden layer includes:

[0127] z=w1×x+b1;

[0128] Where x is the input layer data (i.e., the predicted data of electricity quantity, predicted demand quantity and electricity price), w1 is the weight parameter of the hidden node from the input layer to any first hidden layer, b1 is the bias parameter, and z is the result of each hidden node in the first hidden layer;

[0129] It is particularly noted that the weight parameter and the bias parameter are independent, and the weight parameter and the bias parameter may be different or the same;

[0130] The formula for the activation function ReLU(z) of the first hidden layer is:

[0131] ReLU(z)=max(0,z);

[0132] The number of hidden nodes in the second hidden layer is 64. The general formula for calculating the number of hidden nodes in each second hidden layer includes:

[0133] j = w2 × a + b2;

[0134] a = ReLU(j);

[0135] ReLU(j)=max(0,j)

[0136] Where a is the output result of the first hidden layer, w2 is the weight parameter of the number of hidden nodes from the first hidden layer to the second hidden layer, b2 is the bias parameter; ReLU(j) function is the activation function of the second hidden layer;

[0137] The number of output nodes in the output layer is 3, corresponding to the three actions in A. The general formula for calculating the output nodes of each output layer includes:

[0138] e=w3×d+b3;

[0139] Q = e;

[0140] ReLU(e)=max(0,e)

[0141] Where, e is the output result of the second hidden layer, w3 is the weight parameter of the output node from the second hidden layer to the output layer, b3 is the bias parameter, Q is the result vector of all output layer nodes; ReLU(e) function is the activation function of the output layer;

[0142] Step 4: Design reward function:

[0143] The time unit is defined as one hour, and rewards are given after each hour. The reward indicators include:

[0144] Electricity cost: Calculate the charge amount in the current hour × the predicted electricity price:

[0145] Energy storage cost: calculate the amount of charge in the current hour × unit energy storage cost;

[0146] Sales revenue: Calculate the amount of surplus electricity sold in the current hour × the predicted data of electricity price;

[0147] Demand cost: If the forecast demand is not met, that is, the forecast demand minus the electricity is a positive number, then this positive number is the demand gap; if the forecast demand minus the electricity is a negative number, then the demand gap is 0, and the demand cost penalty is formulated according to the forecast data of demand gap × electricity price;

[0148] The specific formula of the reward function R is:

[0149] R = - electricity cost - energy storage cost + sales revenue - demand cost;

[0150] In the formula, the demand cost is adjustable, the initial value of the demand cost is the predicted data of the electricity price, the reward value is γ decayed, the γ value is 0.9, and the final reward value is fed back to the Q network to update, and the first machine learning model is continuously optimized according to the actual operation data;

[0151] The first machine learning model training method comprises:

[0152] Collect data. Each time the first machine learning model runs, obtain the state S, select action A, reward R and next state S'; add the collected (S, A, R, S') samples to the replay pool, sample the training set, and randomly sample a batch of sampled data from the replay pool every predetermined step length. The batch size is set to 32; for each sampled data, use the current target Q network to calculate the maximum Q value of the state S'. The target Q value formula is:

[0153] Y = R + γ × max Q'(S', A');

[0154] Where Y is the target Q value; A' is the next action; Q' is the next Q value;

[0155] Input S into the current Q network to predict Q(S, A), and solve the loss function value of the Q value: loss function value MSE1, Use an optimizer such as Adam to apply the gradient to update the parameters, update each parameter of each layer of the Q network with a learning rate α, and update the parameter in the direction of subtracting the gradient. The formula is:

[0156] θ = θ - α × θ MSE1;

[0157] In the formula, θ is a parameter, and this formula is in computer language style;

[0158] Every C steps, replace the current Q network parameter θ with the target Q network parameter θ′, where C is the preset value; repeat the training process, continuously collect data, and train the Q network until the MSE converges;

[0159] A first execution management module sends charge and discharge instructions to the energy storage device according to the charge and discharge optimization strategy;

[0160] The present invention optimizes the charging and discharging strategies of energy storage equipment through machine learning, and makes the optimal charging and discharging strategy based on the real-time predicted electricity price fluctuations; it adopts a modular design, clearly divides specific functional modules such as the monitoring module, price forecast module and optimization scheduling module, and can be easily applied to energy storage systems of different scales and types, which is beneficial to the subsequent system maintenance and expansion; it uses machine learning algorithms for optimization scheduling, can continuously learn and optimize strategies based on real-time operating data, and can minimize costs while ensuring safety and meeting user needs.

[0161] Example 2

[0162] like Figure 3 As shown, in the actual use of the smart energy management system, the energy storage device is not properly temperature-regulated, and the energy storage device cannot be overheated or overcooled. Overheating can easily cause safety hazards, and overcooling may reduce energy storage performance, shorten service life, and reduce discharge efficiency. Both heat release and cooling require electrical energy. At the current stage, using the least amount of electrical energy to keep the temperature at a preset appropriate temperature can reduce costs. Therefore, this embodiment provides a smart energy management system based on an AI algorithm group and a large model system, which also includes a temperature control module;

[0163] The operation data also includes the current temperature and the preset suitable temperature. The temperature is crucial to the safe operation of the energy storage device. The temperature of the energy storage device needs to be collected in real time so as to adjust the temperature of the energy storage device to the preset suitable temperature of each energy storage device.

[0164] The temperature control module inputs the current temperature to the pre-built second machine learning model to output a temperature regulation strategy for adjusting to a preset suitable temperature with the least amount of electricity, and sends the temperature regulation strategy to the second execution management module, where the current temperature is measured by a temperature sensor;

[0165] The method for constructing the second machine learning model includes:

[0166] The recorded multiple sets of temperature data are used as training sets D. The temperature data sets include the current temperature, action, and the difference between the power at the current temperature and the power when adjusted to the preset suitable temperature. The state F is defined, F = {0, 1, 2...η} represents all possible temperature values, η is any value greater than or equal to 0, and the action H is defined, H = {heating β℃, cooling g℃}. The linear regression model is designed. The linear regression model is:

[0167] LR(n)=u0+u1x1+u2x2+u3x3;

[0168] Where x1 is the current temperature, x2 is the square of the current temperature, x3 is the difference between the current temperature and the preset suitable temperature, u1, u2 and u3 are the linear regression model parameters, and are obtained by gradient descent method based on the training set D;

[0169] Establish the dynamic programming equation, the equation is:

[0170] V(F)=min{V(F-1)+LR(F-1, heating β℃),V(F+1)+LR(F+1, cooling g℃)};

[0171] In the formula, function LR is a linear regression model, V(F) is a state value function in dynamic programming, β is an arbitrary value greater than or equal to 0, and g is an arbitrary value greater than or equal to 0. It should be noted that the energy storage device is accompanied by the physical phenomenon of natural heat dissipation during the temperature adjustment process. For example, when the heating device heats up by 2°C, the energy storage device may naturally dissipate 1°C, and the energy storage device actually heats up by 1°C. The energy storage device will be affected by the previous decision during the temperature adjustment process, because the temperature rise and fall takes time, and the time difference may affect the temperature adjustment. For example, when the cooling device cools down by 2°C, the energy storage device may heat up by 1°C because the influence of the previous heating action does not disappear quickly. This process is a dynamic change and needs to be reflected in the dynamic programming equation.

[0172] Reversely solve the temperature regulation strategy π*(H) that adjusts to the preset suitable temperature with the minimum amount of electricity. The reverse solution of the dynamic programming equation includes:

[0173] Define the optimal value function V (target state) = 0, then consider the adjacent states, find the optimal value functions of these states according to the dynamic programming equation, continue to diffuse to all states, find the optimal value function of each state F, and determine the temperature regulation strategy π*(H) with the minimum amount of electricity required to adjust to the preset suitable temperature under state F according to the minimization principle of the equation. For example: if V(F-1)+LR(F-1, heating 1°C) is the minimum value, then π*(H) = heating 1°C; if V(F-1)+LR(F-1, heating 3°C) is the minimum value, then π*(H) = heating 3°C;

[0174] The training method of the second machine learning model includes:

[0175] Split D into training data set, validation data set and test data set, use linear regression model LR as the state value function of dynamic programming; define loss function MSE2, In the formula, is the number of samples, yi is the actual power change value of the i-th sample, is the power change value of the i-th sample predicted by the model;

[0176] The training data set is forward-calculated to predict the power change, and the parameter update gradient is backward-calculated. The gradient descent method SGD is used to continuously update u1, u2, and u3 to minimize the loss. After multiple rounds of iterations, if the loss value of the verification data set no longer decreases, the update is stopped. The obtained parameters u1, u2, and u3 are used to calculate the temperature adjustment strategy π*(H) with the minimum power required to adjust to the preset suitable temperature. The performance of π*(H) is evaluated on the test data set. If the performance is not ideal, more data is collected and the training process is repeated until MSE2 converges.

[0177] The second execution management module sends a temperature adjustment instruction to the energy storage device according to a temperature adjustment strategy for adjusting to a preset suitable temperature with a minimum amount of electricity.

[0178] Example 3

[0179] See also Figure 4 As shown, the smart energy management method based on AI algorithm group and large model system described in this embodiment includes:

[0180] Real-time monitoring and collection of operating data of each energy storage device status;

[0181] Obtain forecast data on electricity prices from energy exchanges;

[0182] Input the time to the pre-built time-demand mathematical model to obtain the corresponding predicted demand, input the predicted data of power, predicted demand and electricity price to the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action;

[0183] Sending charging and discharging instructions to energy storage devices according to the charging and discharging optimization strategy;

[0184] Input the current temperature into a pre-built second machine learning model to output a temperature regulation strategy that adjusts the current temperature to the minimum amount of electricity required to set a preset suitable temperature;

[0185] A temperature adjustment instruction is sent to the energy storage device according to the temperature adjustment strategy for adjusting to the preset suitable temperature with the minimum amount of electricity required.

[0186] Example 4

[0187] See also Figure 5 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memory stores a computer readable code, and when the computer readable code is executed by one or more processors, the smart energy management method based on the AI ​​algorithm group and the large model system as described above can be executed.

[0188] The method or system according to the embodiment of the present application can also be used by Figure 5The electronic device architecture shown in FIG. Figure 5 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, ROM 503, RAM 504, a communication port 505 connected to a network, an input / output 506, a hard disk 507, etc. The storage device in the electronic device 500, such as ROM 503 or hard disk 507, may store the smart energy management method based on the AI ​​algorithm group and the large model system provided in the present application. Furthermore, the electronic device 500 may also include a user interface 508. Of course, Figure 5 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 5 One or more components of an electronic device are shown.

[0189] Example 5

[0190] See also Figure 6 As shown, it is a computer storage medium according to an embodiment of the present application. Computer-readable instructions are stored on the computer storage medium. When the computer-readable instructions are executed by the processor, the smart energy management method based on the AI ​​algorithm group and the large model system according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0191] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0192] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. Intelligent energy management method based on AI algorithm group and large model system, Characterized in that the method include: Real-time monitoring and collection of operating data of each energy storage device status; Obtain forecast data on electricity prices from energy exchanges; Input the time to the pre-built time-demand mathematical model to obtain the corresponding predicted demand, input the predicted data of power, predicted demand and electricity price to the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action; Sending charging and discharging instructions to energy storage devices according to the charging and discharging optimization strategy; Input the current temperature into a pre-built second machine learning model to output a temperature regulation strategy that adjusts the current temperature to the minimum amount of electricity required to set a preset suitable temperature; A temperature adjustment instruction is sent to the energy storage device according to the temperature adjustment strategy for adjusting to the preset suitable temperature with the minimum amount of electricity required.

2. According to claim 1, the smart energy management method based on AI algorithm group and large model system, It is characterized in that The operation data includes time, power consumption, unit energy storage cost, current temperature and preset suitable temperature.

3. The smart energy management method based on AI algorithm group and large model system according to claim 1, It is characterized in that The method for constructing the time-demand mathematical model includes: yt=Trend(t)+Seasonal(t); Where Trend(t) represents the daily cumulative trend part; Seasonal(t) represents the periodic component; Trend(t) is set to: Trend(t)=a+bt; Among them, a and b are regression parameters; Seasonal(t) is set to: In the formula, t is the time, 7 represents the weekly cycle, c 1 With c 2 is the Fourier regression coefficient, π is the circumference of a circle, and the historical moments and corresponding historical forecast demand data are used to estimate a, b, and c using the least squares method. 1 With c 2 ; When forecasting, input t and calculate the sum of Trend(t) and Seasonal(t) according to the formula to get yt, where yt is the forecast demand.

4. The smart energy management method based on AI algorithm group and large model system according to claim 1, It is characterized in that The method for constructing the first machine learning model includes: Step 1: Design the first machine learning model state space; S = {prediction data of electricity price, electricity quantity, predicted demand}, S is the state; Step 2: Design the first machine learning model action space; A = {charging (floating point number between 0-1, representing the charging ratio), discharging (floating point number between 0-1, representing the discharging ratio), selling surplus electricity (whether the remaining part of the electricity minus the predicted demand exceeds r% of the electricity, r is a value greater than 0, if it exceeds, the excess part will be sold to the grid as surplus electricity, if not, the amount of surplus electricity sold is 0)}, A is the action; Step 3: construct a Q network. The method of constructing a Q network includes: The Q network consists of an input layer, two hidden layers and an output layer; the hidden layers include the first hidden layer and the second hidden layer; the number of input nodes of the input layer is the dimension of the state variable, and the state variables include power, predicted demand and electricity price; it is set to 3 nodes, and the 3 nodes correspond to the predicted data of power, predicted demand and electricity price respectively; the number of hidden nodes in the first hidden layer is 32, and the general formula for calculating each hidden node in the first hidden layer includes: z=w 1 ×x+b 1 ; Where x is the input layer data, i.e., the predicted data of electricity quantity, predicted demand quantity and electricity price, and w is 1 is the weight parameter of the hidden node from the input layer to any first hidden layer, b 1 is the bias parameter, z is the result of each hidden node in the first hidden layer; The formula for the activation function ReLU(z) of the first hidden layer is: ReLU(z)=max(0,z); The number of hidden nodes in the second hidden layer is 64. The general formula for calculating the number of hidden nodes in each second hidden layer includes: j=w 2 ×a+b 2 ; a = ReLU(j); ReLU(j)=max(0,j) In the formula, a is the output result of the first hidden layer, w 2 is the weight parameter of the number of hidden nodes from the first hidden layer to the second hidden layer, b 2 is the bias parameter; ReLU(j) function is the activation function of the second hidden layer; The number of output nodes in the output layer is 3, corresponding to the three actions in A. The general formula for calculating the output nodes of each output layer includes: e=w 3 ×d+b 3 ; Q = e; ReLU(e)=max(0,e) In the formula, e is the output result of the second hidden layer, w 3 is the weight parameter of the output node from the second hidden layer to the output layer, b 3 Bias parameter, Q is the result vector of all output layer nodes; ReLU(e) function is the activation function of the output layer; Step 4: Design reward function: The time unit is defined as one hour, and rewards are given after each hour. The reward indicators include: Electricity cost: Calculate the charge amount in the current hour × the predicted electricity price: Energy storage cost: calculate the amount of charge in the current hour × unit energy storage cost; Sales revenue: Calculate the amount of surplus electricity sold in the current hour × the predicted data of electricity price; Demand cost: If the forecast demand is not met, that is, the forecast demand minus the electricity is a positive number, then this positive number is the demand gap; if the forecast demand minus the electricity is a negative number, then the demand gap is 0, and the demand cost penalty is formulated according to the forecast data of demand gap × electricity price; The formula for the reward function R is: R = - electricity cost - energy storage cost + sales revenue - demand cost; In the formula, the demand cost is adjustable, the initial value of the demand cost is the predicted data of the electricity price, the reward value is γ decayed, the γ value is 0.9, and the final reward value is fed back to the Q network to update, and the first machine learning model is continuously optimized according to the actual operation data.

5. The smart energy management method based on AI algorithm group and large model system according to claim 4, It is characterized in that The first machine learning model training method comprises: Collect data. Each time the first machine learning model runs, obtain the state S, select action A, reward R and next state S'; add the collected (S, A, R, S') samples to the replay pool, sample the training set, and randomly sample a batch of sampled data from the replay pool every predetermined step length. The batch size is set to 32; for each sampled data, use the current target Q network to calculate the maximum Q value of the state S'. The target Q value formula is: Y = R + γ × maxQ'(S', A'); Where Y is the target Q value; A' is the next action; Q' is the next Q value; Input S into the current Q network to predict Q(S, A), and solve the loss function value of the Q value: loss function value MSE 1 , Using the optimizer, apply the gradient to update the parameters, update each parameter of each layer of the Q network with a learning rate α, and the parameter update direction is to subtract the gradient. The formula is: In the formula, θ is a parameter; Every C steps, replace the current Q network parameter θ with the target Q network parameter θ′, where C is the preset value; repeat the training process, continuously collect data, and train the Q network until the MSE 1 convergence.

6. The smart energy management method based on AI algorithm group and large model system according to claim 1, It is characterized in that The method for constructing the second machine learning model includes: The recorded multiple sets of temperature data are used as training sets D. The temperature data sets include the current temperature, action, and the difference between the power at the current temperature and the power when adjusted to the preset suitable temperature. The state F is defined, F = {0, 1, 2...η} represents all possible temperature values, η is any value greater than or equal to 0, and the action H is defined, H = {heating β℃, cooling g℃}. The linear regression model is designed. The linear regression model is: LR(n)=u 0 +u 1 x 1 +u 2 x 2 +u 3 x 3 ; In the formula, x 1 is the current temperature, x 2 is the square of the current temperature, x 3 is the difference between the current temperature and the preset suitable temperature, u 1 、u 2 with u 3 are the linear regression model parameters and are obtained by gradient descent based on the training set D; Establish the dynamic programming equation V(F), the equation is: V(F)=min{V(F-1)+LR(F-1, heating β℃),V(F+1)+LR(F+1, cooling g℃)}; Wherein, function LR is a linear regression model, V(F) is the state value function in dynamic programming, β is any value greater than or equal to 0, and g is any value greater than or equal to 0; Reversely solve the temperature regulation strategy π*(H) that adjusts to the preset suitable temperature with the minimum amount of electricity. The reverse solution of the dynamic programming equation includes: Define the optimal value function V(target state) = 0, then consider the adjacent states, and find the optimal value functions of these states according to the dynamic programming equation, continue to diffuse to all states, find the optimal value function of each state F, and according to the minimization principle of the equation, determine the temperature control strategy π*(H) with the minimum amount of electricity required to adjust to the preset suitable temperature under state F.

7. The smart energy management method based on AI algorithm group and large model system according to claim 6, It is characterized in that The training method of the second machine learning model includes: Split D into training data set, validation data set and test data set, use linear regression model LR as the state value function of dynamic programming; define loss function MSE 2 , In the formula, is the number of samples, yi is the actual power change value of the i-th sample, is the power change value of the i-th sample predicted by the model; The training data set is forward calculated to predict the power change, the parameter update gradient is backward calculated, and the gradient descent method SGD is used to continuously update u 1 、u 2 with u 3 , minimize the loss, after multiple rounds of iterations, if the loss value of the validation data set no longer decreases, stop updating; use the obtained parameter u 1 、u 2 with u 3 To calculate the temperature regulation strategy π*(H) with the minimum amount of electricity required to adjust to the preset suitable temperature, evaluate the performance of π*(H) on the test data set. If the performance is not ideal, collect more data and repeat the training process until the MSE 2 convergence.

8. Intelligent energy management system based on AI algorithm group and large model system, It is characterized in that The smart energy management method based on the AI ​​algorithm group and the large model system according to any one of claims 1 to 7 is implemented, and the system includes: The monitoring module is used to monitor and collect the operating data of each energy storage device in real time, and send all the operating data of the energy storage devices to the optimization scheduling module and the temperature control module; The price forecast module is used to obtain the forecast data of electricity prices from the energy exchange and input the forecast data of electricity prices into the optimization scheduling module; The optimization scheduling module inputs the time into the pre-built time-demand mathematical model to obtain the corresponding predicted demand, inputs the predicted data of the power, predicted demand and power price into the pre-built first machine learning model to output the optimization strategy of charging and discharging, i.e., action, and sends the optimization strategy of charging and discharging to the first execution management module; A first execution management module sends charge and discharge instructions to the energy storage device according to the charge and discharge optimization strategy; The temperature control module inputs the current temperature to the pre-built second machine learning model to output a temperature regulation strategy that adjusts the temperature to the preset suitable temperature with the least amount of electricity required; The second execution management module sends a temperature adjustment instruction to the energy storage device according to a temperature adjustment strategy for adjusting to a preset suitable temperature with a minimum amount of electricity.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, it implements the intelligent energy management method based on the AI ​​algorithm group and the large model system as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the smart energy management method based on the AI ​​algorithm group and the large model system described in any one of claims 1 to 7 is implemented.