Energy management method, device and equipment and storage medium
By periodically obtaining and analyzing task data in the smart home environment, and using pre-trained energy management models to generate execution control strategies, dynamically adjusting the operating status of equipment, the problem of lack of flexibility and personalization of traditional energy management systems is solved, and more efficient energy management and user comfort is achieved.
Patent Information
- Application Number
- CN202411791619.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Traditional energy management systems use preset rules or a single machine learning model, resulting in lack of flexibility and personalization of energy management strategies, which cannot meet users' dual needs for energy conservation and comfort.
By periodically obtaining task data for the current scenario task, including environmental context data, user feature data and device status data, and inputting it into the pre-trained energy management model, obtaining the execution control strategy for each device task, and dynamically adjusting the operating status of the device.
It realizes that the time for synchronous operation of high-power equipment is staggered while meeting the completion deadline set by the user's task, and priority is given to operating the equipment within a time period with low electricity prices, reducing the total energy loss cost, and flexibly adjusting the equipment startup time according to the user's tolerance for equipment task delays.
Smart Images

Figure CN119644741A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of energy management, and in particular to an energy management method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of Internet of Things (IoT) and artificial intelligence (AI) technologies, smart home systems have become an important way to improve quality of life and energy efficiency. Traditional energy management systems often use preset rules or a single machine learning model, resulting in a lack of flexibility and personalization in energy management strategies, which cannot meet users' dual needs for energy saving and comfort. Summary of the invention
[0003] The purpose of the present invention is to at least provide an energy management method, device, equipment and storage medium, which can at least solve the problem that traditional energy management systems often adopt preset rules or a single machine learning model, resulting in a lack of flexibility and personalization in energy management strategies and an inability to meet users' dual needs for energy saving and comfort.
[0004] To solve the above technical problems, at least one embodiment of the present application provides an energy management method, including:
[0005] Periodically obtain task data for the current scenario task; the scenario task is executed synchronously by at least two device tasks, each device task corresponds to the operation process of a device; the task data includes environmental context data, user feature data and device status data corresponding to each of the device tasks;
[0006] The task data periodically acquired are sequentially input into a pre-trained energy management model to periodically obtain an execution control strategy for each of the device tasks output by the energy management model;
[0007] Based on the execution control strategy of each of the equipment tasks obtained periodically, the operation status of the equipment in each of the equipment tasks is dynamically adjusted.
[0008] In some optional embodiments, training the energy management model includes:
[0009] Creating an original model, wherein the original model is provided with a plurality of task-specific parameters to be trained and a shared parameter, each of the task-specific parameters corresponding to a device task of a device;
[0010] Constructing scenario task samples of multiple scenario tasks, each of the scenario task samples includes device task samples corresponding to at least two types of devices, and each of the device task samples includes user feature sample data, environmental context sample data, device state sample data, and historical control strategy samples;
[0011] Based on scenario task samples of a plurality of the scenario tasks, the original model is trained with unrelated meta-learning of multiple device tasks to obtain the energy management model.
[0012] In some optional embodiments, performing unrelated meta-learning training of multiple device tasks on the original model based on scenario task samples of the plurality of scenario tasks to obtain the energy management model includes:
[0013] Initialization step: initializing an inner loop learning rate, an outer loop learning rate, a plurality of task-specific parameters to be trained, and a shared parameter in the original model;
[0014] Inner loop step: for the scenario task samples of each scenario task, each of the device task samples contained therein is sequentially subjected to inner loop training, wherein the inner loop training process is: training the original model based on the device task samples, calculating the loss value of the device task, and updating the task-specific parameters corresponding to the device task using the gradient descent method based on the loss value of the device task;
[0015] Outer loop step: after completing the inner loop training for each of the device task samples included in the scene task sample, calculating the comprehensive loss value of all the device tasks, and updating the shared parameters of the original model using the gradient descent method based on the comprehensive loss value of all the device tasks;
[0016] A learning rate updating step, based on the current round of the outer loop, updating the inner loop learning rate and the outer loop learning rate of the original model;
[0017] The inner loop step, the outer loop step and the learning rate update step are repeated until the preset training end condition is met and the training is stopped, and the original model obtained after stopping the training is used as the energy management model.
[0018] In some optional embodiments, the loss function used to calculate the loss value of the device task is calculated as follows:
[0019]
[0020] Among them, E i is the total energy consumption cost of the device corresponding to the i-th device task, D i is the user comfort deviation corresponding to the i-th device task, S iis the device synergy loss between the device corresponding to the ith device task and the device included in the scene corresponding to the scene task; λ1, λ2 and λ3 are respectively the hyperparameters of the total energy consumption cost of the device corresponding to the device task, the hyperparameters of the user comfort deviation corresponding to the device task and the hyperparameters of the device synergy loss between the device corresponding to the device task and the device included in the scene corresponding to the scene task.
[0021] In some optional embodiments, the total energy consumption cost E of the device corresponding to the i-th device task is i The calculation formula is:
[0022]
[0023] Among them, P i (t) is the total energy consumption of the equipment corresponding to the i-th equipment task at time t, c(t) is the electricity price at time t, and Δt is the time interval.
[0024] In some optional embodiments, the user comfort deviation D corresponding to the i-th device task i The calculation formula is:
[0025]
[0026] Among them, S i (t) is the environmental impact parameter of the equipment corresponding to the i-th equipment task at time t, S user (t) is the user's comfort setting value for the device corresponding to the i-th device task at time t, δ is the preset tolerance threshold, and f(·) is the measurement function of the deviation.
[0027] In some optional embodiments, the device coordination loss S between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task is i The calculation formula is:
[0028]
[0029] Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, P threshold is the safety threshold of the power load.
[0030] At least one embodiment of the present application further provides an energy management device, including:
[0031] An acquisition module is used to periodically acquire task data for a current scenario task; the scenario task is executed synchronously by at least two device tasks, each device task corresponds to an operation process of a device; the task data includes environmental context data, user feature data and device status data corresponding to each of the device tasks;
[0032] A generation module, used for sequentially inputting the periodically acquired task data into a pre-trained energy management model to periodically obtain an execution control strategy for each of the device tasks output by the energy management model;
[0033] The control module is used to dynamically adjust the operating status of the equipment in each of the equipment tasks based on the execution control strategy of each of the equipment tasks obtained periodically.
[0034] At least one embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned energy management method.
[0035] At least one embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned energy management method when executed by a processor.
[0036] The embodiments of the present application provide an energy management method, apparatus, device and storage medium, which periodically obtains task data for the current scenario task; the scenario task is executed synchronously by at least two device tasks, and each device task corresponds to the operation process of a device; the task data includes environmental context data, user feature data and device status data corresponding to each device task; then the periodically obtained task data is sequentially input into the pre-trained energy management model to periodically obtain the execution control strategy for each device task output by the energy management model; based on the execution control strategy of each device task obtained periodically, the operation status of the device in each device task is dynamically adjusted. The present application can meet the user's dual needs for energy saving and comfort. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.
[0038] Figure 1 is a flow chart of an energy management method provided by an embodiment of the present application;
[0039] Figure 2 is a training flow chart of an energy management model provided by an embodiment of the present application;
[0040] Figure 3 It is a structural diagram of an energy management device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0042] In order to facilitate understanding of the embodiments of the present application, relevant content about energy management is first introduced here.
[0043] With the rapid development of Internet of Things (IoT) and artificial intelligence (AI) technologies, smart home systems have become an important way to improve quality of life and energy efficiency. Traditional energy management systems often use preset rules or a single machine learning model, resulting in a lack of flexibility and personalization in energy management strategies, which cannot meet users' dual needs for energy saving and comfort.
[0044] This application finds that the smart home environment has the following characteristics:
[0045] Rich contextual information: including time, weather, electricity price, user schedule, etc.
[0046] Diverse user behavior patterns: Different users have different living habits and preferences;
[0047] Collaborative relationship between devices: Multiple devices in the home may run at the same time, and there is room for collaborative optimization.
[0048] In order to solve the technical problem that the above-mentioned traditional energy management systems often adopt preset rules or a single machine learning model, resulting in the lack of flexibility and personalization of energy management strategies and the inability to meet users' dual needs for energy saving and comfort, the present invention proposes an energy management method. The implementation details of the energy management method of this embodiment are specifically described below. The following content is only the implementation details provided for easy understanding and is not necessary for the implementation of this solution.
[0049] Embodiment 1:
[0050] The energy method of this embodiment can be applied to electronic devices with communication, computing and data storage capabilities. The specific process can be as follows: Figure 1 As shown, including:
[0051] Step S11, periodically obtain task data for the current scenario task. The scenario task is at least two device tasks executed synchronously, and each device task corresponds to the operation process of a device. The task data includes the environment context data, user feature data and device status data corresponding to each device task.
[0052] Specifically, the environmental context data is context data extracted from the smart home environment information using the context perception mechanism, such as time, weather forecast, real-time electricity price, holiday information, environmental data, etc. The environmental data includes indoor and outdoor temperature, indoor and outdoor humidity, light intensity, air quality, etc. The environmental context data can change with the changes in the environment, and can help the subsequent energy management model perceive the changes in the external environment so as to dynamically adjust the output operation control strategy.
[0053] The user characteristic data is a parameter that reflects user preferences and behavior patterns, such as the user's temperature preference, living habits, tolerance for delay, user daily schedule, historical behavior records, etc., which can be obtained by establishing a user profile. The user characteristic data can help the subsequent energy management model output an operation control strategy that meets user needs.
[0054] The device status data includes parameters related to the device's operating status, energy consumption information, etc., such as the device's operating status, energy consumption information, control parameters, etc. For example, for an air conditioner, the device status data includes the currently set temperature, operating mode, power consumption, etc.; for a washing machine, the device status data includes the task duration, the current working mode (washing, rinsing, dehydration), etc.
[0055] Step S12, sequentially inputting the periodically acquired task data into a pre-trained energy management model to periodically obtain an execution control strategy for each of the device tasks output by the energy management model.
[0056] In some embodiments, Figure 2 As shown, training the energy management model includes:
[0057] Step S21, creating an original model.
[0058] Specifically, the original model is provided with a plurality of task-specific parameters to be trained and a shared parameter, and each of the task-specific parameters corresponds to a device task of a device.
[0059] Step S22, constructing scenario task samples of multiple scenario tasks.
[0060] Specifically, each of the scenario task samples includes device task samples corresponding to at least two types of devices, and each of the device task samples includes user feature sample data, environmental context sample data, device state sample data, and historical control strategy samples.
[0061] Step S23, performing multi-device task-independent meta-learning training on the original model based on scenario task samples of a plurality of the scenario tasks to obtain the energy management model.
[0062] In some embodiments, step S23 includes:
[0063] Initialization step: Initialize the inner loop learning rate α, the outer loop learning rate β, and the multiple task-specific parameters φ to be trained in the original model i , and a shared parameter θ.
[0064] Inner loop step: for the scene task samples of each of the scene tasks, inner loop training is performed on each of the device task samples contained therein in turn.
[0065] Specifically, for each device task, the original model experiments the device samples of the device task to perform model training with the goal of adjusting the task feature parameters of the original model to make it better suited to the corresponding device task.
[0066] For each device task The inner loop training process is:
[0067] (1) Training the original model based on the device task samples.
[0068] The i-th device task The device samples output to the original model for model training are:
[0069]
[0070] in, Indicates the device status data of the device corresponding to the i-th device task; x user represents user feature data; C represents environmental context data.
[0071] (2) Calculating the loss value of the device task, and updating the task-specific parameters corresponding to the device task using a gradient descent method based on the loss value of the device task.
[0072] In some examples, the loss function used to calculate the loss value of the device task is calculated as follows:
[0073]
[0074] Among them, E i is the total energy consumption of the device corresponding to the i-th device task;
[0075] D i is the user comfort deviation corresponding to the i-th device task;
[0076] S i is the device coordination loss between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task;
[0077] λ1, λ2 and λ3 are respectively the hyperparameters of the total energy consumption of the device corresponding to the device task, the hyperparameters of the user comfort deviation corresponding to the device task, and the hyperparameters of the device synergy loss between the device corresponding to the device task and the devices included in the scene corresponding to the scene task.
[0078] By adjusting the values of λ1, λ2, and λ3, we can balance the relationship between energy saving and user comfort, as well as the impact of device coordination. The above loss function integrates the relationship between energy consumption cost and user comfort, as well as the impact of control device coordination.
[0079] The total energy consumption E of the device corresponding to the i-th device task i It refers to the total energy consumption of the device corresponding to the i-th device task in a specific time period, which can be calculated by the device power and running time. The calculation formula is:
[0080]
[0081] Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, and Δt is the time interval.
[0082] Taking into account the energy cost of electricity prices, in order to reflect the actual energy, the real-time electricity price c(t) can be combined for calculation:
[0083]
[0084] Where c(t) is the electricity price at time t.
[0085] The operation control strategy output by the trained energy management model can reduce equipment power consumption during periods of high electricity prices to reduce energy consumption costs.
[0086] The user comfort deviation D iIt measures the difference between the actual environmental parameters and the user's expectations. The user comfort deviation D i The smaller it is, the higher the user's comfort level is.
[0087] The user comfort deviation D corresponding to the i-th device task i The calculation formula is:
[0088]
[0089] Among them, S i (t) is the environmental impact parameter of the equipment corresponding to the i-th equipment task at time t;
[0090] S user (t) is the user's comfort setting value for the device corresponding to the i-th device task at time t;
[0091] f(·) is a measure function of the deviation, which is usually selected as a linear or quadratic function.
[0092] For example, take temperature as an example:
[0093]
[0094] Among them, T room (t) represents the indoor temperature at time t, T user Indicates the room temperature desired by the user.
[0095] In order to focus only on the user comfort deviation D that exceeds the user's acceptable range i , a tolerance threshold δ is introduced:
[0096]
[0097] When the user comfort level deviates from D i When within the tolerance threshold δ, the user comfort deviation D i The damage caused was zero.
[0098] The equipment synergy loss S i The interaction between multiple devices is taken into account, such as load peaks or mutual interference caused by simultaneous operation. For example, when multiple high-power devices are running at the same time, the household power load may be too high.
[0099] The device coordination loss S between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task i The calculation formula is:
[0100]
[0101]
[0102] Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, P threshold is the safety threshold of the power load.
[0103] Update the device task using gradient descent The corresponding task-specific parameter φ i The calculation formula used is as follows:
[0104]
[0105] Among them, α is the inner loop learning rate;
[0106] is the i-th device task The loss function of
[0107] φ′ i are the new task-specific parameters obtained after one or more steps of gradient descent;
[0108] is the loss function About the task-specific parameter φ i gradient.
[0109] Take the example of running the washing machine task and the water heater task at the same time:
[0110] The total energy consumption cost of the washing machine task is E WM :
[0111]
[0112] Among them, P WM (t) is the total energy consumption of the washing machine at time t, c(t) is the electricity price at time t, and Δt is the time interval.
[0113] Total energy consumption cost for water heater task:
[0114]
[0115] Among them, P HW (t) is the total energy consumption of the water heater at time t.
[0116] The total energy cost E of the washing machine task and the water heater task total For: E total =E WM +E HW .
[0117] User comfort deviation for washing machine task:
[0118] D WM =max(0,T WM,complete -T WM,deadline )
[0119] Among them, D WM It is the user comfort deviation of the washing machine task (it can also be referred to as task delay penalty). It indicates the degree of delay of the actual completion time of the washing machine task relative to the preset completion deadline. If the task is completed within the specified time, the delay penalty is 0; if it is completed overtime, there will be a penalty value, indicating the user's comfort deviation.
[0120] T WM,complete is the actual completion time of the washing machine task. WM,complete The value of is the completion time of the washing machine task, which is used to calculate the delay relative to the deadline preset by the user.
[0121] T WM,deadline is the scheduled completion deadline of the washing machine task. The user expects the washing machine task to be completed before the deadline.
[0122] User comfort deviation for water heater task:
[0123] D HW =max(0,T HW,ready -T HW,deadline )
[0124] Among them, D HW It is the user comfort deviation of the water heater task (it can also be referred to as task delay penalty). Similar to the user comfort deviation of the washing machine task, it indicates the degree of delay of the actual preparation time of the water heater task relative to the predetermined preparation deadline.
[0125] T HW,ready is the actual preparation time of the water heater task, that is, the time it takes for the water heater to reach the set temperature, which is used to calculate the delay relative to the preparation time set by the user.
[0126] T HW,deadline is the scheduled preparation deadline of the water heater task. The user expects the water heater to be ready before the scheduled preparation deadline.
[0127] Equipment coordination loss S for washing machine task WM , the equipment coordination loss S of the washing machine task HM They are:
[0128]
[0129] P total (t) = P WM (t)+PHW (t)
[0130] Among them, P threshold is the safety threshold of the power load, Indicates the proportion of the washing machine's contribution to the total load, Indicates the proportion of the water heater's contribution to the total load. total (t) represents the total energy consumption of the washing machine and water heater at time t.
[0131] Outer loop step: After completing the inner loop training for each of the device task samples contained in the scene task sample, calculate the comprehensive loss value of all the device tasks, and update the shared parameters of the original model using the gradient descent method based on the comprehensive loss value of all the device tasks.
[0132] Specifically, the goal of the outer loop is to update the shared parameters θ of the original model so that the model can better generalize to new device tasks. This step is performed on the basis of multiple device tasks completing the inner loop steps, using the loss function of all device tasks to update the shared parameters θ.
[0133] The calculation formula for updating the shared parameter θ of the original model using the gradient descent method is as follows:
[0134]
[0135] where β is the outer loop learning rate, which represents the step size of the shared parameter update in the outer loop.
[0136] represents the comprehensive loss value of all the equipment tasks, and k represents the total number of equipment tasks.
[0137] The learning rate updating step updates the inner loop learning rate and the outer loop learning rate of the original model based on the current outer loop round.
[0138] The inner loop step, the outer loop step and the learning rate update step are repeated until the preset training end condition is met and the training is stopped, and the original model obtained after stopping the training is used as the energy management model.
[0139] Step S13: based on the execution control strategy of each of the equipment tasks obtained periodically, dynamically adjust the operation status of the equipment in each of the equipment tasks.
[0140] The method provided in this embodiment periodically obtains task data for the current scenario task; the scenario task is executed synchronously by at least two device tasks, and each device task corresponds to the operation process of one device; the task data includes environmental context data, user feature data and device status data corresponding to each device task; the periodically obtained task data are sequentially input into the pre-trained energy management model to periodically obtain the execution control strategy for each device task output by the energy management model; based on the execution control strategy of each device task obtained periodically, the operation status of the device in each device task is dynamically adjusted, so that on the premise of meeting the completion deadline set by the user task, the time for the synchronous operation of high-power devices can be staggered, and the equipment can be operated preferentially during the time period with lower electricity prices, thereby reducing the total energy loss cost. The startup time of the equipment can also be flexibly adjusted according to the user's tolerance for device task delays.
[0141] Embodiment 2:
[0142] Another embodiment of the present application relates to an energy management device. The implementation details of the energy management device of this embodiment are described in detail below. The following content is only for the convenience of understanding the implementation details, and is not necessary for the implementation of this solution. The schematic diagram of the energy management device of this embodiment can be as follows Figure 3 As shown, it includes an acquisition module 301, a generation module 302 and a control module 303.
[0143] The acquisition module 301 periodically acquires task data for the current scenario task. The scenario task is executed synchronously by at least two device tasks, each of which corresponds to the operation process of a device. The task data includes the environment context data, user feature data and device status data corresponding to each of the device tasks.
[0144] Specifically, the environmental context data is context data extracted from the smart home environment information using the context perception mechanism, such as time, weather forecast, real-time electricity price, holiday information, environmental data, etc. The environmental data includes indoor and outdoor temperature, indoor and outdoor humidity, light intensity, air quality, etc. The environmental context data can change with the changes in the environment, and can help the subsequent energy management model perceive the changes in the external environment so as to dynamically adjust the output operation control strategy.
[0145] The user characteristic data is a parameter that reflects user preferences and behavior patterns, such as the user's temperature preference, living habits, tolerance for delay, user daily schedule, historical behavior records, etc., which can be obtained by establishing a user profile. The user characteristic data can help the subsequent energy management model output an operation control strategy that meets user needs.
[0146] The device status data includes parameters related to the device's operating status, energy consumption information, etc., such as the device's operating status, energy consumption information, control parameters, etc. For example, for an air conditioner, the device status data includes the currently set temperature, operating mode, power consumption, etc.; for a washing machine, the device status data includes the task duration, the current working mode (washing, rinsing, dehydration), etc.
[0147] The generating module 302 is used to sequentially input the periodically acquired task data into the pre-trained energy management model to periodically obtain the execution control strategy for each of the device tasks output by the energy management model.
[0148] In some embodiments, Figure 2 As shown, training the energy management model includes:
[0149] Step S21, creating an original model.
[0150] Specifically, the original model is provided with a plurality of task-specific parameters to be trained and a shared parameter, and each of the task-specific parameters corresponds to a device task of a device.
[0151] Step S22, constructing scenario task samples of multiple scenario tasks.
[0152] Specifically, each of the scenario task samples includes device task samples corresponding to at least two types of devices, and each of the device task samples includes user feature sample data, environmental context sample data, device state sample data, and historical control strategy samples.
[0153] Step S23, performing multi-device task-independent meta-learning training on the original model based on scenario task samples of a plurality of the scenario tasks to obtain the energy management model.
[0154] In some embodiments, step S23 includes:
[0155] Initialization step: Initialize the inner loop learning rate α, the outer loop learning rate β, and the multiple task-specific parameters φ to be trained in the original model i , and a shared parameter θ.
[0156] Inner loop step: for the scene task samples of each of the scene tasks, inner loop training is performed on each of the device task samples contained therein in turn.
[0157] Specifically, for each device task, the original model experiments the device samples of the device task to perform model training with the goal of adjusting the task feature parameters of the original model to make it better suited to the corresponding device task.
[0158] For each device task The inner loop training process is:
[0159] (1) Training the original model based on the device task samples.
[0160] The i-th device task The device samples output to the original model for model training are:
[0161]
[0162] Indicates the device status data of the device corresponding to the i-th device task; x user represents user feature data, and C represents environmental context data.
[0163] (2) Calculating the loss value of the device task, and updating the task-specific parameters corresponding to the device task using a gradient descent method based on the loss value of the device task.
[0164] In some examples, the loss function used to calculate the loss value of the device task is calculated as follows:
[0165]
[0166] Among them, E i is the total energy consumption of the device corresponding to the i-th device task;
[0167] D i is the user comfort deviation corresponding to the i-th device task;
[0168] S i is the device coordination loss between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task;
[0169] λ1, λ2 and λ3 are respectively the hyperparameters of the total energy consumption of the device corresponding to the device task, the hyperparameters of the user comfort deviation corresponding to the device task, and the hyperparameters of the device synergy loss between the device corresponding to the device task and the devices included in the scene corresponding to the scene task.
[0170] By adjusting the values of λ1, λ2, and λ3, we can balance the relationship between energy saving and user comfort, as well as the impact of device coordination. The above loss function integrates the relationship between energy consumption cost and user comfort, as well as the impact of control device coordination.
[0171] The total energy consumption E of the device corresponding to the i-th device taski It refers to the total energy consumption of the device corresponding to the i-th device task in a specific time period, which can be calculated by the device power and running time. The calculation formula is:
[0172]
[0173] Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, and Δt is the time interval.
[0174] Taking into account the energy cost of electricity prices, in order to reflect the actual energy, the real-time electricity price c(t) can be combined for calculation:
[0175]
[0176] Where c(t) is the electricity price at time t.
[0177] The operation control strategy output by the trained energy management model can reduce equipment power consumption during periods of high electricity prices to reduce energy consumption costs.
[0178] The user comfort deviation D i It measures the difference between the actual environmental parameters and the user's expectations. The user comfort deviation D i The smaller it is, the higher the user's comfort level is.
[0179] The user comfort deviation D corresponding to the i-th device task i The calculation formula is:
[0180]
[0181] Among them, S i (t) is the environmental impact parameter of the equipment corresponding to the i-th equipment task at time t;
[0182] S user (t) is the user's comfort setting value for the device corresponding to the i-th device task at time t;
[0183] f(·) is a measure function of the deviation, which is usually selected as a linear or quadratic function.
[0184] For example, take temperature as an example:
[0185]
[0186] Among them, T room (t) represents the indoor temperature at time t, T user Indicates the room temperature desired by the user.
[0187] In order to focus only on the user comfort deviation D that exceeds the user's acceptable range i , a tolerance threshold δ is introduced:
[0188]
[0189] When the user comfort level deviates from D i When within the tolerance threshold δ, the user comfort deviation D i The damage caused was zero.
[0190] The equipment synergy loss S i The interaction between multiple devices is taken into account, such as load peaks or mutual interference caused by simultaneous operation. For example, when multiple high-power devices are running at the same time, the household power load may be too high.
[0191] The device coordination loss S between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task i The calculation formula is:
[0192]
[0193] Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, P threshold is the safety threshold of the power load.
[0194] Update the device task using gradient descent The corresponding task-specific parameter φ i The calculation formula used is as follows:
[0195]
[0196] Among them, α is the inner loop learning rate;
[0197] is the i-th device task The loss function of
[0198] φ′ i are the new task-specific parameters obtained after one or more steps of gradient descent;
[0199] is the loss function About the task-specific parameter φ i gradient.
[0200] The control module 303 is used to dynamically adjust the operating status of the equipment in each of the equipment tasks based on the execution control strategy of each of the equipment tasks obtained periodically.
[0201] The device provided in this embodiment periodically obtains task data for the current scenario task through the acquisition module 301; the scenario task is at least two device tasks executed synchronously, and each device task corresponds to the operation process of a device; the task data includes environmental context data, user feature data and device status data corresponding to each device task; the task data periodically obtained are sequentially input into the pre-trained energy management model through the generation module 302 to periodically obtain the execution control strategy for each device task output by the energy management model; and then the control module 303 dynamically adjusts the operation status of the devices in each device task based on the execution control strategy of each device task obtained periodically, so as to achieve the staggered time of the synchronous operation of high-power devices and give priority to running the devices in the time period with lower electricity prices, thereby reducing the total energy loss cost, and flexibly adjusting the startup time of the device according to the user's tolerance for device task delays.
[0202] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.
[0203] Embodiment three:
[0204] Another embodiment of the present application relates to an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the energy management method in the above-mentioned embodiments.
[0205] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0206] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0207] Embodiment 4:
[0208] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0209] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as: ROM), random access memory (Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.
[0210] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. An energy management method, characterized in that: include: Periodically obtain task data for the current scene task; The scenario task is executed synchronously by at least two device tasks, each device task corresponds to the operation process of a device; the task data includes the environmental context data, user feature data and device status data corresponding to each of the device tasks; The task data periodically acquired are sequentially input into a pre-trained energy management model to periodically obtain an execution control strategy for each of the device tasks output by the energy management model; Based on the execution control strategy of each of the equipment tasks obtained periodically, the operation status of the equipment in each of the equipment tasks is dynamically adjusted.
2. The energy management method according to claim 1, characterized in that: Training the energy management model includes: Creating an original model, wherein the original model is provided with a plurality of task-specific parameters to be trained and a shared parameter, each of the task-specific parameters corresponding to a device task of a device; Constructing scenario task samples of multiple scenario tasks, each of the scenario task samples includes device task samples corresponding to at least two types of devices, and each of the device task samples includes user feature sample data, environmental context sample data, device state sample data, and historical control strategy samples; Based on scenario task samples of a plurality of the scenario tasks, the original model is trained with unrelated meta-learning of multiple device tasks to obtain the energy management model.
3. The energy management method according to claim 2, characterized in that: The step of performing unrelated meta-learning training of multiple device tasks on the original model based on scenario task samples of the plurality of scenario tasks to obtain the energy management model comprises: Initialization step: initializing an inner loop learning rate, an outer loop learning rate, a plurality of task-specific parameters to be trained, and a shared parameter in the original model; Inner loop step: for the scenario task samples of each scenario task, each of the device task samples contained therein is sequentially subjected to inner loop training, wherein the inner loop training process is: training the original model based on the device task samples, calculating the loss value of the device task, and updating the task-specific parameters corresponding to the device task using the gradient descent method based on the loss value of the device task; Outer loop step: after completing the inner loop training for each of the device task samples included in the scene task sample, calculating the comprehensive loss value of all the device tasks, and updating the shared parameters of the original model using the gradient descent method based on the comprehensive loss value of all the device tasks; A learning rate updating step, based on the current round of the outer loop, updating the inner loop learning rate and the outer loop learning rate of the original model; The inner loop step, the outer loop step and the learning rate update step are repeated until the preset training end condition is met and the training is stopped, and the original model obtained after stopping the training is used as the energy management model.
4. The energy management method according to claim 3, characterized in that: The loss function used to calculate the loss value of the device task is calculated as follows: Among them, E i is the total energy consumption cost of the device corresponding to the i-th device task, D i is the user comfort deviation corresponding to the i-th device task, S i is the device synergy loss between the device corresponding to the ith device task and the device included in the scene corresponding to the scene task; λ1, λ2 and λ3 are respectively the hyperparameters of the total energy consumption cost of the device corresponding to the device task, the hyperparameters of the user comfort deviation corresponding to the device task and the hyperparameters of the device synergy loss between the device corresponding to the device task and the device included in the scene corresponding to the scene task.
5. The energy management method according to claim 4, characterized in that: The total energy consumption cost E of the device corresponding to the i-th device task i The calculation formula is: Among them, P i (t) is the total energy consumption of the equipment corresponding to the i-th equipment task at time t, c(t) is the electricity price at time t, and Δt is the time interval.
6. The energy management method according to claim 4, characterized in that: The user comfort deviation D corresponding to the i-th device task i The calculation formula is: Among them, S i (t) is the environmental impact parameter of the equipment corresponding to the i-th equipment task at time t, S user (t) is the user's comfort setting value for the device corresponding to the i-th device task at time t, δ is the preset tolerance threshold, and f(·) is the deviation measurement function.
7. The energy management method according to claim 6, characterized in that: The device coordination loss S between the device corresponding to the i-th device task and the devices included in the scene corresponding to the scene task i The calculation formula is: Among them, P i (t) is the energy consumption of the device corresponding to the i-th device task at time t, P threshold is the safety threshold of the power load.
8. An energy management device, characterized in that: include: The acquisition module is used to periodically acquire task data for the current scene task; The scenario task is executed synchronously by at least two device tasks, each device task corresponds to the operation process of a device; the task data includes the environmental context data, user feature data and device status data corresponding to each of the device tasks; A generation module, used for sequentially inputting the periodically acquired task data into a pre-trained energy management model to periodically obtain an execution control strategy for each of the device tasks output by the energy management model; The control module is used to dynamically adjust the operating status of the equipment in each of the equipment tasks based on the execution control strategy of each of the equipment tasks obtained periodically.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the energy management method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the energy management method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Integrated energy system double-side cooperative control method and device and storage medium
CN117134432A
Model determination method and device and computer readable storage medium
CN117313893A
Model-independent element learning method and device, equipment and storage medium
CN118428454A
Smart space system management method and device, equipment and storage medium
CN118627759A
Building air conditioner optimization control method and system considering personalized comfort of regional users
CN118794109A